asm
... end ['R1', ... ,'Rn']; |
Here R1 to Rn are the names of the registers you modify in your assembly code.
As an example:
asm
movl BP,%eax movl 4(%eax),%eax movl %eax,__RESULT end ['EAX']; |
This example tells the compiler that the EAX register was modi ed.
For assembler routines, i.e., routines that are written completely in assembler, the ABI of the processor & platform must be respected, i.e. the routine itself must know what registers to save and what not. The method described above doesn't apply there.
The only thing the compiler does, is create a minimal stack frame if needed (e.g. when variables are declared). All the rest is up to the programmer.