talks

git clone git://code.dwrz.net/talks
Log | Files | Refs

hello-world.s (402B)


      1 .data
      2 str:
      3         .ascii "Hello, World\n"
      4 
      5 .text
      6 	.global _start
      7 
      8 _start:
      9         mov $1, %rax   # 64-bit system call number for sys_write.
     10         mov $1, %rdi   # stdout.
     11         mov $str, %rsi # Address of the buffer.
     12         mov $13, %rdx  # Number of bytes to write.
     13         syscall
     14 
     15 	mov $231, %rax # 64-bit system call number for exit_group.
     16         mov $0, %rdi   # Exit code.
     17         syscall