首页 文章

我对比较和跳跃装配很困惑

提问于
浏览
0

我想输入

11,00,01,10 in ebx and eax register.

Everytime i input 01 or 10 i need to jump at l1.

And if i input 11 or 00 i want to quit from the procedure.

我怎样才能做到这一点 . 我尝试过,但只有前两个cmp正在工作休息不起作用 .

cmp ebx,0
    cmp eax,0
    je l1

    cmp ebx,1
    cmp eax,0
        jmp quit

    cmp ebx,1
    cmp eax,1
    jmp quit2

l1: mov edx,offset num3
    call writestring
    call crlf
    mov edx,offset num2
    call writestring
    call calf

1 回答

  • 1
    • 你确定'jmp'?不应该't it be ' je'?

    • 据我所知,只存储了最后一个cmp结果 . 因此,如果您编写两个顺序cmp命令,第一个命令将没有任何效果 . 你应该在任何cmp命令之后检查结果 .

    • 如果你在检查10个案件后立即跳起来,你将永远无法检查11个案例 .

相关问题