Created
December 12, 2021 21:05
-
-
Save numanturle/8e7b1fd6c00a15e742400fb2f0c81716 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
.data | |
/* Data segment: define our message string and calculate its length. */ | |
msg: | |
.ascii "Hello, ARM64!\n" | |
len = . - msg | |
.text | |
/* Our application's entry point. */ | |
.globl _start | |
_start: | |
/* syscall write(int fd, const void *buf, size_t count) */ | |
mov x0, #1 /* fd := STDOUT_FILENO */ | |
ldr x1, =msg /* buf := msg */ | |
ldr x2, =len /* count := len */ | |
mov w8, #64 /* write is syscall #64 */ | |
svc #0 /* invoke syscall */ | |
/* syscall exit(int status) */ | |
mov x0, #0 /* status := 0 */ | |
mov w8, #93 /* exit is syscall #1 */ | |
svc #0 /* invoke syscall */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://main.lv/writeup/arm64_assembly_hello_world.md