[英]NASM Assembly 16bit "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 需要方括號用於內存引用。 正確的語法是mov [handle], ax
。 foo
正在使用地址, [foo]
是內容。 你也可能在其他地方混淆了。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.