操作码和操作数的组合无效?(x86 DOS)

use*_*856 1 x86 assembly dos nasm x86-16

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"
Run Code Online (Sandbox Code Playgroud)

为什么NA​​SM会给我这个错误信息:

第5行出错:操作码和操作数的组合无效

mov byte [str1+2], [char] 
Run Code Online (Sandbox Code Playgroud)

在这一行我试图将存储的字节移动*char到地址*str1+2.

小智 7

英特尔架构处理器通常无法在一条指令中将数据从内存传输到内存.你需要写一些类似的东西:

mov byte al, [char]
mov byte [str1+2], al
Run Code Online (Sandbox Code Playgroud)