有效地址计算无效
请看下面的程序,错误是有效地址计算无效,我已经提到了该行,请告诉我为什么它的有效地址计算无效 这是程序
[org 0x100]
jmp start
array1: dw 10,15,20,25,30,35,40,45,50,55
array2: dw 15,10,20,35,40,30,55,50,25,45
start: mov bx,0
mov cx,0
loop: mov ax,[array2+bx]
cmp ax,[array1+cx]//here is the error invalid effective address calculation
jne NextElementOfArray1
NextElementOfArray2: add bx,2
cmp bx,20
je end
mov cx,0
jmp loop
NextElementOfArray1: add cx,2
cmp cx,20
je NextElementOfArray2
jmp loop
end: mov ax,0x4c00
int 0x21
Please look at the following program, the error is invalid effective address calculation and i have mentioned that line please tell me why its invalid effective address calculation
here is the program
[org 0x100]
jmp start
array1: dw 10,15,20,25,30,35,40,45,50,55
array2: dw 15,10,20,35,40,30,55,50,25,45
start: mov bx,0
mov cx,0
loop: mov ax,[array2+bx]
cmp ax,[array1+cx]//here is the error invalid effective address calculation
jne NextElementOfArray1
NextElementOfArray2: add bx,2
cmp bx,20
je end
mov cx,0
jmp loop
NextElementOfArray1: add cx,2
cmp cx,20
je NextElementOfArray2
jmp loop
end: mov ax,0x4c00
int 0x21
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
编辑:如果我没记错的话,
cx
寄存器不能用作索引。表 2-1。采用 ModR/M 字节的 16 位寻址形式
Edit: If I recall correctly,
cx
register can not be used as an index.Table 2-1. 16-Bit Addressing Forms with the ModR/M Byte
以下公式(对于 TASM)更容易记住地址规范:
使用 表示 OR(意味着 BX 和 BP 不能在同一地址规范中)。
常量可以是变量或数值常量。
It is easier to remember the address specification with the following formula (for TASM):
Where | Denotes the OR (meaning that BX and BP can't be in the same address specification).
constant can be a variable or a numeric constant.