; hello7.s, NASM program to print "hello world" with Borland or gcc C library ; Equivalent MASM is shown in comments where different ; ; To compile with Borland: ; ; nasm -f obj hello7.s ; bcc32 hello7.obj ; ; To compile with DJGPP: ; ; nasm -f coff hello7.s ; gcc hello7.o -o hello7.exe -s ; ; To compile with MINGW: ; ; nasm -f win32 hello7.s ; gcc hello7.obj -o hello7.exe -s ; .386 global _main ; public _main extern _printf ; extern C printf: proc section .data use32 ; .data greeting db 'hello world',10,0 section .text use32 class=CODE ; .code, .model flat _main: push greeting ; push offset greeting call _printf ; call printf add esp,4 ret ; end