簡體   English   中英

我在NASM中收到宏錯誤:“錯誤:解析器:預期指令”

[英]I get a macro error in NASM: 'error: parser: instruction expected'

我不斷收到相同的錯誤: error: parser: instruction expected
我在以下行中收到此錯誤:

WSTRING 'MESSAGE'

我的代碼是:

Bits 16  
call clear_screen  
WSTRING 'MESSAGE'  
jmp $   

%MACRO WSTRING 1  
     mov si, %1  
     call print  
%ENDMACRO   

我已經嘗試過了,但也不起作用:

Bits 16
MSG DB 'MESSAGE',0
call clear_screen
WSTRING MSG
jmp $

%MACRO WSTRING 1
    mov si, %1
    call print
%ENDMACRO

您不能將文字字符串用作指令的操作數。 您只能使用string的地址。 這意味着,您需要指示匯編器將該字符串放置在某個位置,然后使用其符號地址。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM