错误:操作码和操作数的无效组合

时间:2018-04-19 18:50:47

标签: nasm

我是NASM的新手。我收到了错误:

  

操作码和操作数的无效组合

位于第一行

mov     si,bl   ;si contains address of number string
mov     cx,7    ;once for each line
jmp     print_num ;print the number
loop    line_loop ;decrement cx, repeat if cx<>0
int     20h

1 个答案:

答案 0 :(得分:0)

si是16位寄存器,而bl是8位寄存器。当操作数都在相同位时,您只能使用 mov 指令。

作为问题的解决方案,请使用bx代替bl

mov si,bx

这是因为Intel 8086处理器使用16位寻址而不是8位。

顺便说一下,在编写32位应用程序时,可以使用esiebx

相关问题