open /Users/invincible/Documents/Docs/Arch/armv8_arm.pdf

Calling Convention

Untitled

Untitled

ARM (A64)
The 64-bit ARM (AArch64) calling convention 
allocates the 31 general-purpose registers as:

x31 (SP): Stack pointer or a zero register, depending on context.
x30 (LR): Procedure link register, used to return from subroutines.
x29 (FP): Frame pointer.
x19 to x29: Callee-saved.
x18 (PR): Platform register. Used for some operating-system-specific special purpose, or an additional caller-saved register.
x16 (IP0) and x17 (IP1): Intra-Procedure-call scratch registers.
x9 to x15: Local variables, caller saved.
x8 (XR): Indirect return value address.
x0 to x7: Argument values passed to and results returned from a subroutine.
All registers starting with x have a corresponding 32-bit register prefixed with w. Thus, a 32-bit x0 is called w0.

C6.2.33 BL

Untitled

C6.2.25 B.cond

https://support.huaweicloud.com/pinsrcase-kunpengprocs/kunpengprocessor_18_0040.html

在Arm64汇编指令中,有一个CPSR寄存器称之为程序状态寄存器,有N\Z\C\V四个标志位存在其中,Arm汇编主要通过这些标志位的标记和判断实现分支结构的功能,其基本用法结构:CMP/CCMP/ADDS/SUBS/ANDS/TST… … //改写状态寄存器的指令

Branch conditionally to a label at a PC-relative offset, with a hint that this is not a subroutine call or return.

bits(64) offset = SignExtend(imm19:'00', 64);

Untitled