2

Here is my code fragment:

    .data
Num1    equ     40h
Num2    equ     41h
Var1    dword   0
Var2    dword   0
;----------------------------------------------------------------------
    align   4
    .code       ;insert executable instructions below
main    PROC        ;program execution begins here
    mov Var1, Num1
    mov Var2, Num2

    add Var1, Var2

I am trying to use the ADD instruction but I get the following error:

error A2070: invalid instruction operands

This error is related to the ADD line. If I omit that line the program runs fine.

4

1 に答える 1

2

2つのメモリ位置を相互に追加することはできません。レジスタの1つを第2オペランドとして使用する必要があります

 .data
Num1    equ     40h
Num2    equ     41h
;----------------------------------------------------------------------
    align   4
    .code       ;insert executable instructions below
    main    PROC        ;program execution begins here

    mov ax, Num2

    add ax, Num1
于 2012-10-10T17:09:04.740 に答える