Inline assembly registers

bearophile bearophileHUGS at lycos.com
Sat Aug 10 15:36:09 PDT 2013


Temtaime:

> I'm writing some ASM code in my function.
>
> Does it mean that DMD saves "his" registers before my asm code 
> and restores after? So i can use all registers without 
> interaction with code that DMD backend produces?

dmd saves some registers before the asm code, and then restores 
them after your asm. If you don't want that behavour then you 
have to use the "naked" attribute.

For details of what registers can be used take a look at the 
docs. And also take a look at the disassembly of your function 
that contains an empty asm statement, to see exactly what's saved.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list