summaryrefslogtreecommitdiff
path: root/tb/sim/modeswitch.S
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-11-07 13:30:03 -0600
committerAlejandro Soto <alejandro@34project.org>2022-11-07 13:31:57 -0600
commitbf8bd4a00f1cdfc93b2f702f5f87918e66a2e361 (patch)
tree936ed1d54cb117a51fe66b972f6a76869c4be2ac /tb/sim/modeswitch.S
parent0907d94bf1e71c5ec697db53933abc462e703c35 (diff)
Add test sim: modeswitch
Diffstat (limited to '')
-rw-r--r--tb/sim/modeswitch.S21
1 files changed, 21 insertions, 0 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