- adrp 页 基地址 指令(address of page), 用于计算基于当前 PC 的页基地址
adrp x0, #_g@PAGE # 将变量 _g 所在的 4KB 大小页的 基地址,读入 x0 寄存器 - ccmp 条件比较 (conditional compare), 前面一般都有一条 cmp 指令
mov w0, #10 mov w1, #3 cmp w0, #10 # 比较 w0 和 10 ccmp w1, #5, #0, ne # 上面的比较结果如果是 ne (不等于),则 比较 w1 和 5, 并将结果置为标志,否则将标志置为 0 b.eq do_something # 整段代码的意思就是 当 (w0 != 10) && (w1 == 5) 时, do_something - ldp 双加载 (load pair),从一个内存地址同时Load 到两个寄存器
ldp x0, x1, [sp, #0x10] # 将内存位置 sp + 0x10 的数分别加载到 x0 和 x1 寄存器 - svc 触发系统调用 (SuperVisor Call) , 会让CPU 进入异常级别 EL1, PC 会跳转到 异常向量表 中的相应地址
svc #0 # 调用 系统调用号 为 0 的系统调用
Last active
August 15, 2024 06:08
-
-
Save lucmann/c49b12d2a0e92ca355b53294b976f810 to your computer and use it in GitHub Desktop.
arm assembly
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment