diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-10-23 19:12:09 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-10-23 19:12:09 -0600 |
| commit | 3e134fb9758ca0bc5b0d4cad9d95564aa019be5f (patch) | |
| tree | 427dcec85b323eadb1cbab64cf09146c1bf56c85 /tb/sim | |
| parent | 469e29b90ebc248a3b69aa82a36aabaa14d936f2 (diff) | |
Add sim test: stack
Diffstat (limited to '')
| -rw-r--r-- | tb/sim/stack.S | 20 | ||||
| -rw-r--r-- | tb/sim/stack.py | 8 |
2 files changed, 28 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 diff --git a/tb/sim/stack.py b/tb/sim/stack.py new file mode 100644 index 0000000..c1f4e7f --- /dev/null +++ b/tb/sim/stack.py @@ -0,0 +1,8 @@ +def final(): + assert_reg(r0, 0x0123_4567) + assert_reg(r1, 0x89ab_cdef) + assert_reg(r2, 0x1fff_fff4) + assert_reg(r3, 0x1fff_fffc) + assert_reg(r4, 0x1fff_fff8) + assert_reg(r5, 0x1fff_fffc) + assert_reg(sp_svc, 0x2000_0000) |
