OpenCores
URL https://opencores.org/ocsvn/rf6809/rf6809/trunk

Subversion Repositories rf6809

[/] [rf6809/] [trunk/] [software/] [boot/] [disassem.asm] - Blame information for rev 21

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 robfinch
; ============================================================================
2
;        __
3
;   \\__/ o\    (C) 2013-2022  Robert Finch, Waterloo
4
;    \  __ /    All rights reserved.
5
;     \/_//     robfinch@opencores.org
6
;       ||
7
;
8
;
9
; BSD 3-Clause License
10
; Redistribution and use in source and binary forms, with or without
11
; modification, are permitted provided that the following conditions are met:
12
;
13
; 1. Redistributions of source code must retain the above copyright notice, this
14
;    list of conditions and the following disclaimer.
15
;
16
; 2. Redistributions in binary form must reproduce the above copyright notice,
17
;    this list of conditions and the following disclaimer in the documentation
18
;    and/or other materials provided with the distribution.
19
;
20
; 3. Neither the name of the copyright holder nor the names of its
21
;    contributors may be used to endorse or promote products derived from
22
;    this software without specific prior written permission.
23
;
24
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25
; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26
; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28
; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29
; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30
; SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31
; CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32
; OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
;
35
; ============================================================================
36
;
37 15 robfinch
farflag EQU             $15F
38
asmbuf  EQU             $160    ; to $17F
39
CharOutVec      EQU             $800
40
CharInVec       EQU             $804
41
 
42 13 robfinch
; Disassembler
43
;
44
;
45
DIRECT  EQU     1
46
LSREL           EQU     2
47
IMMB            EQU     3
48
SREL            EQU     4
49
NDX                     EQU     5
50
EXT                     EQU     6
51
IMMW            EQU     7
52
FAREXT  EQU     8
53 14 robfinch
TFREXG  EQU     9
54 13 robfinch
 
55
distbl1:
56
        ; 00 to 0F
57
        fcb             "NEG ", DIRECT
58
        fcb             "    ", 0
59
        fcb             "    ", 0
60
        fcb             "COM ", DIRECT
61
        fcb             "LSR ", DIRECT
62
        fcb             "    ", 0
63
        fcb             "ROR ", DIRECT
64
        fcb             "ASR ", DIRECT
65
        fcb             "ASL ", DIRECT
66
        fcb             "ROL ", DIRECT
67
        fcb             "DEC ", DIRECT
68
        fcb             "    ", 0
69
        fcb             "INC ", DIRECT
70
        fcb             "TST ", DIRECT
71
        fcb             "JMP ", DIRECT
72
        fcb             "CLR ", DIRECT
73
 
74
        ; 10 to 1F
75
        fcb             "    ", 0
76
        fcb             "    ", 0
77
        fcb             "NOP ", 0
78
        fcb             "SYNC", 0
79
        fcb             "    ", 0
80
        fcb             "FAR ", 0
81
        fcb             "LBRA", LSREL
82
        fcb             "LBSR", LSREL
83
        fcb             "    ", 0
84
        fcb             "DAA ", 0
85
        fcb             "ORCC", IMMB
86
        fcb             "    ", 0
87
        fcb             "ANDC", IMMB
88
        fcb             "SEX ", 0
89 14 robfinch
        fcb             "EXG ", TFREXG
90
        fcb             "TFR ", TFREXG
91 13 robfinch
 
92
        ; 20 to 2F
93
        fcb             "BRA ", SREL
94
        fcb             "BRN ", SREL
95
        fcb             "BHI ", SREL
96
        fcb             "BLS ", SREL
97
        fcb             "BHS ", SREL
98
        fcb             "BLO ", SREL
99
        fcb             "BNE ", SREL
100
        fcb             "BEQ ", SREL
101
        fcb             "BVC ", SREL
102
        fcb             "BVS ", SREL
103
        fcb             "BPL ", SREL
104
        fcb             "BMI ", SREL
105
        fcb             "BGE ", SREL
106
        fcb             "BLT ", SREL
107
        fcb             "BGT ", SREL
108
        fcb             "BLE ", SREL
109
 
110
        ; 30 to 3F
111
        fcb             "LEAX", NDX
112
        fcb             "LEAY", NDX
113
        fcb             "LEAS", NDX
114
        fcb             "LEAU", NDX
115
        fcb             "PSHS", IMMB
116
        fcb             "PULS", IMMB
117
        fcb             "PSHU", IMMB
118
        fcb             "PULU", IMMB
119
        fcb             "RTF ", 0
120
        fcb             "RTS ", 0
121
        fcb             "ABX ", 0
122
        fcb             "RTI ", 0
123
        fcb             "CWAI", IMMB
124
        fcb             "MUL ", 0
125
        fcb             "    ", 0
126
        fcb             "SWI ", 0
127
 
128
        ; 40 to 4F
129
        fcb             "NEGA", 0
130
        fcb             "    ", 0
131
        fcb       "    ", 0
132
        fcb             "COMA", 0
133
        fcb             "LSRA", 0
134
        fcb             "    ", 0
135
        fcb             "RORA", 0
136
        fcb             "ASRA", 0
137
        fcb             "ASLA", 0
138
        fcb             "ROLA", 0
139
        fcb             "DECA", 0
140
        fcb             "    ", 0
141
        fcb             "INCA", 0
142
        fcb             "TSTA", 0
143
        fcb             "    ", 0
144
        fcb             "CLRA", 0
145
 
146
        ; 50 to 5F
147
        fcb             "NEGB", 0
148
        fcb             "    ", 0
149
        fcb       "    ", 0
150
        fcb             "COMB", 0
151
        fcb             "LSRB", 0
152
        fcb             "    ", 0
153
        fcb             "RORB", 0
154
        fcb             "ASRB", 0
155
        fcb             "ASLB", 0
156
        fcb             "ROLB", 0
157
        fcb             "DECB", 0
158
        fcb             "    ", 0
159
        fcb             "INCB", 0
160
        fcb             "TSTB", 0
161
        fcb             "    ", 0
162
        fcb             "CLRB", 0
163
 
164
        ; 60 to 6F
165
        fcb             "NEG ", NDX
166
        fcb             "    ", 0
167
        fcb       "    ", 0
168
        fcb             "COM ", NDX
169
        fcb             "LSR ", NDX
170
        fcb             "    ", 0
171
        fcb             "ROR ", NDX
172
        fcb             "ASR ", NDX
173
        fcb             "ASL ", NDX
174
        fcb             "ROL ", NDX
175
        fcb             "DEC ", NDX
176
        fcb             "    ", 0
177
        fcb             "INC ", NDX
178
        fcb             "TST ", NDX
179
        fcb             "JMP ", NDX
180
        fcb             "CLR ", NDX
181
 
182
        ; 70 to 7F
183
        fcb             "NEG ", EXT
184
        fcb             "    ", 0
185
        fcb       "    ", 0
186
        fcb             "COM ", EXT
187
        fcb             "LSR ", EXT
188
        fcb             "    ", 0
189
        fcb             "ROR ", EXT
190
        fcb             "ASR ", EXT
191
        fcb             "ASL ", EXT
192
        fcb             "ROL ", EXT
193
        fcb             "DEC ", EXT
194
        fcb             "    ", 0
195
        fcb             "INC ", EXT
196
        fcb             "TST ", EXT
197
        fcb             "JMP ", EXT
198
        fcb             "CLR ", EXT
199
 
200
        ; 80 to 8F
201
        fcb             "SUBA", IMMB
202
        fcb             "CMPA", IMMB
203
        fcb             "SBCA", IMMB
204
        fcb             "SUBD", IMMW
205
        fcb             "ANDA", IMMB
206
        fcb             "BITA", IMMB
207
        fcb             "LDA ", IMMB
208
        fcb             "    ", 0
209
        fcb             "EORA", IMMB
210
        fcb             "ADCA", IMMB
211
        fcb             "ORA ", IMMB
212
        fcb             "ADDA", IMMB
213
        fcb             "CMPX", IMMW
214
        fcb             "BSR ", SREL
215
        fcb             "LDX ", IMMW
216
        fcb             "JMF ", FAREXT
217
 
218
        ; 90 to 9F
219
        fcb             "SUBA", DIRECT
220
        fcb             "CMPA", DIRECT
221
        fcb             "SBCA", DIRECT
222
        fcb             "SUBD", DIRECT
223
        fcb             "ANDA", DIRECT
224
        fcb             "BITA", DIRECT
225
        fcb             "LDA ", DIRECT
226
        fcb             "STA ", DIRECT
227
        fcb             "EORA", DIRECT
228
        fcb             "ADCA", DIRECT
229
        fcb             "ORA ", DIRECT
230
        fcb             "ADDA", DIRECT
231
        fcb             "CMPX", DIRECT
232
        fcb             "JSR ", DIRECT
233
        fcb             "LDX ", DIRECT
234
        fcb             "STX ", DIRECT
235
 
236
        ; A0 to AF
237
        fcb             "SUBA", NDX
238
        fcb             "CMPA", NDX
239
        fcb             "SBCA", NDX
240
        fcb             "SUBD", NDX
241
        fcb             "ANDA", NDX
242
        fcb             "BITA", NDX
243
        fcb             "LDA ", NDX
244
        fcb             "STA ", NDX
245
        fcb             "EORA", NDX
246
        fcb             "ADCA", NDX
247
        fcb             "ORA ", NDX
248
        fcb             "ADDA", NDX
249
        fcb             "CMPX", NDX
250
        fcb             "JSR ", NDX
251
        fcb             "LDX ", NDX
252
        fcb             "STX ", NDX
253
 
254
        ; B0 to BF
255
        fcb             "SUBA", EXT
256
        fcb             "CMPA", EXT
257
        fcb             "SBCA", EXT
258
        fcb             "SUBD", EXT
259
        fcb             "ANDA", EXT
260
        fcb             "BITA", EXT
261
        fcb             "LDA ", EXT
262
        fcb             "STA ", EXT
263
        fcb             "EORA", EXT
264
        fcb             "ADCA", EXT
265
        fcb             "ORA ", EXT
266
        fcb             "ADDA", EXT
267
        fcb             "CMPX", EXT
268
        fcb             "JSR ", EXT
269
        fcb             "LDX ", EXT
270
        fcb             "STX ", EXT
271
 
272
        ; C0 to CF
273
        fcb             "SUBB", IMMB
274
        fcb             "CMPB", IMMB
275
        fcb             "SBCb", IMMB
276
        fcb             "ADDD", IMMW
277
        fcb             "ANDB", IMMB
278
        fcb             "BITB", IMMB
279
        fcb             "LDB ", IMMB
280
        fcb             "    ", 0
281
        fcb             "EORB", IMMB
282
        fcb             "ADCB", IMMB
283
        fcb             "ORB ", IMMB
284
        fcb             "ADDB", IMMB
285
        fcb             "LDD ", IMMW
286
        fcb             "    ", SREL
287
        fcb             "LDU ", IMMW
288
        fcb             "JSF ", FAREXT
289
 
290
        ; D0 to DF
291
        fcb             "SUBB", DIRECT
292
        fcb             "CMPB", DIRECT
293
        fcb             "SBCB", DIRECT
294
        fcb             "ADDD", DIRECT
295
        fcb             "ANDB", DIRECT
296
        fcb             "BITB", DIRECT
297
        fcb             "LDB ", DIRECT
298
        fcb             "STB ", DIRECT
299
        fcb             "EORB", DIRECT
300
        fcb             "ADCB", DIRECT
301
        fcb             "ORB ", DIRECT
302
        fcb             "ADDB", DIRECT
303
        fcb             "LDD ", DIRECT
304
        fcb             "STD ", DIRECT
305
        fcb             "LDU ", DIRECT
306
        fcb             "STU ", DIRECT
307
 
308
        ; E0 to EF
309
        fcb             "SUBB", NDX
310
        fcb             "CMPB", NDX
311
        fcb             "SBCB", NDX
312
        fcb             "ADDD", NDX
313
        fcb             "ANDB", NDX
314
        fcb             "BITB", NDX
315
        fcb             "LDB ", NDX
316
        fcb             "STB ", NDX
317
        fcb             "EORB", NDX
318
        fcb             "ADCB", NDX
319
        fcb             "ORB ", NDX
320
        fcb             "ADDB", NDX
321
        fcb             "LDD ", NDX
322
        fcb             "STD ", NDX
323
        fcb             "LDU ", NDX
324
        fcb             "STU ", NDX
325
 
326
        ; F0 to FF
327
        fcb             "SUBB", EXT
328
        fcb             "CMPB", EXT
329
        fcb             "SBCB", EXT
330
        fcb             "ADDD", EXT
331
        fcb             "ANDB", EXT
332
        fcb             "BITB", EXT
333
        fcb             "LDB ", EXT
334
        fcb             "STB ", EXT
335
        fcb             "EORB", EXT
336
        fcb             "ADCB", EXT
337
        fcb             "ORB ", EXT
338
        fcb             "ADDB", EXT
339
        fcb             "LDD ", EXT
340
        fcb             "STD ", EXT
341
        fcb             "LDU ", EXT
342
        fcb             "STU ", EXT
343
 
344
        ; 120 to 12F
345
distbl2:
346
        fcb             "LBRA"
347
        fcb             "LBRN"
348
        fcb             "LBHI"
349
        fcb             "LBLS"
350
        fcb             "LBHS"
351
        fcb             "LBLO"
352
        fcb             "LBNE"
353
        fcb             "LBEQ"
354
        fcb             "LBVC"
355
        fcb             "LBVS"
356
        fcb             "LBPL"
357
        fcb             "LBMI"
358
        fcb             "LBGE"
359
        fcb             "LBLT"
360
        fcb             "LBGT"
361
        fcb             "LBLE"
362
 
363
distbl3:
364
        fcb             $13F
365
        fcb             $183
366
        fcb             $18C
367
        fcb             $18E
368
        fcb             $193
369
        fcb             $19C
370
        fcb             $19E
371
        fcb             $19F
372
        fcb             $1A3
373
        fcb             $1AC
374
        fcb             $1AE
375
        fcb             $1AF
376
        fcb             $1B3
377
        fcb             $1BC
378
        fcb             $1BE
379
        fcb             $1BF
380
        fcb             $1CE
381
        fcb             $1DE
382
        fcb             $1DF
383
        fcb             $1EE
384
        fcb             $1EF
385
        fcb             $1FE
386
        fcb             $1FF
387
        fcb             $23F
388
        fcb             $283
389
        fcb             $28C
390
        fcb             $293
391
        fcb             $29C
392
        fcb             $2A3
393
        fcb             $2AC
394
        fcb             $2B3
395
        fcb             $2BC
396
 
397
distbl4:
398
        fcb             "SWI2", 0
399
        fcb             "CMPD", IMMW
400
        fcb             "CMPY", IMMW
401
        fcb             "LDY ", IMMW
402
        fcb             "CMPD", DIRECT
403
        fcb             "CMPY", DIRECT
404
        fcb             "LDY ", DIRECT
405
        fcb             "STY ", DIRECT
406
        fcb             "CMPD", NDX
407
        fcb             "CMPY", NDX
408
        fcb             "LDY ", NDX
409
        fcb             "STY ", NDX
410
        fcb             "CMPD", EXT
411
        fcb             "CMPY", EXT
412
        fcb             "LDY ", EXT
413
        fcb             "STY ", EXT
414
        fcb             "LDS ", IMMW
415
        fcb             "LDS ", DIRECT
416
        fcb             "STS ", DIRECT
417
        fcb             "LDS ", NDX
418
        fcb             "STS ", NDX
419
        fcb             "LDS ", EXT
420
        fcb             "STS ", EXT
421
        fcb             "SWI3", 0
422
        fcb             "CMPU", IMMW
423
        fcb             "CMPS", IMMW
424
        fcb             "CMPU", DIRECT
425
        fcb             "CMPS", DIRECT
426
        fcb             "CMPU", NDX
427
        fcb             "CMPS", NDX
428
        fcb             "CMPU", EXT
429
        fcb             "CMPS", EXT
430
 
431
disassem:
432 14 robfinch
        clr             farflag
433 15 robfinch
        swi
434
        fcb             MF_GetRange
435
        swi
436
        fcb             MF_CRLF
437 13 robfinch
        ldy             mon_r1+2
438
disLoop1:
439
        tfr             y,d
440 15 robfinch
        swi
441
        fcb             MF_DisplayWordAsHex
442 13 robfinch
        ldb             #' '
443 15 robfinch
        swi
444
        fcb             MF_OUTCH
445 13 robfinch
        ldb             ,y+
446
        bitb    #$300
447
        lbne    dis1
448 14 robfinch
        andb    #$FF                    ; mask off extra bits
449
        cmpb    #$15
450
        bne             dis20
451
        stb             farflag
452
        bra             disLoop1
453 13 robfinch
dis20:
454
        ldx             #distbl1
455
dis23:
456
        lda             #5
457
        mul
458
        abx
459
        ldb             ,x+
460 15 robfinch
        swi
461
        fcb             MF_OUTCH
462 13 robfinch
        ldb             ,x+
463 15 robfinch
        swi
464
        fcb             MF_OUTCH
465 13 robfinch
        ldb             ,x+
466 15 robfinch
        swi
467
        fcb             MF_OUTCH
468 13 robfinch
        ldb             ,x+
469 15 robfinch
        swi
470
        fcb             MF_OUTCH
471 13 robfinch
        ldb             #' '
472 15 robfinch
        swi
473
        fcb             MF_OUTCH
474 13 robfinch
        ldb             ,x+
475
        lbeq    disNextLine
476
        cmpb    #DIRECT
477
        bne             disNotDirect
478
        ldb             ,y+
479 15 robfinch
        swi
480
        fcb             MF_DisplayByteAsHex
481 13 robfinch
        lbra    disNextLine
482
disNotDirect:
483
        cmpb    #LSREL
484
        bne             disNotLRel
485
dis21:
486
        ldd             ,y++
487
dis2:
488
        leax    d,y
489
        tfr             x,d
490 15 robfinch
        swi
491
        fcb             MF_DisplayWordAsHex
492 13 robfinch
        lbra    disNextLine
493
disNotLRel:
494
        cmpb    #SREL
495
        bne             disNotRel
496
        ldb             ,y+
497
        clra
498
        bra             dis2
499
disNotRel:
500
        cmpb    #NDX
501
        bne             disNotNdx
502
        ldb             ,y+
503
        bitb    #$800
504
        bne             disNot9                 ; test for offset 9 mode
505
        pshs    b
506
        andb    #$1FF                           ; mask to offset bits
507
        clra                                                    ;
508
        bitb    #$100                           ; test for negative offset
509
        beq             dis3
510
        deca                                                    ; sign extend offset
511
        orb             #$E00
512
dis3:
513 15 robfinch
        swi
514
        fcb             MF_DisplayWordAsHex
515 13 robfinch
        ldb             #','
516 15 robfinch
        swi
517
        fcb             MF_OUTCH
518 13 robfinch
        puls    b
519
        bsr             disNdxReg
520 15 robfinch
        swi
521
        fcb             MF_OUTCH
522 13 robfinch
        lbra    disNextLine
523
disNot9:
524
        pshs    b
525
        bitb    #$100                   ; check if indirect
526 14 robfinch
        beq             dis4
527 13 robfinch
        ldb             #'['
528 15 robfinch
        swi
529
        fcb             MF_OUTCH
530 13 robfinch
dis4:
531
        ldb             ,s                              ; get back b
532
        andb    #15
533
        bne             disNotRplus
534
        ldb             ,s
535
        bitb    #$80                    ; outer indexed?
536 14 robfinch
        beq             dis5
537 13 robfinch
        ldb             #']'
538 15 robfinch
        swi
539
        fcb             MF_OUTCH
540 13 robfinch
dis5:
541
        ldb             #','
542 15 robfinch
        swi
543
        fcb             MF_OUTCH
544 13 robfinch
        ldb             ,s
545
        bsr             disNdxReg
546 15 robfinch
        swi
547
        fcb             MF_OUTCH
548 13 robfinch
        ldb             #'+'
549 15 robfinch
        swi
550
        fcb             MF_OUTCH
551 13 robfinch
        puls    b
552
        bitb    #$100
553 14 robfinch
        lbeq    disNextLine
554 13 robfinch
        bitb    #$80
555
        lbne    disNextLine
556
        ldb             #']'
557 15 robfinch
        swi
558
        fcb             MF_OUTCH
559 13 robfinch
        lbra    disNextLine
560
disNotRplus:
561
        cmpb    #1
562
        bne             disNotRplusplus
563
        ldb             ,s
564
        bitb    #$80                    ; outer indexed?
565 14 robfinch
        beq             dis6
566 13 robfinch
        ldb             #']'
567 15 robfinch
        swi
568
        fcb             MF_OUTCH
569 13 robfinch
dis6:
570
        ldb             #','
571 15 robfinch
        swi
572
        fcb             MF_OUTCH
573 13 robfinch
        ldb             ,s
574
        bsr             disNdxReg
575 15 robfinch
        swi
576
        fcb             MF_OUTCH
577 13 robfinch
        ldb             #'+'
578 15 robfinch
        swi
579
        fcb             MF_OUTCH
580
        swi
581
        fcb             MF_OUTCH
582 13 robfinch
        puls    b
583
        bitb    #$100
584 14 robfinch
        lbeq    disNextLine
585 13 robfinch
        bitb    #$80
586
        lbne    disNextLine
587
        ldb             #']'
588 15 robfinch
        swi
589
        fcb             MF_OUTCH
590 13 robfinch
        lbra    disNextLine
591
disNotRplusplus:
592
        cmpb    #2
593
        bne             disNotRminus
594
        ldb             ,s
595
        bitb    #$80                    ; outer indexed?
596 14 robfinch
        beq             dis7
597 13 robfinch
        ldb             #']'
598 15 robfinch
        swi
599
        fcb             MF_OUTCH
600 13 robfinch
dis7:
601
        ldb             #','
602 15 robfinch
        swi
603
        fcb             MF_OUTCH
604 13 robfinch
        ldb             ,s
605
        bsr             disNdxReg
606 15 robfinch
        swi
607
        fcb             MF_OUTCH
608 13 robfinch
        ldb             #'-'
609 15 robfinch
        swi
610
        fcb             MF_OUTCH
611 13 robfinch
        puls    b
612
        bitb    #$100
613 14 robfinch
        lbeq    disNextLine
614 13 robfinch
        bitb    #$80
615
        lbne    disNextLine
616
        ldb             #']'
617 15 robfinch
        swi
618
        fcb             MF_OUTCH
619 13 robfinch
        lbra    disNextLine
620
disNotRminus:
621
        cmpb    #3
622
        bne             disNotRminusminus
623
        ldb             ,s
624
        bitb    #$80                    ; outer indexed?
625 14 robfinch
        beq             dis8
626 13 robfinch
        ldb             #']'
627 15 robfinch
        swi
628
        fcb             MF_OUTCH
629 13 robfinch
dis8:
630
        ldb             #','
631 15 robfinch
        swi
632
        fcb             MF_OUTCH
633 13 robfinch
        ldb             ,s
634
        bsr             disNdxReg
635 15 robfinch
        swi
636
        fcb             MF_OUTCH
637 13 robfinch
        ldb             #'-'
638 15 robfinch
        swi
639
        fcb             MF_OUTCH
640
        swi
641
        fcb             MF_OUTCH
642 13 robfinch
        puls    b
643
        bitb    #$100
644 14 robfinch
        lbeq    disNextLine
645 13 robfinch
        bitb    #$80
646
        lbne    disNextLine
647
        ldb             #']'
648 15 robfinch
        swi
649
        fcb             MF_OUTCH
650 13 robfinch
        lbra    disNextLine
651
disNotRminusminus:
652
        cmpb    #4
653
        bne             disNotR
654
        ldb             ,s
655
        bitb    #$80                    ; outer indexed?
656 14 robfinch
        beq             dis9
657 13 robfinch
        ldb             #']'
658 15 robfinch
        swi
659
        fcb             MF_OUTCH
660 13 robfinch
dis9:
661
        ldb             #','
662 15 robfinch
        swi
663
        fcb             MF_OUTCH
664 13 robfinch
        ldb             ,s
665
        bsr             disNdxReg
666 15 robfinch
        swi
667
        fcb             MF_OUTCH
668 13 robfinch
        puls    b
669
        bitb    #$100
670 14 robfinch
        lbeq    disNextLine
671 13 robfinch
        bitb    #$80
672
        lbne    disNextLine
673
        ldb             #']'
674 15 robfinch
        swi
675
        fcb             MF_OUTCH
676 13 robfinch
        lbra    disNextLine
677
disNotR:
678
        cmpb    #5
679
        bne             disNotBOffs
680
        ldb             #'B'
681 15 robfinch
        swi
682
        fcb             MF_OUTCH
683 13 robfinch
        ldb             ,s
684
        bitb    #$80                    ; outer indexed?
685 14 robfinch
        beq             dis10
686 13 robfinch
        ldb             #']'
687 15 robfinch
        swi
688
        fcb             MF_OUTCH
689 13 robfinch
dis10:
690
        ldb             #','
691 15 robfinch
        swi
692
        fcb             MF_OUTCH
693 13 robfinch
        ldb             ,s
694
        bsr             disNdxReg
695 15 robfinch
        swi
696
        fcb             MF_OUTCH
697 13 robfinch
        ldb             #'-'
698 15 robfinch
        swi
699
        fcb             MF_OUTCH
700
        swi
701
        fcb             MF_OUTCH
702 13 robfinch
        puls    b
703
        bitb    #$100
704 14 robfinch
        lbeq    disNextLine
705 13 robfinch
        bitb    #$80
706
        lbne    disNextLine
707
        ldb             #']'
708 15 robfinch
        swi
709
        fcb             MF_OUTCH
710 13 robfinch
        lbra    disNextLine
711
disNotBOffs:
712
        cmpb    #6
713
        bne             disNotAOffs
714
        ldb             #'A'
715 15 robfinch
        swi
716
        fcb             MF_OUTCH
717 13 robfinch
        ldb             ,s
718
        bitb    #$80                    ; outer indexed?
719 14 robfinch
        beq             dis11
720 13 robfinch
        ldb             #']'
721 15 robfinch
        swi
722
        fcb             MF_OUTCH
723 13 robfinch
dis11:
724
        ldb             #','
725 15 robfinch
        swi
726
        fcb             MF_OUTCH
727 13 robfinch
        ldb             ,s
728
        bsr             disNdxReg
729 15 robfinch
        swi
730
        fcb             MF_OUTCH
731 13 robfinch
        ldb             #'-'
732 15 robfinch
        swi
733
        fcb             MF_OUTCH
734
        swi
735
        fcb             MF_OUTCH
736 13 robfinch
        puls    b
737
        bitb    #$100
738 14 robfinch
        lbeq    disNextLine
739 13 robfinch
        bitb    #$80
740
        lbne    disNextLine
741
        ldb             #']'
742 15 robfinch
        swi
743
        fcb             MF_OUTCH
744 13 robfinch
        lbra    disNextLine
745
disNotAOffs:
746
        cmpb    #8
747
        bne             disNotBO
748
        ldb             ,y+
749
        sex
750 15 robfinch
        swi
751
        fcb             MF_DisplayWordAsHex
752 13 robfinch
        ldb             ,s
753
        bitb    #$80                    ; outer indexed?
754 14 robfinch
        beq             dis12
755 13 robfinch
        ldb             #']'
756 15 robfinch
        swi
757
        fcb             MF_OUTCH
758 13 robfinch
dis12:
759
        ldb             #','
760 15 robfinch
        swi
761
        fcb             MF_OUTCH
762 13 robfinch
        ldb             ,s
763
        bsr             disNdxReg
764 15 robfinch
        swi
765
        fcb             MF_OUTCH
766 13 robfinch
        ldb             #'-'
767 15 robfinch
        swi
768
        fcb             MF_OUTCH
769
        swi
770
        fcb             MF_OUTCH
771 13 robfinch
        puls    b
772
        bitb    #$100
773 14 robfinch
        lbeq    disNextLine
774 13 robfinch
        bitb    #$80
775
        lbne    disNextLine
776
        ldb             #']'
777 15 robfinch
        swi
778
        fcb             MF_OUTCH
779 13 robfinch
        lbra    disNextLine
780
disNotBO:
781
        cmpb    #9
782
        bne             disNotWO
783
        ldd             ,y++
784 15 robfinch
        swi
785
        fcb             MF_DisplayWordAsHex
786 13 robfinch
        ldb             ,s
787
        bitb    #$80                    ; outer indexed?
788 14 robfinch
        beq             dis13
789 13 robfinch
        ldb             #']'
790 15 robfinch
        swi
791
        fcb             MF_OUTCH
792 13 robfinch
dis13:
793
        ldb             #','
794 15 robfinch
        swi
795
        fcb             MF_OUTCH
796 13 robfinch
        ldb             ,s
797
        bsr             disNdxReg
798 15 robfinch
        swi
799
        fcb             MF_OUTCH
800 13 robfinch
        ldb             #'-'
801 15 robfinch
        swi
802
        fcb             MF_OUTCH
803
        swi
804
        fcb             MF_OUTCH
805 13 robfinch
        puls    b
806
        bitb    #$100
807 14 robfinch
        lbeq    disNextLine
808 13 robfinch
        bitb    #$80
809
        lbne    disNextLine
810
        ldb             #']'
811 15 robfinch
        swi
812
        fcb             MF_OUTCH
813 13 robfinch
        lbra    disNextLine
814
disNotWO:
815
        cmpb    #10
816
        bne             disNotTO
817
        ldb             ,y++
818 15 robfinch
        swi
819
        fcb             MF_DisplayByteAsHex
820 13 robfinch
        ldd             ,y++
821 15 robfinch
        swi
822
        fcb             MF_DisplayWordAsHex
823 13 robfinch
        ldb             ,s
824
        bitb    #$80                    ; outer indexed?
825 14 robfinch
        beq             dis14
826 13 robfinch
        ldb             #']'
827 15 robfinch
        swi
828
        fcb             MF_OUTCH
829 13 robfinch
dis14:
830
        ldb             #','
831 15 robfinch
        swi
832
        fcb             MF_OUTCH
833 13 robfinch
        ldb             ,s
834
        bsr             disNdxReg
835 15 robfinch
        swi
836
        fcb             MF_OUTCH
837 13 robfinch
        ldb             #'-'
838 15 robfinch
        swi
839
        fcb             MF_OUTCH
840
        swi
841
        fcb             MF_OUTCH
842 13 robfinch
        puls    b
843
        bitb    #$100
844 14 robfinch
        lbeq    disNextLine
845 13 robfinch
        bitb    #$80
846
        lbne    disNextLine
847
        ldb             #']'
848 15 robfinch
        swi
849
        fcb             MF_OUTCH
850 13 robfinch
        lbra    disNextLine
851
disNotTO:
852
        cmpb    #11
853
        bne             disNotDOffs
854
        ldb             #'D'
855 15 robfinch
        swi
856
        fcb             MF_OUTCH
857 13 robfinch
        ldb             ,s
858
        bitb    #$80                    ; outer indexed?
859 14 robfinch
        beq             dis15
860 13 robfinch
        ldb             #']'
861 15 robfinch
        swi
862
        fcb             MF_OUTCH
863 13 robfinch
dis15:
864
        ldb             #','
865 15 robfinch
        swi
866
        fcb             MF_OUTCH
867 13 robfinch
        ldb             ,s
868
        bsr             disNdxReg
869 15 robfinch
        swi
870
        fcb             MF_OUTCH
871 13 robfinch
        ldb             #'-'
872 15 robfinch
        swi
873
        fcb             MF_OUTCH
874
        swi
875
        fcb             MF_OUTCH
876 13 robfinch
        puls    b
877
        bitb    #$100
878 14 robfinch
        lbeq    disNextLine
879 13 robfinch
        bitb    #$80
880
        lbne    disNextLine
881
        ldb             #']'
882 15 robfinch
        swi
883
        fcb             MF_OUTCH
884 13 robfinch
        lbra    disNextLine
885
disNotDOffs:
886
        cmpb    #12
887
        bne             disNotPBO
888
        ldb             ,y+
889
        sex
890 15 robfinch
        swi
891
        fcb             MF_DisplayWordAsHex
892 13 robfinch
        ldb             ,s
893
        bitb    #$80                    ; outer indexed?
894 14 robfinch
        beq             dis16
895 13 robfinch
        ldb             #']'
896 15 robfinch
        swi
897
        fcb             MF_OUTCH
898 13 robfinch
dis16:
899
        ldb             #','
900 15 robfinch
        swi
901
        fcb             MF_OUTCH
902 13 robfinch
        ldb             ,s
903
        bsr             disNdxReg
904
        ldb             #'P'
905 15 robfinch
        swi
906
        fcb             MF_OUTCH
907 13 robfinch
        ldb             #'C'
908 15 robfinch
        swi
909
        fcb             MF_OUTCH
910 13 robfinch
        ldb             #'-'
911 15 robfinch
        swi
912
        fcb             MF_OUTCH
913
        swi
914
        fcb             MF_OUTCH
915 13 robfinch
        puls    b
916
        bitb    #$100
917 14 robfinch
        lbeq    disNextLine
918 13 robfinch
        bitb    #$80
919
        lbne    disNextLine
920
        ldb             #']'
921 15 robfinch
        swi
922
        fcb             MF_OUTCH
923 13 robfinch
        lbra    disNextLine
924
disNotPBO:
925
        cmpb    #13
926
        bne             disNotPWO
927
        ldd             ,y++
928 15 robfinch
        swi
929
        fcb             MF_DisplayWordAsHex
930 13 robfinch
        ldb             ,s
931
        bitb    #$80                    ; outer indexed?
932 14 robfinch
        beq             dis17
933 13 robfinch
        ldb             #']'
934 15 robfinch
        swi
935
        fcb             MF_OUTCH
936 13 robfinch
dis17:
937
        ldb             #','
938 15 robfinch
        swi
939
        fcb             MF_OUTCH
940 13 robfinch
        ldb             ,s
941
        bsr             disNdxReg
942
        ldb             #'P'
943 15 robfinch
        swi
944
        fcb             MF_OUTCH
945 13 robfinch
        ldb             #'C'
946 15 robfinch
        swi
947
        fcb             MF_OUTCH
948 13 robfinch
        ldb             #'-'
949 15 robfinch
        swi
950
        fcb             MF_OUTCH
951
        swi
952
        fcb             MF_OUTCH
953 13 robfinch
        puls    b
954
        bitb    #$100
955 14 robfinch
        lbeq    disNextLine
956 13 robfinch
        bitb    #$80
957
        lbne    disNextLine
958
        ldb             #']'
959 15 robfinch
        swi
960
        fcb             MF_OUTCH
961 13 robfinch
        lbra    disNextLine
962
disNotPWO:
963
        cmpb    #14
964
        bne             disNotPTO
965
        ldb             ,y+
966 15 robfinch
        swi
967
        fcb             MF_DisplayByteAsHex
968 13 robfinch
        ldd             ,y++
969 15 robfinch
        swi
970
        fcb             MF_DisplayWordAsHex
971 13 robfinch
        ldb             ,s
972
        bitb    #$80                    ; outer indexed?
973 14 robfinch
        beq             dis18
974 13 robfinch
        ldb             #']'
975 15 robfinch
        swi
976
        fcb             MF_OUTCH
977 13 robfinch
dis18:
978
        ldb             #','
979 15 robfinch
        swi
980
        fcb             MF_OUTCH
981 13 robfinch
        ldb             ,s
982
        bsr             disNdxReg
983
        ldb             #'P'
984 15 robfinch
        swi
985
        fcb             MF_OUTCH
986 13 robfinch
        ldb             #'C'
987 15 robfinch
        swi
988
        fcb             MF_OUTCH
989 13 robfinch
        ldb             #'-'
990 15 robfinch
        swi
991
        fcb             MF_OUTCH
992
        swi
993
        fcb             MF_OUTCH
994 13 robfinch
        puls    b
995
        bitb    #$100
996 14 robfinch
        lbeq    disNextLine
997 13 robfinch
        bitb    #$80
998
        lbne    disNextLine
999
        ldb             #']'
1000 15 robfinch
        swi
1001
        fcb             MF_OUTCH
1002 13 robfinch
        lbra    disNextLine
1003
disNotPTO:
1004
        ldb             #'['
1005 15 robfinch
        swi
1006
        fcb             MF_OUTCH
1007 13 robfinch
        ldd             ,y++
1008 15 robfinch
        swi
1009
        fcb             MF_DisplayWordAsHex
1010 13 robfinch
        ldb             #']'
1011 15 robfinch
        swi
1012
        fcb             MF_OUTCH
1013 13 robfinch
        lbra    disNextLine
1014
disNotNdx:
1015
        cmpb    #EXT
1016
        bne             disNotExt
1017 14 robfinch
        tst             farflag
1018
        beq             dis30
1019
        ldb             ,y++
1020 15 robfinch
        swi
1021
        fcb             MF_DisplayByteAsHex
1022 14 robfinch
dis30:
1023 13 robfinch
        ldd             ,y++
1024 15 robfinch
        swi
1025
        fcb             MF_DisplayWordAsHex
1026 14 robfinch
        clr             farflag
1027 13 robfinch
        lbra    disNextLine
1028
disNotExt:
1029
        cmpb    #IMMB
1030
        bne             disNotIMMB
1031
        ldb             #'#'
1032 15 robfinch
        swi
1033
        fcb             MF_OUTCH
1034 13 robfinch
        ldb             ,y+
1035 15 robfinch
        swi
1036
        fcb             MF_DisplayByteAsHex
1037 13 robfinch
        lbra    disNextLine
1038
disNotIMMB:
1039
        cmpb    #IMMW
1040
        bne             disNotIMMW
1041
        ldb             #'#'
1042 15 robfinch
        swi
1043
        fcb             MF_OUTCH
1044 13 robfinch
        ldd             ,y++
1045 15 robfinch
        swi
1046
        fcb             MF_DisplayWordAsHex
1047 13 robfinch
        bra             disNextLine
1048
disNotIMMW:
1049 14 robfinch
        cmpb    #TFREXG
1050
        bne             disNotTfr
1051
        ldb             ,y+
1052
        bsr             disTfrExg
1053
        bra             disNextLine
1054
disNotTfr:
1055 13 robfinch
dis1:
1056
        cmpb    #$121
1057
        blo             dis19
1058
        cmpb    #$12F
1059
        bhi             dis19
1060
        andb    #$FF
1061 14 robfinch
        ldx             #distbl2
1062 13 robfinch
        aslb
1063
        aslb
1064
        abx
1065
        ldb             ,x+
1066 15 robfinch
        swi
1067
        fcb             MF_OUTCH
1068 13 robfinch
        ldb             ,x+
1069 15 robfinch
        swi
1070
        fcb             MF_OUTCH
1071 13 robfinch
        ldb             ,x+
1072 15 robfinch
        swi
1073
        fcb             MF_OUTCH
1074 13 robfinch
        ldb             ,x+
1075 15 robfinch
        swi
1076
        fcb             MF_OUTCH
1077 13 robfinch
        ldb             #' '
1078 15 robfinch
        swi
1079
        fcb             MF_OUTCH
1080 13 robfinch
        lbra    dis21
1081
dis19:
1082
        ldx             #0
1083
dis24:
1084
        cmpb    distbl3,x
1085
        bne             dis25
1086
        ldx             #distbl4
1087
        lbra    dis23
1088
dis25:
1089
        inx
1090
        cmpx    #31
1091
        blo             dis24
1092
        ldb             #'?'
1093 15 robfinch
        swi
1094
        fcb             MF_OUTCH
1095
        swi
1096
        fcb             MF_OUTCH
1097
        swi
1098
        fcb             MF_OUTCH
1099
        swi
1100
        fcb             MF_OUTCH
1101 13 robfinch
        bra             disNextLine
1102 14 robfinch
disNextLine:
1103
        clr             farflag
1104 15 robfinch
        swi
1105
        fcb             MF_CRLF
1106 13 robfinch
        cmpy    mon_r2+2
1107
        lblo    disLoop1
1108 15 robfinch
disJmpMon:
1109
        swi
1110
        fcb             MF_Monitor
1111
        bra             disJmpMon
1112 13 robfinch
 
1113
disNdxRegs:
1114
        fcb             'X','Y','S','U'
1115 14 robfinch
disTfrRegs:
1116
        fcb             "D X Y U S PC    A B CCDP        "
1117
 
1118 13 robfinch
disNdxReg:
1119
        andb    #$600
1120
        rolb
1121
        rolb
1122
        rolb
1123
        rolb
1124
        clra
1125
        pshs    u
1126
        tfr             d,u
1127
        lda             disNdxRegs,u
1128
        puls    u
1129
        exg             a,b
1130
        rts
1131
 
1132 14 robfinch
disTfrReg:
1133
        pshs    b,x
1134
        ldx             #disTfrRegs
1135
        aslb
1136
        lda             b,x
1137
        exg             a,b
1138 15 robfinch
        swi
1139
        fcb             MF_OUTCH
1140 14 robfinch
        exg             a,b
1141
        inx
1142
        ldb             b,x
1143
        cmpb    #' '
1144
        beq             disTfr1
1145 15 robfinch
        swi
1146
        fcb             MF_OUTCH
1147 14 robfinch
disTfr1:
1148
        puls    b,x,pc
1149
 
1150
disTfrExg:
1151
        pshs    b
1152
        rolb
1153
        rolb
1154
        rolb
1155
        rolb
1156
        andb    #15
1157
        bsr             disTfrReg
1158
        ldb             #','
1159 15 robfinch
        swi
1160
        fcb             MF_OUTCH
1161 14 robfinch
        ldb             ,s
1162
        andb    #15
1163
        bsr             disTfrReg
1164
        puls    b,pc
1165
 
1166 13 robfinch
ASMO:
1167
        pshs    d
1168
        ldd             #ASMOUTCH
1169
        std             CharOutVec
1170
        puls    d,pc
1171
 
1172
ASMOO:
1173
        pshs    d
1174 15 robfinch
''      ldd             #DisplayChar
1175 13 robfinch
        std             CharOutVec
1176
        puls    d,pc
1177
 
1178
ASMOUTCH:
1179
        stb             ,u+
1180
        rts
1181
 
1182
DumpAsmbuf:
1183
        ldu             #asmbuf
1184
dab2:
1185
        ldb             ,u+
1186
        beq             dab1
1187 15 robfinch
        swi
1188
        fcb             MF_OUTCH
1189 13 robfinch
        bra             dab2
1190
dab1:
1191
        rts

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.