The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: Yuri on January 30, 2012, 05:05:27 PM

Title: Bug in USES in x86/x64 code
Post by: Yuri on January 30, 2012, 05:05:27 PM
For some reason GoAsm ignores the USES directive in x86 mode if I put x64 register names in it.

"USES rbx,rdi,rsi" — works OK in x64 mode but is ingored in x86. The registers are not preserved.
"USES ebx,edi,esi" — seems to work in both.

Can anyone confirm this, or maybe I am doing something wrong and don't see that ...  ::)
Title: Re: Bug in USES in x86/x64 code
Post by: donkey on January 31, 2012, 05:35:39 AM
You're not doing anything wrong Yuri, this is a bug in compatibility mode. For now this workaround works fine:

TestFrame FRAME param
#IFDEF X64
uses rbx,rdi,rsi
#ELSE
uses ebx,edi,esi
#ENDIF

ret
ENDF
Title: Re: Bug in USES in x86/x64 code
Post by: Yuri on January 31, 2012, 06:23:19 AM
I guess we can just write "USES ebx,edi,esi". The GoAsm manual states that pushes are equivalent for both versions of a register. This is probably unlikely to change. But of course your solution is more precise.
Title: Re: Bug in USES in x86/x64 code
Post by: jorgon on January 31, 2012, 10:38:02 PM
Hi Yuri

Thanks for the bug report.
Currently Wayne and Edgar are helping to maintain the "Go" source and to deal with bugs and enhancements.
Your bug has been identified, and a fix will be incorporated in GoAsm Version 0.57 which will be released very shortly.

Title: Re: Bug in USES in x86/x64 code
Post by: Yuri on February 01, 2012, 02:52:33 AM
Great news, Jeremy. :thumbu Thank you, guys, for maintaining this excellent project.