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

Subversion Repositories rf6809

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

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

powered by: WebSVN 2.1.0

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