assembly - 为什么 JB 没有做准确的 CMP
问题描述
在emu8086中,我写了这段代码
include 'emu8086.inc'
org 100h
MOV AX,-1
CMP AX,0
JB case1
case2:
printn 'This line should not be displayed'
case1:
print 'I want this line'
ret
它应该只打印案例 1,但在这种情况下,输出显示了这两种情况。我究竟做错了什么?
解决方案
JB
(Jump if below) 用于类似于JNAE
(Jump if Not Above or Equal) 的无符号整数。
因此,如果要与有符号整数(在您的情况下为 -1)进行比较,则必须使用JL
(Jump if Less) 或JNGE
(Jump if Not Greater or Equal)
推荐阅读
- azure - 验证的开放 API 规范无法上传到 Azure API 管理
- flutter - FlutterError('无法加载资产:$key');
- windows-runtime - C++17
返回访问被拒绝,无论功能如何 - spring - 为什么页面在 Spring 中不去聊天?
- python - 手动安装python包但无法导入
- python - 通过对随机大小的可变调用来控制 numpy 随机种子
- java - 评估项目 ':app' 时出现问题。Android Studio 3.6 更新
- python - Pyspark 产生非确定性文件未找到错误
- python-3.x - Cython - Python 列表的高效选项
- javascript - 当所有孩子都被绝对定位时如何弯曲(或类似的影响)