ARM 7 Assembly and C coding mix up

Hi

I am new TO ARM7 And KEIL uVISION4 IDE.

I am using AT91FR40162S ATMEL COntroller.

When i created a project using KEIL IDE and selected AT91FR40162S ATMEL COntroller from the device list. Automatically startup.s file is added to the project.

In startup.s file Interrupts are Enabled and Disabled by following assembly code:

To Disable the interrupts

I_Bit EQU 0x80 ; when I bit is set, IRQ is disabled
F_Bit EQU 0x40 ; when F bit is set, FIQ is disabled

; Enter Undefined Instruction Mode and set its Stack Pointer

MSR CPSR_c, #Mode_UND:OR:I_Bit:OR:F_Bit
so interrupts are disabled here as corresponding bits in CPSR are set.

To Enable the interrupts

; Enter User Mode and set its Stack Pointer MSR CPSR_c, #Mode_USR

So interrupts are enabled

then after all the settings in startup.s it will jump to main.c file

QUESTION:

1. I want to enable and disable the interrupts in my main.c file. So How will i be able to access the CPSR register in my c coding.

Parents Reply Children
No data
More questions in this forum