Invalid combination of opcode and operands? (x86 DOS) [duplicate]

▼魔方 西西 提交于 2019-12-01 10:13:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!