NASM 汇编 16 位 "invalid combination of opcode and operands"
NASM Assembly 16bit "invalid combination of opcode and operands"
所以我正在尝试编写一个程序来创建一个文件和我的名字。
但是我得到 "invalid combination of opcode and operands"
mov handle, ax
,我不知道为什么。
我看到 你可以做到,为什么我不能。
预先感谢您的帮助。
org 100h
mov ah, 3ch ;create a file
mov dx, name ;file name
mov cx, 0
int 21h
mov handle, ax ; save handle
mov ah, 40h ;write to file
mov bx, handle
mov cx, 1000
mov dx, text ; what to write
int 21h
mov ah, 3eh ;close the file
mov bx, handle
int 21h
mov ax, 4C00h ; end
int 21h
section .data
name db "name.txt", 0
text db "Michal",0ah,0dh,"$"
section .bss
handle resb 2
NASM Requires Square Brackets For Memory References。正确的语法是 mov [handle], ax
。 foo
是使用地址,[foo]
是内容。您也可能在其他地方混淆了它。
所以我正在尝试编写一个程序来创建一个文件和我的名字。
但是我得到 "invalid combination of opcode and operands"
mov handle, ax
,我不知道为什么。
我看到
org 100h
mov ah, 3ch ;create a file
mov dx, name ;file name
mov cx, 0
int 21h
mov handle, ax ; save handle
mov ah, 40h ;write to file
mov bx, handle
mov cx, 1000
mov dx, text ; what to write
int 21h
mov ah, 3eh ;close the file
mov bx, handle
int 21h
mov ax, 4C00h ; end
int 21h
section .data
name db "name.txt", 0
text db "Michal",0ah,0dh,"$"
section .bss
handle resb 2
NASM Requires Square Brackets For Memory References。正确的语法是 mov [handle], ax
。 foo
是使用地址,[foo]
是内容。您也可能在其他地方混淆了它。