Archive for 2012年1月9日

Using and Preserving Registers in Inline Assembly

2012年1月9日

http://msdn.microsoft.com/ja-jp/library/k1a8ss06.aspx

より、ポイントだけメモ。

When using __asm to write assembly language in C/C++ functions, you don’t need to preserve the EAX, EBX, ECX, EDX, ESI, or EDI registers.

You should preserve other registers you use (such as DS, SS, SP, BP, and flags registers) for the scope of the __asm block. You should preserve the ESP and EBP registers unless you have some reason to change them (to switch stacks, for example).

広告