Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4586

Bare metal, Assembly language • An unsuccessful attempt to switch the CPU operation mode RPI2

$
0
0
Good afternoon, everyone. There is a piece of code that should switch the CPU operation mode, but it does not do this. Of course, I'm misunderstanding something. Please help me resolve this misunderstanding.

Code:

.data.bss.text.global _start_start:     MRS R0, CPSR    BIC R1, R0, #0x1F    ORR R1, R1, #0x12 // 0x12 == 10010 (IRQ)    MSR CPSR, R1    end:    MOV R7, #1    SWI 0
When running the script, the CPSR value is 0x10 16 (USR)
In the MSR line CPSR, R1
the value 0x12 should be written to the CPSR, which corresponds to the IRQ mode, but this does not happen. After executing this line (in gdb)
0x00010060 <+12>: msr CPSR_fc, r1
The CPSR value remains the same. Help me figure it out. Thank you.

Statistics: Posted by dio4 — Sat Apr 20, 2024 6:43 am — Replies 1 — Views 40



Viewing all articles
Browse latest Browse all 4586

Trending Articles