TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: JAN WAGEMAKERS
from: JAMES VAHN
date: 1997-04-17 15:20:00
subject: NASM & Linux

 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)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.