AN2109 Freescale Semiconductor / Motorola, AN2109 Datasheet - Page 37

no-image

AN2109

Manufacturer Part Number
AN2109
Description
MPC555 Interrupts
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
7.3.3.2 Example 3: exceptions.s File
external_interrupt_exception:
.name "exceptions.s"
.section .abs.00000100
.section .abs.00000500
.text
.equ
stwu
stw
mfsrr0
stw
mfsrr1
stw
mtspr
mflr
stw
mfxer
stw
mfspr
stw
mfcr
stw
stw
stw
stw
stw
stw
stw
stw
stw
stw
stw
lis
lbz
lis
ori
add
mtlr
blrl
lwz
lwz
lwz
r4
b _start
r3,
r3
r3,
r3
r0,
r6,
r9,
r10,
r11, 68 (sp)
r4,
r0,
b external_interrupt_exception
SIVEC,
r3
r3
r3,
EID, r3
r3,
r3
r3,
r4,
r5,
r7,
r8,
r12, 72 (sp)
r4,
r4,
r5,
sp,
r3,
r3,
r3,
r3,
r3,
r4,
Freescale Semiconductor, Inc.
SIVEC@ha
IRQ_table@h
32 (sp)
40 (sp)
36 (sp)
16 (sp)
44 (sp)
-80(sp)
12 (sp)
24 (sp)
28 (sp)
32 (sp)
40 (sp)
44 (sp)
48 (sp)
56 (sp)
60 (sp)
SIVEC@l (r3)
r4, IRQ_table@l
r3, r4
8 (sp)
20 (sp)
CTR
52 (sp)
64 (sp)
For More Information On This Product,
0x2fc01c
Rev. 0, 26 July 2001
MPC555 Interrupts
Go to: www.freescale.com
; Load higher 16 bits of SIVEC address
; System reset exception, per crt0 file
;Register address
; STEP 1:
; Create stack frame and store back chain
; Save working register
; Get SRR0
; and save SRR0
; Get SRR1
; and save SRR1
; STEP 2:
; Set recoverable bit
; Now debugger breakpoints can be set
; STEP 3: SAVE OTHER APPROPRIATE CONTEXT
; Get LR
; and save LR
; Get XER
; and save XER
; Get CTR
; and save CTR
; Get CR
; and save CR
; Save R0
; Save R4 to R12
; STEP 4: DETERMINE INTERRUPT SOURCE
; Load Interrupt Code byte from SIVEC
; Interrupt Code will be jump tableindex
; Load interrupt jump table base address
; Add index to table base address
; Load result address to link register
; STEP 5: BRANCH TO INTERRUPT HANDLER
; Jump to Execution Routine (subroutine)
; (After returning here, restore context)
; STEP 6: RESTORE CONTEXT
; Restore gprs except R3
SAVE "MACHINE CONTEXT"
MAKE MSR[RI] RECOVERABLE
MOTOROLA
37

Related parts for AN2109