Quote:
Originally Posted by Hedeon
Can you confirm i can use any volatile register I want (r3-r12) inside the asm code without trashing stuff?
|
Using __asm() inside a C function? No. The compiler does not know what happens inside such a block.
Or did you think about calling an assembler function or inline routine? Then yes, the compiler always treats the ABI-defined volatile registers accordingly and may save them before a call. If your function does not use all volatile registers you may specify that with __regsused().
Quote:
And non-volatile (r13-r31) are saved on the stack before jumping to a(n asm) function?
|
Saving and restoring non-volatile registers is always the duty of the callee, not of the caller.