digitalmars.D.learn - Inline assembly registers
- Temtaime (4/4) Aug 10 2013 Hello for all!
- bearophile (6/8) Aug 10 2013 D is a system language, and registers are there to be used. What
- Temtaime (4/4) Aug 10 2013 I'm writing some ASM code in my function.
- bearophile (9/13) Aug 10 2013 dmd saves some registers before the asm code, and then restores
- Temtaime (2/2) Aug 10 2013 Now it's clear.
Hello for all! Which registers in IASM i must preserve? http://dlang.org/iasm.html says nothing. Regards.
Aug 10 2013
Temtaime:Which registers in IASM i must preserve? http://dlang.org/iasm.html says nothing.D is a system language, and registers are there to be used. What do you want to keep safe? Take a look at the docs page about the D ABI. Bye, bearophile
Aug 10 2013
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?
Aug 10 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
Aug 10 2013