|
楼主 |
发表于 2006-8-29 16:49:10
|
显示全部楼层
这是汇编上的TIMER3的中断子程序
BIT_TIMER0 EQU (0x1<<13)
BIT_GLOBAL EQU (0x1<<26)
I_ISPC EQU 0x1e00024
INTMSK EQU 0x1e0000c
BIT_TIMER3 EQU (0x1<<10);
AREA |C$$code|, CODE, READONLY
IMPORT need_to_swap_context
IMPORT Timer3Int
IMPORT IrqStart
IMPORT IrqFinish
IMPORT _CON_SW
IMPORT _NOT_CON_SW
EXPORT Timer3_ISR
Timer3_ISR
STMDB sp!,{r0-r11,lr} ;=push lr, r0-r11-->sp
;interrupt disable(not nessary)
mrs r0, CPSR ; r0=CPSR
orr r0, r0, #0x80 ; and set IRQ disable flag
msr CPSR_cxsf, R0 ; CPSR_cxsf=R0
;End of interrupt
;(Clear pending bit of INTPEND that don't accessed it.)
;rI_ISPC= BIT_TIMER3;
LDR r0, =I_ISPC
LDR r1, =BIT_TIMER3
STR r1, [r0]
LDR R0, =INTMSK
LDR R2, [R0]
LDR R1, =BIT_TIMER3
ORR R2, R1, R2
LDR R1, =BIT_TIMER0
ORR R2, R1, R2
STR R2, [R0]
BL IrqStart
BL Timer3Int
BL IrqFinish
LDR r0, =need_to_swap_context
LDR r2, [r0] ;ldr: memory to register,r2=need_to_swap_context
CMP r2, #1
LDREQ pc, =_CON_SW;if equal,then switch context
LDR pc, =_NOT_CON_SW
END |
|