一般調用動態C庫msvcrt.dll,所以要includelib msvcrt.lib,文件可以從VC的lib目錄里面獲取。
MSVCRT.LIB
|
Multithreaded, dynamic link (import library for MSVCR71.DLL). Be aware that if you use the Standard C++ Library, your program will need MSVCP71.DLL to run.
|
asm源代碼
//test.asm 感謝aogo的masmplus
;MASMPlus 代碼模板 - 控制臺程序
;--------------------------------------------------------------------
.386
.model flat, stdcall
option casemap :none
include windows.inc
include user32.inc
include kernel32.inc
include masm32.inc
PUBLIC?main???????????????//提供main給msvcrt鏈接
includelib user32.lib
includelib kernel32.lib
includelib masm32.lib
includelib msvcrt.lib
.data
?lpMsg??db "Hello World!",0
.code
extrn printf :near
main?PROC C???????????//注意調用規則為 cdecl
?invoke locate,2,2???;設定輸出文本的坐標
?push? offset lpMsg
?call?? printf
?add esp,4
?invoke ExitProcess,0
?ret?0
main?ENDP
end?????????//end后面不要跟入口標示
posted on 2006-05-12 05:39
陣雨 閱讀(406)
評論(0) 編輯 收藏 引用