968
|
1 nam Disasm
|
|
2 ttl Os9 disassembler by Ron Lammardo
|
|
3
|
|
4 * Disasm v1.5 (c) 1988 by Ron Lammardo
|
|
5 * 6309 additions by L. Curtis Boyle Jan. 1993
|
|
6 ********
|
|
7 *
|
|
8 * 03/12/87 (#2) - added code for line,address,obj display
|
|
9 * added options 'o' and 'x'
|
|
10 *
|
|
11 * 04/02/87 (#3) - added code to provide commented disassembly
|
|
12 * of device descriptors
|
|
13 *
|
|
14 * 11/16/87 (#4) - fixed restart link failure
|
|
15 * added code to display direct page addresses
|
|
16 *
|
|
17 * 02/22/88 (#5) - added code to display dp/u offsets
|
|
18 * added code to display fcb bytes preceding eom
|
|
19 * added code for z option (hex input disassembly)
|
|
20 * added code to display date/time run
|
|
21 *
|
|
22 * 01/23/93 - added code to handle 6309 instruction set additions
|
|
23 ********
|
|
24
|
|
25 ifp1
|
|
26 use defsfile
|
|
27 endc
|
|
28
|
|
29 typ set prgrm+objct
|
|
30 attrev set reent+revision
|
|
31 revision set 1
|
|
32 edtn set 5 edition
|
|
33 edition equ $30+edtn ascii edition
|
|
34
|
|
35 mod eom,mname,typ,attrev,start,datend
|
|
36
|
|
37 pcrzero equ *-$0D module start
|
|
38
|
|
39 mname fcs /Disasm/
|
|
40 fcb edtn
|
|
41
|
|
42 dfltdrv fcc /dd/
|
|
43 cr set C$CR
|
|
44 **** start of data area ****
|
|
45 stackhld rmb 2
|
|
46 ureghold rmb 2
|
|
47 xreghold rmb 2
|
|
48 xsave rmb 2
|
|
49 dsave rmb 2
|
|
50 startadr rmb 2
|
|
51 modadr rmb 2
|
|
52 address rmb 2
|
|
53 addrsave rmb 2
|
|
54 lineadr rmb 2
|
|
55 objadr rmb 2
|
|
56 crntadr rmb 2
|
|
57 modend rmb 2
|
|
58 nameadr rmb 2
|
|
59 size rmb 2
|
|
60 temp rmb 2
|
|
61 readpos rmb 2
|
|
62 readcnt rmb 1
|
|
63 readclr rmb 1
|
|
64 byte rmb 1
|
|
65 TFMFlag rmb 1 Flag to indicate processing TFM
|
|
66 bitcom rmb 1 Flag to indicate processing bit instruction
|
|
67 indirct rmb 1
|
|
68 hexstrng rmb 4
|
|
69 decstrng rmb 5
|
|
70 testbyte rmb 1
|
|
71 register rmb 1
|
|
72 labladr rmb 2
|
|
73 highadr rmb 2
|
|
74 utabend rmb 2
|
|
75 pass rmb 1
|
|
76 path rmb 1
|
|
77 diskio rmb 1
|
|
78 objcnt rmb 1
|
|
79 tylghold rmb 1
|
|
80 atrvhold rmb 1
|
|
81 revshold rmb 1
|
|
82 m.opt rmb 1
|
|
83 o.opt rmb 1
|
|
84 x.opt rmb 1
|
|
85 z.opt rmb 1
|
|
86 u.opt rmb 1
|
|
87 op.cnt rmb 1
|
|
88 descript rmb 1
|
|
89 mgradr rmb 2
|
|
90 drvadr rmb 2
|
|
91 desctype rmb 1
|
|
92 printadr rmb 2
|
|
93 initsize rmb 2
|
|
94 counter rmb 1
|
|
95 countdec rmb 2
|
|
96 numline rmb 2
|
|
97 runtime rmb 6
|
|
98 * start of output line
|
|
99 linenum rmb 8
|
|
100 holdadr rmb 5
|
|
101 holdobj rmb 11
|
|
102 holdline rmb 56
|
|
103 * end of output line
|
|
104 holdname rmb 32
|
|
105 namehold rmb 32
|
|
106 hldtylg rmb 40
|
|
107 hldatrv rmb 40
|
|
108 hldrev rmb 40
|
|
109 hldttl rmb 40
|
|
110 pathlist rmb 80
|
|
111 readbuff rmb 20
|
|
112 labeltab rmb 6742
|
|
113 lbtblend rmb 1
|
|
114 rmb 255
|
|
115 datend equ .
|
|
116
|
|
117 *****************************************
|
|
118 ** os9 call tables **
|
|
119 ** (sequence = $10,$3f,..) **
|
|
120 *****************************************
|
|
121 os9f$tab equ *
|
|
122 fcc /F$Link /
|
|
123 fcc /F$Load /
|
|
124 fcc /F$UnLink/
|
|
125 fcc /F$Fork /
|
|
126 fcc /F$Wait /
|
|
127 fcc /F$Chain /
|
|
128 fcc /F$Exit /
|
|
129 fcc /F$Mem /
|
|
130 fcc /F$Send /
|
|
131 fcc /F$Icpt /
|
|
132 fcc /F$Sleep /
|
|
133 fcc /F$SSpd /
|
|
134 fcc /F$ID /
|
|
135 fcc /F$SPrior/
|
|
136 fcc /F$SSWi /
|
|
137 fcc /F$PErr /
|
|
138 fcc /F$PrsNam/
|
|
139 fcc /F$CmpNam/
|
|
140 fcc /F$SchBit/
|
|
141 fcc /F$AllBit/
|
|
142 fcc /F$DelBit/
|
|
143 fcc /F$Time /
|
|
144 fcc /F$STime /
|
|
145 fcc /F$CRC /
|
|
146 fcc /F$GPrDsc/
|
|
147 fcc /F$GBlkMp/
|
|
148 fcc /F$GModDr/
|
|
149 fcc /F$CpyMem/
|
|
150 fcc /F$SUser /
|
|
151 fcc /F$UnLoad/
|
|
152 fcc /F$Alarm /
|
|
153 fcc /????????/
|
|
154 fcc /????????/
|
|
155 fcc /F$NMLink/
|
|
156 fcc /F$NMLoad/
|
|
157 fcc /F$Ctime /
|
|
158 fcc /F$Cstime/
|
|
159 fcc /F$CTswi2/
|
|
160 fcc /????????/
|
|
161 fcc /F$VIRQ /
|
|
162 fcc /F$SRqMem/
|
|
163 fcc /F$SRtMem/
|
|
164 fcc /F$IRQ /
|
|
165 fcc /F$IOQu /
|
|
166 fcc /F$AProc /
|
|
167 fcc /F$NProc /
|
|
168 fcc /F$VModul/
|
|
169 fcc /F$Find64/
|
|
170 fcc /F$All64 /
|
|
171 fcc /F$Ret64 /
|
|
172 fcc /F$SSvc /
|
|
173 fcc /F$IODel /
|
|
174 fcc /F$SLink /
|
|
175 fcc /F$Boot /
|
|
176 fcc /F$BtMem /
|
|
177 fcc /F$GProcP/
|
|
178 fcc /F$Move /
|
|
179 fcc /F$AllRAM/
|
|
180 fcc /F$AllImg/
|
|
181 fcc /F$DelImg/
|
|
182 fcc /F$SetImg/
|
|
183 fcc /F$FreeLB/
|
|
184 fcc /F$FreeHB/
|
|
185 fcc /F$AllTsk/
|
|
186 fcc /F$DelTsk/
|
|
187 fcc /F$SetTsk/
|
|
188 fcc /F$ResTsk/
|
|
189 fcc /F$RelTsk/
|
|
190 fcc /F$DATLog/
|
|
191 fcc /F$DATTmp/
|
|
192 fcc /F$LDAXY /
|
|
193 fcc /F$LDAXYP/
|
|
194 fcc /F$LDDDXY/
|
|
195 fcc /F$LDABX /
|
|
196 fcc /F$STABX /
|
|
197 fcc /F$AllPrc/
|
|
198 fcc /F$DelPrc/
|
|
199 fcc /F$ELink /
|
|
200 fcc /F$FModul/
|
|
201 fcc /F$MapBlk/
|
|
202 fcc /F$ClrBlk/
|
|
203 fcc /F$DelRAM/
|
|
204 fcc /F$GCMDir/
|
|
205 fcc /F$AlHRAM/
|
|
206
|
|
207 os9i$tab equ *
|
|
208 fcc /I$Attach/
|
|
209 fcc /I$Detach/
|
|
210 fcc /I$Dup /
|
|
211 fcc /I$Create/
|
|
212 fcc /I$Open /
|
|
213 fcc /I$MakDir/
|
|
214 fcc /I$ChgDir/
|
|
215 fcc /I$Delete/
|
|
216 fcc /I$Seek /
|
|
217 fcc /I$Read /
|
|
218 fcc /I$Write /
|
|
219 fcc /I$ReadLn/
|
|
220 fcc /I$WritLn/
|
|
221 fcc /I$GetStt/
|
|
222 fcc /I$SetStt/
|
|
223 fcc /I$Close /
|
|
224 fcc /I$DeletX/
|
|
225 bados9op fcc /????????/
|
|
226
|
|
227 * Mnemonic table: 1st byte =Opcode
|
|
228 * 2nd byte =Flags to indicate mode type of opcode
|
|
229 * Bytes 3-7 =Mnemonic name of opcode
|
|
230 *****************************************
|
|
231 ** 2 byte table - **
|
|
232 ** $10 is first byte of op code **
|
|
233 *****************************************
|
|
234 get10tab equ *
|
|
235 fcb $21
|
|
236 fcb $fc
|
|
237 fcc /lbrn /
|
|
238 fcb $22
|
|
239 fcb $fc
|
|
240 fcc /lbhi /
|
|
241 fcb $23
|
|
242 fcb $fc
|
|
243 fcc /lbls /
|
|
244 fcb $24
|
|
245 fcb $fc
|
|
246 fcc /lbcc /
|
|
247 fcb $25
|
|
248 fcb $fc
|
|
249 fcc /lbcs /
|
|
250 fcb $26
|
|
251 fcb $fc
|
|
252 fcc /lbne /
|
|
253 fcb $27
|
|
254 fcb $fc
|
|
255 fcc /lbeq /
|
|
256 fcb $28
|
|
257 fcb $fc
|
|
258 fcc /lbvc /
|
|
259 fcb $29
|
|
260 fcb $fc
|
|
261 fcc /lbvs /
|
|
262 fcb $2a
|
|
263 fcb $fc
|
|
264 fcc /lbpl /
|
|
265 fcb $2b
|
|
266 fcb $fc
|
|
267 fcc /lbmi /
|
|
268 fcb $2c
|
|
269 fcb $fc
|
|
270 fcc /lbge /
|
|
271 fcb $2d
|
|
272 fcb $fc
|
|
273 fcc /lblt /
|
|
274 fcb $2e
|
|
275 fcb $fc
|
|
276 fcc /lbgt /
|
|
277 fcb $2f
|
|
278 fcb $fc
|
|
279 fcc /lble /
|
|
280 * Test of 6309 codes
|
|
281 fcb $30
|
|
282 fcb $fa
|
|
283 fcc /addr /
|
|
284 fcb $31
|
|
285 fcb $fa
|
|
286 fcc /adcr /
|
|
287 fcb $32
|
|
288 fcb $fa
|
|
289 fcc /subr /
|
|
290 fcb $33
|
|
291 fcb $fa
|
|
292 fcc /sbcr /
|
|
293 fcb $34
|
|
294 fcb $fa
|
|
295 fcc /andr /
|
|
296 fcb $35
|
|
297 fcb $fa
|
|
298 fcc /orr /
|
|
299 fcb $36
|
|
300 fcb $fa
|
|
301 fcc /eorr /
|
|
302 fcb $37
|
|
303 fcb $fa
|
|
304 fcc /cmpr /
|
|
305 fcb $38
|
|
306 fcb $fd
|
|
307 fcc /pshsw/
|
|
308 fcb $39
|
|
309 fcb $fd
|
|
310 fcc /pulsw/
|
|
311 fcb $3a
|
|
312 fcb $fd
|
|
313 fcc /pshuw/
|
|
314 fcb $3b
|
|
315 fcb $fd
|
|
316 fcc /puluw/
|
|
317 fcb $40
|
|
318 fcb $fd
|
|
319 fcc /negd /
|
|
320 fcb $43
|
|
321 fcb $fd
|
|
322 fcc /comd /
|
|
323 fcb $44
|
|
324 fcb $fd
|
|
325 fcc /lsrd /
|
|
326 fcb $46
|
|
327 fcb $fd
|
|
328 fcc /rord /
|
|
329 fcb $47
|
|
330 fcb $fd
|
|
331 fcc /asrd /
|
|
332 fcb $48
|
|
333 fcb $fd
|
|
334 fcc /asld /
|
|
335 fcb $49
|
|
336 fcb $fd
|
|
337 fcc /rold /
|
|
338 fcb $4a
|
|
339 fcb $fd
|
|
340 fcc /decd /
|
|
341 fcb $4c
|
|
342 fcb $fd
|
|
343 fcc /incd /
|
|
344 fcb $4d
|
|
345 fcb $fd
|
|
346 fcc /tstd /
|
|
347 fcb $4f
|
|
348 fcb $fd
|
|
349 fcc /clrd /
|
|
350 fcb $53
|
|
351 fcb $fd
|
|
352 fcc /comw /
|
|
353 fcb $54
|
|
354 fcb $fd
|
|
355 fcc /lsrw /
|
|
356 fcb $56
|
|
357 fcb $fd
|
|
358 fcc /rorw /
|
|
359 fcb $59
|
|
360 fcb $fd
|
|
361 fcc /rolw /
|
|
362 fcb $5a
|
|
363 fcb $fd
|
|
364 fcc /decw /
|
|
365 fcb $5c
|
|
366 fcb $fd
|
|
367 fcc /incw /
|
|
368 fcb $5d
|
|
369 fcb $fd
|
|
370 fcc /tstw /
|
|
371 fcb $5f
|
|
372 fcb $fd
|
|
373 fcc /clrw /
|
|
374 fcb $80
|
|
375 fcb $f3
|
|
376 fcc /subw /
|
|
377 fcb $81
|
|
378 fcb $f3
|
|
379 fcc /cmpw /
|
|
380 fcb $82
|
|
381 fcb $f3
|
|
382 fcc /sbcd /
|
|
383 fcb $83
|
|
384 fcb $f3
|
|
385 fcc /cmpd /
|
|
386 fcb $84
|
|
387 fcb $f3
|
|
388 fcc /andd /
|
|
389 fcb $85
|
|
390 fcb $f3
|
|
391 fcc /bitd /
|
|
392 fcb $86
|
|
393 fcb $f3
|
|
394 fcc /ldw /
|
|
395 fcb $88
|
|
396 fcb $f3
|
|
397 fcc /eord /
|
|
398 fcb $89
|
|
399 fcb $f3
|
|
400 fcc /adcd /
|
|
401 fcb $8a
|
|
402 fcb $f3
|
|
403 fcc /ord /
|
|
404 fcb $8b
|
|
405 fcb $f3
|
|
406 fcc /addw /
|
|
407 fcb $8c
|
|
408 fcb $f3
|
|
409 fcc /cmpy /
|
|
410 fcb $8e
|
|
411 fcb $f3
|
|
412 fcc /ldy /
|
|
413 fcb $90
|
|
414 fcb $ff
|
|
415 fcc /subw /
|
|
416 fcb $91
|
|
417 fcb $ff
|
|
418 fcc /cmpw /
|
|
419 fcb $92
|
|
420 fcb $ff
|
|
421 fcc /sbcd /
|
|
422 fcb $93
|
|
423 fcb $ff
|
|
424 fcc /cmpd /
|
|
425 fcb $94
|
|
426 fcb $ff
|
|
427 fcc /andd /
|
|
428 fcb $95
|
|
429 fcb $ff
|
|
430 fcc /bitd /
|
|
431 fcb $96
|
|
432 fcb $ff
|
|
433 fcc /ldw /
|
|
434 fcb $97
|
|
435 fcb $ff
|
|
436 fcc /stw /
|
|
437 fcb $98
|
|
438 fcb $ff
|
|
439 fcc /eord /
|
|
440 fcb $99
|
|
441 fcb $ff
|
|
442 fcc /adcd /
|
|
443 fcb $9a
|
|
444 fcb $ff
|
|
445 fcc /ord /
|
|
446 fcb $9b
|
|
447 fcb $ff
|
|
448 fcc /addw /
|
|
449 fcb $9c
|
|
450 fcb $ff
|
|
451 fcc /cmpy /
|
|
452 fcb $9e
|
|
453 fcb $ff
|
|
454 fcc /ldy /
|
|
455 fcb $9f
|
|
456 fcb $ff
|
|
457 fcc /sty /
|
|
458 fcb $a0
|
|
459 fcb $f8
|
|
460 fcc /subw /
|
|
461 fcb $a1
|
|
462 fcb $f8
|
|
463 fcc /cmpw /
|
|
464 fcb $a2
|
|
465 fcb $f8
|
|
466 fcc /sbcd /
|
|
467 fcb $a3
|
|
468 fcb $f8
|
|
469 fcc /cmpd /
|
|
470 fcb $a4
|
|
471 fcb $f8
|
|
472 fcc /andd /
|
|
473 fcb $a5
|
|
474 fcb $f8
|
|
475 fcc /bitd /
|
|
476 fcb $a6
|
|
477 fcb $f8
|
|
478 fcc /ldw /
|
|
479 fcb $a7
|
|
480 fcb $f8
|
|
481 fcc /stw /
|
|
482 fcb $a8
|
|
483 fcb $f8
|
|
484 fcc /eord /
|
|
485 fcb $a9
|
|
486 fcb $f8
|
|
487 fcc /adcd /
|
|
488 fcb $aa
|
|
489 fcb $f8
|
|
490 fcc /ord /
|
|
491 fcb $ab
|
|
492 fcb $f8
|
|
493 fcc /addw /
|
|
494 fcb $ac
|
|
495 fcb $f8
|
|
496 fcc /cmpy /
|
|
497 fcb $ae
|
|
498 fcb $f8
|
|
499 fcc /ldy /
|
|
500 fcb $af
|
|
501 fcb $f8
|
|
502 fcc /sty /
|
|
503 fcb $b0
|
|
504 fcb $f4
|
|
505 fcc /subw /
|
|
506 fcb $b1
|
|
507 fcb $f4
|
|
508 fcc /cmpw /
|
|
509 fcb $b2
|
|
510 fcb $f4
|
|
511 fcc /sbcd /
|
|
512 fcb $b3
|
|
513 fcb $f4
|
|
514 fcc /cmpd /
|
|
515 fcb $b4
|
|
516 fcb $f4
|
|
517 fcc /andd /
|
|
518 fcb $b5
|
|
519 fcb $f4
|
|
520 fcc /bitd /
|
|
521 fcb $b6
|
|
522 fcb $f4
|
|
523 fcc /ldw /
|
|
524 fcb $b7
|
|
525 fcb $f4
|
|
526 fcc /stw /
|
|
527 fcb $b8
|
|
528 fcb $f4
|
|
529 fcc /eord /
|
|
530 fcb $b9
|
|
531 fcb $f4
|
|
532 fcc /adcd /
|
|
533 fcb $ba
|
|
534 fcb $f4
|
|
535 fcc /ord /
|
|
536 fcb $bb
|
|
537 fcb $f4
|
|
538 fcc /addw /
|
|
539 fcb $bc
|
|
540 fcb $f4
|
|
541 fcc /cmpy /
|
|
542 fcb $be
|
|
543 fcb $f4
|
|
544 fcc /ldy /
|
|
545 fcb $bf
|
|
546 fcb $f4
|
|
547 fcc /sty /
|
|
548 fcb $ce
|
|
549 fcb $f3
|
|
550 fcc /lds /
|
|
551 fcb $dc
|
|
552 fcb $ff
|
|
553 fcc /ldq /
|
|
554 fcb $dd
|
|
555 fcb $ff
|
|
556 fcc /stq /
|
|
557 fcb $de
|
|
558 fcb $ff
|
|
559 fcc /lds /
|
|
560 fcb $df
|
|
561 fcb $ff
|
|
562 fcc /sts /
|
|
563 fcb $ec
|
|
564 fcb $f8
|
|
565 fcc /ldq /
|
|
566 fcb $ed
|
|
567 fcb $f8
|
|
568 fcc /stq /
|
|
569 fcb $ee
|
|
570 fcb $f8
|
|
571 fcc /lds /
|
|
572 fcb $ef
|
|
573 fcb $f8
|
|
574 fcc /sts /
|
|
575 fcb $fc
|
|
576 fcb $f4
|
|
577 fcc /ldq /
|
|
578 fcb $fd
|
|
579 fcb $f4
|
|
580 fcc /stq /
|
|
581 fcb $fe
|
|
582 fcb $f4
|
|
583 fcc /lds /
|
|
584 fcb $ff
|
|
585 fcb $f4
|
|
586 fcc /sts /
|
|
587 fcb $00
|
|
588 fcb $fe
|
|
589 fcc /fcb /
|
|
590 pag
|
|
591 *****************************************
|
|
592 ** 2 byte table - **
|
|
593 ** $11 is first byte of op code **
|
|
594 *****************************************
|
|
595 get11tab equ *
|
|
596 fcb $30
|
|
597 fcb $f0
|
|
598 fcc /band /
|
|
599 fcb $31
|
|
600 fcb $f0
|
|
601 fcc /biand/
|
|
602 fcb $32
|
|
603 fcb $f0
|
|
604 fcc /bor /
|
|
605 fcb $33
|
|
606 fcb $f0
|
|
607 fcc /bior /
|
|
608 fcb $34
|
|
609 fcb $f0
|
|
610 fcc /beor /
|
|
611 fcb $35
|
|
612 fcb $f0
|
|
613 fcc /bieor/
|
|
614 fcb $36
|
|
615 fcb $f0
|
|
616 fcc /ldbt /
|
|
617 fcb $37
|
|
618 fcb $f0
|
|
619 fcc /stbt /
|
|
620 fcb $38
|
|
621 fcb $fa
|
|
622 fcc /tfm /
|
|
623 fcb $39
|
|
624 fcb $fa
|
|
625 fcc /tfm /
|
|
626 fcb $3a
|
|
627 fcb $fa
|
|
628 fcc /tfm /
|
|
629 fcb $3b
|
|
630 fcb $fa
|
|
631 fcc /tfm /
|
|
632 fcb $3c
|
|
633 fcb $fb
|
|
634 fcc /bitmd/
|
|
635 fcb $3d
|
|
636 fcb $fb
|
|
637 fcc /ldmd /
|
|
638 fcb $3f
|
|
639 fcb $fd
|
|
640 fcc /swi3 /
|
|
641 fcb $43
|
|
642 fcb $fd
|
|
643 fcc /come /
|
|
644 fcb $4a
|
|
645 fcb $fd
|
|
646 fcc /dece /
|
|
647 fcb $4c
|
|
648 fcb $fd
|
|
649 fcc /ince /
|
|
650 fcb $4d
|
|
651 fcb $fd
|
|
652 fcc /tste /
|
|
653 fcb $4f
|
|
654 fcb $fd
|
|
655 fcc /clre /
|
|
656 fcb $53
|
|
657 fcb $fd
|
|
658 fcc /comf /
|
|
659 fcb $5a
|
|
660 fcb $fd
|
|
661 fcc /decf /
|
|
662 fcb $5c
|
|
663 fcb $fd
|
|
664 fcc /incf /
|
|
665 fcb $5d
|
|
666 fcb $fd
|
|
667 fcc /tstf /
|
|
668 fcb $5f
|
|
669 fcb $fd
|
|
670 fcc /clrf /
|
|
671 fcb $80
|
|
672 fcb $fb
|
|
673 fcc /sube /
|
|
674 fcb $81
|
|
675 fcb $fb
|
|
676 fcc /cmpe /
|
|
677 fcb $83
|
|
678 fcb $f3
|
|
679 fcc /cmpu /
|
|
680 fcb $86
|
|
681 fcb $fb
|
|
682 fcc /lde /
|
|
683 fcb $8b
|
|
684 fcb $fb
|
|
685 fcc /adde /
|
|
686 fcb $8c
|
|
687 fcb $f3
|
|
688 fcc /cmps /
|
|
689 fcb $8d
|
|
690 fcb $fb
|
|
691 fcc /divd /
|
|
692 fcb $8e
|
|
693 fcb $f3
|
|
694 fcc /divq /
|
|
695 fcb $8f
|
|
696 fcb $f3
|
|
697 fcc /muld /
|
|
698 fcb $90
|
|
699 fcb $ff
|
|
700 fcc /sube /
|
|
701 fcb $91
|
|
702 fcb $ff
|
|
703 fcc /cmpe /
|
|
704 fcb $93
|
|
705 fcb $ff
|
|
706 fcc /cmpu /
|
|
707 fcb $96
|
|
708 fcb $ff
|
|
709 fcc /lde /
|
|
710 fcb $97
|
|
711 fcb $ff
|
|
712 fcc /ste /
|
|
713 fcb $9b
|
|
714 fcb $ff
|
|
715 fcc /adde /
|
|
716 fcb $9c
|
|
717 fcb $ff
|
|
718 fcc /cmps /
|
|
719 fcb $9d
|
|
720 fcb $ff
|
|
721 fcc /divd /
|
|
722 fcb $9e
|
|
723 fcb $ff
|
|
724 fcc /divq /
|
|
725 fcb $9f
|
|
726 fcb $ff
|
|
727 fcc /muld /
|
|
728 fcb $a0
|
|
729 fcb $f8
|
|
730 fcc /sube /
|
|
731 fcb $a1
|
|
732 fcb $f8
|
|
733 fcc /cmpe /
|
|
734 fcb $a3
|
|
735 fcb $f8
|
|
736 fcc /cmpu /
|
|
737 fcb $a6
|
|
738 fcb $f8
|
|
739 fcc /lde /
|
|
740 fcb $a7
|
|
741 fcb $f8
|
|
742 fcc /ste /
|
|
743 fcb $ab
|
|
744 fcb $f8
|
|
745 fcc /adde /
|
|
746 fcb $ac
|
|
747 fcb $f8
|
|
748 fcc /cmps /
|
|
749 fcb $ad
|
|
750 fcb $f8
|
|
751 fcc /divd /
|
|
752 fcb $ae
|
|
753 fcb $f8
|
|
754 fcc /divq /
|
|
755 fcb $af
|
|
756 fcb $f8
|
|
757 fcc /muld /
|
|
758 fcb $b0
|
|
759 fcb $f4
|
|
760 fcc /sube /
|
|
761 fcb $b1
|
|
762 fcb $f4
|
|
763 fcc /cmpe /
|
|
764 fcb $b3
|
|
765 fcb $f4
|
|
766 fcc /cmpu /
|
|
767 fcb $b6
|
|
768 fcb $f4
|
|
769 fcc /lde /
|
|
770 fcb $b7
|
|
771 fcb $f4
|
|
772 fcc /ste /
|
|
773 fcb $bb
|
|
774 fcb $f4
|
|
775 fcc /adde /
|
|
776 fcb $bc
|
|
777 fcb $f4
|
|
778 fcc /cmps /
|
|
779 fcb $bd
|
|
780 fcb $f4
|
|
781 fcc /divd /
|
|
782 fcb $be
|
|
783 fcb $f4
|
|
784 fcc /divq /
|
|
785 fcb $bf
|
|
786 fcb $f4
|
|
787 fcc /muld /
|
|
788 fcb $c0
|
|
789 fcb $fb
|
|
790 fcc /subf /
|
|
791 fcb $c1
|
|
792 fcb $fb
|
|
793 fcc /cmpf /
|
|
794 fcb $c6
|
|
795 fcb $fb
|
|
796 fcc /ldf /
|
|
797 fcb $cb
|
|
798 fcb $fb
|
|
799 fcc /addf /
|
|
800 fcb $d0
|
|
801 fcb $ff
|
|
802 fcc /subf /
|
|
803 fcb $d1
|
|
804 fcb $ff
|
|
805 fcc /cmpf /
|
|
806 fcb $d6
|
|
807 fcb $ff
|
|
808 fcc /ldf /
|
|
809 fcb $d7
|
|
810 fcb $ff
|
|
811 fcc /stf /
|
|
812 fcb $db
|
|
813 fcb $ff
|
|
814 fcc /addf /
|
|
815 fcb $e0
|
|
816 fcb $f8
|
|
817 fcc /subf /
|
|
818 fcb $e1
|
|
819 fcb $f8
|
|
820 fcc /cmpf /
|
|
821 fcb $e6
|
|
822 fcb $f8
|
|
823 fcc /ldf /
|
|
824 fcb $e7
|
|
825 fcb $f8
|
|
826 fcc /stf /
|
|
827 fcb $eb
|
|
828 fcb $f8
|
|
829 fcc /addf /
|
|
830 fcb $f0
|
|
831 fcb $f4
|
|
832 fcc /subf /
|
|
833 fcb $f1
|
|
834 fcb $f4
|
|
835 fcc /cmpf /
|
|
836 fcb $f6
|
|
837 fcb $f4
|
|
838 fcc /ldf /
|
|
839 fcb $f7
|
|
840 fcb $f4
|
|
841 fcc /stf /
|
|
842 fcb $fb
|
|
843 fcb $f4
|
|
844 fcc /addf /
|
|
845 fcb $00 Unknown gets FCB's
|
|
846 fcb $fe
|
|
847 fcc /fcb /
|
|
848 pag
|
|
849 *****************************************
|
|
850 ** 1 byte op code table **
|
|
851 *****************************************
|
|
852 * Position in table is opcode, byte stored there is how to interpret it
|
|
853 * Interpreter bytes are:
|
|
854 * $FF: Direct page mode (1 byte address)
|
|
855 * $FE: FCB (unknown single byte)
|
|
856 * $FD: Implied (single byte by itself)
|
|
857 * $FC: 2 byte relative
|
|
858 * $FB: 1 byte immediate
|
|
859 * $FA: Dual register (EXG/TFR)
|
|
860 * $F9: 1 byte relative
|
|
861 * $F8: Indexed (1 or more post bytes)
|
|
862 * $F7: Stack (PSH/PUL) register post-byte
|
|
863 * $F6: ??? (internal use?)
|
|
864 * $F5: SWI???
|
|
865 * $F4: Extended (2 byte address)
|
|
866 * $F3: 2 byte immediate
|
|
867 * $F2: 4 byte immediate
|
|
868 * $F1: In memory (AIM, etc.)
|
|
869 * $F0: Bit commands (LDBT, etc.)
|
|
870 optable fcb $00
|
|
871 tab0x equ *
|
|
872 fcb $ff =00
|
|
873 fcc /neg /
|
|
874 fcb $f1 =01
|
|
875 fcc /oim /
|
|
876 fcb $f1 =02
|
|
877 fcc /aim /
|
|
878 fcb $ff =03
|
|
879 fcc /com /
|
|
880 fcb $ff =04
|
|
881 fcc /lsr /
|
|
882 fcb $f1 =05
|
|
883 fcc /eim /
|
|
884 fcb $ff =06
|
|
885 fcc /ror /
|
|
886 fcb $ff =07
|
|
887 fcc /asr /
|
|
888 fcb $ff =08
|
|
889 fcc /lsl /
|
|
890 fcb $ff =09
|
|
891 fcc /rol /
|
|
892 fcb $ff =0a
|
|
893 fcc /dec /
|
|
894 fcb $f1 =0b
|
|
895 fcc /tim /
|
|
896 fcb $ff =0c
|
|
897 fcc /inc /
|
|
898 fcb $ff =0d
|
|
899 fcc /tst /
|
|
900 fcb $ff =0e
|
|
901 fcc /jmp /
|
|
902 fcb $ff =0f
|
|
903 fcc /clr /
|
|
904 tab1x equ *
|
|
905 fcb $fe =10 Unused entry; pre-byte
|
|
906 fcc /fcb /
|
|
907 fcb $fe =11 Unused entry; pre-byte
|
|
908 fcc /fcb /
|
|
909 fcb $fd =12
|
|
910 fcc /nop /
|
|
911 fcb $fd =13
|
|
912 fcc /sync /
|
|
913 fcb $fd =14
|
|
914 fcc /sexw /
|
|
915 fcb $fe =15
|
|
916 fcc /fcb /
|
|
917 fcb $fc =16
|
|
918 fcc /lbra /
|
|
919 fcb $fc =17
|
|
920 fcc /lbsr /
|
|
921 fcb $fe =18
|
|
922 fcc /fcb /
|
|
923 fcb $fd =19
|
|
924 fcc /daa /
|
|
925 fcb $fb =1a
|
|
926 fcc /orcc /
|
|
927 fcb $fe =1b
|
|
928 fcc /fcb /
|
|
929 fcb $fb =1c
|
|
930 fcc /andcc/
|
|
931 fcb $fd =1d
|
|
932 fcc /sex /
|
|
933 fcb $fa =1e
|
|
934 fcc /exg /
|
|
935 fcb $fa =1f
|
|
936 fcc /tfr /
|
|
937 tab2x equ *
|
|
938 fcb $f9 =20
|
|
939 fcc /bra /
|
|
940 fcb $f9 =21
|
|
941 fcc /brn /
|
|
942 fcb $f9 =22
|
|
943 fcc /bhi /
|
|
944 fcb $f9 =23
|
|
945 fcc /bls /
|
|
946 fcb $f9 =24
|
|
947 fcc /bcc /
|
|
948 fcb $f9 =25
|
|
949 fcc /bcs /
|
|
950 fcb $f9 =26
|
|
951 fcc /bne /
|
|
952 fcb $f9 =27
|
|
953 fcc /beq /
|
|
954 fcb $f9 =28
|
|
955 fcc /bvc /
|
|
956 fcb $f9 =29
|
|
957 fcc /bvs /
|
|
958 fcb $f9 =2a
|
|
959 fcc /bpl /
|
|
960 fcb $f9 =2b
|
|
961 fcc /bmi /
|
|
962 fcb $f9 =2c
|
|
963 fcc /bge /
|
|
964 fcb $f9 =2d
|
|
965 fcc /blt /
|
|
966 fcb $f9 =2e
|
|
967 fcc /bgt /
|
|
968 fcb $f9 =2f
|
|
969 fcc /ble /
|
|
970 tab3x equ *
|
|
971 fcb $f8 =30
|
|
972 fcc /leax /
|
|
973 fcb $f8 =31
|
|
974 fcc /leay /
|
|
975 fcb $f8 =32
|
|
976 fcc /leas /
|
|
977 fcb $f8 =33
|
|
978 fcc /leau /
|
|
979 fcb $f7 =34
|
|
980 fcc /pshs /
|
|
981 fcb $f7 =35
|
|
982 fcc /puls /
|
|
983 fcb $f7 =36
|
|
984 fcc /pshu /
|
|
985 fcb $f7 =37
|
|
986 fcc /pulu /
|
|
987 fcb $fe =38
|
|
988 fcc /fcb /
|
|
989 fcb $fd =39
|
|
990 fcc /rts /
|
|
991 fcb $fd =3a
|
|
992 fcc /abx /
|
|
993 fcb $fd =3b
|
|
994 fcc /rti /
|
|
995 fcb $fb =3c
|
|
996 fcc /cwai /
|
|
997 fcb $fd =3d
|
|
998 fcc /mul /
|
|
999 fcb $fe =3e
|
|
1000 fcc /fcb /
|
|
1001 fcb $f5 =3f
|
|
1002 fcc /swi /
|
|
1003 tab4x equ *
|
|
1004 fcb $fd =40
|
|
1005 fcc /nega /
|
|
1006 fcb $fe =41
|
|
1007 fcc /fcb /
|
|
1008 fcb $fe =42
|
|
1009 fcc /fcb /
|
|
1010 fcb $fd =43
|
|
1011 fcc /coma /
|
|
1012 fcb $fd =44
|
|
1013 fcc /lsra /
|
|
1014 fcb $fe =45
|
|
1015 fcc /fcb /
|
|
1016 fcb $fd =46
|
|
1017 fcc /rora /
|
|
1018 fcb $fd =47
|
|
1019 fcc /asra /
|
|
1020 fcb $fd =48
|
|
1021 fcc /lsla /
|
|
1022 fcb $fd =49
|
|
1023 fcc /rola /
|
|
1024 fcb $fd =4a
|
|
1025 fcc /deca /
|
|
1026 fcb $fe =4b
|
|
1027 fcc /fcb /
|
|
1028 fcb $fd =4c
|
|
1029 fcc /inca /
|
|
1030 fcb $fd =4d
|
|
1031 fcc /tsta /
|
|
1032 fcb $fe =4e
|
|
1033 fcc /fcb /
|
|
1034 fcb $fd =4f
|
|
1035 fcc /clra /
|
|
1036 tab5x equ *
|
|
1037 fcb $fd =50
|
|
1038 fcc /negb /
|
|
1039 fcb $fe =51
|
|
1040 fcc /fcb /
|
|
1041 fcb $fe =52
|
|
1042 fcc /fcb /
|
|
1043 fcb $fd =53
|
|
1044 fcc /comb /
|
|
1045 fcb $fd =54
|
|
1046 fcc /lsrb /
|
|
1047 fcb $fe =55
|
|
1048 fcc /fcb /
|
|
1049 fcb $fd =56
|
|
1050 fcc /rorb /
|
|
1051 fcb $fd =57
|
|
1052 fcc /asrb /
|
|
1053 fcb $fd =58
|
|
1054 fcc /lslb /
|
|
1055 fcb $fd =59
|
|
1056 fcc /rolb /
|
|
1057 fcb $fd =5a
|
|
1058 fcc /decb /
|
|
1059 fcb $fe =5b
|
|
1060 fcc /fcb /
|
|
1061 fcb $fd =5c
|
|
1062 fcc /incb /
|
|
1063 fcb $fd =5d
|
|
1064 fcc /tstb /
|
|
1065 fcb $fe =5e
|
|
1066 fcc /fcb /
|
|
1067 fcb $fd =5f
|
|
1068 fcc /clrb /
|
|
1069 tab6x equ *
|
|
1070 fcb $f8 =60
|
|
1071 fcc /neg /
|
|
1072 fcb $f1 =61
|
|
1073 fcc /oim /
|
|
1074 fcb $f1 =62
|
|
1075 fcc /aim /
|
|
1076 fcb $f8 =63
|
|
1077 fcc /com /
|
|
1078 fcb $f8 =64
|
|
1079 fcc /lsr /
|
|
1080 fcb $f1 =65
|
|
1081 fcc /eim /
|
|
1082 fcb $f8 =66
|
|
1083 fcc /ror /
|
|
1084 fcb $f8 =67
|
|
1085 fcc /asr /
|
|
1086 fcb $f8 =68
|
|
1087 fcc /lsl /
|
|
1088 fcb $f8 =69
|
|
1089 fcc /rol /
|
|
1090 fcb $f8 =6a
|
|
1091 fcc /dec /
|
|
1092 fcb $f1 =6b
|
|
1093 fcc /tim /
|
|
1094 fcb $f8 =6c
|
|
1095 fcc /inc /
|
|
1096 fcb $f8 =6d
|
|
1097 fcc /tst /
|
|
1098 fcb $f8 =6e
|
|
1099 fcc /jmp /
|
|
1100 fcb $f8 =6f
|
|
1101 fcc /clr /
|
|
1102 tab7x equ *
|
|
1103 fcb $f4 =70
|
|
1104 fcc /neg /
|
|
1105 fcb $f1 =71
|
|
1106 fcc /oim /
|
|
1107 fcb $f1 =72
|
|
1108 fcc /aim /
|
|
1109 fcb $f4 =73
|
|
1110 fcc /com /
|
|
1111 fcb $f4 =74
|
|
1112 fcc /lsr /
|
|
1113 fcb $f1 =75
|
|
1114 fcc /eim /
|
|
1115 fcb $f4 =76
|
|
1116 fcc /ror /
|
|
1117 fcb $f4 =77
|
|
1118 fcc /asr /
|
|
1119 fcb $f4 =78
|
|
1120 fcc /lsl /
|
|
1121 fcb $f4 =79
|
|
1122 fcc /rol /
|
|
1123 fcb $f4 =7a
|
|
1124 fcc /dec /
|
|
1125 fcb $f1 =7b
|
|
1126 fcc /tim /
|
|
1127 fcb $f4 =7c
|
|
1128 fcc /inc /
|
|
1129 fcb $f4 =7d
|
|
1130 fcc /tst /
|
|
1131 fcb $f4 =7e
|
|
1132 fcc /jmp /
|
|
1133 fcb $f4 =7f
|
|
1134 fcc /clr /
|
|
1135 tab8x equ *
|
|
1136 fcb $fb =80
|
|
1137 fcc /suba /
|
|
1138 fcb $fb =81
|
|
1139 fcc /cmpa /
|
|
1140 fcb $fb =82
|
|
1141 fcc /sbca /
|
|
1142 fcb $f3 =83
|
|
1143 fcc /subd /
|
|
1144 fcb $fb =84
|
|
1145 fcc /anda /
|
|
1146 fcb $fb =85
|
|
1147 fcc /bita /
|
|
1148 fcb $fb =86
|
|
1149 fcc /lda /
|
|
1150 fcb $fe =87
|
|
1151 fcc /fcb /
|
|
1152 fcb $fb =88
|
|
1153 fcc /eora /
|
|
1154 fcb $fb =89
|
|
1155 fcc /adca /
|
|
1156 fcb $fb =8a
|
|
1157 fcc /ora /
|
|
1158 fcb $fb =8b
|
|
1159 fcc /adda /
|
|
1160 fcb $f3 =8c
|
|
1161 fcc /cmpx /
|
|
1162 fcb $f9 =8d
|
|
1163 fcc /bsr /
|
|
1164 fcb $f3 =8e
|
|
1165 fcc /ldx /
|
|
1166 fcb $fe =8f
|
|
1167 fcc /fcb /
|
|
1168 tab9x equ *
|
|
1169 fcb $ff =90
|
|
1170 fcc /suba /
|
|
1171 fcb $ff =91
|
|
1172 fcc /cmpa /
|
|
1173 fcb $ff =92
|
|
1174 fcc /sbca /
|
|
1175 fcb $ff =93
|
|
1176 fcc /subd /
|
|
1177 fcb $ff =94
|
|
1178 fcc /anda /
|
|
1179 fcb $ff =95
|
|
1180 fcc /bita /
|
|
1181 fcb $ff =96
|
|
1182 fcc /lda /
|
|
1183 fcb $ff =97
|
|
1184 fcc /sta /
|
|
1185 fcb $ff =98
|
|
1186 fcc /eora /
|
|
1187 fcb $ff =99
|
|
1188 fcc /adca /
|
|
1189 fcb $ff =9a
|
|
1190 fcc /ora /
|
|
1191 fcb $ff =9b
|
|
1192 fcc /adda /
|
|
1193 fcb $ff =9c
|
|
1194 fcc /cmpx /
|
|
1195 fcb $ff =9d
|
|
1196 fcc /jsr /
|
|
1197 fcb $ff =9e
|
|
1198 fcc /ldx /
|
|
1199 fcb $ff =9f
|
|
1200 fcc /stx /
|
|
1201 tabax equ *
|
|
1202 fcb $f8 =a0
|
|
1203 fcc /suba /
|
|
1204 fcb $f8 =a1
|
|
1205 fcc /cmpa /
|
|
1206 fcb $f8 =a2
|
|
1207 fcc /sbca /
|
|
1208 fcb $f8 =a3
|
|
1209 fcc /subd /
|
|
1210 fcb $f8 =a4
|
|
1211 fcc /anda /
|
|
1212 fcb $f8 =a5
|
|
1213 fcc /bita /
|
|
1214 fcb $f8 =a6
|
|
1215 fcc /lda /
|
|
1216 fcb $f8 =a7
|
|
1217 fcc /sta /
|
|
1218 fcb $f8 =a8
|
|
1219 fcc /eora /
|
|
1220 fcb $f8 =a9
|
|
1221 fcc /adca /
|
|
1222 fcb $f8 =aa
|
|
1223 fcc /ora /
|
|
1224 fcb $f8 =ab
|
|
1225 fcc /adda /
|
|
1226 fcb $f8 =ac
|
|
1227 fcc /cmpx /
|
|
1228 fcb $f8 =ad
|
|
1229 fcc /jsr /
|
|
1230 fcb $f8 =ae
|
|
1231 fcc /ldx /
|
|
1232 fcb $f8 =af
|
|
1233 fcc /stx /
|
|
1234 tabbx equ *
|
|
1235 fcb $f4 =b0
|
|
1236 fcc /suba /
|
|
1237 fcb $f4 =b1
|
|
1238 fcc /cmpa /
|
|
1239 fcb $f4 =b2
|
|
1240 fcc /sbca /
|
|
1241 fcb $f4 =b3
|
|
1242 fcc /subd /
|
|
1243 fcb $f4 =b4
|
|
1244 fcc /anda /
|
|
1245 fcb $f4 =b5
|
|
1246 fcc /bita /
|
|
1247 fcb $f4 =b6
|
|
1248 fcc /lda /
|
|
1249 fcb $f4 =b7
|
|
1250 fcc /sta /
|
|
1251 fcb $f4 =b8
|
|
1252 fcc /eora /
|
|
1253 fcb $f4 =b9
|
|
1254 fcc /adca /
|
|
1255 fcb $f4 =ba
|
|
1256 fcc /ora /
|
|
1257 fcb $f4 =bb
|
|
1258 fcc /adda /
|
|
1259 fcb $f4 =bc
|
|
1260 fcc /cmpx /
|
|
1261 fcb $f4 =bd
|
|
1262 fcc /jsr /
|
|
1263 fcb $f4 =be
|
|
1264 fcc /ldx /
|
|
1265 fcb $f4 =bf
|
|
1266 fcc /stx /
|
|
1267 tabcx equ *
|
|
1268 fcb $fb =c0
|
|
1269 fcc /subb /
|
|
1270 fcb $fb =c1
|
|
1271 fcc /cmpb /
|
|
1272 fcb $fb =c2
|
|
1273 fcc /sbcb /
|
|
1274 fcb $f3 =c3
|
|
1275 fcc /addd /
|
|
1276 fcb $fb =c4
|
|
1277 fcc /andb /
|
|
1278 fcb $fb =c5
|
|
1279 fcc /bitb /
|
|
1280 fcb $fb =c6
|
|
1281 fcc /ldb /
|
|
1282 fcb $fe =c7
|
|
1283 fcc /fcb /
|
|
1284 fcb $fb =c8
|
|
1285 fcc /eorb /
|
|
1286 fcb $fb =c9
|
|
1287 fcc /adcb /
|
|
1288 fcb $fb =ca
|
|
1289 fcc /orb /
|
|
1290 fcb $fb =cb
|
|
1291 fcc /addb /
|
|
1292 fcb $f3 =cc
|
|
1293 fcc /ldd /
|
|
1294 fcb $f2 =cd
|
|
1295 fcc /ldq /
|
|
1296 fcb $f3 =ce
|
|
1297 fcc /ldu /
|
|
1298 fcb $fe =cf
|
|
1299 fcc /fcb /
|
|
1300 tabdx equ *
|
|
1301 fcb $ff =d0
|
|
1302 fcc /subb /
|
|
1303 fcb $ff =d1
|
|
1304 fcc /cmpb /
|
|
1305 fcb $ff =d2
|
|
1306 fcc /sbcb /
|
|
1307 fcb $ff =d3
|
|
1308 fcc /addd /
|
|
1309 fcb $ff =d4
|
|
1310 fcc /andb /
|
|
1311 fcb $ff =d5
|
|
1312 fcc /bitb /
|
|
1313 fcb $ff =d6
|
|
1314 fcc /ldb /
|
|
1315 fcb $ff =d7
|
|
1316 fcc /stb /
|
|
1317 fcb $ff =d8
|
|
1318 fcc /eorb /
|
|
1319 fcb $ff =d9
|
|
1320 fcc /adcb /
|
|
1321 fcb $ff =da
|
|
1322 fcc /orb /
|
|
1323 fcb $ff =db
|
|
1324 fcc /addb /
|
|
1325 fcb $ff =dc
|
|
1326 fcc /ldd /
|
|
1327 fcb $ff =dd
|
|
1328 fcc /std /
|
|
1329 fcb $ff =de
|
|
1330 fcc /ldu /
|
|
1331 fcb $ff =df
|
|
1332 fcc /stu /
|
|
1333 tabex equ *
|
|
1334 fcb $f8 =e0
|
|
1335 fcc /subb /
|
|
1336 fcb $f8 =e1
|
|
1337 fcc /cmpb /
|
|
1338 fcb $f8 =e2
|
|
1339 fcc /sbcb /
|
|
1340 fcb $f8 =e3
|
|
1341 fcc /addd /
|
|
1342 fcb $f8 =e4
|
|
1343 fcc /andb /
|
|
1344 fcb $f8 =e5
|
|
1345 fcc /bitb /
|
|
1346 fcb $f8 =e6
|
|
1347 fcc /ldb /
|
|
1348 fcb $f8 =e7
|
|
1349 fcc /stb /
|
|
1350 fcb $f8 =e8
|
|
1351 fcc /eorb /
|
|
1352 fcb $f8 =e9
|
|
1353 fcc /adcb /
|
|
1354 fcb $f8 =ea
|
|
1355 fcc /orb /
|
|
1356 fcb $f8 =eb
|
|
1357 fcc /addb /
|
|
1358 fcb $f8 =ec
|
|
1359 fcc /ldd /
|
|
1360 fcb $f8 =ed
|
|
1361 fcc /std /
|
|
1362 fcb $f8 =ee
|
|
1363 fcc /ldu /
|
|
1364 fcb $f8 =ef
|
|
1365 fcc /stu /
|
|
1366 tabfx equ *
|
|
1367 fcb $f4 =f0
|
|
1368 fcc /subb /
|
|
1369 fcb $f4 =f1
|
|
1370 fcc /cmpb /
|
|
1371 fcb $f4 =f2
|
|
1372 fcc /sbcb /
|
|
1373 fcb $f4 =f3
|
|
1374 fcc /addd /
|
|
1375 fcb $f4 =f4
|
|
1376 fcc /andb /
|
|
1377 fcb $f4 =f5
|
|
1378 fcc /bitb /
|
|
1379 fcb $f4 =f6
|
|
1380 fcc /ldb /
|
|
1381 fcb $f4 =f7
|
|
1382 fcc /stb /
|
|
1383 fcb $f4 =f8
|
|
1384 fcc /eorb /
|
|
1385 fcb $f4 =f9
|
|
1386 fcc /adcb /
|
|
1387 fcb $f4 =fa
|
|
1388 fcc /orb /
|
|
1389 fcb $f4 =fb
|
|
1390 fcc /addb /
|
|
1391 fcb $f4 =fc
|
|
1392 fcc /ldd /
|
|
1393 fcb $f4 =fd
|
|
1394 fcc /std /
|
|
1395 fcb $f4 =fe
|
|
1396 fcc /ldu /
|
|
1397 fcb $f4 =ff
|
|
1398 fcc /stu /
|
|
1399 pag
|
|
1400
|
|
1401
|
|
1402 testing equ 0 (0=no,1=yes)
|
|
1403 regtab fcc /d x y u s pcw v a b ccdp0 0 e f /
|
|
1404 stackreg fcc /pcu y x dpb a cc/
|
|
1405 timesplt fcc '// :: '
|
|
1406 title equ *
|
|
1407 fcc /program module /
|
|
1408 fcc /subroutine module /
|
|
1409 fcc /multi-module /
|
|
1410 fcc /data module /
|
|
1411 fcc /os9 system module /
|
|
1412 fcc /os9 file manager /
|
|
1413 fcc /os9 device driver /
|
|
1414 fcc /os9 device descriptor/
|
|
1415 badindx fcc /?????????????????????/
|
|
1416 devtype equ *
|
|
1417 fcc /Prgrm/
|
|
1418 fcc /Sbrtn/
|
|
1419 fcc /Multi/
|
|
1420 fcc /Data /
|
|
1421 fcc /Systm/
|
|
1422 fcc /FlMgr/
|
|
1423 fcc /Drivr/
|
|
1424 fcc /Devic/
|
|
1425 fcc /?????/
|
|
1426 language equ *
|
|
1427 fcc /Objct /
|
|
1428 fcc /ICode /
|
|
1429 fcc /PCode /
|
|
1430 fcc /CCode /
|
|
1431 fcc /CblCode /
|
|
1432 fcc /FrtnCode/
|
|
1433 fcc /???????? /
|
|
1434 reent. fcc /ReEnt /
|
|
1435 modprot. fcc /Modprot /
|
|
1436 line010 fcc / ifp1/
|
|
1437 line011 fcb $0d
|
|
1438 ln010sz equ *-line010
|
|
1439 line020 fcc % use /%
|
|
1440 ln020sz equ *-line020
|
|
1441 line025 fcc %/defs/os9defs%
|
|
1442 fcb $0d
|
|
1443 ln025sz equ *-line025
|
|
1444 line030 fcc / endc/
|
|
1445 fcb $0d
|
|
1446 ln030sz equ *-line030
|
|
1447 line040 fcc / /
|
|
1448 fcc / /
|
|
1449 fcc / /
|
|
1450 fcc / /
|
|
1451
|
|
1452 line050 fcc / mod /
|
|
1453 fcc /eom,name,tylg,/
|
|
1454 fcc /atrv,start,size/
|
|
1455 fcb $0d
|
|
1456 ln050sz equ *-line050
|
|
1457 line060 fcc %fcs /%
|
|
1458 ln060sz equ *-line060
|
|
1459 line070 fcc /u0000 rmb /
|
|
1460 ln070sz equ *-line070
|
|
1461 line080 fcc /<u/
|
|
1462 line085 fcc /<$/
|
|
1463 line090 fcc /fcb $/
|
|
1464 ln090sz equ *-line090
|
|
1465 line100 fcc /name equ */
|
|
1466 ln100sz equ *-line100
|
|
1467 line110 fcc / rmb /
|
|
1468 ln110sz equ *-line110
|
|
1469 line120 fcc /size equ ./
|
|
1470 fcb $0d
|
|
1471 ln120sz equ *-line120
|
|
1472 line130 fcc /start equ */
|
|
1473 fcb $0d
|
|
1474 ln130sz equ *-line130
|
|
1475 line140 fcc /swi2/
|
|
1476 ln140sz equ *-line140
|
|
1477 line150 fcc /os9 /
|
|
1478 ln150sz equ *-line150
|
|
1479 line160 fcc / ttl /
|
|
1480 ln160sz equ *-line160
|
|
1481 line170 fcc / emod/
|
|
1482 fcb $0d
|
|
1483 ln170sz equ *-line170
|
|
1484 line180 fcc /eom equ */
|
|
1485 fcb $0d
|
|
1486 ln180sz equ *-line180
|
|
1487 line190 fcc /equ */
|
|
1488 ln190sz equ *-line190
|
|
1489 line200 fcb $0a
|
|
1490 fcc /error: can't link to module/
|
|
1491 fcb $0d
|
|
1492 ln200sz equ *-line200
|
|
1493 line210 fcc /* Disassembled /
|
|
1494 ln210sz equ *-line210
|
|
1495 line215 fcc /by Disasm v1./
|
|
1496 fcb edition
|
|
1497 fcc / (C) 1988 by RML/
|
|
1498 ln215sz equ *-line215
|
|
1499 line220 fcc /,pcr/
|
|
1500 ln220sz equ *-line220
|
|
1501 line230 fcb $0a
|
|
1502 fcc /* entries in symbol table :$/
|
|
1503 ln230sz equ *-line230
|
|
1504 line240 fcb $0a
|
|
1505 fcb $0a
|
|
1506 fcc /error: symbol table full/
|
|
1507 fdb $070d
|
|
1508 ln240sz equ *-line240
|
|
1509 line250 fcb $0a
|
|
1510 fcb $0a
|
|
1511 fcc /error: illegal option/
|
|
1512 fdb $070d
|
|
1513 ln250sz equ *-line250
|
|
1514 line260 fcb $0a
|
|
1515 fcc %error: no module/path name found%
|
|
1516 fcb $0a
|
|
1517 fcc /use Disasm -? for help/
|
|
1518 fdb $070d
|
|
1519 ln260sz equ *-line260
|
|
1520 line270 fcb $0a
|
|
1521 fcc / Disasm v1./
|
|
1522 fcb edition
|
|
1523 fcc / (for 6809 & 6309 code) options:/
|
|
1524 fcb $0a
|
|
1525 fcc / Disasm -m modname/
|
|
1526 fcb $0a
|
|
1527 fcc / will link to module 'modname' -/
|
|
1528 fcc / if not found,will load module/
|
|
1529 fcb $0a
|
|
1530 fcb $0a
|
|
1531 fcc / Disasm modname/
|
|
1532 fcb $0a
|
|
1533 fcc / will 'read' the module from the/
|
|
1534 fcc / specified path without loading/
|
|
1535 fcb $0a,$0a
|
|
1536 fcc / Disasm -z {hex data}/
|
|
1537 fcb $0a
|
|
1538 fcc / will disassemble the data input on the comand line/
|
|
1539 fcb $0a
|
|
1540 fcc / as if it were part of a module in memory/
|
|
1541 fcb $0a,$0a
|
|
1542 fcc / other options:/
|
|
1543 fcb $0a
|
|
1544 fcc / o = display line number,address,object code & source code/
|
|
1545 fcb $0a
|
|
1546 fcc / x = take modules from execution directory/
|
|
1547 fcb $0a
|
|
1548 fcc ' u = do not convert u/dp offsets to symbolic labels'
|
|
1549 fcb $0a,$0a
|
|
1550 fcc / any combination of options is allowed (lower or upper case)/
|
|
1551 fcb $0a
|
|
1552 fcc / but they must immediately follow the '-' and there must be/
|
|
1553 fcb $0a
|
|
1554 fcc / no spaces separating options./
|
|
1555 fcb $0a
|
|
1556 ln270sz equ *-line270
|
|
1557 line280 fcc / nam /
|
|
1558 ln280sz equ *-line280
|
|
1559 line290 fcc /tylg set /
|
|
1560 ln290sz equ *-line290
|
|
1561 line300 fcc /atrv set /
|
|
1562 ln300sz equ *-line300
|
|
1563 line310 fcc /rev set $/
|
|
1564 ln310sz equ *-line310
|
|
1565 line320 fcc /+rev/
|
|
1566 ln320sz equ *-line320
|
|
1567 line330 fcc / mod /
|
|
1568 fcc /eom,name,tylg,/
|
|
1569 fcc /atrv,mgrnam,drvnam/
|
|
1570 fcb $0d
|
|
1571 ln330sz equ *-line330
|
|
1572
|
|
1573 line340 fcc /mode byte/
|
|
1574 ln340sz equ *-line340
|
|
1575 line350 fcc /extended controller address/
|
|
1576 ln350sz equ *-line350
|
|
1577 line360 fcc / physical controller address/
|
|
1578 ln360sz equ *-line360
|
|
1579 line370 fcc /fdb $/
|
|
1580 ln370sz equ *-line370
|
|
1581 line380 fcc /fcb initsize-*-1 initilization table size/
|
|
1582 ln380sz equ *-line380
|
|
1583 line390 fcc /device type:0=scf,1=rbf,2=pipe,3=scf/
|
|
1584 ln390sz equ *-line390
|
|
1585 line400 fcc /initsize equ */
|
|
1586 ln400sz equ *-line400
|
|
1587 line410 fcc /mgrnam equ */
|
|
1588 ln410sz equ *-line410
|
|
1589 line420 fcc /drvnam equ */
|
|
1590 ln420sz equ *-line420
|
|
1591 line430 fcc /fdb name copy of descriptor name address/
|
|
1592 ln430sz equ *-line430
|
|
1593 rbfprint fcc /1drive number/
|
|
1594 fcb cr
|
|
1595 fcc /1step rate/
|
|
1596 fcb cr
|
|
1597 fcc /1drive device type/
|
|
1598 fcb cr
|
|
1599 fcc /1media density:0=single,1=double/
|
|
1600 fcb cr
|
|
1601 fcc /2number of cylinders (tracks)/
|
|
1602 fcb cr
|
|
1603 fcc /1number of sides/
|
|
1604 fcb cr
|
|
1605 fcc /1verify disk writes:0=on/
|
|
1606 fcb cr
|
|
1607 fcc /2# of sectors per track/
|
|
1608 fcb cr
|
|
1609 fcc /2# of sectors per track (track 0)/
|
|
1610 fcb cr
|
|
1611 fcc /1sector interleave factor/
|
|
1612 fcb cr
|
|
1613 fcc /1minimum size of sector allocation/
|
|
1614 fcb cr
|
|
1615 fcc /1?/
|
|
1616 fcb cr
|
|
1617
|
|
1618 scfprint equ *
|
|
1619 fcc /1case:0=up&lower,1=upper only/
|
|
1620 fcb cr
|
|
1621 fcc /1backspace:0=bsp,1=bsp then sp & bsp/
|
|
1622 fcb cr
|
|
1623 fcc /1delete:0=bsp over line,1=return/
|
|
1624 fcb cr
|
|
1625 fcc /1echo:0=no echo/
|
|
1626 fcb cr
|
|
1627 fcc /1auto line feed:0=off/
|
|
1628 fcb cr
|
|
1629 *
|
|
1630 fcc /1end of line null count/
|
|
1631 fcb cr
|
|
1632 fcc /1pause:0=no end of page pause/
|
|
1633 fcb cr
|
|
1634 fcc /1lines per page/
|
|
1635 fcb cr
|
|
1636 fcc /1backspace character/
|
|
1637 fcb cr
|
|
1638 fcc /1delete line character/
|
|
1639 fcb cr
|
|
1640 fcc /1end of record character/
|
|
1641 fcb cr
|
|
1642 fcc /1end of file character/
|
|
1643 fcb cr
|
|
1644 fcc /1reprint line character/
|
|
1645 fcb cr
|
|
1646 fcc /1duplicate last line character/
|
|
1647 fcb cr
|
|
1648 fcc /1pause character/
|
|
1649 fcb cr
|
|
1650 fcc /1interrupt character/
|
|
1651 fcb cr
|
|
1652 fcc /1quit character/
|
|
1653 fcb cr
|
|
1654 fcc /1backspace echo character/
|
|
1655 fcb cr
|
|
1656 fcc /1line overflow character (bell)/
|
|
1657 fcb cr
|
|
1658 fcc /1init value for dev ctl reg/
|
|
1659 fcb cr
|
|
1660 fcc /1baud rate/
|
|
1661 fcb cr
|
|
1662 fcc /3/
|
|
1663 fcc /1acia xon char/
|
|
1664 fcb cr
|
|
1665 fcc /1acia xoff char/
|
|
1666 fcb cr
|
|
1667 fcc /1(szx) number of columns for display/
|
|
1668 fcb cr
|
|
1669 fcc /1(szy) number of rows for display/
|
|
1670 fcb cr
|
|
1671 fcc /1window number/
|
|
1672 fcb cr
|
|
1673 fcc /1data in rest of descriptor valid/
|
|
1674 fcb cr
|
|
1675 fcc /1(sty) window type/
|
|
1676 fcb cr
|
|
1677 fcc /1(cpx) x cursor position/
|
|
1678 fcb cr
|
|
1679 fcc /1(cpy) y cursor position/
|
|
1680 fcb cr
|
|
1681 fcc /1(prn1) foreground color/
|
|
1682 fcb cr
|
|
1683 fcc /1(prn2) background color/
|
|
1684 fcb cr
|
|
1685 fcc /1(prn3) border color/
|
|
1686 fcb cr
|
|
1687 scfpend fcc /1?/
|
|
1688 fcb cr
|
|
1689 * use /dd/defs/usr/usrall
|
|
1690
|
|
1691 start equ *
|
|
1692 sts <stackhld save the stack address for later
|
|
1693 stx <xreghold
|
|
1694 stu <ureghold
|
|
1695 cmpd #2
|
|
1696 bhs pathok
|
|
1697 leax line260,pcr
|
|
1698 ldy #ln260sz
|
|
1699 lbra prterror
|
|
1700 pathok equ *
|
|
1701 leax labeltab,u
|
|
1702 stx <labladr
|
|
1703 clra
|
|
1704 sta ,x+
|
|
1705 sta ,x+
|
|
1706 leax -500,s
|
|
1707 * leax labeltab+40,u
|
|
1708 stx <utabend
|
|
1709 ldd #$ffff
|
|
1710 std ,x
|
|
1711 leax -2,x
|
|
1712 stx <highadr
|
|
1713 ldd #0
|
|
1714 std ,x
|
|
1715 clr <pass
|
|
1716 clr <diskio
|
|
1717 clr <m.opt
|
|
1718 clr <o.opt
|
|
1719 clr <x.opt
|
|
1720 clr <z.opt
|
|
1721 clr <u.opt
|
|
1722 clr <op.cnt
|
|
1723 clr <descript
|
|
1724 lbsr clrline
|
|
1725
|
|
1726 restart equ *
|
|
1727 clr <readcnt
|
|
1728 clr <readclr
|
|
1729 leax readbuff,u
|
|
1730 stx <readpos
|
|
1731 ldd #0
|
|
1732 std <numline
|
|
1733 ldx #$ffff
|
|
1734 stx <modend
|
|
1735 ldx <xreghold
|
|
1736 tst <pass
|
|
1737 lbeq getprm
|
|
1738 lbsr clrline
|
|
1739 leay line280,pcr
|
|
1740 ldb #ln280sz
|
|
1741 lbsr mergline
|
|
1742 leay holdname,u
|
|
1743 ldb #$44
|
|
1744 lbsr mergline
|
|
1745 lbsr writline
|
|
1746 leay hldttl,u
|
|
1747 ldb #40
|
|
1748 lbsr mergline
|
|
1749 lbsr writline
|
|
1750 lbsr writline
|
|
1751 leax holdobj,u
|
|
1752 tst <o.opt
|
|
1753 bne time010
|
|
1754 leax holdline,u
|
|
1755 time010
|
|
1756 stx <lineadr
|
|
1757 leay line210,pcr
|
|
1758 ldb #ln210sz
|
|
1759 lbsr mergline
|
|
1760 leax runtime,u
|
|
1761 os9 F$Time get time
|
|
1762 lbcs exit
|
|
1763 lda #6
|
|
1764 sta <temp
|
|
1765 leay timesplt,pcr
|
|
1766 time020
|
|
1767 ldb ,x+
|
|
1768 clra
|
|
1769 pshs x
|
|
1770 pshs y
|
|
1771 leay decstrng,u
|
|
1772 lbsr getdec
|
|
1773 leay decstrng+3,u
|
|
1774 ldb #2
|
|
1775 lbsr mergline
|
|
1776 puls y
|
|
1777 lda ,y+
|
|
1778 lbsr movechar
|
|
1779 puls x
|
|
1780 dec <temp
|
|
1781 bne time020
|
|
1782 leay line215,pcr
|
|
1783 ldb #ln215sz
|
|
1784 lbsr mergline
|
|
1785 lbsr writline
|
|
1786 lbsr writline
|
|
1787
|
|
1788 leay line010,pcr
|
|
1789 ldb #ln010sz
|
|
1790 lbsr mergline
|
|
1791 lbsr writline
|
|
1792 leay line020,pcr
|
|
1793 ldb #ln020sz
|
|
1794 lbsr mergline
|
|
1795 leay dfltdrv,pcr
|
|
1796 ldb #2
|
|
1797 lbsr mergline
|
|
1798 leay line025,pcr
|
|
1799 ldb #ln025sz
|
|
1800 lbsr mergline
|
|
1801 lbsr writline
|
|
1802 leay line030,pcr
|
|
1803 ldb #ln030sz
|
|
1804 lbsr mergline
|
|
1805 lbsr writline
|
|
1806 ldb <tylghold
|
|
1807 bsr movehdr
|
|
1808 leay hldtylg,u
|
|
1809 ldb #$50
|
|
1810 lbsr mergline
|
|
1811 lbsr writline
|
|
1812 ldb <atrvhold
|
|
1813 bsr movehdr
|
|
1814 leay hldatrv,u
|
|
1815 ldb #$50
|
|
1816 lbsr mergline
|
|
1817 lbsr writline
|
|
1818 ldb <revshold
|
|
1819 bsr movehdr
|
|
1820 leay hldrev,u
|
|
1821 ldb #$50
|
|
1822 lbsr mergline
|
|
1823 lbsr writline
|
|
1824 ldx <xreghold
|
|
1825 tst <diskio
|
|
1826 lbne diskmod
|
|
1827 lbra mem020
|
|
1828
|
|
1829 movehdr equ *
|
|
1830 clra
|
|
1831 lbsr gethex
|
|
1832 leax holdadr,u
|
|
1833 leay hexstrng,u
|
|
1834 ldb #4
|
|
1835 lbsr merge
|
|
1836 rts
|
|
1837
|
|
1838 getprm lda ,x+
|
|
1839 cmpa #$20
|
|
1840 beq getprm
|
|
1841 leax -1,x
|
|
1842 stx <xreghold
|
|
1843 cmpa #'-
|
|
1844 lbne diskmod
|
|
1845 leax 1,x
|
|
1846 getopt equ *
|
|
1847 lda ,x+
|
|
1848 sta <byte
|
|
1849 anda #$df
|
|
1850 cmpa #'M
|
|
1851 bne gtopt010
|
|
1852 inc <m.opt
|
|
1853 inc <op.cnt
|
|
1854 bra getopt
|
|
1855 gtopt010 cmpa #'O
|
|
1856 bne gtopt020
|
|
1857 inc <o.opt
|
|
1858 inc <op.cnt
|
|
1859 bra getopt
|
|
1860 gtopt020 equ *
|
|
1861 cmpa #'X
|
|
1862 bne gtopt030
|
|
1863 inc <x.opt
|
|
1864 inc <op.cnt
|
|
1865 bra getopt
|
|
1866
|
|
1867 gtopt030 equ *
|
|
1868 cmpa #'Z
|
|
1869 bne gtopt040
|
|
1870 inc <z.opt
|
|
1871 inc <op.cnt
|
|
1872 bra getopt
|
|
1873
|
|
1874 gtopt040 equ *
|
|
1875 cmpa #'U
|
|
1876 bne gtopt050
|
|
1877 inc <u.opt
|
|
1878 inc <op.cnt
|
|
1879 bra getopt
|
|
1880
|
|
1881 gtopt050 equ *
|
|
1882 lda <byte
|
|
1883 cmpa #'?
|
|
1884 bne chkopt
|
|
1885 leax line270,pcr
|
|
1886 ldy #ln270sz
|
|
1887 lbra prterror
|
|
1888 chkopt equ *
|
|
1889 tst <z.opt
|
|
1890 beq optest
|
|
1891 lbsr u$hexin convert hex chars to binary
|
|
1892 leay 3,y
|
|
1893 sty <modend
|
|
1894 leax -1,x
|
|
1895 stx <crntadr
|
|
1896 ldd #$FFFF
|
|
1897 std <address
|
|
1898 lda #1
|
|
1899 sta <pass
|
|
1900 leax line011,pcr
|
|
1901 ldy #1
|
|
1902 lda #1
|
|
1903 os9 I$WritLn
|
|
1904 lbcs exit
|
|
1905 lbra readbyte go start doing it!!!
|
|
1906
|
|
1907 optest tst <op.cnt
|
|
1908 bne memmod
|
|
1909 badopt equ *
|
|
1910 leax line250,pcr
|
|
1911 ldy #ln250sz
|
|
1912 lbra prterror
|
|
1913 diskmod equ *
|
|
1914 inc <diskio
|
|
1915 lda #read.
|
|
1916 tst <x.opt
|
|
1917 beq open
|
|
1918 ora #exec.
|
|
1919 open os9 i$open
|
|
1920 lbcs exit
|
|
1921 sta <path
|
|
1922 lbsr getbyte
|
|
1923 bra gotmod
|
|
1924 memmod equ *
|
|
1925 mem010 lda ,x+
|
|
1926 cmpa #$20
|
|
1927 beq mem010
|
|
1928 leax -1,x
|
|
1929 stx <xreghold
|
|
1930 tst <m.opt
|
|
1931 beq diskmod
|
|
1932
|
|
1933 mem020 equ *
|
|
1934 clra
|
|
1935 os9 f$link
|
|
1936 bcc gotmod
|
|
1937 clra
|
|
1938 ldx <xreghold
|
|
1939 os9 f$load
|
|
1940 lbcs nolink
|
|
1941 gotmod equ *
|
|
1942 stu <modadr
|
|
1943 stu <crntadr
|
|
1944 ldu <ureghold
|
|
1945 ldx #0
|
|
1946 stx <address
|
|
1947 lbsr getbyte
|
|
1948 lbsr getbyte2
|
|
1949 std <modend
|
|
1950 lbsr clrline
|
|
1951 lda #$87
|
|
1952 lbsr moveobj
|
|
1953 lda #$cd
|
|
1954 lbsr moveobj
|
|
1955 ldd <modend
|
|
1956 lbsr moveobj
|
|
1957 ldd <modend
|
|
1958 tfr b,a
|
|
1959 lbsr moveobj
|
|
1960 leay holdadr,u
|
|
1961 lda #$30
|
|
1962 sta ,y+
|
|
1963 sta ,y+
|
|
1964 sta ,y+
|
|
1965 sta ,y+
|
|
1966 leay line050,pcr
|
|
1967 ldb #ln050sz
|
|
1968 tst <descript
|
|
1969 beq prtmod
|
|
1970 leay line330,pcr
|
|
1971 ldb #ln330sz
|
|
1972 prtmod equ *
|
|
1973 lbsr mergline
|
|
1974 lbsr writline
|
|
1975 lbsr getbyte2
|
|
1976 std <nameadr
|
|
1977 leay hldtylg,u
|
|
1978 lbsr clrhld
|
|
1979 leay line290,pcr
|
|
1980 ldb #ln290sz
|
|
1981 lbsr mergline
|
|
1982 lbsr getbyte
|
|
1983 stb <tylghold
|
|
1984 andb #typemask
|
|
1985 tstb
|
|
1986 beq badtype
|
|
1987 cmpb #$40
|
|
1988 bls goodtype
|
|
1989 cmpb #$c0
|
|
1990 bhs goodtype
|
|
1991 badtype equ *
|
|
1992 lbsr mvchr005
|
|
1993 lbsr merghex
|
|
1994 bra chklang
|
|
1995 goodtype equ *
|
|
1996 lsrb
|
|
1997 lsrb
|
|
1998 lsrb
|
|
1999 lsrb
|
|
2000 cmpb #$0c
|
|
2001 blo type010
|
|
2002 subb #$7
|
|
2003 cmpb #8
|
|
2004 bne type010
|
|
2005 inc <descript
|
|
2006 type010 subb #1
|
|
2007 stb <testbyte
|
|
2008 lda #$5
|
|
2009 mul
|
|
2010 leay devtype,pcr
|
|
2011 leay d,y
|
|
2012 ldb #5
|
|
2013 lbsr mergline
|
|
2014 chklang equ *
|
|
2015 lbsr mvchr008
|
|
2016 ldb <byte
|
|
2017 andb #langmask
|
|
2018 tstb
|
|
2019 beq badlang
|
|
2020 cmpb #6
|
|
2021 bls goodlang
|
|
2022 badlang equ *
|
|
2023 lbsr mvchr005
|
|
2024 lbsr merghex
|
|
2025 bra lang010
|
|
2026 goodlang equ *
|
|
2027 subb #1
|
|
2028 leay language,pcr
|
|
2029 lda #8
|
|
2030 mul
|
|
2031 leay d,y
|
|
2032 ldb #8
|
|
2033 lbsr mergline
|
|
2034 lang010 equ *
|
|
2035 lda #$0d
|
|
2036 lbsr movechar
|
|
2037 chkattr equ *
|
|
2038 leay hldttl,u
|
|
2039 lbsr clrhld
|
|
2040 leay line160,pcr
|
|
2041 ldb #ln160sz
|
|
2042 lbsr mergline
|
|
2043 ldb <testbyte
|
|
2044 lda #$15
|
|
2045 mul
|
|
2046 leay title,pcr
|
|
2047 leay d,y
|
|
2048 ldb #$15
|
|
2049 lbsr mergline
|
|
2050 lda #$0d
|
|
2051 lbsr movechar
|
|
2052 leay hldatrv,u
|
|
2053 lbsr clrhld
|
|
2054 leay line300,pcr
|
|
2055 ldb #ln300sz
|
|
2056 lbsr mergline
|
|
2057 lbsr getbyte
|
|
2058 stb <atrvhold
|
|
2059 andb #attrmask
|
|
2060 cmpb #reent
|
|
2061 beq attr.r
|
|
2062 cmpb #modprot
|
|
2063 beq attr.m
|
|
2064 lbsr mvchr005
|
|
2065 lbsr merghex
|
|
2066 bra chkrevs
|
|
2067 attr.r equ *
|
|
2068 leay reent.,pcr
|
|
2069 ldb #5
|
|
2070 bra moveattr
|
|
2071 attr.m equ *
|
|
2072 leay modprot.,pcr
|
|
2073 ldb #7
|
|
2074 moveattr lbsr mergline
|
|
2075 chkrevs leay line320,pcr
|
|
2076 ldb #ln320sz
|
|
2077 lbsr mergline
|
|
2078 lda #$0d
|
|
2079 lbsr movechar
|
|
2080 leay hldrev,u
|
|
2081 lbsr clrhld
|
|
2082 leay line310,pcr
|
|
2083 ldb #ln310sz
|
|
2084 lbsr mergline
|
|
2085 ldb <byte
|
|
2086 andb #revsmask
|
|
2087 stb revshold
|
|
2088 lbsr merghex
|
|
2089 lda #$0d
|
|
2090 lbsr movechar
|
|
2091 lbsr getbyte
|
|
2092 tst <descript
|
|
2093 lbne descrhdr
|
|
2094 lbsr getbyte2
|
|
2095 std <startadr
|
|
2096 lbsr getbyte2
|
|
2097 std <size
|
|
2098 ldx <utabend
|
|
2099 std ,x
|
|
2100 lbsr clrline
|
|
2101 tst <pass
|
|
2102 * lbra findname
|
|
2103
|
|
2104 ldx <address
|
|
2105 stx <addrsave
|
|
2106 ldx <highadr
|
|
2107 tst <u.opt
|
|
2108 beq movedp
|
|
2109 ldx <utabend
|
|
2110 leax -2,x
|
|
2111 clra
|
|
2112 clrb
|
|
2113 std ,x
|
|
2114
|
|
2115 movedp equ *
|
|
2116 ldd ,x++
|
|
2117 pshs x
|
|
2118 std <address
|
|
2119 lbsr adrmove
|
|
2120 leay line070,pcr
|
|
2121 ldb #ln070sz
|
|
2122 lbsr mergline
|
|
2123 leay linenum,u
|
|
2124 lda #'D
|
|
2125 sta 6,y
|
|
2126 leax holdadr,u
|
|
2127 leay 25,y
|
|
2128 ldb #4
|
|
2129 exg x,y
|
|
2130 lbsr merge
|
|
2131 puls x
|
|
2132 ldd ,x
|
|
2133 subd -2,x
|
|
2134 pshs x
|
|
2135 lbsr mergdec
|
|
2136 lbsr writline
|
|
2137 puls x
|
|
2138 ldd ,x
|
|
2139 cmpd <size
|
|
2140 bne movedp
|
|
2141
|
|
2142 ldd <size
|
|
2143 lbsr gethex
|
|
2144 leay hexstrng,u
|
|
2145 leax holdadr,u
|
|
2146 ldb #4
|
|
2147 lbsr merge
|
|
2148 leay linenum,u
|
|
2149 leay 6,y
|
|
2150 lda #'D
|
|
2151 sta ,y
|
|
2152 leay line120,pcr
|
|
2153 ldb #ln120sz
|
|
2154 lbsr mergline
|
|
2155 lbsr writline
|
|
2156 ldx <addrsave
|
|
2157 stx <address
|
|
2158
|
|
2159 findname equ *
|
|
2160 lbsr getbyte
|
|
2161 ldx <nameadr
|
|
2162 cmpx <address
|
|
2163 beq getname
|
|
2164 lbsr fcbline
|
|
2165 bra findname
|
|
2166
|
|
2167 getname equ *
|
|
2168 lbsr clrline
|
|
2169 lbsr adrmove
|
|
2170 leay line100,pcr
|
|
2171 ldb #ln100sz
|
|
2172 lbsr mergline
|
|
2173 lbsr writline
|
|
2174 leay holdname,u
|
|
2175 lbsr movename
|
|
2176 getstart lbsr getbyte
|
|
2177 ldx <address
|
|
2178 cmpx <startadr
|
|
2179 beq gotstart
|
|
2180 lbsr fcbline
|
|
2181 bra getstart
|
|
2182 gotstart equ *
|
|
2183 lbsr clrline
|
|
2184 lbsr adrmove
|
|
2185 leay line130,pcr
|
|
2186 ldb #ln130sz
|
|
2187 lbsr mergline
|
|
2188 lbsr writline
|
|
2189 lda <byte
|
|
2190 lbsr moveobj
|
|
2191 bra testop
|
|
2192 readbyte lbsr getbyte
|
|
2193 * Check opcodes
|
|
2194 testop equ *
|
|
2195 clr <bitcom Clear bit instruction processing flag
|
|
2196 lbsr moveadr Go bump address up?
|
|
2197 lda <byte Get next byte
|
|
2198 cmpa #$10 Is it a $10?
|
|
2199 bne test11 No, check for next special one
|
|
2200 lbsr getbyte Is $10, get next byte
|
|
2201 cmpb #$3f OS9 System call?
|
|
2202 bne test10 No, do rest of check for $10 pre-byte
|
|
2203 lbsr getbyte Get function code
|
|
2204 tfr b,a Move to A
|
|
2205 ldb #$3f Go get proper mnemonic for System call
|
|
2206 lbsr getop
|
|
2207 cmpa #'? Unknown one?
|
|
2208 bne os9ok No, print out regular system call
|
|
2209 leax holdobj,u Unknown, deal with it
|
|
2210 stx <objadr
|
|
2211 clr <objcnt
|
|
2212 lda #$10
|
|
2213 lbsr moveobj
|
|
2214 lda #$3f
|
|
2215 lbsr moveobj
|
|
2216 ldx <objadr
|
|
2217 ldd #$2020
|
|
2218 std ,x
|
|
2219 ldx <lineadr
|
|
2220 leax -15,x
|
|
2221 stx <lineadr
|
|
2222 leay line140,pcr Print SWI2 message
|
|
2223 ldb #ln140sz
|
|
2224 lbsr mergline
|
|
2225 lbsr writline
|
|
2226 lda <testbyte
|
|
2227 sta <byte
|
|
2228 lbsr fcbline And FCB byte following it
|
|
2229 bra readbyte
|
|
2230
|
|
2231 * Got recognizable OS9 System call... print it
|
|
2232 os9ok lbsr writline
|
|
2233 bra readbyte
|
|
2234 * $10 Pre-byte OTHER than SWI2 (system calls)
|
|
2235
|
|
2236 test10 tfr b,a Put opcode part into A
|
|
2237 ldb #$10 Go get proper mnemonic type for $10xx code
|
|
2238 lbsr getop
|
|
2239 cmpb #$fe Unknown opcode?
|
|
2240 bne chkreslt No, deal with result
|
|
2241 lda #$10 Unknown, convert to FCB line
|
|
2242 bra tst11.1
|
|
2243 test11 cmpa #$11 $11 pre-byte?
|
|
2244 bne onebyte No, must be normal
|
|
2245 lbsr getbyte Get opcode part of $11xx command
|
|
2246 tfr b,a Put into A
|
|
2247 ldb #$11 $11 pre-byte
|
|
2248 lbsr getop Go get proper mnemonic type for $11xxx code
|
|
2249 cmpb #$fe Unknown opcode?
|
|
2250 bne chkreslt No, deal with result
|
|
2251 lda #$11 Make FCB line
|
|
2252 tst11.1 ldb <byte
|
|
2253 pshs b
|
|
2254 sta <byte
|
|
2255 ldx <address
|
|
2256 leax -1,x
|
|
2257 stx <address
|
|
2258 lbsr fcbline
|
|
2259 puls b
|
|
2260 stb <byte
|
|
2261 tfr b,a
|
|
2262 lbsr moveobj
|
|
2263 ldx <address
|
|
2264 leax 1,x
|
|
2265 stx <address
|
|
2266 lbra testop
|
|
2267
|
|
2268 * Opcode type branch table
|
|
2269 rslttab fdb chk.ff Direct page (1 byte address)
|
|
2270 fdb dofcb FCB (Unknown type... should never get here!)
|
|
2271 fdb chk.fd Implied (single byte by itself)
|
|
2272 fdb chk.fc 2 byte relative (long branches)
|
|
2273 fdb chk.fb 1 byte immediate value
|
|
2274 fdb chk.fa Dual register spec (EXG/TFR)
|
|
2275 fdb chk.f9 1 byte relative (short branches)
|
|
2276 fdb chk.f8 Indexed (1 or more post bytes)
|
|
2277 fdb chk.f7 Stack (PSH/PUL) register post-byte
|
|
2278 fdb chk.f6 ???
|
|
2279 fdb chk.f5 SWI
|
|
2280 fdb chk.f4 Extended (2 byte address)
|
|
2281 fdb chk.f3 2 byte immediate value
|
|
2282 fdb chk.f2 4 byte immediate
|
|
2283 fdb chk.f1 in memory (AIM, etc.)
|
|
2284 fdb chk.f0 Bit commands (LDBT, etc.)
|
|
2285
|
|
2286 onebyte clrb Clear $10/$11/Syscall flag
|
|
2287 lbsr getop Get type into B/Code in <testbyte
|
|
2288
|
|
2289 chkreslt cmpb #$f0 Check legal limit of opcode type
|
|
2290 blo dofcb If <$F0, assume FCB
|
|
2291 comb Flip bits
|
|
2292 lslb 2 bytes per entry
|
|
2293 leax rslttab,pcr Point to opcode type table
|
|
2294 ldd b,x Get offset to proper routine
|
|
2295 leax pcrzero,pcr Point to start of module
|
|
2296 jmp d,x Go process proper type
|
|
2297
|
|
2298 * Illegal opcode-FCB it
|
|
2299 dofcb lbsr fcbline
|
|
2300 lbra readbyte
|
|
2301
|
|
2302 * Direct Page Addr - 1 byte
|
|
2303 chk.ff leay line080,pc
|
|
2304 tst <u.opt User wants Symbolic labels?
|
|
2305 beq ff.010 Yes, do so
|
|
2306 leay line085,pcr No, use <$00xx instead
|
|
2307 ff.010 ldb #2 In both cases, 2 chars to merge
|
|
2308 lbsr mergline Merge onto current output line
|
|
2309 lbsr getbyte Get direct page address byte
|
|
2310 clra Make for 4 digit hex number
|
|
2311 lbsr merghex2 Merge 4 digit hex result onto output line
|
|
2312 tst <u.opt Direct page currently @ 0?
|
|
2313 lbeq indx046 put address in u table & write out line
|
|
2314
|
|
2315 * Inherent Addr - 0 bytes (also exit point when line is completed)
|
|
2316 chk.fd lbsr writline Flush line out & continue processing
|
|
2317 lbra readbyte
|
|
2318
|
|
2319 * Relative Addr - 2 bytes
|
|
2320 chk.fc lbsr getbyte2 Get 2 byte relative offset
|
|
2321 lbsr reladr.2 Calculate relative address & append it
|
|
2322 bra chk.fd Write out line
|
|
2323
|
|
2324 * Immediate Addr - 1 byte
|
|
2325 chk.fb lbsr mvchr004 Add '#' to line
|
|
2326 lbsr mvchr005 Add '$' to line
|
|
2327 lbsr getbyte Get immediate value
|
|
2328 lbsr merghex Add hex version to line
|
|
2329 bra chk.fd Write it out
|
|
2330
|
|
2331 * Dual register field
|
|
2332 * (used only for TFR/EXG/TFM & register to register operations)
|
|
2333 chk.fa lda <testbyte Get original opcode
|
|
2334 clr <TFMFlag Clear TFM flag
|
|
2335 cmpa #$38 TFM?
|
|
2336 blo normtf No, skip ahead
|
|
2337 cmpa #$3b
|
|
2338 bhi normtf
|
|
2339 inc <TFMFlag Set TFM flag
|
|
2340 normtf lbsr getbyte Get register field byte
|
|
2341 pshs b Preserve
|
|
2342 lsrb Move source reg. into proper pos.
|
|
2343 lsrb
|
|
2344 lsrb
|
|
2345 lsrb
|
|
2346 bsr fa.020 Add it to line
|
|
2347 lda <testbyte Get original opcode
|
|
2348 cmpa #$38 Is it a TFM?
|
|
2349 blo notTFM Too low
|
|
2350 cmpa #$3B
|
|
2351 bhs notTFM Too high (or is r1,r2+ and doesn't need sign)
|
|
2352 cmpa #$39 TFM r1-,r2-?
|
|
2353 bne Tplus1
|
|
2354 lbsr mvchr009 Add '-'
|
|
2355 bra notTFM
|
|
2356 Tplus1 lbsr mvchr008 Add '+'
|
|
2357 notTFM lda #', Add comma to line
|
|
2358 lbsr movechar
|
|
2359 puls b Get back field byte
|
|
2360 andb #$0f Just destination reg.
|
|
2361 bsr fa.020 Add it to line
|
|
2362 lda <testbyte Get original opcode
|
|
2363 cmpa #$38 Is it a TFM?
|
|
2364 blo notTFM2 Too low
|
|
2365 cmpa #$3B
|
|
2366 bhi notTFM2 Too high
|
|
2367 cmpa #$3A TFM r1+,r2?
|
|
2368 beq notTFM2 Yes, don't need to add anything
|
|
2369 cmpa #$39 TFM r1-,r2-?
|
|
2370 bne Tplus2
|
|
2371 lbsr mvchr009 Add '-'
|
|
2372 bra notTFM2
|
|
2373 Tplus2 lbsr mvchr008 Add '+'
|
|
2374 notTFM2 lbsr writline Write line & leave
|
|
2375 lbra readbyte
|
|
2376
|
|
2377 fa.020 lslb 2 bytes/entry
|
|
2378 leax regtab,pc Point to register field table
|
|
2379 ldd b,x Get register name
|
|
2380 tst <TFMFlag Is this a TFM command?
|
|
2381 beq normreg No, allow all register names
|
|
2382 cmpb #$20 2 char. register name?
|
|
2383 bne badreg Yes, illegal in TFM
|
|
2384 cmpa #'s Lower than S register?
|
|
2385 blo badreg
|
|
2386 cmpa #'w W register?
|
|
2387 bne normreg No, all others are legal
|
|
2388 badreg ldd #'?*256+'? Illegal register, use question marks
|
|
2389 normreg bsr movereg Add to end of line (eating spaces)
|
|
2390 rts
|
|
2391
|
|
2392 movereg lbsr movechar Add first char of reg. name to line
|
|
2393 cmpb #$20 2nd char a space?
|
|
2394 beq mvreg010 Yes, exit
|
|
2395 tfr b,a Move to proper reg.
|
|
2396 lbsr movechar And add 2nd char of reg. name to line
|
|
2397 mvreg010 rts
|
|
2398
|
|
2399 * Relative Addr - 1 byte
|
|
2400 chk.f9 lbsr getbyte Get relative offset byte
|
|
2401 lbsr reladr.1 Calculate & add it to line
|
|
2402 lbra chk.fd Print line
|
|
2403
|
|
2404 indxregs fcb %00000000,'x
|
|
2405 fcb %00100000,'y
|
|
2406 fcb %01000000,'u
|
|
2407 fcb %01100000,'s
|
|
2408 * Index table routine list for both normal & indirect modes
|
|
2409 indxjmp fcb %10000100 Zero offset ($84)
|
|
2410 fdb indx010
|
|
2411 fcb %10001000 8 bit offset ($88)
|
|
2412 fdb indx.3
|
|
2413 fcb %10001001 16 bit offset ($89)
|
|
2414 fdb indx.4
|
|
2415 fcb %10000110 A,R ($86)
|
|
2416 fdb indx.5
|
|
2417 fcb %10000101 B,R ($85)
|
|
2418 fdb indx.6
|
|
2419 fcb %10001011 D,R ($8B)
|
|
2420 fdb indx.7
|
|
2421 fcb %10000111 E,R ($87)
|
|
2422 fdb indx.E
|
|
2423 fcb %10001010 F,R ($8a)
|
|
2424 fdb indx.F
|
|
2425 fcb %10001110 W,R ($8e)
|
|
2426 fdb indx.W
|
|
2427 fcb %10000000 ,R+ ($80)
|
|
2428 fdb indx.8
|
|
2429 fcb %10000001 ,R++ ($81)
|
|
2430 fdb indx.9
|
|
2431 fcb %10000010 ,-R ($82)
|
|
2432 fdb indx.10
|
|
2433 fcb %10000011 ,--R ($83)
|
|
2434 fdb indx.11
|
|
2435 fcb %10001100 8 bit,PC ($8C)
|
|
2436 fdb indx.12
|
|
2437 fcb %10001101 16 bit,PC ($8D)
|
|
2438 fdb indx.13
|
|
2439 fcb %10001111 Non-indirect W modes ($8f)
|
|
2440 fdb indx.Wm
|
|
2441 fcb 0 table end (any patterns not covered are illegal)
|
|
2442
|
|
2443 * indexed addr - 1 or 2 bytes
|
|
2444 chk.f8 clr <indirct Clear indirect flag
|
|
2445 lbsr getbyte Get byte into B (and duplicate in <byte>)
|
|
2446 andb #%10011111 Mask out register bits (mode bits for W)
|
|
2447 cmpb #%10001111 W base (non-indirect)?
|
|
2448 beq isw Yes, set register name
|
|
2449 cmpb #%10010000 W base (indirect)?
|
|
2450 beq isw Yes, set register name
|
|
2451 ldb <byte Get original byte back
|
|
2452 bra notw Do normal search
|
|
2453 isw ldb #'w W register is base register
|
|
2454 bra streg Store it as base register
|
|
2455 notw andb #%01100000 Register mask
|
|
2456 leax indxregs-2,pc Point to register offsets -2 for loop
|
|
2457 f8.10 leax 2,x Point to next entry
|
|
2458 cmpb ,x This the one we want?
|
|
2459 bne f8.10 No, keep looking
|
|
2460 ldb 1,x Get base register name
|
|
2461 streg stb <register Preserve it
|
|
2462 ldb <byte Get back original byte
|
|
2463 andb #%10011111 Mask out the base register bits
|
|
2464 * Main indexing type check here
|
|
2465 cmpb #%00100000 5 bit offset indexing (special case)?
|
|
2466 blo indx.2 Yes, go do
|
|
2467 cmpb #%10010000 Non-indirect?
|
|
2468 blo f8.15 Yes, skip ahead
|
|
2469 * Indirect modes start here
|
|
2470 lbsr mvchr001 Add '['
|
|
2471 inc <indirct Set indirect flag
|
|
2472 cmpb #%10010000 W indirect indexing mode (since it shares pattern)
|
|
2473 lbeq indx.Wm Yes, go process
|
|
2474 cmpb #%10010010 Illegal?
|
|
2475 lbeq indx.15 Yes, bad mode
|
|
2476 cmpb #%10011111 Extended indirect?
|
|
2477 lbeq indx.14 Yes, go do that
|
|
2478 andb #%10001111 Mask out indirect bit for next routine
|
|
2479 f8.15 leax indxjmp-3,pc Point to index jump table -3 for loop
|
|
2480 f8.20 leax 3,x Point to next entry
|
|
2481 cmpb ,x Bit mask we want?
|
|
2482 beq f8.30 Yes, skip ahead
|
|
2483 tst ,x No, is the end of table marker?
|
|
2484 lbeq indx.15 Yes, bad mode
|
|
2485 bra f8.20 Otherwise, keep searching
|
|
2486 f8.30 ldd 1,x Get vector
|
|
2487 leax pcrzero,pc Set base address of vector
|
|
2488 jmp d,x Go to proper routine
|
|
2489
|
|
2490 * 5 bit offset
|
|
2491 indx.2 andb #$1f Mask out upper 3 bits
|
|
2492 pshs b Preserve it
|
|
2493 cmpb #$0f Negative offset?
|
|
2494 bls indx2.1 No, skip ahead
|
|
2495 ldb #$20 Calculate negative offset & preserve
|
|
2496 subb ,s
|
|
2497 stb ,s
|
|
2498 lbsr mvchr009 Add '-'
|
|
2499 indx2.1 lbsr mvchr005 Add '$'
|
|
2500 puls a Get offset value
|
|
2501 bra indx3.1 Add it to the line in hex format
|
|
2502
|
|
2503 * 8 bit offset
|
|
2504 indx.3 lbsr getbyte Get next byte
|
|
2505 lbsr mvchr006 Add '<'
|
|
2506 cmpb #$7f Negative value?
|
|
2507 bls indx3.0 No, skip ahead
|
|
2508 clra Make it a 16 bit number
|
|
2509 std <temp Store it
|
|
2510 ldd #$0100 Calculate negative offset for 8 bit #
|
|
2511 subd <temp
|
|
2512 lbsr mvchr009 Add '-'
|
|
2513 indx3.0 lbsr mvchr005 Add '$'
|
|
2514 indx3.1 lbsr merghex Add LSB of D as a 2 digit hex byte
|
|
2515 lbra indx010
|
|
2516
|
|
2517 * 16 bit offset
|
|
2518 indx.4 lbsr mvchr007 Add '>'
|
|
2519 lbsr getbyte2 Get 2 byte offset
|
|
2520 pshs d Preserve it
|
|
2521 cmpd #$7fff Is it negative?
|
|
2522 bls indx4.1 No, skip ahead
|
|
2523 puls d Get back value
|
|
2524 std <temp Preserve it
|
|
2525 ldd #$ffff Calculate negative offset
|
|
2526 subd <temp
|
|
2527 addd #1
|
|
2528 pshs d Preserve it
|
|
2529 lbsr mvchr009 Add '-'
|
|
2530 indx4.1 lbsr mvchr005 Add '$'
|
|
2531 puls d Get back offset value
|
|
2532 lbsr merghex2 Add 16 bit number in hex format
|
|
2533 bra indx010
|
|
2534
|
|
2535 indx.5 lda #'a A,R
|
|
2536 indx5.1 lbsr movechar
|
|
2537 bra indx010
|
|
2538
|
|
2539 indx.6 lda #'b B,R
|
|
2540 bra indx5.1
|
|
2541
|
|
2542 indx.7 lda #'d D,R
|
|
2543 bra indx5.1
|
|
2544
|
|
2545 indx.E lda #'e E,R
|
|
2546 bra indx5.1
|
|
2547
|
|
2548 indx.F lda #'f F,R
|
|
2549 bra indx5.1
|
|
2550
|
|
2551 indx.W lda #'w W,R
|
|
2552 bra indx5.1
|
|
2553
|
|
2554 * ,R+
|
|
2555 indx.8 lbsr isub010 Add ',' & register name
|
|
2556 indx8.1 lbsr mvchr008 Add '+'
|
|
2557 bra indx040 Continue
|
|
2558
|
|
2559 * ,R++
|
|
2560 indx.9 lbsr isub010 Add ',' & register name
|
|
2561 lbsr mvchr008 Add '+'
|
|
2562 bra indx8.1 Add 2nd '+' and continue
|
|
2563
|
|
2564 * ,-R
|
|
2565 indx.10 lbsr mvchr003 Add ','
|
|
2566 indx10.1 lbsr isub020 '-' & register name
|
|
2567 bra indx040 Continue
|
|
2568
|
|
2569 * ,--R
|
|
2570 indx.11 lbsr mvchr003 Add ','
|
|
2571 lbsr mvchr009 Add '-'
|
|
2572 bra indx10.1 Add 2nd '-' & register name & continue
|
|
2573
|
|
2574 * 8 bit,pc
|
|
2575 indx.12 lbsr mvchr006 Add '<'
|
|
2576 lbsr getbyte Get next byte
|
|
2577 lbsr reladr.1 Calculate relative address label
|
|
2578 bra indx030 Add ',pcr'
|
|
2579
|
|
2580 * 16 bit,pc
|
|
2581 indx.13 lbsr mvchr007 Add '>'
|
|
2582 lbsr getbyte2 Get next 2 bytes
|
|
2583 lbsr reladr.2 Calculate relative address label
|
|
2584 bra indx030 Add ',pcr'
|
|
2585
|
|
2586 * Extended indirect
|
|
2587 indx.14 lbsr mvchr007 Add '>'
|
|
2588 lbsr mvchr005 Add '$'
|
|
2589 lbsr getbyte2 Get next 2 bytes
|
|
2590 lbsr merghex2 Append hex version of 16 bit #
|
|
2591 bra indx040 Continue
|
|
2592 * W modes (<register=w and <indirct flag is set)
|
|
2593 indx.Wm ldb <byte Get original byte again
|
|
2594 andb #%01100000 Mask out all but W mode settings
|
|
2595 cmpb #%00000000 Straight register?
|
|
2596 beq indx010 Yes, do it
|
|
2597 cmpb #%00100000 mmmm,W?
|
|
2598 lbeq indx.4 Go do that
|
|
2599 cmpb #%01000000 ,W++?
|
|
2600 beq indx.9 Do that
|
|
2601 bra indx.11 Must be ,--W
|
|
2602 * Illegal indexing mode
|
|
2603 indx.15 leay badindx,pcr Point to '?'
|
|
2604 ldb #5 Add 5 of them
|
|
2605 lbsr mergline
|
|
2606 bra indx040 Continue
|
|
2607
|
|
2608 indx010 lbsr isub010 Add ',R'
|
|
2609 bra indx040 Continue
|
|
2610
|
|
2611 indx030 leay line220,pc Add ',pcr'
|
|
2612 ldb #ln220sz
|
|
2613 lbsr mergline
|
|
2614
|
|
2615 indx040 tst <indirct Is it an indirect mode?
|
|
2616 beq indx041 No, skip ahead
|
|
2617 lbsr mvchr002 Add ']'
|
|
2618 indx041 lda <register Get register name
|
|
2619 cmpa #'u U register offset?
|
|
2620 bne indx090 No, skip ahead
|
|
2621 tst <u.opt User wants uxxxx?
|
|
2622 bne indx090 No, skip
|
|
2623 ldd <dsave get the offset
|
|
2624 cmpd <size is it > total data size ???
|
|
2625 bhi indx090 yes..skip this stuff
|
|
2626 leax holdline+15,u start of mnemonic
|
|
2627 * Calculating 'uxxxx' info
|
|
2628 indx042 lda ,x+
|
|
2629 cmpa #'u done??
|
|
2630 beq indx090 yes..go send line as is
|
|
2631 cmpa #'$
|
|
2632 bne indx042
|
|
2633 lda #'u
|
|
2634 sta -1,x
|
|
2635 lda 2,x
|
|
2636 cmpa #',
|
|
2637 bne indx046
|
|
2638 stx <xsave
|
|
2639 ldx <lineadr
|
|
2640 leax 1,x
|
|
2641 indx044 lda ,-x
|
|
2642 sta 2,x
|
|
2643 cmpx <xsave
|
|
2644 bne indx044
|
|
2645 ldd #$3030
|
|
2646 std ,x
|
|
2647 ldx <lineadr
|
|
2648 leax 2,x
|
|
2649 stx <lineadr
|
|
2650
|
|
2651 * put the offset in u table
|
|
2652 indx046 tst <pass
|
|
2653 bne indx090
|
|
2654 ldd <dsave get the u offset
|
|
2655 ldx <highadr start of u table
|
|
2656 leax -2,x back off for loop increment
|
|
2657 indx050 leax 2,x
|
|
2658 cmpd ,x
|
|
2659 beq indx090
|
|
2660 bhi indx050 if >,go loop
|
|
2661 leax -2,x this is where to insert it
|
|
2662 stx <xsave
|
|
2663 ldx <highadr
|
|
2664 leax -2,x
|
|
2665 stx <highadr
|
|
2666 cmpx <labladr
|
|
2667 lbls rladr2.3
|
|
2668 indx052 ldd 2,x
|
|
2669 std ,x
|
|
2670 leax 2,x
|
|
2671 cmpx <xsave
|
|
2672 bne indx052
|
|
2673 ldd <dsave
|
|
2674 std ,x
|
|
2675
|
|
2676 indx090 tst <bitcom We a bit operation and need to RTS?
|
|
2677 beq notbit No, write line & exit
|
|
2678 rts
|
|
2679 notbit lbsr writline Send the line out
|
|
2680 lbra readbyte and continue
|
|
2681
|
|
2682 isub010 lbsr mvchr003 Add ','
|
|
2683 bra isub025 skip ahead
|
|
2684 isub020 lbsr mvchr009 Add '-'
|
|
2685 isub025 lda <register Get register name
|
|
2686 lbsr movechar Add it too
|
|
2687 rts
|
|
2688
|
|
2689 chk.f7 equ *
|
|
2690 * inherent addr - 1 byte
|
|
2691 * (used for psh and pul only)
|
|
2692 lbsr getbyte
|
|
2693 lda #$80
|
|
2694 sta <testbyte
|
|
2695 lda #8
|
|
2696 leay stackreg,pcr
|
|
2697 f7.010 pshs a
|
|
2698 ldx ,y++
|
|
2699 ldb <byte
|
|
2700 andb <testbyte
|
|
2701 beq f7.020
|
|
2702 tfr x,d
|
|
2703 lbsr movereg
|
|
2704 lbsr mvchr003
|
|
2705 f7.020 lda <testbyte
|
|
2706 lsra
|
|
2707 sta <testbyte
|
|
2708 puls a
|
|
2709 deca
|
|
2710 bne f7.010
|
|
2711 ldx <lineadr
|
|
2712 leax -1,x
|
|
2713 stx <lineadr
|
|
2714 lbra chk.fd
|
|
2715
|
|
2716 chk.f6 lbsr getbyte Get 1 byte
|
|
2717 clra Make into D
|
|
2718 lbsr merghex Add hex value to output
|
|
2719 lbra chk.fd continue
|
|
2720
|
|
2721 chk.f5 lbsr writline Write line out
|
|
2722 lbsr getbyte Get byte
|
|
2723 lbsr fcbline Make fcb line
|
|
2724 lbra readbyte continue?
|
|
2725
|
|
2726 * extended addr - 2 bytes
|
|
2727 chk.f4 lbsr mvchr007 Add '>'
|
|
2728 lbsr mvchr005 Add '$'
|
|
2729 f4.010 lbsr getbyte2 Get 2 bytes
|
|
2730 lbsr merghex2 Print 4 digit hex value
|
|
2731 lbra chk.fd continue
|
|
2732
|
|
2733 * immediate addr - 2 bytes
|
|
2734 chk.f3 lbsr mvchr004 Add '#'
|
|
2735 lbsr mvchr005 Add '$'
|
|
2736 bra f4.010 Add 4 digit hex value & leave
|
|
2737
|
|
2738 * immediate mode - 4 bytes
|
|
2739 chk.f2 lbsr mvchr004 Add '#'
|
|
2740 lbsr mvchr005 Add '$'
|
|
2741 lbsr getbyte2 Get 2 bytes
|
|
2742 lbsr merghex2 Print 4 hex digits
|
|
2743 bra f4.010 Print next 4 digits & continue
|
|
2744
|
|
2745 * in memory mode (AIM, etc.) (opcode s/b in <testbyte)
|
|
2746 chk.f1 lbsr mvchr004 Add '#'
|
|
2747 lbsr mvchr005 Add '$'
|
|
2748 lbsr getbyte Get the 1 byte immediate value
|
|
2749 lbsr merghex Add it to output
|
|
2750 lbsr mvchr003 Add ','
|
|
2751 ldb <testbyte Get back original opcode
|
|
2752 andb #%11110000 Mask out all but mode nibble
|
|
2753 lbeq chk.ff If Direct page mode, do that
|
|
2754 cmpb #%01100000 Indexed?
|
|
2755 lbeq chk.f8 Yes, do it
|
|
2756 cmpb #%01110000 Extended?
|
|
2757 beq chk.f4 yes, do it
|
|
2758 lbsr mvchr010 Unknown, add '?'
|
|
2759 lbra chk.fd & exit
|
|
2760 * Bit commands (LDBT, etc.)
|
|
2761 chk.f0 lbsr getbyte Get register/bit flags
|
|
2762 andb #%11000000 Mask out all but register bits
|
|
2763 beq iscc If CC, do that
|
|
2764 cmpb #%01000000 A?
|
|
2765 bne tryb No, try B
|
|
2766 ldd #'a*256+32 Add 'a '
|
|
2767 bra gotregn
|
|
2768 tryb cmpb #%10000000 B?
|
|
2769 bne illeg No, illegal register name
|
|
2770 ldd #'b*256+32 Add 'b '
|
|
2771 bra gotregn
|
|
2772 illeg ldd #'?*256+'? Add '??'
|
|
2773 bra gotregn
|
|
2774 iscc ldd #'c*256+'c cc register
|
|
2775 gotregn lbsr movereg Add register name
|
|
2776 lbsr mvchr011 Add '.'
|
|
2777 ldb <byte Get original byte again
|
|
2778 andb #%00000111 Mask out all but register bit #
|
|
2779 bsr getbit Get Bit #
|
|
2780 lbsr movechar Add it to output
|
|
2781 lbsr mvchr003 Add ',
|
|
2782 ldb <byte Get original byte again
|
|
2783 andb #%00111000 Mask out all but memory bit #
|
|
2784 lsrb Shift for subroutine
|
|
2785 lsrb
|
|
2786 lsrb
|
|
2787 bsr getbit Get ASCII value for memory bit #
|
|
2788 pshs a Preserve until DP part is done
|
|
2789 inc <bitcom Set bit command flag
|
|
2790 * Dupe of direct page stuff
|
|
2791 leay line080,pc Point to '<u'
|
|
2792 tst <u.opt User wants Symbolic labels?
|
|
2793 beq f0.010 Yes, do so
|
|
2794 leay line085,pcr No, use <$00xx instead
|
|
2795 f0.010 ldb #2 In both cases, 2 chars to merge
|
|
2796 lbsr mergline Merge onto current output line
|
|
2797 lbsr getbyte Get direct page address byte
|
|
2798 clra Make for 4 digit hex number
|
|
2799 lbsr merghex2 Merge 4 digit hex result onto output line
|
|
2800 tst <u.opt Direct page currently @ 0?
|
|
2801 bne nou No, skip u stuff
|
|
2802 lbsr indx046 put address in u table & write out line
|
|
2803 nou lbsr mvchr011 Add '.'
|
|
2804 puls a Get back memory bit #
|
|
2805 lbsr movechar Add it to output
|
|
2806 lbra chk.fd Write it out & continue
|
|
2807
|
|
2808 * Create ASCII of bit #
|
|
2809 getbit lda #'0 Bit # to 0
|
|
2810 pshs b Put bit # onto stack
|
|
2811 adda ,s+ Add to ASCII base
|
|
2812 rts
|
|
2813
|
|
2814 * 8 bit relative offset (bra)
|
|
2815 reladr.1 lda #'L Add 'L'
|
|
2816 lbsr movechar
|
|
2817 clra D=8 bit relative address offset
|
|
2818 ldb <byte
|
|
2819 addd <address Add to current address pointer
|
|
2820 addd #1 Adjust for current instruction
|
|
2821 pshs a
|
|
2822 lda <byte
|
|
2823 cmpa #$7f Negative offset?
|
|
2824 puls a
|
|
2825 bls rladr2.1 No, skip ahead
|
|
2826 subd #$0100 Calculate negative offset
|
|
2827 bra rladr2.1
|
|
2828 * 16 bit relative offset (bra)
|
|
2829 reladr.2 pshs a
|
|
2830 lda #'L
|
|
2831 lbsr movechar
|
|
2832 puls a
|
|
2833 addd <address
|
|
2834 addd #1
|
|
2835 rladr2.1 tst <pass
|
|
2836 bne rladr2.4
|
|
2837 leay labeltab,u
|
|
2838 rladr2.2 cmpd ,y
|
|
2839 beq rladr2.4
|
|
2840 leay 2,y
|
|
2841 cmpy <labladr
|
|
2842 blo rladr2.2
|
|
2843 ldx <labladr
|
|
2844 std ,x++
|
|
2845 stx <labladr
|
|
2846 leax 2,x
|
|
2847 cmpx <highadr
|
|
2848 blo rladr2.4
|
|
2849 rladr2.3 leax line240,pcr Error:symbol table full
|
|
2850 ldy #ln240sz
|
|
2851 lda #2
|
|
2852 os9 i$writln
|
|
2853 lbra unlink
|
|
2854 rladr2.4 lbsr merghex2 Add 4 hex digits & return
|
|
2855 rts
|
|
2856
|
|
2857 endit lds <stackhld restore stack
|
|
2858 endit010 tst <pass
|
|
2859 bne endit020
|
|
2860 * ldx <highadr
|
|
2861 * ldd <utabend
|
|
2862 * subd <highadr
|
|
2863 * tfr d,y
|
|
2864 * lda #2
|
|
2865 * os9 i$write
|
|
2866 * lbcs exit
|
|
2867 * lbra clrexit
|
|
2868 endit015 inc <pass
|
|
2869 lbsr close
|
|
2870 lbra restart
|
|
2871 endit020 ldb <readcnt
|
|
2872 beq endit024
|
|
2873 inc <readclr
|
|
2874 clra
|
|
2875 std <temp
|
|
2876 ldd <address
|
|
2877 subd <temp
|
|
2878 std <address
|
|
2879 leax readbuff,u
|
|
2880 endit022 ldb ,x+
|
|
2881 stx <readpos
|
|
2882 stb <byte
|
|
2883 lbsr fcbline
|
|
2884 ldd <address
|
|
2885 addd #1
|
|
2886 std <address
|
|
2887 ldx <readpos
|
|
2888 dec <readcnt
|
|
2889 bne endit022
|
|
2890 endit024 tst <z.opt
|
|
2891 lbne clrexit
|
|
2892 clr <readclr
|
|
2893 lbsr clrline
|
|
2894 lbsr adrmove
|
|
2895 ldx #$ffff
|
|
2896 stx <modend
|
|
2897 lbsr getbyte
|
|
2898 lbsr getbyte
|
|
2899 lbsr getbyte
|
|
2900 leay line170,pcr
|
|
2901 ldb #ln170sz
|
|
2902 lbsr mergline
|
|
2903 lbsr writline
|
|
2904 lbsr adrmove
|
|
2905 leay line180,pcr
|
|
2906 ldb #ln180sz
|
|
2907 lbsr mergline
|
|
2908 lbsr writline
|
|
2909 lbsr moveadr
|
|
2910 leax holdline,u
|
|
2911 lda ,x
|
|
2912 cmpa #$20
|
|
2913 beq endit030
|
|
2914 leay line190,pcr
|
|
2915 ldb #ln190sz
|
|
2916 lbsr mergline
|
|
2917 lbsr writline
|
|
2918 endit030 bsr close
|
|
2919
|
|
2920 ifeq testing-1
|
|
2921 lbsr clrline
|
|
2922 lda #$20
|
|
2923 lbsr movechar
|
|
2924 lbsr writline
|
|
2925 leay labeltab,u
|
|
2926 endit040 ldd ,y++
|
|
2927 pshs y
|
|
2928 lda #'*
|
|
2929 lbsr movechar
|
|
2930 lda #$20
|
|
2931 lbsr movechar
|
|
2932 lbsr merghex2
|
|
2933 lbsr writline
|
|
2934 puls y
|
|
2935 cmpy <labladr
|
|
2936 bls endit040
|
|
2937 leay line230,pcr
|
|
2938 ldb #ln230sz
|
|
2939 lbsr mergline
|
|
2940 ldd <labladr
|
|
2941 leax labeltab,u
|
|
2942 stx <labladr
|
|
2943 subd <labladr
|
|
2944 lsra
|
|
2945 rorb
|
|
2946 lbsr merghex2
|
|
2947 lbsr writline
|
|
2948 endc
|
|
2949
|
|
2950 tst <diskio
|
|
2951 lbne clrexit
|
|
2952 lda #2
|
|
2953 sta <byte
|
|
2954
|
|
2955 unlink ldu <modadr
|
|
2956 os9 f$unlink
|
|
2957 lbcs exit
|
|
2958 dec <byte
|
|
2959 bne unlink
|
|
2960 lbra clrexit
|
|
2961
|
|
2962 close tst <diskio
|
|
2963 beq close010
|
|
2964 lda <path
|
|
2965 os9 i$close
|
|
2966 lbcs exit
|
|
2967 close010 rts
|
|
2968
|
|
2969
|
|
2970 pag
|
|
2971 *
|
|
2972 ******************** descriptor processing ***************************
|
|
2973 descrhdr lbsr getbyte2
|
|
2974 std <mgradr
|
|
2975 lbsr getbyte2
|
|
2976 std <drvadr
|
|
2977 lbsr clrline
|
|
2978 lbsr getbyte
|
|
2979 lbsr fcbline
|
|
2980 leay line340,pcr
|
|
2981 ldb #ln340sz
|
|
2982 lbsr mergline
|
|
2983 lbsr writline
|
|
2984 lbsr getbyte
|
|
2985 lbsr fcbline
|
|
2986 leay line350,pcr
|
|
2987 ldb #ln350sz
|
|
2988 lbsr mergline
|
|
2989 lbsr writline
|
|
2990 lbsr getbyte2
|
|
2991 lbsr fdbline
|
|
2992 leay line360,pcr
|
|
2993 ldb #ln360sz
|
|
2994 lbsr mergline
|
|
2995 lbsr writline
|
|
2996 lbsr getbyte
|
|
2997 lbsr moveadr
|
|
2998 clra
|
|
2999 ldb <byte
|
|
3000 addd <address
|
|
3001 addd #1
|
|
3002 std <initsize
|
|
3003 leay line380,pcr
|
|
3004 ldb #ln380sz
|
|
3005 lbsr mergline
|
|
3006 lbsr writline
|
|
3007 lbsr getbyte
|
|
3008 stb <desctype
|
|
3009 lbsr fcbline
|
|
3010 leay line390,pcr
|
|
3011 ldb #ln390sz
|
|
3012 lbsr mergline
|
|
3013 lbsr writline
|
|
3014 leax scfprint,pcr
|
|
3015 stx <printadr
|
|
3016 lda <desctype
|
|
3017 cmpa #1
|
|
3018 bne getdescr
|
|
3019 leax rbfprint,pcr
|
|
3020 stx <printadr
|
|
3021 getdescr ldx <printadr
|
|
3022 lda ,x+
|
|
3023 pshs x
|
|
3024 cmpa #'2
|
|
3025 lbeq descr2
|
|
3026 cmpa #'3
|
|
3027 lbeq descr3
|
|
3028 lbsr getbyte
|
|
3029 ldd <address
|
|
3030 cmpd <initsize
|
|
3031 bne desc010
|
|
3032 lbsr clrline
|
|
3033 lbsr adrmove
|
|
3034 leay line400,pcr
|
|
3035 ldb #ln400sz
|
|
3036 lbsr mergline
|
|
3037 lbsr writline
|
|
3038 desc010 ldd <address
|
|
3039 cmpd <nameadr
|
|
3040 bne desc015
|
|
3041 leay line100,pcr
|
|
3042 ldb #ln100sz
|
|
3043 leax holdname,u
|
|
3044 bra desc030
|
|
3045 desc015 cmpd <mgradr
|
|
3046 bne desc020
|
|
3047 leay line410,pcr
|
|
3048 ldb #ln410sz
|
|
3049 leax namehold,u
|
|
3050 bra desc030
|
|
3051 desc020 cmpd <drvadr
|
|
3052 bne desc040
|
|
3053 leay line420,pcr
|
|
3054 ldb #ln420sz
|
|
3055 leax namehold,u
|
|
3056 desc030 pshs x
|
|
3057 pshs b
|
|
3058 leax holdobj,u
|
|
3059 ldd #$2020
|
|
3060 std ,x++
|
|
3061 std ,x++
|
|
3062 std ,x++
|
|
3063 std ,x++
|
|
3064 puls b
|
|
3065 lbsr mergline
|
|
3066 lbsr adrmove
|
|
3067 lbsr writline
|
|
3068 puls y
|
|
3069 lbsr movename
|
|
3070 lbsr getbyte
|
|
3071 puls x
|
|
3072 leax scfpend,pcr
|
|
3073 leax 1,x
|
|
3074 pshs x
|
|
3075 stx <printadr
|
|
3076 bra desc010
|
|
3077 desc040 lbsr fcbline
|
|
3078 bra mergdesc
|
|
3079 descr2 lbsr getbyte2
|
|
3080 lbsr fdbline
|
|
3081 bra mergdesc
|
|
3082 * descriptor name copy
|
|
3083 descr3 stx <printadr
|
|
3084 lbsr getbyte2
|
|
3085 lbsr moveadr
|
|
3086 leay line430,pcr
|
|
3087 ldb #ln430sz
|
|
3088 lbsr mergline
|
|
3089 lbsr writline
|
|
3090 lbra getdescr
|
|
3091
|
|
3092 mergdesc clrb
|
|
3093 puls x
|
|
3094 pshs x
|
|
3095 desc050 lda ,x+
|
|
3096 cmpa #$0d
|
|
3097 beq desc060
|
|
3098 incb
|
|
3099 bra desc050
|
|
3100 desc060 stx <printadr
|
|
3101 leax -2,x
|
|
3102 lda ,x
|
|
3103 cmpa #'?
|
|
3104 bne desc070
|
|
3105 leax -1,x
|
|
3106 stx <printadr
|
|
3107 desc070 puls y
|
|
3108 lbsr mergline
|
|
3109 lbsr writline
|
|
3110 lbra getdescr
|
|
3111
|
|
3112 **********************************************************************
|
|
3113 *######################################################################
|
|
3114 * subroutines
|
|
3115 *######################################################################
|
|
3116
|
|
3117
|
|
3118 ***********************************************************************
|
|
3119 * *
|
|
3120 * U$hexin - converts hex characters to binary digits *
|
|
3121 * *
|
|
3122 * Entry: x=start address of digits to convert *
|
|
3123 * *
|
|
3124 * Exit: x=same as entry *
|
|
3125 * y=# of converted bytes *
|
|
3126 * *
|
|
3127 ***********************************************************************
|
|
3128
|
|
3129 u$hexin pshs a,b
|
|
3130 pshs x
|
|
3131 leay ,x move start addr for scan
|
|
3132 hexin010 bsr hexin030 convert bytes
|
|
3133 bcs hexin020 exit if done
|
|
3134 stb ,x+ move the converted byte in
|
|
3135 bra hexin010 go back & get more
|
|
3136 hexin020 tfr x,d get current byte position
|
|
3137 subd ,s subtract start position
|
|
3138 tfr d,y move the length of the string
|
|
3139 puls x
|
|
3140 puls a,b,pc done
|
|
3141
|
|
3142 hexin030 ldb ,y+ get char
|
|
3143 cmpb #', was it a comma??
|
|
3144 bne hexin050 no..don't skip it
|
|
3145 hexin040 ldb ,y+ get next char
|
|
3146 hexin050 cmpb #$20 was it a space
|
|
3147 beq hexin040 yes...skip it & get next char
|
|
3148 leay -$01,y else back up to point to the char
|
|
3149 bsr hexin080 convert it
|
|
3150 bcs hexin070 done....exit
|
|
3151 pshs b save the byte
|
|
3152 bsr hexin080 convert next byte
|
|
3153 bcs hexin060 exit if done
|
|
3154 asl ,s shift saved char to put in high 4 bits
|
|
3155 asl ,s
|
|
3156 asl ,s
|
|
3157 asl ,s
|
|
3158 addb ,s and move in low 4 bits
|
|
3159 stb ,s save the byte
|
|
3160 hexin060 clrb clear the carry flag
|
|
3161 puls b restore the saved flag
|
|
3162 hexin070 rts return
|
|
3163
|
|
3164 hexin080 ldb ,y get the char in
|
|
3165 subb #$30 subtract bias for numbers
|
|
3166 cmpb #$09 was it > 9
|
|
3167 bls hexin100 no...its good
|
|
3168 cmpb #$31 was it 'a'
|
|
3169 blo hexin090 if less than that..skip next
|
|
3170 subb #$20 else make it upper case
|
|
3171 hexin090 subb #$07 back off so 'A' = $0a
|
|
3172 cmpb #$0F check if it was a 'F'
|
|
3173 bhi hexin110 if >...error
|
|
3174 cmpb #$0A was it a 'A'
|
|
3175 bcs hexin110 if <...error
|
|
3176 hexin100 andcc #$FE clear carry bit of cc
|
|
3177 leay $01,y bump up pointer for next char
|
|
3178 rts return
|
|
3179 hexin110 comb set carry flag
|
|
3180 rts return
|
|
3181
|
|
3182
|
|
3183 *
|
|
3184 * convert bytes in d to hex, output to hexstrng
|
|
3185 *
|
|
3186 gethex std <dsave
|
|
3187 pshs y
|
|
3188 leay hexstrng,u
|
|
3189 pshs b
|
|
3190 bsr gethx010
|
|
3191 puls a
|
|
3192 bsr gethx010
|
|
3193 puls y,pc
|
|
3194 gethx010 pshs a
|
|
3195 lsra
|
|
3196 lsra
|
|
3197 lsra
|
|
3198 lsra
|
|
3199 bsr gethx020
|
|
3200 puls a
|
|
3201 anda #$0f
|
|
3202 bsr gethx020
|
|
3203 rts
|
|
3204 gethx020 adda #$30
|
|
3205 cmpa #$3a
|
|
3206 blt gethx030
|
|
3207 adda #$07
|
|
3208 gethx030 sta ,y+
|
|
3209 rts
|
|
3210
|
|
3211 *
|
|
3212 * get decimal value of bytes id d ,output in string pointed at by 'y'
|
|
3213 *
|
|
3214 getdec pshs x
|
|
3215 ldx #10000
|
|
3216 bsr getdc010
|
|
3217 ldx #01000
|
|
3218 bsr getdc010
|
|
3219 ldx #00100
|
|
3220 bsr getdc010
|
|
3221 ldx #00010
|
|
3222 bsr getdc010
|
|
3223 stb <counter
|
|
3224 bsr getdc030
|
|
3225 puls x,pc
|
|
3226 getdc010 stx <countdec
|
|
3227 clr <counter
|
|
3228 getdc020 cmpd <countdec
|
|
3229 blo getdc030
|
|
3230 subd <countdec
|
|
3231 inc <counter
|
|
3232 bra getdc020
|
|
3233 getdc030 pshs b
|
|
3234 ldb <counter
|
|
3235 addb #$30
|
|
3236 stb ,y+
|
|
3237 puls b,pc
|
|
3238
|
|
3239 *
|
|
3240 * read next 2 bytes into 'd'
|
|
3241 *
|
|
3242 getbyte2 bsr getbyte
|
|
3243 tfr b,a
|
|
3244 bsr getbyte
|
|
3245 rts
|
|
3246
|
|
3247 *
|
|
3248 * merge last 2 bytes of hexstrng with output line
|
|
3249 *
|
|
3250 merghex equ *
|
|
3251 clra
|
|
3252 bsr gethex
|
|
3253 leay hexstrng,u
|
|
3254 leay 2,y
|
|
3255 ldb #2
|
|
3256 lbsr mergline
|
|
3257 rts
|
|
3258
|
|
3259 *
|
|
3260 * merge all 4 hex chars to output line
|
|
3261 *
|
|
3262 merghex2 bsr gethex
|
|
3263 leay hexstrng,u
|
|
3264 ldb #4
|
|
3265 lbsr mergline
|
|
3266 rts
|
|
3267
|
|
3268
|
|
3269 *
|
|
3270 * merge significant decimal characters
|
|
3271 *
|
|
3272 mergdec pshs a,b
|
|
3273 leay decstrng,u
|
|
3274 lda #$30
|
|
3275 sta ,y
|
|
3276 puls a,b
|
|
3277 cmpd #0
|
|
3278 bne mergd010
|
|
3279 ldb #1
|
|
3280 lbra mergline
|
|
3281 mergd010 bsr getdec
|
|
3282 leay decstrng,u
|
|
3283 ldb #6
|
|
3284 chkdecln decb
|
|
3285 lda ,y+
|
|
3286 cmpa #$30
|
|
3287 beq chkdecln
|
|
3288 leay -1,y
|
|
3289 lbra mergline
|
|
3290
|
|
3291 *
|
|
3292 * read 1 byte
|
|
3293 *
|
|
3294 getbyte pshs x,y,a
|
|
3295 ldx <address
|
|
3296 leax 1,x
|
|
3297 stx <address
|
|
3298 leax 3,x
|
|
3299 cmpx <modend
|
|
3300 lbhs endit
|
|
3301 tst <diskio
|
|
3302 bne getdisk
|
|
3303 ldx <crntadr
|
|
3304 leax 1,x
|
|
3305 stx <crntadr
|
|
3306 ldb ,x
|
|
3307 stb <byte
|
|
3308 bra gotbyte
|
|
3309 *
|
|
3310 * read byte from disk
|
|
3311 *
|
|
3312 getdisk leax byte,u
|
|
3313 ldy #1
|
|
3314 lda <path
|
|
3315 os9 i$read
|
|
3316 lbcs endit
|
|
3317 ldb <byte
|
|
3318 gotbyte lda <byte
|
|
3319 bsr moveobj
|
|
3320 ldb <byte
|
|
3321 ldx <readpos
|
|
3322 stb ,x+
|
|
3323 stx <readpos
|
|
3324 inc <readcnt
|
|
3325 puls x,y,a,pc
|
|
3326
|
|
3327 *
|
|
3328 * convert 'a' to hex,merge with object code listing
|
|
3329 *
|
|
3330 moveobj pshs x,y,b
|
|
3331 ldb <objcnt
|
|
3332 cmpb #4
|
|
3333 bhs moverts
|
|
3334 inc <objcnt
|
|
3335 lbsr gethex
|
|
3336 ldx <objadr
|
|
3337 leay hexstrng,u
|
|
3338 lda ,y+
|
|
3339 lbsr getupc
|
|
3340 sta ,x+
|
|
3341 lda ,y
|
|
3342 lbsr getupc
|
|
3343 sta ,x+
|
|
3344 stx <objadr
|
|
3345 moverts puls x,y,b,pc
|
|
3346
|
|
3347 *
|
|
3348 * clear one of the hold strings pointed to by 'y'
|
|
3349 *
|
|
3350 clrhld sty <lineadr
|
|
3351 pshs x,b
|
|
3352 tfr y,x
|
|
3353 leay line040,pcr
|
|
3354 ldb #40
|
|
3355 bsr merge
|
|
3356 ldy <lineadr
|
|
3357 puls x,b,pc
|
|
3358
|
|
3359 *
|
|
3360 * clear all parts of the output line
|
|
3361 *
|
|
3362 clrline pshs x,y,a,b
|
|
3363 leax holdline,u
|
|
3364 stx <lineadr
|
|
3365 leax holdobj,u
|
|
3366 stx <objadr
|
|
3367 leax linenum,u
|
|
3368 clr <objcnt
|
|
3369 leay line040,pcr
|
|
3370 ldb #80
|
|
3371 bsr merge
|
|
3372 puls x,y,a,b,pc
|
|
3373
|
|
3374 *
|
|
3375 * merge the string pointed to by 'y' with the current line
|
|
3376 *
|
|
3377 mergline ldx <lineadr
|
|
3378 bsr merge
|
|
3379 stx <lineadr
|
|
3380 rts
|
|
3381
|
|
3382 *
|
|
3383 * merge the sring pointed to by 'y' with the string pointed to by 'x'
|
|
3384 *
|
|
3385 merge pshs a
|
|
3386 merge010 lda ,y+
|
|
3387 sta ,x+
|
|
3388 decb
|
|
3389 bne merge010
|
|
3390 puls a,pc
|
|
3391
|
|
3392 *
|
|
3393 * write the output line to standard output path,then clear line
|
|
3394 *
|
|
3395 writline pshs x,y
|
|
3396 tst <pass
|
|
3397 beq wrtln010
|
|
3398 ldd <numline
|
|
3399 addd #1
|
|
3400 std <numline
|
|
3401 leay linenum,u
|
|
3402 lbsr getdec
|
|
3403 ldx <lineadr
|
|
3404 lda #$0d
|
|
3405 sta ,x+
|
|
3406 tfr x,d
|
|
3407 leax linenum,u
|
|
3408 tst <o.opt
|
|
3409 bne wrtln005
|
|
3410 leax holdline,u
|
|
3411 wrtln005 stx <temp
|
|
3412 subd <temp
|
|
3413 tfr d,y
|
|
3414 lbsr send
|
|
3415 wrtln010 bsr clrline
|
|
3416 tst <readclr
|
|
3417 bne wrtln020
|
|
3418 leax readbuff,u
|
|
3419 stx <readpos
|
|
3420 clr <readcnt
|
|
3421 wrtln020 puls x,y,pc
|
|
3422 *
|
|
3423 * move the current address to holdadr of output line
|
|
3424 *
|
|
3425 adrmove pshs x
|
|
3426 ldd <address
|
|
3427 lbsr gethex
|
|
3428 leax hexstrng,u
|
|
3429 leay holdadr,u
|
|
3430 ldb #4
|
|
3431 adrmv010 lda ,x+
|
|
3432 lbsr getupc
|
|
3433 sta ,y+
|
|
3434 decb
|
|
3435 bne adrmv010
|
|
3436 puls x,pc
|
|
3437
|
|
3438 *
|
|
3439 * move the current address if its second pass and its a referenced address
|
|
3440 *
|
|
3441 moveadr tst <pass
|
|
3442 beq mvadr020
|
|
3443 bsr adrmove
|
|
3444 leay labeltab,u
|
|
3445 ldd <address
|
|
3446 mvadr010 cmpy <labladr
|
|
3447 beq mvadr020
|
|
3448 cmpd ,y
|
|
3449 beq mvadr030
|
|
3450 leay 2,y
|
|
3451 bra mvadr010
|
|
3452 mvadr020 leay line040,pcr
|
|
3453 ldb #9
|
|
3454 lbsr mergline
|
|
3455 rts
|
|
3456 mvadr030 lda #'L
|
|
3457 bsr movechar
|
|
3458 ldd <address
|
|
3459 lbsr merghex2
|
|
3460 leay line040,pcr
|
|
3461 ldb #4
|
|
3462 lbsr mergline
|
|
3463 rts
|
|
3464
|
|
3465 *
|
|
3466 * merge the char in 'a' with the output line
|
|
3467 *
|
|
3468 movechar ldx <lineadr
|
|
3469 sta ,x+
|
|
3470 stx <lineadr
|
|
3471 rts
|
|
3472
|
|
3473 *
|
|
3474 * merge predefined characters with the output line
|
|
3475 *
|
|
3476 mvchr001 lda #'[
|
|
3477 bra mvchr999
|
|
3478 mvchr002 lda #']
|
|
3479 bra mvchr999
|
|
3480 mvchr003 lda #',
|
|
3481 bra mvchr999
|
|
3482 mvchr004 lda #'#
|
|
3483 bra mvchr999
|
|
3484 mvchr005 lda #'$
|
|
3485 bra mvchr999
|
|
3486 mvchr006 lda #'<
|
|
3487 bra mvchr999
|
|
3488 mvchr007 lda #'>
|
|
3489 bra mvchr999
|
|
3490 mvchr008 lda #'+
|
|
3491 bra mvchr999
|
|
3492 mvchr009 lda #'-
|
|
3493 bra mvchr999
|
|
3494 mvchr010 lda #'?
|
|
3495 bra mvchr999
|
|
3496 mvchr011 lda #'.
|
|
3497 bra mvchr999
|
|
3498
|
|
3499 mvchr999 bsr movechar
|
|
3500 rts
|
|
3501
|
|
3502 movename pshs y
|
|
3503 lbsr clrline
|
|
3504 bsr moveadr
|
|
3505 leay line060,pcr
|
|
3506 ldb #ln060sz
|
|
3507 lbsr mergline
|
|
3508 ldb <byte
|
|
3509 tfr b,a
|
|
3510 lbsr moveobj
|
|
3511 puls y
|
|
3512 getnm010 cmpb #$80
|
|
3513 bhs getnm020
|
|
3514 stb ,y+
|
|
3515 tfr b,a
|
|
3516 bsr movechar
|
|
3517 lbsr getbyte
|
|
3518 bra getnm010
|
|
3519 getnm020 subb #$80
|
|
3520 stb ,y+
|
|
3521 tfr b,a
|
|
3522 bsr movechar
|
|
3523 ldb #$0d
|
|
3524 stb ,y
|
|
3525 lda #'/
|
|
3526 bsr movechar
|
|
3527 lbsr writline
|
|
3528 rts
|
|
3529 *
|
|
3530 * line type is fcb ...create all parts of fcb line
|
|
3531 *
|
|
3532 fcbline lbsr clrline
|
|
3533 lbsr moveadr
|
|
3534 leay line090,pcr
|
|
3535 ldb #ln090sz
|
|
3536 lbsr mergline
|
|
3537 ldb <byte
|
|
3538 lbsr merghex
|
|
3539 leay hexstrng,u
|
|
3540 leay 2,y
|
|
3541 pshs x
|
|
3542
|
|
3543 ldx <objadr
|
|
3544 lda ,y+
|
|
3545 sta ,x+
|
|
3546 lda ,y
|
|
3547 sta ,x+
|
|
3548 stx <objadr
|
|
3549 puls x
|
|
3550 lda #$20
|
|
3551 lbsr movechar
|
|
3552 tst <descript
|
|
3553 bne fcbl030
|
|
3554 lda <byte
|
|
3555 cmpa #$20
|
|
3556 bls fcbl020
|
|
3557 cmpa #'z
|
|
3558 bls fcbl010
|
|
3559 suba #$80
|
|
3560 cmpa #$20
|
|
3561 bls fcbl020
|
|
3562 cmpa #'z
|
|
3563 bgt fcbl020
|
|
3564 fcbl010 lbsr movechar
|
|
3565 fcbl020 lbsr writline
|
|
3566 fcbl030 rts
|
|
3567 fdbline pshs d
|
|
3568 lbsr clrline
|
|
3569 ldd <address
|
|
3570 pshs d
|
|
3571 subd #1
|
|
3572 std <address
|
|
3573 lbsr moveadr
|
|
3574 puls d
|
|
3575 std <address
|
|
3576 leay line370,pcr
|
|
3577 ldb #ln370sz
|
|
3578 lbsr mergline
|
|
3579 puls d
|
|
3580 lbsr merghex2
|
|
3581 leay hexstrng,u
|
|
3582 ldb #4
|
|
3583 pshs x
|
|
3584 ldx <objadr
|
|
3585 ldd ,y++
|
|
3586 std ,x++
|
|
3587 ldd ,y++
|
|
3588 std ,x++
|
|
3589 stx <objadr
|
|
3590 puls x
|
|
3591 lda #$20
|
|
3592 lbsr movechar
|
|
3593 rts
|
|
3594
|
|
3595
|
|
3596 *
|
|
3597 * convert 'a' to uppper case if its a letter
|
|
3598 *
|
|
3599 getupc cmpa #'z
|
|
3600 bls getup010
|
|
3601 anda #$df
|
|
3602 getup010 rts
|
|
3603
|
|
3604
|
|
3605 *
|
|
3606 * if its 2nd pass,write the line to standard output path
|
|
3607 *
|
|
3608 send tst <pass
|
|
3609 beq send010
|
|
3610 lda #1
|
|
3611 os9 i$writln
|
|
3612 lbcs exit
|
|
3613 send010 lbsr clrline
|
|
3614 rts
|
|
3615 ********* get op ******************
|
|
3616 * entry: opcode in a / a&b for 2 ops
|
|
3617 *
|
|
3618
|
|
3619 getop sta <testbyte
|
|
3620 tstb
|
|
3621 bne chkos9
|
|
3622 ldb #6
|
|
3623 mul
|
|
3624 leay optable,pcr
|
|
3625 leay d,y
|
|
3626 getrest leay 1,y
|
|
3627 lda ,y+
|
|
3628 tfr a,b
|
|
3629 pshs b
|
|
3630 ldb #5
|
|
3631 moveop lda ,y+
|
|
3632 lbsr movechar
|
|
3633 decb
|
|
3634 bne moveop
|
|
3635 pshs a
|
|
3636 lda #$20
|
|
3637 lbsr movechar
|
|
3638 puls a
|
|
3639 puls b,pc
|
|
3640
|
|
3641 chkos9 cmpb #$3f
|
|
3642 bne chk10
|
|
3643 leay line150,pcr
|
|
3644 ldb #ln150sz
|
|
3645 lbsr mergline
|
|
3646 cmpa #$80
|
|
3647 bhs i$os9
|
|
3648 cmpa #$54
|
|
3649 bhs bados9
|
|
3650 leay os9f$tab,pcr
|
|
3651 bra getos9
|
|
3652
|
|
3653 i$os9 cmpa #$91
|
|
3654 bhs bados9
|
|
3655 leay os9i$tab,pcr
|
|
3656 suba #$80
|
|
3657 bra getos9
|
|
3658 bados9 leay bados9op,pcr
|
|
3659 clra
|
|
3660 getos9 ldb #8
|
|
3661 mul
|
|
3662 leay d,y
|
|
3663 pshs b
|
|
3664 ldb #8
|
|
3665 bra moveop
|
|
3666
|
|
3667 chk10 sta <testbyte
|
|
3668 cmpb #$10
|
|
3669 beq load10
|
|
3670 cmpb #$11
|
|
3671 beq load11
|
|
3672 clr <testbyte
|
|
3673 load11 leay get11tab,pcr
|
|
3674 bra loop10
|
|
3675 load10 leay get10tab,pcr
|
|
3676 loop10 lda ,y
|
|
3677 tsta
|
|
3678 beq getrest
|
|
3679 cmpa <testbyte
|
|
3680 beq getrest
|
|
3681 leay 7,y
|
|
3682 bra loop10
|
|
3683
|
|
3684 nolink lbsr clrline
|
|
3685 leay line200,pcr
|
|
3686 ldb #ln200sz
|
|
3687 lbsr mergline
|
|
3688 ldy <xreghold
|
|
3689 ldb #$20
|
|
3690 lbsr mergline
|
|
3691 lda #$0d
|
|
3692 lbsr movechar
|
|
3693 leax holdline,u
|
|
3694 ldy #$50
|
|
3695
|
|
3696 *
|
|
3697 * error encountered - print error to standard error path
|
|
3698 *
|
|
3699 prterror lda #2
|
|
3700 os9 i$writln
|
|
3701 clrexit clrb
|
|
3702 exit os9 f$exit
|
|
3703
|
|
3704 emod
|
|
3705 eom equ *
|
|
3706 end
|
|
3707
|