Mercurial > hg > Members > kono > nitros9-code
comparison level2/cmds/idir.asm @ 0:6641a883d6b0
Initial revision
author | boisy |
---|---|
date | Thu, 04 Apr 2002 16:34:12 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:6641a883d6b0 |
---|---|
1 ******************************************************************** | |
2 * IDir - Show interrupt polling table | |
3 * | |
4 * $Id$ | |
5 * | |
6 * Ed. Comments Who YY/MM/DD | |
7 * ------------------------------------------------------------------ | |
8 * 1 Created KKD | |
9 * 2 Modified GH | |
10 | |
11 nam IDir | |
12 ttl Show interrupt polling table | |
13 | |
14 ifp1 | |
15 use defsfile | |
16 endc | |
17 | |
18 rev set $01 | |
19 edition set 2 | |
20 | |
21 mod lenmod,namemd,prgrm+objct,reent+rev,start,endmem | |
22 | |
23 org $0000 | |
24 usaver rmb $0002 = $0000 | |
25 datptr rmb $0002 = $0002 | |
26 notuse rmb $0002 = $0004 | |
27 outptr rmb $0002 = $0008 | |
28 cntr1 rmb $0001 = $0009 | |
29 devptr rmb $0002 = $000B | |
30 tblptr rmb $0002 = $000D | |
31 dpvars rmb $0009 | |
32 rptbuf rmb $0050 | |
33 Devbuf rmb $0104 | |
34 u016A rmb $0002 | |
35 u016C rmb $0102 | |
36 u026E rmb $0104 | |
37 buffer2 rmb $02C8 | |
38 endmem equ . | |
39 x0004 equ $0004 | |
40 Poltbl equ $0011 | |
41 x0012 equ $0012 | |
42 DevTbl equ $0013 | |
43 x0015 equ $0015 | |
44 x0023 equ $0023 | |
45 x0050 equ $0050 | |
46 x0080 equ $0080 | |
47 x00C8 equ $00C8 | |
48 x0100 equ $0100 | |
49 z0000 equ $0000 | |
50 | |
51 namemd fcs "IDir" | |
52 fcb edition | |
53 | |
54 z0012 fcc "Polling Table at: " | |
55 z0012L equ *-z0012 | |
56 Device fcc " Device Table at: " | |
57 DeviceL equ *-Device | |
58 Topline fcc " Device Driver IRQ Flip " | |
59 fcb C$CR | |
60 ToplineL equ *-Topline | |
61 Line2 fcc "Port Mem Name Vector &Mask Pty" | |
62 fcb C$CR | |
63 Line2L equ *-Line2 | |
64 Line3 fcc "---- ---- ------------ ----- ---" | |
65 crtn fcb C$CR | |
66 Line3L equ *-Line3 | |
67 | |
68 start lda #$01 | |
69 stu <usaver at 0000 in direct page | |
70 leax >crtn,pcr start with \n | |
71 ldy #$0001 | |
72 os9 I$WritLn | |
73 bcs errexit | |
74 leax >z0012,pcr "Polling Table at: " etc | |
75 ldy #z0012L num chars to write | |
76 os9 I$Write | |
77 bcs errexit | |
78 lda #$01 | |
79 leax buffer2,u $0372,u | |
80 os9 F$GPrDsc get $200 byte copy of process 1 | |
81 bcs errexit | |
82 * F$GPrDsc returns $200 bytes, why inc only $40? | |
83 leax P$DatImg,x 40,x to next ptr area=$03B2,u | |
84 stx <datptr at +2 in direct page | |
85 bra z00C5 | |
86 okexit clrb | |
87 errexit os9 F$Exit | |
88 z00C5 leay rptbuf,u = $0016,u | |
89 sty <outptr at 0006 in direct page | |
90 ldu <usaver get u back? was it diddled? | |
91 leau u016A,u is now! destination buffer | |
92 ldd <datptr get ptr P$datimg | |
93 ldx #$0080 offset to begin=D.Devtbl | |
94 ldy #$0004 include D.Poltbl 4 bytes to copy | |
95 os9 F$CpyMem get it | |
96 bcs errexit | |
97 ldu <usaver restore u | |
98 ldd u016A,u get D.Devtbl addr | |
99 std <DevTbl put in dp | |
100 ldd u016C,u get D.Poltbl addr | |
101 std <Poltbl put in dp u016A is re-used below | |
102 lbsr z023B cnvrt 4 dgts of poll tbl addr | |
103 lbsr z01B1 output poll tbl address in ascii | |
104 * troubleshooting printout | |
105 pshs u,x,y,d | |
106 leax >Device,pcr | |
107 ldy #DeviceL | |
108 lda #1 | |
109 os9 I$Write | |
110 ldu <usaver | |
111 leax rptbuf,u | |
112 stx <outptr | |
113 ldd <devtbl | |
114 lbsr z023B | |
115 lbsr z01B1 | |
116 puls u,x,y,d | |
117 * to here | |
118 lda #1 | |
119 leax >crtn,pcr stick another \n on it | |
120 ldy #$0001 | |
121 os9 I$WritLn | |
122 bcs errexit | |
123 leax >Topline,pcr " Device Driver IRQ Flip " | |
124 ldy #ToplineL | |
125 os9 I$WritLn | |
126 bcs errexit | |
127 leax >Line2,pcr "Port Mem Name Vector &Mask Pty" | |
128 ldy #Line2L | |
129 os9 I$WritLn | |
130 bcs errexit | |
131 leax >Line3,pcr "---- ---- ------------ ----- ---" | |
132 ldy #Line3L | |
133 os9 I$WritLn | |
134 lbcs errexit | |
135 ldu <usaver now get orig u back | |
136 leau u016A,u | |
137 stu <devptr | |
138 ldx <Poltbl D.Poltbl addr | |
139 ldy #$006C 256 bytes to get is too many | |
140 ldd <datptr s/b only 9*12 entries, $6C | |
141 os9 F$CpyMem | |
142 lbcs errexit | |
143 ldu <usaver | |
144 leau Devbuf,u | |
145 ldd <datptr | |
146 ldx <DevTbl D.Devtbl | |
147 ldy #x0100 is not all of devtbl, s/b $015F! | |
148 os9 F$CpyMem | |
149 lbcs errexit | |
150 ldb #$0C | |
151 stb <cntr1 | |
152 ldx <devptr | |
153 z0165 ldd Q$STAT,x 06,x checking memory required | |
154 * another troubleshooting printout | |
155 * pshs u,x,y,d,cc | |
156 * ldu <usaver | |
157 * leax rptbuf,u | |
158 * stx <outptr | |
159 * lbsr z023B converet d to ascii | |
160 * lbsr z01B1 | |
161 * puls u,x,y,d,cc | |
162 * to here | |
163 beq z016B | |
164 bsr z0179 | |
165 z016B dec <cntr1 | |
166 lbeq okexit | |
167 ldx <devptr | |
168 leax $09,x | |
169 stx <devptr to next irqtbl entry | |
170 bra z0165 | |
171 z0179 ldu <usaver restore u to dp | |
172 leay rptbuf,u | |
173 sty <outptr | |
174 ldx <devptr | |
175 ldd ,x | |
176 lbsr z023B convert 2 bytes port addr->ascii | |
177 ldd $06,x | |
178 lbsr z023B convert 2 bytes memsiz->ascii | |
179 lbsr z0243 extra space in line | |
180 bsr z01CA now do name | |
181 ldu <usaver | |
182 ldx <devptr | |
183 ldd $04,x get irq vector | |
184 lbsr z023B convert it to ascii | |
185 lbsr z0243 extra space | |
186 lda $02,x get flip | |
187 lbsr z0241 convert 1 byte + space | |
188 lda $03,x get mask | |
189 lbsr z0241 convert 1 byte + space | |
190 lbsr z0243 extra space | |
191 lda $08,x get priority byte | |
192 lbsr z0241 convert 1 byte | |
193 z01B1 ldx <outptr | |
194 lda #C$CR terminate this line | |
195 sta ,x | |
196 ldu <usaver restore u again | |
197 leax rptbuf,u ptr to outbuff | |
198 ldy #80 max 80 chars | |
199 lda #$01 stdout | |
200 os9 I$WritLn | |
201 lbcs errexit | |
202 rts | |
203 z01CA ldx <devptr fnd nam in devtbl if memaddr= | |
204 ldb #$1C 27 entries max in devtbl | |
205 pshs b | |
206 * now we make an assumption that data | |
207 * areas for the same driver will be | |
208 * in the same page of memory, so compare | |
209 * only the high bytes of the address | |
210 ldb $06,x get irq dat addr | |
211 leax Devbuf,u devtbl buffer | |
212 z01D6 cmpb $02,x | |
213 beq z01F3 if match, found device | |
214 leax $09,x else inc to next tbl entry | |
215 dec ,s that pshs'd b above | |
216 bne z01D6 | |
217 leas $01,s get rid of stack data | |
218 ldy <outptr | |
219 * lda #$20 | |
220 * ldb #$08 trial to space empty over | |
221 * z01EA sta ,y+ | |
222 * decb | |
223 * bne z01EA | |
224 leay 8,y this leaves name visible | |
225 sty <outptr until new one found | |
226 rts | |
227 z01E9 ldy <outptr | |
228 ldb #08 | |
229 lda #$20 a space | |
230 z01EA sta ,y+ | |
231 decb | |
232 bne z01EA | |
233 sty <outptr | |
234 rts | |
235 z01F3 leas $01,s get rid of stack dat | |
236 ldx V$DESC,x $04,x pointer to dev desc | |
237 beq z01E9 what, no module name ptr? | |
238 pshs u | |
239 leau u026E,u | |
240 ldd <datptr | |
241 ldy #x00C8 | |
242 os9 F$CpyMem | |
243 puls u | |
244 lbcs errexit | |
245 leax u026E,u | |
246 ldd $0B,x | |
247 leax d,x | |
248 lda #$08 | |
249 sta <x0015 | |
250 clrb | |
251 bra z0220 | |
252 z021D bsr z025B | |
253 z0220 incb | |
254 cmpb <x0015 | |
255 bcc z0232 | |
256 lda ,x+ | |
257 bpl z021D | |
258 anda #$7F | |
259 bsr z025B | |
260 cmpb <x0015 | |
261 bcc z023A | |
262 z0232 bsr z0243 | |
263 incb | |
264 cmpb <x0015 | |
265 bcs z0232 | |
266 z023A rts | |
267 z023B pshs b convert to ascii | |
268 bsr z0247 make 2 digits | |
269 puls a | |
270 z0241 bsr z0247 make 2 more | |
271 z0243 lda #$20 | |
272 bra z025B | |
273 z0247 tfr a,b | |
274 lsra | |
275 lsra | |
276 lsra | |
277 lsra | |
278 bsr z0251 | |
279 tfr b,a | |
280 z0251 anda #$0F | |
281 cmpa #$0A | |
282 bcs z0259 | |
283 adda #$07 | |
284 z0259 adda #$30 | |
285 z025B pshs x | |
286 ldx <outptr get outbuf ptr | |
287 sta ,x+ | |
288 stx <outptr | |
289 puls pc,x | |
290 | |
291 emod | |
292 lenmod equ * | |
293 end |