Skip to content

Commit f631c32

Browse files
committed
fix patched add example
1 parent 6ced896 commit f631c32

1 file changed

Lines changed: 21 additions & 10 deletions

File tree

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1-
sub sp, sp, -32
1+
.text
2+
3+
.global _start
4+
5+
_start:
6+
bl main
7+
mov x8, #93
8+
svc #0
9+
10+
main:
11+
sub sp, sp, 32
212
str lr, [sp, 24]
3-
str x5, [sp, 16]
4-
add w5, wsp, 32
13+
str fp, [sp, 16]
14+
add fp, sp, 32
515
mov x12, 3
6-
str w12, [x5, -20]
16+
str w12, [fp, -20]
717
mov x12, 4
8-
str w12, [x5, -24]
9-
ldr w12, [x5, -20]
18+
str w12, [fp, -24]
19+
ldr w12, [fp, -20]
1020
add x11, x12, 0
11-
ldr w12, [x5, -24]
21+
ldr w12, [fp, -24]
1222
add w12, w11, w12
1323
sxtw x12, w12
14-
add x7, x12, 0
24+
add x0, x12, 0
1525
ldr lr, [sp, 24]
16-
ldr x5, [sp, 16]
26+
ldr fp, [sp, 16]
1727
add sp, sp, 32
18-
blr lr
28+
ret
29+

0 commit comments

Comments
 (0)