2014-01-11 79 views
1

我正在使用MASM製作一個簡單的消息程序。目前我在Windows 8 64位上運行DOSBOX。我有一個文件夾8086,其中包含DEBUG,BIN2HEX,EDIT,EXE2BIN,LINK,MASM,TASM和TD可執行文件。 MASM與ML命令不同。錯誤A2105:預期:指令或指令程序集

回到我的問題,當我試圖用masm Hello.asm。我得到了Error A2105 : Expected : instruction or directive。我在我的代碼中使用了一些指令。

Hello.asm

.386 
.model flat, stdcall 
option casemap: none 

extrn [email protected] : PROC 
extrn [email protected] : PROC 

.data 
    HelloWorld db "Welcome to Assembly Language!", 0 
    MsgTitle db "Our First MessageBox", 0 
.code 
start: 

    mov eax,0 
    push eax 
    lea ebx , MsgTitle 
    push ebx 
    lea ebx, HelloWorld 
    push ebx 
    push eax 
    call [email protected] 
    push eax 
    call [email protected] 

end start 

我沒有任何想法如何從該ASM創建OBJ,LST,CRF。所以我只是跳過他們兩個。

Object filenam [hello.OBJ] : 
Source listing [NUL.LST]: 
Cross-reference [NUL.CRF]: 
hello.asm(3): error 2105 : Expected : instruction or directive 
+1

您正在使用哪個版本的MASM? – Michael

+0

當masm問你關於.obj,.lst和.crf它是*生成*它們時,你不必提供它們 – Seki

回答

0

我不知道,但MASM從錯誤信息很清楚,彙編器不會考慮此行

option casemap: none 

爲有效的指令或指令。所以你應該檢查你是否使用正確的格式。也許你需要在分號後刪除空白。無論如何,你可以簡單地將它從編譯代碼的程序中移除。