www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Internal assembler having trouble with inout params

By disassembling some test code, it's clear that inout parameters are just
pointers that are implicitly dereferenced when needed.  And treating them as
pointers using inline asm works just fine.  But the assembler seems to have
problems referencing inout parameters < 32 bits in asm blocks.  Here's some
sample code:

C:\code\d>dmd test -version=test1
test.d(7): bad type/size of operands 'mov'

If I compile without the version flag and inspect the code however, I see:

so I'm obviously doing the right thing.  I know I could get around this by
making the block naked or by using pure asm to reference the variable, but this
should not be necessary.

Aug 01 2005