问题
org 100h
mov ah, 9
mov dx, str1
mov byte [str1+2], [char]
int 21h
mov ah, 4Ch
int 21h
str1 db 'String$'
char db "o"
Why does NASM give me this error message:
Error on line 5: Invalid combination of opcode and operands
mov byte [str1+2], [char]
in this line I'm trying to move the byte stored on *char
to the address *str1+2
.
回答1:
Intel architecture processors generally can't transfer data from memory to memory in one instruction. You need to write something like:
mov byte al, [char]
mov byte [str1+2], al
来源:https://stackoverflow.com/questions/8613380/invalid-combination-of-opcode-and-operands-x86-dos