27 lines
744 B
Text
27 lines
744 B
Text
|
|
;;; hellowin.asm
|
||
|
|
;;;
|
||
|
|
;;; nasm -fwin32 hellowin.asm
|
||
|
|
;;; link -subsystem:console -out:hellowin.exe -nodefaultlib -entry:main \
|
||
|
|
;;; hellowin.obj user32.lib kernel32.lib
|
||
|
|
|
||
|
|
global _main
|
||
|
|
extern _MessageBoxA@16
|
||
|
|
extern _ExitProcess@4
|
||
|
|
|
||
|
|
MessageBox equ _MessageBoxA@16
|
||
|
|
ExitProcess equ _ExitProcess@4
|
||
|
|
|
||
|
|
section .text
|
||
|
|
_main:
|
||
|
|
push 0 ; MB_OK
|
||
|
|
push title ;
|
||
|
|
push message ;
|
||
|
|
push 0 ;
|
||
|
|
call MessageBox ; eax = MessageBox(0,message,title,MB_OK);
|
||
|
|
push eax ;
|
||
|
|
call ExitProcess ; ExitProcess(eax);
|
||
|
|
message:
|
||
|
|
db 'Goodbye, World',0
|
||
|
|
title:
|
||
|
|
db 'RosettaCode sample',0
|