The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: Yuri on February 07, 2012, 09:44:32 AM

Title: Bug in x64 with the S type indicator
Post by: Yuri on February 07, 2012, 09:44:32 AM
The S type indicator seems to be ignored in x64 if used as the scale value.

#if x64
    S=8
#else
    S=4
#endif

CODE SECTION

Start:
    mov rax,2
    lea rdx,[rax*S+4]
    invoke msvcrt:printf, "S = %d; rdx = %d", S, rdx
    #if ! x64
        add esp,0Ch
    #endif
    ret


Results in my tests:

x86 S = 4; rdx = 12
x64 S = 8; rdx = 6
Title: Re: Bug in x64 with the S type indicator
Post by: wjr on February 08, 2012, 12:45:48 AM
Thanks. Correct, any defined symbol including S is ignored with only direct numerical scale values being processed in x64. I also see that 32-bit processing assembles without error if the symbol is not defined or defined as a string.

I have forwarded fixes for these to Jeremy to be incorporated into the upcoming GoAsm Version 0.57.

This version will also have a similar P type indicator (default 4) as mentioned previously here:
http://www.masm32.com/board/index.php?topic=13127.0
Title: Re: Bug in x64 with the S type indicator
Post by: Yuri on February 08, 2012, 01:37:50 AM
Thanks, Wayne. Yes, to have a separate type switch for pointers will be more convenient than one S for all purposes. :thumbu