hello.asm:
extern MessageBoxA
extern ExitProcess
section .data
title db "caption.",0
message db "hello world....",0
section .text
global main
main:
push 0
push title
push message
push 0
call MessageBoxA
_exit:
push 0
call ExitProcess
hello.asm to hello.obj:
>nasm -f win32 hello.asm
编写GoLink命令文件 link.fil:
; 使用:> golink @link.fil
; http://www.godevtool.com/GolinkHelp/GoLink.htm#export
/entry main ; 设置入口函数
hello.obj
; 输入文件
kernel32.dll
user32.dll
hello.obj to hello.exe:
>golink @link.fil