__saveregs

The __saveregs keyword causes the compiler to generate a function entry sequence that saves all CPU registers and an exit sequence that restores the registers. Note that __saveregs does not restore registers used for a return value (the AX register, or AX and DX).

The __saveregs keyword is useful when the register conventions of the caller are not known. For instance, __saveregs can be used for a general-purpose function in a dynamic-link library. Because such a function can be called from any language, it is unsafe to assume any particular calling convention. Functions that are intended to be interfaced with assembly-language code can protect the caller against undesirable side effects by using the __saveregs attribute.

It is illegal to declare a function with both the __saveregs and the __interrupt attributes.

32-Bit Specific

The __saveregs keyword is not supported in 32-bit compilations.¨