Guest User

Untitled

a guest
Jan 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. ; Author: Juan Escobar
  2. ; /usr/include/i386-linux-gnu/asm/unistd_32.h
  3. ; nasm -f elf -o HelloWorld.o HelloWorld.asm
  4. ; ld -o HelloWorld HelloWorld.asm
  5.  
  6. global _start
  7.  
  8. section .text
  9.  
  10. _start:
  11.  
  12. ; print "Hello World!" on the screen
  13. mov eax, 0x4 ; system call _write(fd, *buf, lenght)
  14. mov ebx, 0x1 ; file descriptor (standart output)
  15. mov ecx, message ; *buf
  16. mov edx, 0x0c ; lenght (12)
  17. int 0x80 ; interruptor
  18.  
  19. ; exit the program
  20. mov eax, 0x1 ; system call _exit(status)
  21. mov ebx, 0x5 ; status (5)
  22. int 0x80 ; interruptor
  23.  
  24. section .data
  25. ; label
  26. message: db "Hello World!" ; define byte
Add Comment
Please, Sign In to add comment