posts - 9,comments - 14,trackbacks - 0

一般调用动态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 阵雨 阅读(398) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理