Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; file: a.s
- ;; compile: as a.s -o a.o
- ;; ld a.o -o hello
- ;; execute: ./hello
- ;; output: Hello World
- .section .rodata
- .LC0:
- .string "Hello World\n"
- .section .text
- .global _start
- _start:
- movq $4, %rax ; sys_write
- movq $1, %rbx ; stdout
- movq $.LC0, %rcx ; "Hello World\n" addr
- movq $12, %rdx ; length
- int $0x80 ; do it!
- movq $1, %rax ; sys_exit
- movq $0, %rbx ; exit(0)
- int $0x80
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement