1 ; Hello World Program - asmtutor.com
     
2 ; Compile with: nasm -f elf helloworld.asm
     
3 ; Link with (64 bit systems require elf_i386 option): ld -m elf_i386 helloworld.o -o helloworld
     
4 ; Run with: ./helloworld
     
5  
     6 SECTION .data
     
7 msg     db      'Hello World!', 0Ah
     
8  
     9 SECTION .text
    
10 global  _start
    
11  
    12 _start:
    
13  
    14     mov     edx, 13
    
15     mov     ecx, msg
    
16     mov     ebx, 1
    
17     mov     eax, 4
    
18     int     80h
    
19  
    20     mov     ebx, 0      ; return 0 status on exit - 'No Errors'
    
21     mov     eax, 1      ; invoke SYS_EXIT (kernel opcode 1)
    
22     int     80h