Author Topic: noob questions about uasm64 usage  (Read 3161 times)

jimg

  • Member
  • ***
  • Posts: 355
noob questions about uasm64 usage
« on: August 03, 2018, 01:02:06 AM »
After screwing around for several days trying to figure out how to set up my system to produce 64-bit programs using uasm and wininc, it occurred to me that maybe I didn't have to keep both 32 and 64 bit working.  Before jumping to conclusions based upon nebulous trial and error I thought I'd just ask.

(Assuming I'm working on a computer with 64-bit windows running,) If one uses uasm64, can it also produce 32bit programs, or do I also need to keep uasm32 for 32-bit only programs?  If 64 will produce 32bit programs, are there any special s-field options that need to be different?  (Currently I normally use  /nologo /c /coff /Cp /Fl /Sn /Sg)

Also, it this the place to ask such questions, or would the uasm people prefer it be in the generic "64 bit assembler" subforum?

jj2007

  • Member
  • *****
  • Posts: 9804
  • Assembler is fun ;-)
    • MasmBasic
Re: noob questions about uasm64 usage
« Reply #1 on: August 03, 2018, 02:22:40 AM »
\masm32\bin\UAsm64 -Zp8 -win64 somesource.asm should do the job. Probably the -Zp8 is no longer needed, but let's hear the experts on that ;)

And yes, on a 64-bit machine you need only UAsm64. It can generate 32-bit code.

johnsa

  • Member
  • ****
  • Posts: 791
    • Uasm
Re: noob questions about uasm64 usage
« Reply #2 on: August 03, 2018, 03:03:14 AM »
uasm32 and uasm64 can both produce 32bit or 64bit output formats. The only reason both exist is so that you can run it at all on a 32bit system. Additionally uasm32 is built with XP compatibility toolset. :)


LiaoMi

  • Member
  • ****
  • Posts: 595
Re: noob questions about uasm64 usage
« Reply #3 on: August 31, 2018, 02:03:17 AM »
What does this flag mean in uasm -Fs[=<file_name>] - Write symbolic debug info? How can it be used?

johnsa

  • Member
  • ****
  • Posts: 791
    • Uasm
Re: noob questions about uasm64 usage
« Reply #4 on: September 06, 2018, 02:28:47 AM »
It writes out the debugging symbols into a simple format that easy for you to view or use in other debugging applications. It was added mainly as a way to provide symbolic debugging when generating flat binary files. IE: for OS development etc. It's documented in the user guide.

morgot

  • Regular Member
  • *
  • Posts: 46
Re: noob questions about uasm64 usage
« Reply #5 on: March 29, 2019, 06:17:02 AM »
How can I use Windows COM objects (such as IFileOperation)?
Do you have any sample in uasm?
Sorry for the bad English

Vortex

  • Member
  • *****
  • Posts: 2033
Re: noob questions about uasm64 usage
« Reply #6 on: March 29, 2019, 06:30:30 AM »

morgot

  • Regular Member
  • *
  • Posts: 46
Re: noob questions about uasm64 usage
« Reply #7 on: April 03, 2019, 11:56:43 PM »
A quick COM example :
OK, but where I can get value for CLSID_FileOperation ?

In you source are
Code: [Select]
sCLSID_IActiveDesktop       TEXTEQU <{075048700h,0EF1Fh,011D0h,{098h,088h,00h,060h,097h,0DEh,0ACh,0F9h}}>
sIID_IActiveDesktop         TEXTEQU <{0F490EB00h,01240h,011D1h,{098h,088h,00h,060h,097h,0DEh,0ACh,0F9h}}>

where same values for another COM ?
Sorry for the bad English

jj2007

  • Member
  • *****
  • Posts: 9804
  • Assembler is fun ;-)
    • MasmBasic
Re: noob questions about uasm64 usage
« Reply #8 on: April 04, 2019, 12:15:53 AM »
OK, but where I can get value for CLSID_FileOperation ?

CLSID_FileOperation GuidFromString("3ad05575-8857-4850-9277-11b85bdb8e09")

(and Google is your friend)

morgot

  • Regular Member
  • *
  • Posts: 46
Re: noob questions about uasm64 usage
« Reply #9 on: April 04, 2019, 12:22:00 AM »
Thank you jj2007!

COM is very hard technology.
Sorry for the bad English

Vortex

  • Member
  • *****
  • Posts: 2033
Re: noob questions about uasm64 usage
« Reply #10 on: April 04, 2019, 05:55:14 AM »
Hi morgot,

You can check the file shlguid.inc coming with the asmc package :

https://github.com/nidud/asmc

Reading shlguid.inc :

Code: [Select]
DEFINE_GUID( CLSID_ActiveDesktop, 0x75048700, 0xEF1F, 0x11D0, 0x98, 0x88, 0x00, 0x60, 0x97, 0xDE, 0xAC, 0xF9);
DEFINE_GUID(IID_IActiveDesktop, 0xF490EB00, 0x1240, 0x11D1, 0x98, 0x88, 0x00, 0x60, 0x97, 0xDE, 0xAC, 0xF9);

nidud

  • Member
  • *****
  • Posts: 1800
    • https://github.com/nidud/asmc
Re: noob questions about uasm64 usage
« Reply #11 on: April 04, 2019, 06:46:42 AM »
Note that it is possible to build the uuid.lib from the windows include files:

https://github.com/nidud/asmc/tree/master/source/uuid

If you use the include files directly the IID_'s will be declared as externdef's and the library automatically added by the linker. Otherwise you have to do this manually:

includelib uuid.lib
externdef CLSID_FileOperation:IID

The macros are defined in objbase.inc and guiddef.inc.

For a string guid:

DEFINE_GUIDS macro name, x
    DEFINE_GUID(name, \
   @CatStr(<0x>, @SubStr(x, 2,8)), \
   @CatStr(<0x>, @SubStr(x,11,4)), \
   @CatStr(<0x>, @SubStr(x,16,4)), \
   @CatStr(<0x>, @SubStr(x,21,2)), \
   @CatStr(<0x>, @SubStr(x,23,2)), \
   @CatStr(<0x>, @SubStr(x,26,2)), \
   @CatStr(<0x>, @SubStr(x,28,2)), \
   @CatStr(<0x>, @SubStr(x,30,2)), \
   @CatStr(<0x>, @SubStr(x,32,2)), \
   @CatStr(<0x>, @SubStr(x,34,2)), \
   @CatStr(<0x>, @SubStr(x,36,2)))
   exitm<>
   endm

DEFINE_GUIDS(IDD_ISecurityInformation, "965FC360-16FF-11d0-91CB-00AA00BBB723")


jj2007

  • Member
  • *****
  • Posts: 9804
  • Assembler is fun ;-)
    • MasmBasic
Re: noob questions about uasm64 usage
« Reply #12 on: April 04, 2019, 12:58:08 PM »
COM is very hard technology.

The learning curve is a bit steep, right. However, the main problem is that there are so many functions available, and there is no central documentation where to find all those cryptic CLSID and IID values. Even the Visual Studio include files don't have CLSID_ActiveDesktop, for example. Once you have those for your project, it can be quite straightforward:
Code: [Select]
include \masm32\MasmBasic\MasmBasic.inc
  Init ; ## COM demo: open Internet Explorer ##
  invoke OleInitialize, NULL
  .if eax==S_OK
push Chr$("http://masm32.com/board/index.php?action=unread")
call MyBrowser
  .endif
  invoke OleUninitialize
  Exit
CLSID_IExplorer GuidFromString("0002DF01-0000-0000-C000-000000000046") ; either use quoted text syntax or...
IID_IWebBrowser2  GuidFromString({D30C1661-CDAF-11D0-8A3E-00C04FC9E26E}) ; ... paste copied registry key name
MyBrowser proc uses edi url
LOCAL vEmpty:VARIANT, hWin, WebInterface
  ClearLocals
  lea edi, WebInterface
  pInterface equ dword ptr [edi]
  invoke CoCreateInstance, addr CLSID_IExplorer, NULL, CLSCTX_LOCAL_SERVER, addr IID_IWebBrowser2, edi
  .if eax==S_OK
CoInvoke pInterface, IWebBrowserVtbl.put_StatusBar, VARIANT_FALSE ; OK, now configure the browser
CoInvoke pInterface, IWebBrowserVtbl.put_MenuBar, VARIANT_FALSE   ; false = no menu
CoInvoke pInterface, IWebBrowserVtbl.put_Visible, VARIANT_TRUE
CoInvoke pInterface, IWebBrowserVtbl.get_HWND, addr hWin
lea edx, vEmpty ; Navigate needs pointers to four empty VARIANTS
; Ole$(url): COM wants a BSTR, so the ANSI URL needs to be converted
CoInvoke pInterface, IWebBrowserVtbl.Navigate, Ole$(url), edx, edx, edx, edx
  .endif
  ret
MyBrowser endp
end start

TimoVJL

  • Member
  • ***
  • Posts: 476
Re: noob questions about uasm64 usage
« Reply #13 on: April 07, 2019, 06:38:50 AM »
Time to do something about that, for example static GUID/IIDs ?
We can always create a program to convert or lookup GUID/IID from uuid.lib.

My example in so hated C in this site ;)
One problem is that '_' before name in 32-bit files.
CLSIDConv.ini in user's Documents folder:
Code: [Select]
[Lib]
LIB=C:\code\WDDK710\lib

EDIT: example removed, as it had an errors.

Code: [Select]
[Lib]
LIB=C:\code\WDDK710\lib\
[Libs]
LIB_0=uuid.lib
LIB_1=dxguid.lib
LIB_2=windowscodecs.lib
a4
Code: [Select]
[Lib]
LIB=C:\code\WDDK710\lib\

[Libs]
LIB_0=uuid.lib
LIB_1=dxguid.lib
LIB_2=windowscodecs.lib

[Lib1]
LIB=C:\code\PellesC\lib

[Libs1]
LIB_0=reguids.lib
« Last Edit: April 10, 2019, 02:09:43 AM by TimoVJL »
May the source be with you

Caché GB

  • Member
  • **
  • Posts: 90
  • MASM IS HOT
Re: noob questions about uasm64 usage
« Reply #14 on: April 07, 2019, 09:53:14 AM »
Hi TimoVJL

Quote
“My example in so hated C in this site”

In martial arts there is a legend about a root style that is perfection. It is known as
The Sun Source (Assembly) and that all other martial art styles are derived from it (C,C++,etc).
Thus they are not perfection.

I do not hate C. It is much cleaner than all the others as well as been elegant.
Caché GB's 1 and 0-nly language:MASM