快速链接:
.
个人博客笔记导读目录(全部)
- 付费专栏-付费课程 【购买须知】:
- 【精选】ARMv8/ARMv9架构入门到精通-[目录]
ARMv8有31个通用寄存器X0-X30, 还有SP、PC、XZR等寄存器
下面详细介绍写这些通用寄存器(general-purpose registers):
These are used to pass parameters to a function and to return a result. They can be used as scratch registers or as caller-saved register variables that can hold intermediate values within a function, between calls to other unctions. The fact that 8 registers are available for passing parameters reduces the need to spill parameters to the stack when compared with AArch32
If the caller requires the values in any of these registers to be preserved across a call to another function, the caller must save the affected registers in its own stack frame. They can be modified by the called subroutine ithout the need to save and restore them before returning to the caller.
These registers are saved in the callee frame. They can be modified by the called subroutine as long as they are saved and restored before returning.
• X8 is the indirect result register. This is used to pass the address location of an indirect result, for example, where a function returns a large structure.
• X16 and X17 are IP0 and IP1, intra-procedure-call temporary registers. These can be used by call veneers and similar code, or as temporary registers for intermediate values between subroutine calls. They are corruptible by a function. Veneers are small pieces of code which are automatically inserted by the linker, for example when the branch target is out of range of the branch instruction.
• X18 is the platform register and is reserved for the use of platform ABIs. This is an additional temporary register on platforms that don’t assign a special meaning to it.
• X29 is the frame pointer register (FP).
• X30 is the link register (LR).