【问题标题】:error: invalid combination of opcode and operands错误:操作码和操作数的组合无效
【发布时间】:2018-04-19 18:50:47
【问题描述】:

我是 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

【问题讨论】:

    标签: nasm


    【解决方案1】:

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

    作为您的问题的解决方案,请使用 bx 而不是 bl

    mov si,bx
    

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-23
      • 2015-07-31
      • 1970-01-01
      相关资源
      最近更新 更多