分类: 嵌入式
2011-03-30 19:29:10
The registers RAX, RCX, RDX, R8, R9, R10, R11 are considered volatile and must be considered destroyed on function calls (unless otherwise safety-provable by analysis such as whole program optimization).
The registers RBX, RBP, RDI, RSI, R12, R13, R14, and R15 are considered nonvolatile and must be saved and restored by a function that uses them.
也就是说,你在写汇编子程序,不能修改RBX, RBP, RDI, RSI, R12, R13, R14, and R15 的值,否则就会出错。如果需要使用这些寄存器,需要首先把他们push 栈中,函数返回时,pop。
在用gcc 编译时可以修改r12
在icc编译不可以修改r12
r12 unused for C