ZR21 ZR (zero register)takes value zero,but itis not implemented as aphysical register ZR instruction encodings is 0b11111 (31?X31)ZRhastwoversions XZR (64 bits) WZR (32 bits)ARM032019/3/3
ZR ARM03 2019/3/3 21 ZR (zero register) takes value zero, but it is not implemented as a physical register ZR instruction encodings is 0b11111 (31 ? X31) ZR has two versions XZR (64 bits) WZR (32 bits)
Summary22Xn64-bitGPR: n can be 0-30Wn32-bitGPR:n can beO-30SP64-bitStack pointer registerWSP32-bitStack pointer registerXZR64-bitZero registerWZR32-bitZero register2019/3/3ARM03
Summary ARM03 2019/3/3 22 Xn 64-bit GPR: n can be 0-30 Wn 32-bit GPR: n can be 0-30 SP 64-bit Stack pointer register WSP 32-bit Stack pointer register XZR 64-bit Zero register WZR 32-bit Zero register
Example:add23 add.c add.sARM032019/3/3
Example: add ARM03 2019/3/3 23 add.c add.s
add.c24#include"stdio.h" void main()口 long a=1, b=2, c;口 c= a+b;可ARM032019/3/3
add.c ARM03 2019/3/3 24 #include "stdio.h" void main() { long a=1, b=2, c; c = a+b; }
add.c25#include"stdio.h"sioaohigh_addr void main()口spsp+241(a) long a=1, b=2, c;2(b)sp+16 c= a+b;sp+83(c)可sp=sp-32low_addrstackARM032019/3/3
add.c ARM03 2019/3/3 25 #include "stdio.h " void main() { long a=1, b=2, c; c = a+b; } Local variables, a, b and c are stored in stack high_addr low_addr sp sp=sp -32 sp+24 sp+16 sp+8 stack 1(a) 2(b) 3(c)