News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Bug in USES in x86/x64 code

Started by Yuri, January 30, 2012, 05:05:27 PM

Previous topic - Next topic

Yuri

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 ...  ::)

donkey

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
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

Yuri

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.

jorgon

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.

Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

Yuri

Great news, Jeremy. :thumbu Thank you, guys, for maintaining this excellent project.