2200 HTAB 11: INVERSE : PRINT "BASIC DISASSEMBLER": NORMAL
2210 POKE 34,1: PRINT
2220 PRINT "COPYRIGHT 1985 BY MICROSPARC, INC"
2230 PRINT "WRITTEN BY GARRETT P SMITH"
2240 RETURN
2250 REM GET A & L FROM DISK (48+K/3.3 DOS)
2260 EC = 3: ONERR GOTO 2370
2270 IF PEEK(41868) < >113 THEN POP : VTAB 23: PRINT "ERR --- STANDARD 48K DOS 3.3 NOT BOOTED": VTAB 13: CALL -868: GOTO 3040
2280 POKE 41868,13: REM CRIPPLE BLOAD
2290 PRINT CHR$(4);"BLOAD ";F$;",D";DA
2300 REM BLOAD DID NOT LOAD FILE; IT ONLY LOOKED UP A & L
2310 POKE 41868,113: REM FIX IT
2320 POKE 216,0
2330 A = PEEK( -21902) +256 * PEEK( -21901)
2340 L = PEEK( -21920) +256 * PEEK( -21919)
2350 VTAB 22: PRINT "FYI: A = ";A;" L = ";L: PRINT "PRESS <RETURN> TO CONTINUE ";: GET A$: PRINT A$: RETURN
2360 REM ERROR ROUTINE FOR CRIPPLED BLOAD
2370 POKE 41868,113
2380 IF PEEK(222) < >6 THEN GOTO 3840
2390 POKE 216,0: CALL -3288
2400 IF A$ = CHR$(91) THEN 3840
2410 IF A$ = CHR$(92) THEN PRINT : PRINT "'BASIC.DISAS.AUX' NOT FOUND": PRINT "PLEASE PLACE PROPER DISK IN DRIVE #1": PRINT "HIT <RETURN> TO CONT --- <ESC> TO EXIT ";: GET A$: PRINT A$:F1 = (A$ = CHR$(27)): HOME : GOTO 3790
2420 IF DA <DN THEN DA = DN: HOME : GOTO 3010
2430 HOME : VTAB 8: PRINT "FILE '";F$;"' NOT FOUND": VTAB 21: PRINT "HIT <RESET> TO EXIT": GOTO 2870
2440 REM INPUT A & L FOR NON 3.3 DOS
2450 EC = 4: ONERR GOTO 3840
2460 PRINT CHR$(4);"VERIFY ";F$;",D";DA
2470 POKE 216,0
2480 VTAB 15: PRINT "PLEASE SUPPLY SOME INFORMATION ABOUT": PRINT F$;" (DECIMAL OR $HEX)"
3120 RL = RL -(1150 *PD): IF RL <1 THEN PRINT : PRINT "NOT ENOUGH MEMORY": GOTO 3820: REM PRODOS NEEDS ONE PAGE FOR STRINGS AND 2K FOR FILES
3130 IF RL >L THEN RL = L
3140 DIM R%(RL)
3150 DIM FL%(3),NB$(15),MN$(56),P$(39),XC%(255),AM$(13),PS$(2)
3160 HOME : VTAB 8: PRINT "RATIO OF PROGRAM LENGTH TO LABELS: "; INT(L/RL *10 +0.5)/10: PRINT : PRINT
3170 IF L/RL <4 THEN 3200
3180 PRINT "SINCE THE PROGRAM BEING DISASSEMBLED IS": PRINT "LARGE, THERE MAY NOT BE ENOUGH MEMORY.": PRINT : PRINT "THIS CAN BE AVOIDED BY SECTIONING THE": PRINT "TARGET PROGRAM INTO 2 OR MORE PIECES.": PRINT
3190 VTAB 22: PRINT "BINARY FILE SHOULD STILL BE IN DRIVE ";DA
3200 PRINT "<ESC> TO QUIT --- ANY OTHER KEY TO CONT";: GET A$: PRINT A$: IF ASC(A$) = 27 THEN GOTO 3820
3210 A$ = CHR$(91)
3220 EC = 5: ONERR GOTO 3840
3230 BA = BA +1024 *PD: REM PRODOS WANTS 1K ABOVE HIMEM LEFT OPEN
3330 HTAB 5: PRINT "PLEASE ENTER (T/B/O)";: GET A$: PRINT A$
3340 RESTORE :K = 0
3350 IF A$ = "T" THEN GOSUB 2650:K = 1
3360 GOSUB 2770
3370 IF A$ = "B" THEN GOSUB 2650:K = 1
3380 GOSUB 2770
3390 IF A$ = "O" THEN GOSUB 2650:K = 1
3400 IF K = 0 THEN VTAB 13: CALL -868: FOR I = 1 TO 20: NEXT : GOTO 3330
3410 IF FL%(0) = 99 THEN VTAB 15: PRINT "FLAGS FOR OTHER ASSEMBLER OPTION HAVE": PRINT "NOT BEEN SET. SEEN LINE # 3870.": PRINT "<RESET> TO EXIT":K = 0: GOTO 3400
3420 HOME : VTAB 5: PRINT "TYPE A LETTER TO BE USED WITH LABELS";: GET A$: PRINT A$
3430 IF A$ < > CHR$(13) THEN LB$ = A$: IF ASC(LB$) <65 OR ASC(LB$) >90 THEN PRINT "*** MUST BE A LETTER ***":LB$ = "L": FOR I = 1 TO 1000: NEXT : GOTO 3420
3440 VTAB 19: PRINT "PLACE A DISK IN DRIVE #";DN;" WITH PLENTY OF": PRINT "SPACE TO RECEIVE DISASSEMBLER OUTPUT.": PRINT
3450 PRINT "IF 'BASIC.DISAS.AUX' IS NOT ON DISK IN": PRINT "DRIVE #1 THEN YOU WILL BE PROMPTED": PRINT "BEFORE 'FILE CLEAN UP' STEP.";
3460 HTAB 1: VTAB 10: PRINT "TYPE <ESC> TO SKIP FINAL FILE CLEAN UP": PRINT "TYPE <RETURN> TO CONTINUE ";: GET A$: PRINT A$: IF A$ = CHR$(27) THEN F1 = 1
3470 FOR I = 0 TO 255: READ XC%(I): NEXT
3480 FOR I = 0 TO 15: READ NB$(I): NEXT
3490 FOR I = 1 TO 56: READ MN$(I): NEXT :MN$(0) = PS$(0)
3500 FOR I = 0 TO 13: READ AM$(I): NEXT
3510 GOSUB 1310: REM FIRST PASS
3520 GOSUB 1430: REM SECOND PASS
3530 PI = 0:PN = 0
3540 ON EF GOTO 3580,3570,3560
3550 GOTO 3600
3560 GOSUB 950
3570 GOSUB 950
3580 P$(PI) = EF$:PI = PI +1:PN = PN + LEN(EF$)
3590 F2$ = ".TEMP": GOSUB 490
3600 POKE 216,0
3610 PRINT : PRINT D$"CLOSE"
3620 REM CLEAN UP
3630 PI = 768:K = 0
3640 POKE PI,DN: REM PASS INFO TO AUX ON PAGE THREE
3650 POKE PI +1, LEN(F$)
3660 FOR I = 1 TO LEN(F$)
3670 J = ASC( MID$ (F$,I,1))
3680 POKE PI +1 +I,J
3690 K = K +J: REM SUM USED TO CHECK DATA VALIDITY
3700 NEXT I
3710 POKE PI +2 +I, INT(K/256)
3720 POKE PI +1 +I,K -256 *( INT(K/256))
3730 HIMEM: BS
3740 HOME
3750 IF F1 = 1 THEN VTAB 6: PRINT F$".TEMP AND"
3760 VTAB 5: PRINT "DISASSEMBLED LISTING CAN BE FOUND IN": VTAB 7: PRINT F$".TEXT": PRINT : PRINT
3770 IF CT >0 THEN PRINT : PRINT "THERE WERE ";CT;" ILLEGAL": PRINT "REFERENCES WITHIN THE RANGE OF THE": PRINT "PROGRAM. THEY ARE LISTED AS 'EQU' STMT"
3780 IF CZ >0 THEN PRINT : PRINT "THERE WERE ";CZ;" TWO BYTE": PRINT "REFERENCES TO PAGE ZERO. CHECK LISTING": PRINT "FOR MESSAGES"
3790 A$ = CHR$(92)
3800 EC = 6: ON ER GOTO 3840
3810 IF F1 = 0 THEN PRINT D$"RUN BASIC.DISAS.AUX,D1"
3820 POKE 34,0: POKE 216,0: IF BS < >0 THEN HIMEM: BS
3850 HOME : VTAB 12: IF E = 4 THEN PRINT "DISK IS WRITE PROTECTED": GOTO 3900
3860 IF E = 6 THEN PRINT "FILE: "F$: PRINT "WAS NOT FOUND.": GOTO 3900
3870 IF E = 8 THEN PRINT "I/O ERROR--CHECK DRIVE DOOR.": GOTO 3900
3880 IF E = 13 THEN PRINT "FILE TYPE MISMATCH.": GOTO 3900
3890 PRINT "ERROR #"E: PRINT "IN LINE "EL".": PRINT "PRESS SPACE BAR TO CONTINUE";: GET A$: PRINT : GOTO 2830
3900 VTAB 22: HTAB 1: PRINT "PRESS <RETURN> TO CONTINUE.";: GET Z$: POKE 49168,0: PRINT : HOME : PRINT CHR$(4);"CLOSE"
3910 ON EC GOTO 400,490,2260,2870,3220,3800
3920 REM DATA STATEMENTS
3930 DATA 0,0,0,0," ","A","",0,0,0,"DFB","EQU","ORG"
3940 DATA 1,9,13,29,"","","EOF",2,34,34,"DFB","EQU","ORG"
3950 DATA 99,0,0,0,"","","",0,0,0,"","",""
3960 REM NEXT 16 ARE FOR 256 XC%
3970 DATA 111,835,0,0,0,535,503,0,137,335,203,0,0,1035,1003,0
3980 DATA 410,935,0,0,0,635,603,0,114,1235,0,0,0,1135,1103,0
3990 DATA 1029,802,0,0,507,502,540,0,139,302,240,0,1007,1002,1040,0
4000 DATA 408,902,0,0,0,602,640,0,145,1202,0,0,0,1102,1140,0
4010 DATA 142,824,0,0,0,524,533,0,136,324,233,0,1028,1024,1033,0
4020 DATA 412,924,0,0,0,624,633,0,116,1224,0,0,0,1124,1133,0
4030 DATA 143,801,0,0,0,501,541,0,138,301,241,0,1328,1001,1041,0
4040 DATA 413,901,0,0,0,601,0,0,147,1201,0,0,0,1101,0,0
4050 DATA 0,848,0,0,550,548,549,0,123,0,154,0,1050,1048,1049,0
4060 DATA 404,948,0,0,650,648,749,0,156,1248,155,0,0,1148,0,0
4070 DATA 332,830,331,0,532,530,531,0,152,330,151,0,1032,1030,1031,0
4080 DATA 405,930,0,0,632,630,731,0,117,1230,153,0,1132,1130,1231,0
4090 DATA 320,818,0,0,520,518,521,0,127,318,122,0,1020,1018,1021,0
4100 DATA 409,918,0,0,0,618,621,0,115,1218,0,0,0,1118,1121,0
4110 DATA 319,844,0,0,519,544,525,0,126,344,134,0,1019,1044,1025,0
4120 DATA 406,944,0,0,0,644,625,0,146,1244,0,0,0,1144,1125,0
4130 DATA 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
4140 DATA ADC,AND,ASL,BCC,BCS,BEQ,BIT,BMI,BNE,BPL,BRK,BVC,BVS,CLC,CLD,CLI,CLV,CMP,CPX,CPY,DEC,DEX,DEY,EOR,INC,INX,INY,JMP,JSR,LDA,LDX,LDY,LSR,NOP,ORA,PHA,PHP,PLA,PLP,ROL,ROR,RTI,RTS,SBC,SEC,SED,SEI,STA,STX,STY,TAX,TAY,TSX,TXA,TXS,TYA
4150 DATA UND,IMP,ACC,IMM,REL,Z-P,ZPX,ZPY,I-X,I-Y,ABS,ABX,ABY,IND