From 3e134fb9758ca0bc5b0d4cad9d95564aa019be5f Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 23 Oct 2022 19:12:09 -0600 Subject: Add sim test: stack --- tb/sim/stack.S | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tb/sim/stack.S (limited to 'tb/sim/stack.S') 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 -- cgit v1.2.3