既然你是编程,你已经有一个指令集的参考权像ARM体系结构参考手册(ARM ARM),正确的汇编语言?而当你在读的手动操作下的CMP指令,你发现:
if ConditionPassed(cond) then
alu_out = Rn - shifter_operand
N Flag = alu_out[31]
Z Flag = if alu_out == 0 then 1 else 0
C Flag = NOT BorrowFrom(Rn - shifter_operand)
V Flag = OverflowFrom(Rn - shifter_operand)
然后在该分支指令下
if ConditionPassed(cond) then
if L == 1 then
LR = address of the instruction after the branch instruction
PC = PC + (SignExtend(signed_immed_24) << 2)
,并同时为COND字段描述执行或不执行所需要的条件指令
1100 GT Signed greater than Z clear, and either N set and V set, or
N clear and V clear (Z == 0,N == V)
1110 AL Always (unconditional)
如果没有指定其他条件,则暗示AL。
当您在阅读本手册时,您不了解这部分内容吗?
您是否尝试过使用调试器? –
@RaymondChen我不知道如何使用gdb,如果你能指导我通过它,那将是美好的。 – user7083361
你无法格式化。我的建议是:在学习如何使用基本工具之前,请勿触碰汇编程序 –