The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: donkey on July 25, 2009, 07:57:11 AM

Title: Sifting through emails
Post by: donkey on July 25, 2009, 07:57:11 AM
I have been going through my programming related emails tonight and answering a few or just redirecting the author to this forum. One misconception that seems prevalent is that the header project is "part of" GoAsm. Although it is designed for exclusive use with GoAsm, as it states in windows.h it is *not* a member of GoTools and so any errors or omissions in the headers should not be considered a failing in GoAsm. The most common misconceptions:

Edgar
Title: Re: Sifting through emails
Post by: ecube on July 25, 2009, 09:53:11 AM
Interesting, on a side note what happened to  this idea http://www.masm32.com/board/index.php?topic=11130.msg82258#msg82258 while I was translating my old masm32 code to GoASM 32bit/64bit I was thinking how nice it would be not to have to copy the same code twice for 64bit just to accommodate a few minor changes. It'd be neat if using your headers we could do what you suggested and have variables that auto changed depending on if is was 32bit or 64bit. Aswell as have something that can handle eax,rax interchangeably, macro or what have you.

Title: Re: Sifting through emails
Post by: donkey on July 26, 2009, 08:54:43 AM
Hi E^cube,

For some time the headers have supported % as the prefix for local types. For example:

LOCAL data :%DWORD32
LOCAL data2:%HANDLE

I have been using them in my programming and they work well (see the Help2 viewer source on my website). For RAX/EAX when using the X86 command line switch RAX is translated to EAX by GoAsm so if you are using something like:

LOCAL hMouse:%HANDLE

mov [hMouse], RAX

It will work in both 32 and 64 bit software correctly, replacing RAX with EAX in X86 and using either a QWORD or DWORD for hMouse depending on the WIN64 switch.

Edgar
Title: Re: Sifting through emails
Post by: donkey on July 26, 2009, 02:17:36 PM
New one:

Title: Re: Sifting through emails
Post by: dedndave on July 26, 2009, 03:16:19 PM
lol - you tell em, Edgar
as if you haven't done enough already
Title: Re: Sifting through emails
Post by: wjr on July 26, 2009, 06:35:55 PM
I see that the % prefix usage for LOCALs is based on header defined types and the WIN64 switch.

Without those requirements, I just thought that I would point out another way for GoAsm 32/64-bit switchable LOCAL D/Q data - don't specify the type:


Try FRAME
LOCAL hMouse
;
;
mov [hMouse],rax
ret
ENDF


With the command line switch /x64, hMouse defaults to a QWORD, and with /x86, hMouse defaults to a DWORD.