S-C DisAssembler

1000 *SAVE D.DISASM
1010 *--------------------------------
1020 CALL.INSDS2
1030        JSR DISPLAY.PC
1040        JSR GET.NEXT.OBJ.BYTE
1050        STA OPCODE
1060        BIT MLI.CALL.FLAG
1070        BMI .6       INSIDE AN MLI CALL
1080        TAY
1090        LSR          EVEN/ODD FOR INDEXING FORMAT
1100        TAX
1110        LDA FORMAT.INDEX.TABLE,X
1120        BCS .1
1130        LSR
1140        LSR
1150        LSR
1160        LSR
1170 .1     AND #$0F
1180        TAX          FORMAT INDEX
1190        LDA FORMAT.TABLE,X
1200        STA FORMAT
1210        AND #3
1220        STA LENGTH
1230        LDA MNEMONIC.LEFT,Y
1240        STA MNEMONIC
1250        LDA MNEMONIC.RIGHT,Y
1260        STA MNEMONIC+1
1270        LDY LENGTH   0,1,2
1280        BEQ .4       ...NO OPERAND
1290 .15    JSR GET.NEXT.OBJ.BYTE
1300        STA OPERAND.LO
1310        LDY LENGTH
1320        DEY
1330        TYA          IF 2-BYTE INSTRUCTION, A=0
1340        BEQ .2
1350        JSR GET.NEXT.OBJ.BYTE
1360 .2     STA OPERAND.HI
1370        LDA FORMAT   IS IT RELATIVE FORMAT?
1380        CMP FORMAT.RELATIVE
1390        BNE .4       ...NO
1400 *---COMPUTE REAL ADDRESS---------
1410        LDY PC+1
1420        LDA OPERAND.LO    GET RELATIVE OFFSET
1430        BPL .21           ...POSITIVE OFFSET
1440        DEY               ...NEGATIVE OFFSET
1450 .21    ADC PC            (CARRY WAS SET ABOVE)
1460        BCC .22
1470        INY
1480 .22    STA OPERAND.LO    BUMP IT ONCE MORE
1490        INC OPERAND.LO
1500        BNE .3
1510        INY
1520 .3     STY OPERAND.HI
1530 *---CHECK FOR MLI CALL-----------
1540 .4     LSR MLI.CALL.FLAG     CLEAR FLAG FIRST
1550        LDA OPCODE
1560        CMP #$20
1570        BNE .5            ...NOT MLI CALL
1580        LDA OPERAND.HI
1590        CMP #$BF
1600        BNE .5            ...NOT MLI CALL
1610        LDA OPERAND.LO
1620        BNE .5            ...NOT MLI CALL
1630        ROR MLI.CALL.FLAG
1640 .5     RTS
1650 *---HANDLE REST OF MLI CALL------
1660 .6     LDY #2
1670        STY LENGTH
1680        STY FORMAT
1690        BNE .15      ...ALWAYS
1700 *--------------------------------
1710 GET.NEXT.OBJ.BYTE
1720        JSR MLI
1730        .DA #$CA,P.READ
1740        BCC .1
1750        LDY #Q.OUTOFDATA
1760        JMP MLI.ERROR
1770 .1     LDA INBYTE
1780        RTS
1790 *--------------------------------
1800 DISPLAY.PASS.NO
1810   .DO 1
1820        LDY #5
1830 .1     LDA PASSQT,Y
1840        JSR MON.COUT
1850        DEY
1860        BPL .1
1870   .ELSE
1880        LDY #Q.PASS
1890        JSR QT.OUT
1900   .FIN
1910        CLC
1920        LDA PASS
1930        ADC #"1"
1940        JMP MON.COUT
1950 *--------------------------------
1960 PASSQT .AS -/ SSAP/
1970        .HS 8D
1980 *--------------------------------
1990 FORMAT.INDEX.TABLE
2000     .LIST OFF
2010        .HS 0400.2220.0100.3330  0-
2020        .HS B5C0.2660.0800.3770  1-
2030        .HS 3400.2220.0100.3330  2-
2040        .HS B5C0.6660.0800.7770  3-
2050        .HS 0400.0220.0100.3330  4-
2060        .HS B5C0.0660.0800.0770  5-
2070        .HS 0400.2220.0100.9330  6-
2080        .HS B5C0.6660.0800.D770  7-
2090        .HS B400.2220.0100.3330  8-
2100        .HS B5C0.66A0.0800.3770  9-
2110        .HS 1410.2220.0100.3330  A-
2120        .HS B5C0.66A0.0800.7780  B-
2130        .HS 1400.2220.0100.3330  C-
2140        .HS B5C0.0660.0800.0770  D-
2150        .HS 1400.2220.0100.3330  E-
2160        .HS B5C0.0660.0800.0770  F-
2170     .DO LISTING
2180     .LIST ONN
2190     .FIN
2200 *--------------------------------
2210 FORMAT.TABLE
2220        .HS 00       0 -- NONE
2230 FORMAT.IMMEDIATE
2240        .HS 81       1 -- IMM
2250        .HS 21       2 -- ZP
2260        .HS 22       3 -- ABS
2270        .HS 79       4 -- (ZP,X)
2280        .HS 6D       5 -- (ZP),Y
2290        .HS 31       6 -- ZP,X
2300        .HS 32       7 -- ABS,X
2310        .HS 26       8 -- ABS,Y
2320        .HS 6A       9 -- (ABS)
2330        .HS 25       A -- ZP,Y
2340 FORMAT.RELATIVE
2350        .HS 2D       B -- RELATIVE
2360        .HS 69       C -- (ZP)
2370        .HS 7A       D -- (ABS,X)
2380        .HS 00       E
2390        .HS 00       F
2400 *--------------------------------
2410 CHAR1  .HS 2C.29.2C.00.28.23     , ) , W ( #
2420 CHAR2  .HS 59.00.58.00.00.24     Y . X . . $
2430 *--------------------------------
2440 MNEMONIC.LEFT
2450     .LIST OFF
2460   .HS 1C.84.00.00.AD.84.15.00.8A.84.15.00.AD.84.15.00.
2470   .HS 1C.84.84.00.AC.84.15.00.23.84.53.00.AC.84.15.00.
2480   .HS 5D.13.00.00.1A.13.9C.00.8B.13.9C.00.1A.13.9C.00.
2490   .HS 1B.13.13.00.1A.13.9C.00.A1.13.29.00.1A.13.9C.00.
2500   .HS 9D.34.00.00.00.34.6D.00.8A.34.6D.00.5B.34.6D.00.
2510   .HS 1D.34.34.00.00.34.6D.00.23.34.8A.00.00.34.6D.00.
2520   .HS 9D.11.00.00.A5.11.9C.00.8B.11.9C.00.5B.11.9C.00.
2530   .HS 1D.11.11.00.A5.11.9C.00.A1.11.8B.00.5B.11.9C.00.
2540   .HS 1C.A5.00.00.A5.A5.A5.00.29.1A.AE.00.A5.A5.A5.00.
2550   .HS 19.A5.A5.00.A5.A5.A5.00.AE.A5.AE.00.A5.A5.A5.00.
2560   .HS 69.69.69.00.69.69.69.00.A8.69.A8.00.69.69.69.00.
2570   .HS 19.69.69.00.69.69.69.00.23.69.AD.00.69.69.69.00.
2580   .HS 24.23.00.00.24.23.29.00.53.23.29.00.24.23.29.00.
2590   .HS 1B.23.23.00.00.23.29.00.23.23.8A.00.00.23.29.00.
2600   .HS 24.A0.00.00.24.A0.53.00.53.A0.7C.00.24.A0.53.00.
2610   .HS 19.A0.A0.00.00.A0.53.00.A1.A0.8B.00.00.A0.53.00.
2620     .DO LISTING
2630     .LIST ONN
2640     .FIN
2650 *--------------------------------
2660 MNEMONIC.RIGHT
2670     .LIST OFF
2680   .HS D8.C4.00.00.06.C4.1A.00.62.C4.1A.00.06.C4.1A.00.
2690   .HS 5A.C4.C4.00.C6.C4.1A.00.48.C4.C8.00.C6.C4.1A.00.
2700   .HS 26.CA.00.00.AA.CA.1A.00.62.CA.1A.00.AA.CA.1A.00.
2710   .HS 94.CA.CA.00.AA.CA.1A.00.88.CA.88.00.AA.CA.1A.00.
2720   .HS 54.26.00.00.00.26.26.00.44.26.26.00.A2.26.26.00.
2730   .HS C8.26.26.00.00.26.26.00.54.26.74.00.00.26.26.00.
2740   .HS 68.48.00.00.76.48.26.00.44.48.26.00.A2.48.26.00.
2750   .HS E8.48.48.00.76.48.26.00.94.48.74.00.A2.48.26.00.
2760   .HS C4.44.00.00.74.44.72.00.B4.AA.44.00.74.44.72.00.
2770   .HS 08.44.44.00.74.44.72.00.84.44.68.00.76.44.76.00.
2780   .HS 74.44.72.00.74.44.72.00.B4.44.B2.00.74.44.72.00.
2790   .HS 28.44.44.00.74.44.72.00.6E.44.32.00.74.44.72.00.
2800   .HS 74.A2.00.00.74.A2.88.00.F4.A2.B2.00.74.A2.88.00.
2810   .HS CC.A2.A2.00.00.A2.88.00.4A.A2.72.00.00.A2.88.00.
2820   .HS 72.C8.00.00.72.C8.C8.00.F2.C8.22.00.72.C8.C8.00.
2830   .HS A4.C8.C8.00.00.C8.C8.00.8A.C8.72.00.00.C8.C8.00.
2840     .DO LISTING
2850     .LIST ONN
2860     .FIN
2870 *--------------------------------