diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-11-07 13:30:03 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-11-07 13:31:57 -0600 |
| commit | bf8bd4a00f1cdfc93b2f702f5f87918e66a2e361 (patch) | |
| tree | 936ed1d54cb117a51fe66b972f6a76869c4be2ac /tb | |
| parent | 0907d94bf1e71c5ec697db53933abc462e703c35 (diff) | |
Add test sim: modeswitch
Diffstat (limited to 'tb')
| -rw-r--r-- | tb/sim/modeswitch.S | 21 | ||||
| -rw-r--r-- | tb/sim/modeswitch.py | 3 | ||||
| -rw-r--r-- | tb/sim/start.S | 6 |
3 files changed, 29 insertions, 1 deletions
diff --git a/tb/sim/modeswitch.S b/tb/sim/modeswitch.S new file mode 100644 index 0000000..c04f8a3 --- /dev/null +++ b/tb/sim/modeswitch.S @@ -0,0 +1,21 @@ +.global reset +reset: + mrs r0, cpsr + udf + mrs r2, cpsr + ldr r3, =#0x16f + bic r3, r2, r3 + msr cpsr_fxc, r3 + mrs r4, cpsr + cmp r0, r0 + mrs r5, spsr + nop + msr cpsr_fxc, r0 + msr spsr_fxc, r0 + mov pc, lr + +.global undefined +undefined: + mrs r1, spsr + mrs r13, cpsr + movs pc, lr diff --git a/tb/sim/modeswitch.py b/tb/sim/modeswitch.py new file mode 100644 index 0000000..6919f2e --- /dev/null +++ b/tb/sim/modeswitch.py @@ -0,0 +1,3 @@ +def final(): + #TODO + assert_reg(r0, -1) diff --git a/tb/sim/start.S b/tb/sim/start.S index 54a8d1f..7639513 100644 --- a/tb/sim/start.S +++ b/tb/sim/start.S @@ -4,7 +4,7 @@ __reset: b _start __undefined: - b __undefined + b undefined __swi: b __data_abort @@ -28,3 +28,7 @@ _start: ldr sp, =_stack_end bl reset b . + +.weak undefined +undefined: + b undefined |
