简单的8086比较指令问题
最近我有一个8086汇编作业要完成,我尝试使用CMP指令,但无法正确执行。代码如下:
MOV AL, 88h
CMP AL, 24h
JL exit
label:
mov al,4h
exit:
RET
当我调试它时,在jl之后它直接跳到exit:
但下面的代码工作正常
MOV AL, 88
CMP AL, 24
JL exit
label:
mov al,4h
exit:
RET
为什么会发生这种情况?
recently i have a 8086 assembly homework to finish, i try to use the CMP instruction , but can't get it right.here is the code:
MOV AL, 88h
CMP AL, 24h
JL exit
label:
mov al,4h
exit:
RET
when i debug it , after jl it jump right to exit:
but the following code works fine
MOV AL, 88
CMP AL, 24
JL exit
label:
mov al,4h
exit:
RET
why this is happening ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JL 使用有符号条件。从有符号的角度来看,88h 是一个负数。如果您希望 24h 被视为小于 88h,您有多种选择 - 最明显的是使用无符号条件,这意味着使用
jb
而不是jl< /代码>。
JL uses a signed condition. From a signed viewpoint, 88h is a negative number. If you want 24h to be treated as less than 88h, you have a couple of choices -- the most obvious would be to use an unsigned condition, which would mean using
jb
instead ofjl
.