-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterrupt_handler.s
More file actions
34 lines (24 loc) · 895 Bytes
/
interrupt_handler.s
File metadata and controls
34 lines (24 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;----------------------------------------------------------------------------------
; Interrupt Handler
; T. Pritchard
; Created: March 2017
; Last Updated: 9 March 2017
;
;
; Known Bugs: None.
;
; Register usage:
; R0-R6: Pushed and used for handling stuff.
;----------------------------------------------------------------------------------
fiq_handler ;This is never actually branched to, but eh, formatting
PUSH {R0 - R6, LR}
b interrupt_return
irq_handler
PUSH {R0 - R6, LR}
b interrupt_return
;----------------------------------------------------------------------------------
; Called by all SVC instructions to pop registers and return to the program.
;----------------------------------------------------------------------------------
interrupt_return
POP {R0 - R6, LR}
SUBS PC, LR, #4 ;Return to the user program.