News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

noob questions about uasm64 usage

Started by jimg, August 03, 2018, 01:02:06 AM

Previous topic - Next topic

jimg

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

\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

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

What does this flag mean in uasm -Fs[=<file_name>] - Write symbolic debug info? How can it be used?

johnsa

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

How can I use Windows COM objects (such as IFileOperation)?
Do you have any sample in uasm?
Sorry for the bad English

Vortex

Quote from: morgot 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?

A quick COM example :

http://masm32.com/board/index.php?topic=6736.msg72337#msg72337

http://masm32.com/board/index.php?topic=6861.msg73732#msg73732

morgot

Quote from: Vortex on March 29, 2019, 06:30:30 AM
A quick COM example :
OK, but where I can get value for CLSID_FileOperation ?

In you source are
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

Quote from: morgot on April 03, 2019, 11:56:43 PMOK, but where I can get value for CLSID_FileOperation ?

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

(and Google is your friend)

morgot

Thank you jj2007!

COM is very hard technology.
Sorry for the bad English

Vortex

Hi morgot,

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

https://github.com/nidud/asmc

Reading shlguid.inc :

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

#11
deleted

jj2007

Quote from: morgot on April 04, 2019, 12:22:00 AMCOM 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:
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

#13
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:
[Lib]
LIB=C:\code\WDDK710\lib


EDIT: example removed, as it had an errors.

[Lib]
LIB=C:\code\WDDK710\lib\
[Libs]
LIB_0=uuid.lib
LIB_1=dxguid.lib
LIB_2=windowscodecs.lib
a4
[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
May the source be with you

Caché GB

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