Skip to content

Instantly share code, notes, and snippets.

@m-doughty
Created November 17, 2025 10:32
Show Gist options
  • Select an option

  • Save m-doughty/43169c8a3610d2e350ddcc99d694c622 to your computer and use it in GitHub Desktop.

Select an option

Save m-doughty/43169c8a3610d2e350ddcc99d694c622 to your computer and use it in GitHub Desktop.
.global _main
.align 2
.data
msg: .ascii "Hello, World!\n" ; non-null terminated 'string'
len = . - msg ; Calculate string length (14 bytes)
.text
_main:
mov x0, #1 ; File descriptor 1 = stdout
adrp x1, msg@PAGE ; Load page address of msg
add x1, x1, msg@PAGEOFF ; Add page offset
mov x2, #len ; x2 = length (14)
mov x16, #4 ; System call: write
svc #0x80 ; Ask kernel to print
mov x0, #0 ; Return code 0 = success
mov x16, #1 ; System call: exit
svc #0x80 ; Goodbye!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment