Mixin in Inline Assembly

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 8 18:59:59 PST 2017


On Monday, 9 January 2017 at 02:31:42 UTC, Chris M. wrote:
>     asm
>     {
>         mov EAX, tmp; // I'd also like to know if I could just 
> load *op1 directly into EAX
>         mov ECX, op2[EBP];
>         mixin(ins ~ " EAX, CL;"); // Issue here
>         mov tmp, EAX;
>     }
>     *op1 = tmp;
> }
>
> However, the inline assembler doesn't like me trying to do a 
> mixin. Is there a way around this?
'

You should be able to break it up too

asm {
    mov EAX, tmp;
}
mixin("asm { "~ ins ~ "EAX, CL;" }");
asm {
    move tmp, EAX;
}


you get the idea. It should compile to the same thing.


More information about the Digitalmars-d-learn mailing list