Re: GNU AS and multiplatform example ...



Hi James,

Here is a simple Win32 example :

..intel_syntax noprefix
..global _start

..data
..extern _MessageBoxA@16
..extern _ExitProcess@4

..equ MessageBox,_MessageBoxA@16
..equ ExitProcess,_ExitProcess@4

message:
..asciz "Hello world!" /* define NULL terminated string */
caption:
..asciz "Message box"

..text
_start:
pushd 0 /* push DOUBLE word */
push OFFSET caption
push OFFSET message
pushd 0
call MessageBox
pushd 0
call ExitProcess

To build the project :

as -o Sample.o Sample.asm
ld -e_start -subsystem windows -Lc:\masm32\lib -o Sample.exe Sample.o
--library=user32 --library=kernel32 -s

.