www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19528] New: asm ptoblem

https://issues.dlang.org/show_bug.cgi?id=19528

          Issue ID: 19528
           Summary: asm ptoblem
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: blocker
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: steven_kladitis yahoo.com

the following code compiles in 32 ,but not in 64 bit.
int main()
{
    import std.stdio;

   long i;


   asm
   {
     mov EAX,10;
     add EAX,20;
     mov i,EAX;

   }
   writeln(i," ",i.sizeof);
   return 0;
}

-- in 32 bit I get --> 30 8
in 64 bit it gets length error at lc:\rosetta>dmd -m64 machine_code.d
machine_code.d(14): Error: bad type/size of operands mov
-- commint out the move instruction I get ==> 0 8
the size of 'i' and 'EAX' are the same in both.

This is in -> DMD32 D Compiler v2.084.0-rc.1

--
Dec 30 2018