Maskmd EQU 0x1f SVC32md EQU 0x13 I_Bit EQU 0x80
FRAME_R0 EQU 0X00 FRAME_R1 EQU FRAME_R0 + 4 FRAME_R2 EQU FRAME_R1 + 4 FRAME_R3 EQU FRAME_R2 + 4 FRAME_R4 EQU FRAME_R3 + 4 FRAME_R5 EQU FRAME_R4 + 4 FRAME_R6 EQU FRAME_R5 + 4 FRAME_R7 EQU FRAME_R6 + 4 FRAME_R8 EQU FRAME_R7 + 4 FRAME_R9 EQU FRAME_R8 + 4 FRAME_R10 EQU FRAME_R9 + 4 FRAME_R11 EQU FRAME_R10 + 4 FRAME_R12 EQU FRAME_R11 + 4 FRAME_PSR EQU FRAME_12 + 4 FRAME_LR EQU FRAME_PSR + 4 FRAME_PC EQU FRAME_LR + 4 FRAME_SIZE EQU FRAME_PC + 4
IRQ_Entry SUB r14,r14,#4 STMDB r13,!{r0-r3,r12,r14} <服务中断> BL read_RescheduleFlag CMP r0,#0 LDMNEIA r13!,{r0-r13,r12,PC}^ MRS r2,spsr MOV r0,r13 ADD r13,r13,#6*4 MRS r1,cpsr BIC r1,r1,#Maskmd ORR r1,r1,SVC32md MSR cpsr_c,r1 SUB r13,r13,#FRAME_SIZE-FRAME_R4 STMIA r13,{r4-r11} LDMIA r0,{r4-r9} BIC r1,r1,#I_Bit MSR cpsr_c,r1 STMDB r13!,{r4-r7} STR r2,[r13,#FRAME_PSR] STR r8,[r13,#FRAME_R12] STR r9,[r13,#FRAME_PC] STR r14,[r13,#FRAME_LR] <完成中断服务程序> LDMIA r13!,{r0-r12,r14} MSR spsr_cxsf,r14 LDMIA r13!,{r14,pc}^ |