summaryrefslogtreecommitdiff
path: root/tb/sim/stack.S
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-10-23 19:12:09 -0600
committerAlejandro Soto <alejandro@34project.org>2022-10-23 19:12:09 -0600
commit3e134fb9758ca0bc5b0d4cad9d95564aa019be5f (patch)
tree427dcec85b323eadb1cbab64cf09146c1bf56c85 /tb/sim/stack.S
parent469e29b90ebc248a3b69aa82a36aabaa14d936f2 (diff)
Add sim test: stack
Diffstat (limited to '')
-rw-r--r--tb/sim/stack.S20
1 files changed, 20 insertions, 0 deletions
diff --git a/tb/sim/stack.S b/tb/sim/stack.S
new file mode 100644
index 0000000..f1bc0a8
--- /dev/null
+++ b/tb/sim/stack.S
@@ -0,0 +1,20 @@
+.global reset
+reset:
+ ldr r0, =stub1
+ ldr r1, =stub2
+ push {r0, r1, lr}
+ mov r2, sp
+ pop {r5, pc}
+
+stub1:
+ ldr r0, =0x01234567
+ pop {pc}
+
+stub2:
+ mov r3, sp
+ ldr r1, =0x89abcdef
+ push {r5}
+ mov r4, sp
+ pop {lr}
+ mov r5, sp
+ mov pc, lr