From bf8bd4a00f1cdfc93b2f702f5f87918e66a2e361 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Mon, 7 Nov 2022 13:30:03 -0600 Subject: Add test sim: modeswitch --- tb/sim/modeswitch.S | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tb/sim/modeswitch.S (limited to 'tb/sim/modeswitch.S') 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 -- cgit v1.2.3