-
Notifications
You must be signed in to change notification settings - Fork 82
/
irq
68 lines (68 loc) · 1.56 KB
/
irq
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
;***************************************
;***************************************
;
; PROCESS AN 'IRQ' OR 'BRK'
; THIS INCLUDES DISK SEQUENCER
; COMPLETIONS AND IEEE INTERRUPTS
;
;***************************************
;
IRQ
PHA ;SAVE ACCUMULATOR
TXA ;SAVE X
PHA ;*
TYA ;SAVE Y
PHA ;*
TSX ;SAVE BG STACK POINTER
STX BGSP ;*
LDX IRQSP ;RE-ESTABLISH IRQ SP
TXS
STX IRQMOD ;SET IRQ MODE SWITCH
RTS ;GO BACK TO IEEE PROCESS
;
; EXIT IRQ LEVEL OF PROCESSING
;
IRQEX
TSX ;SAVE IRQ SP
STX IRQSP ;*
LDX BGSP ;RESTORE BG SP
TXS ;*
JSR IRQPOL ;CHECK FOR DISK COMPL.
LDA #0 ;RESET IRQ MODE SWITCH
STA IRQMOD ;*
PLA ;RESTORE Y
TAY ;*
PLA ;RESTORE X
TAX ;*
PLA ;RESTORE ACCUMULATOR
RTI ;EXIT TO BG
;
; EXIT IRQ LEAVING INTERRUPTS DISABLED
;
IRQDEX
TSX ;SAVE IRQ SP
STX IRQSP ;*
LDX BGSP ;RESTORE BG SP
TXS ;*
JSR IRQPOL ;CHECK FOR DISK COMP
LDA #0 ;RESET IRQ MODE SWITCH
STA IRQMOD ;*
LDA IEIER ;SAVE VIA ENABLES
ORA #$80 ;SET THE SET BIT
STA IEIERS ;*
LDA DRCA ;SAVE THE PIA ENABLES
STA DRCAS ;*
LDA #$7F ;DISABLE VIA
STA IEIER ;*
LDA #$06 ;DISABLE PIA
STA DRCA ;*
PLA ;RESTORE Y
TAY ;*
PLA ;AND X
TAX ;*
PLA ;ACC
RTI ;EXIT IRQ
;
;
;
.END