Advertisement
danielhilst

*paste IT&T hello world assembly*

Sep 5th, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. ;; file: a.s
  2. ;; compile: as a.s -o a.o
  3. ;; ld a.o -o hello
  4. ;; execute: ./hello
  5. ;; output: Hello World
  6.  
  7. .section .rodata
  8. .LC0:
  9. .string "Hello World\n"
  10.  
  11. .section .text
  12. .global _start
  13. _start:
  14. movq $4, %rax ; sys_write
  15. movq $1, %rbx ; stdout
  16. movq $.LC0, %rcx ; "Hello World\n" addr
  17. movq $12, %rdx ; length
  18.  
  19. int $0x80 ; do it!
  20.  
  21. movq $1, %rax ; sys_exit
  22. movq $0, %rbx ; exit(0)
  23.  
  24. int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement