fork download
  1. SECTION .data ; data section
  2. msg: db "Hello World",10 ; the string to print, 10=cr
  3. len: equ $-msg ; "$" means "here"
  4. ; len is a value, not an address
  5.  
  6. SECTION .text ; code section
  7. global main ; make label available to linker
  8. main: ; standard gcc entry point
  9.  
  10. mov edx,len ; arg3, length of string to print
  11. mov ecx,msg ; arg2, pointer to string
  12. mov ebx,1 ; arg1, where to write, screen
  13. mov eax,4 ; write sysout command to int 80 hex
  14. int 0x80 ; interrupt 80 hex, call kernel
  15.  
  16. mov ebx,0 ; exit code, 0=normal
  17. mov eax,1 ; exit command to kernel
  18. int 0x80 ; interrupt 80 hex, call kern
Success #stdin #stdout 0.01s 144KB
stdin
Standard input is empty
stdout
Hello World