www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Strange things allowed in iasm

reply Basile B. <b2.temp gmx.com> writes:
1/

void foo()
{
     asm pure nothrow
     {
         naked;
         mov RAX, [0x10][0x20] R8;
         ret;
     }
}

generates

;------- SUB 0000000000449468h -------
0000000000449468h  mov eax, 00000030h
000000000044946Dh  ret
;-------------------------------------


2/

void foo()
{
     asm pure nothrow
     {
         naked;
         mov RAX, [R9][R10] R8;
         ret;
     }
}

generates

;------- SUB 0000000000449468h -------
0000000000449468h  mov rax, r8
000000000044946Bh  ret
;-------------------------------------


IASM Parser bug ?
Feb 03
next sibling parent Basile B. <b2.temp gmx.com> writes:
On Sunday, 4 February 2018 at 05:45:02 UTC, Basile B. wrote:
 1/

 void foo()
 {
     asm pure nothrow
     {
         naked;
         mov RAX, [0x10][0x20] R8;
         ret;
     }
 }

 generates

 ;------- SUB 0000000000449468h -------
 0000000000449468h  mov eax, 00000030h
 000000000044946Dh  ret
 ;-------------------------------------


 2/

 void foo()
 {
     asm pure nothrow
     {
         naked;
         mov RAX, [R9][R10] R8;
         ret;
     }
 }

 generates

 ;------- SUB 0000000000449468h -------
 0000000000449468h  mov rax, r8
 000000000044946Bh  ret
 ;-------------------------------------


 IASM Parser bug ?
This one too void foo() { asm pure nothrow { naked; mov RAX[R8][R12], [0x10][0x20] DX [0x10][0x20]; ret; } }
Feb 03
prev sibling parent Basile B. <b2.temp gmx.com> writes:
On Sunday, 4 February 2018 at 05:45:02 UTC, Basile B. wrote:
 1/

 void foo()
 {
     asm pure nothrow
     {
         naked;
         mov RAX, [0x10][0x20] R8;
         ret;
     }
 }

 generates

 ;------- SUB 0000000000449468h -------
 0000000000449468h  mov eax, 00000030h
 000000000044946Dh  ret
 ;-------------------------------------


 2/

 void foo()
 {
     asm pure nothrow
     {
         naked;
         mov RAX, [R9][R10] R8;
         ret;
     }
 }

 generates

 ;------- SUB 0000000000449468h -------
 0000000000449468h  mov rax, r8
 000000000044946Bh  ret
 ;-------------------------------------


 IASM Parser bug ?
Decided than it is indeed a bug: https://issues.dlang.org/show_bug.cgi?id=18373 but maybe that the problem happens after parsing.
Feb 05