www.pudn.com > mp3decoder.rar > MISCEL.INC


;Interrupt Control 
INTPND	    EQU	0x01e00004 
INTMOD	    EQU	0x01e00008 
INTMSK	    EQU	0x01e0000c 
I_ISPR	    EQU	0x01e00020 
I_CMST	    EQU	0x01e0001c 
 
;Watchdog timer 
WTCON	    EQU	0x01d30000 
 
;Clock Controller 
PLLCON	    EQU	0x01d80000 
CLKCON	    EQU	0x01d80004 
LOCKTIME    EQU	0x01d8000c  
	 
;Memory Controller 
REFRESH	    EQU 0x01c80024 
 
;BDMA destination register 
BDIDES0     EQU 0x1f80008 
BDIDES1     EQU 0x1f80028 
 
;Pre-defined constants 
USERMODE    EQU	0x10 
FIQMODE	    EQU	0x11 
IRQMODE	    EQU	0x12 
SVCMODE	    EQU	0x13 
ABORTMODE   EQU	0x17 
UNDEFMODE   EQU	0x1b 
MODEMASK    EQU	0x1f 
NOINT	    EQU	0xc0 
 
;PLL constans 
 
M_DIV		EQU	72	;Fin=8MHz Fout=64MHz 
P_DIV		EQU	3 
S_DIV		EQU	1 
 
_ISR_STARTADDRESS	EQU 0xc7fff00 
_VIDEO_ADDRESS      EQU 0xc400000 
 
	MACRO 
$HandlerLabel HANDLER $HandleLabel 
 
$HandlerLabel 
    sub	    sp,sp,#4	    ;decrement sp(to store jump address) 
    stmfd   sp!,{r0}	    ;PUSH the work register to stack(lr does't push because it return to original address) 
    ldr	    r0,=$HandleLabel;load the address of HandleXXX to r0 
    ldr	    r0,[r0]	    	;load the contents(service routine start address) of HandleXXX 
    str	    r0,[sp,#4]	    ;store the contents(ISR) of HandleXXX to stack 
    ldmfd   sp!,{r0,pc}	    ;POP the work register and pc(jump to ISR) 
    MEND 
     
    END