Skip to content

Commit

Permalink
using proper sections
Browse files Browse the repository at this point in the history
previous version was an experiment I was running. this current version has the proper sections defined which make the code easier to disassemble in something like gdb or radare
  • Loading branch information
gcmartinelli committed Sep 29, 2019
1 parent 904fa7c commit 2b802fe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hello.s
Expand Up @@ -5,10 +5,12 @@
; https://blog.rchapman.org/posts/Linux_System_Call_Table_for_x86_64/
; https://en.wikipedia.org/wiki/Write_(system_call)

section .config
global _start

section .data
hello_world db 'Hello, world!',10 ;string and the ascii code for a new line (10)
global _start

section .text
_start:
mov rax, 1 ;1 is the syscall code for write. bellow the arguments are set
mov rdi, 1 ;fd - 0: stdin, 1:stdou, 2:sterr
Expand Down

0 comments on commit 2b802fe

Please sign in to comment.