mirror of
https://github.com/pkivolowitz/asm_book.git
synced 2026-06-21 02:26:59 +08:00
18 lines
415 B
ArmAsm
18 lines
415 B
ArmAsm
.global main
|
|
.text
|
|
.align 2
|
|
|
|
main: stp x29, x30, [sp, -16]!
|
|
mov x8, 172 // getpid on ARM64
|
|
svc 0 // trap to EL1
|
|
mov w1, w0
|
|
ldr x0, =fmt
|
|
bl printf
|
|
ldp x29, x30, [sp], 16
|
|
mov w0, wzr
|
|
ret
|
|
|
|
.data
|
|
fmt: .asciz "Greetings from: %d\n"
|
|
|
|
.end
|