/[projet1]/public/pc/tools/osdk/main/Osdk/_final_/lib2/irq.s
Defence Force logotype

Contents of /public/pc/tools/osdk/main/Osdk/_final_/lib2/irq.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1154 - (show annotations)
Sun Aug 10 18:19:54 2014 UTC (5 years, 3 months ago) by dbug
File size: 1000 byte(s)


1 _install_irq_handler
2 ldx #<$024A
3 lda #>$024A
4 jmp chain_handler
5
6 _chain_irq_handler
7 ldx $0245
8 lda $0246
9 jmp chain_handler
10
11 _uninstall_irq_handler
12 ldx old_handler
13 lda old_handler+1
14 php
15 sei
16 stx $0245
17 sta $0246
18 plp
19 rts
20
21 chain_handler
22 stx jmp_old_handler+1
23 sta jmp_old_handler+2
24
25 ldy #0
26 lda (sp),y
27 sta jsr_C_handler+1
28 iny
29 lda (sp),y
30 sta jsr_C_handler+2
31 ldx $0245
32 lda $0246
33 stx old_handler
34 sta old_handler+1
35 ldx #<irq_handler
36 lda #>irq_handler
37 php
38 sei
39 stx $0245
40 sta $0246
41 plp
42 rts
43
44 old_handler .word 0
45
46 irq_handler
47 pha
48 txa
49 pha
50 tya
51 pha
52 inc sp+1
53 ldy #2*11-1 ; tmp0..7 + tmp + op1 + op2
54 savetmp lda tmp0,y
55 sta (sp),y
56 dey
57 bpl savetmp
58 clc
59 lda sp
60 adc #2*11 ; tmp0..7 + tmp + op1 + op2
61 sta sp
62 bcc *+4
63 inc sp+1
64 jsr_C_handler
65 jsr 0000
66 lda sp
67 sec
68 sbc #2*11 ; tmp0..7 + tmp + op1 + op2
69 sta sp
70 bcs *+4
71 dec sp+1
72 ldy #2*11-1 ; tmp0..7 + tmp + op1 + op2
73 resttmp lda (sp),y
74 sta tmp0,y
75 dey
76 bpl resttmp
77 dec sp+1
78 pla
79 tay
80 pla
81 tax
82 pla
83 jmp_old_handler
84 jmp 0000

  ViewVC Help
Powered by ViewVC 1.1.26