/* hellogas.s, GNU assembler program to print "Hello, world" using gcc library To compile in DJGPP or MINGW under Windows: gcc hellogas.s -o hellogas.exe The equivalent MASM is shown in comments where it differs */ .text /* .code */ msg: .ascii "Hello, world\n\0" /* db 'hello, world', 10, 0 */ .globl _main /* public _main */ _main: pushl $msg /* pushd offset msg ; argument to printf() */ call _printf addl $4, %esp /* add esp, 4 ; pop argument */ movl $0, %eax /* mov eax, 0 ; return exit status 0 in eax */ ret