JW> There are demos included, but so far I can see they are
JW> written to be called from a C-program. I was wondering how I
JW> can write a 100% pure assembly program with NASM under
JW> Linux.
Use bug-fixed nasm-0.94, and assemble the source below like:
nasm -f elf hello.asm
gcc hello.o -o hello
strip hello
There is much to learn. :-)
;-------------NASM's standalone Hello-World.asm for Linux --------
section .text
extern puts
global main
main:
push dword msg ;stash the location of msg on the stack.
call puts ;call the 'puts' routine (libc?)
add esp, byte 4 ;clean the stack?
ret ;exit.
msg:
db "Hello World!",0
--- timEd 1.01
---------------
* Origin: James Vahn (jvahn@short.circuit.com) (1:346/15.1)
|