初学ASM,HELLO WORLD 编译遇到问题..
使用masm
sample.asm 如下
.586
.mmx
.model flat,stdcall
option casemap:none
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;Include 文件定义
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
include windows.inc
include user32.inc
includelib user32.lib
include kernel32.inc
includelib kernel32.lib
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;数据段
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.data
szCaption db 'a MessageBox!',0
szText db 'hello world',0
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
.code
start:
invoke MessageBox,NULL,offset szText,offset szCaption,MB_OK
invoke ExitProcess,NULL
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
end start
用nmake的时候提示:
F:\asm>nmake /f sample3_1.asm
Microsoft (R) Program Maintenance Utility Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
sample3_1.asm(1) : fatal error U1033: syntax error : '.586' unexpected
直接ml
F:\asm>ml sample.asm
Microsoft (R) Macro Assembler Version 6.14.8444
Copyright (C) Microsoft Corp 1981-1997. All rights reserved.
Assembling: sample3_1.asm
Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/z2
"sample.obj"
"sample.exe"
NUL
LINK : warning LNK4044: unrecognized option "z2"; ignored
sample3_1.obj : warning LNK4033: converting object format from OMF to COF
LINK : fatal error LNK1181: cannot open input file "sample.exe"
请问这是什么意思呢?
编译环境应该没错的
我编译书上的例子成功了。