既然你是編程,你已經有一個指令集的參考權像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
你無法格式化。我的建議是:在學習如何使用基本工具之前,請勿觸碰彙編程序 –