-
Notifications
You must be signed in to change notification settings - Fork 145
/
Copy pathldr_tests.s
27 lines (19 loc) · 824 Bytes
/
ldr_tests.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
.global main
.text
.align 2
main: str x30, [sp, -16]!
ldr x0, =fmt // Loads the address of fmt
ldr x1, =q // Loads the address of q
ldr x2, [x1] // Loads the value at q
bl printf // Calls printf()
ldr x0, =fmt // Loads the address of fmt
ldr x1, q // Loads the VALUE at q
ldr x2, [x1] // CRASH!
bl printf
ldr x30, [sp], 16
mov w0, wzr
ret
.data
q: .quad 0x1122334455667788
fmt: .asciz "address: %p value: %lx\n"
.end