-
-
Save ozzyozbourne/560db8df7e740bfcb9a9df2cda48cbbb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .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