Compucolor.org – Virtual Media

Listing of file='DSASPR.BAS;01' on disk='vmedia/utility_2-sector.ccvf'

100 REM  DISASSEMBLER PROGRAM (IN BASIC)--LISTING TO PRINTER
110 REM  BAUD RATE - 9600
120 REM  CORRECTED & ADAPTED BY RICK TAUBOLD
130 REM  197 HOLLYBROOK ROAD, ROCHESTER, NEW YORK 14623
140 REM  ORIGINAL AUTHOR UNKNOWN
150 CLEAR 200:PLOT 15,12,6,2:PRINT TAB( 20)"DISSASEMBLE TO PRINTER"
151 PRINT TAB( 20)"eeeeeeeeeeeeeeeeeeeeeee"
160 DIM RG$(7),AI$(7),C6$(7),CC$(7),C1$(7),C3$(7)
170 DIM C5$(7),X7$(7),X2$(7),HX$(15),RP$(3),ST(10)
175 PLOT 27,18,7
180 GOSUB 1240:GOTO 270
190 X= N:GOSUB 230:N$= X$:X= A:GOSUB 220:A$= X$:IF A1= 1THEN RETURN
200 X= A2:GOSUB 220:A2$= X$:IF A1= 2THEN RETURN
210 X= A3:GOSUB 220:A3$= X$:X= AD:GOSUB 230:AD$= X$:RETURN
220 X$= HX$(INT (X/ 16))+ HX$(XAND 15):RETURN
230 T= X:X= INT (T/ 256):GOSUB 220:T$= X$
240 X= T- 256* X:GOSUB 220:X$= T$+ X$:RETURN
250 X$= RIGHT$ ("  "+ MID$ (STR$ (X),2),3):RETURN
260 X$= RIGHT$ ("    "+ MID$ (STR$ (X),2),5):RETURN
270 PLOT 15,3,14,8:INPUT "ENTER NAME OF ROUTINE: ";NM$
280 IF NM$= ""THEN PLOT 12:END
290 PRINT :PLOT 3,14,10:INPUT "ENTER START ADDRESS IN DECIMAL: ";LM
300 PRINT :PLOT 3,14,12:INPUT "ENTER END ADDRESS IN DECIMAL: ";EN:IF EN< = 0GOTO 300
310 PRINT :PLOT 3,14,14:INPUT "DO YOU WISH TO TRACE JUMPS AND CALLS? ";D$
320 PLOT 12,27,13
330 PRINT TAB( 5)NM$
340 PRINT TAB( 5)"START ADDRESS: ";LM:PRINT
350 N= LM:F= 0:S= 0
360 IF S= 60THEN S= 0:PLOT 12
370 IF N> ENTHEN POKE 33265,0:END
380 S= S+ 1:A= PEEK (N):X= A:GOSUB 250:A$= X$:X= N:GOSUB 260
390 N$= X$:GOSUB 620:ON A1GOTO 490,580,400,490
400 A2= PEEK (N+ 1):X= A2:GOSUB 250:A2$= X$
410 A3= PEEK (N+ 2):X= A3:GOSUB 250:A3$= X$
420 AD= 256* A3+ A2:X= AD:GOSUB 260:AD$= X$
430 PRINT TAB( 5);N$;" ";A$;" ";A2$;" ";A3$;" ";
440 GOSUB 190:PRINT TAB( 27);N$;" ";A$;" ";A2$;" ";A3$;TAB( 46);A1$;TAB( 53);AD$
450 IF LEFT$ (D$,1)< > "Y"THEN 480
460 IF A1$= "CALL "THEN F= F+ 1:ST(F)= N+ 3:N= AD:GOTO 360
470 IF A1$= "JMP  "THEN N= AD:GOTO 360
480 N= N+ 3:GOTO 360
490 PRINT TAB( 5);N$;" ";A$;
500 GOSUB 190:PRINT TAB( 27);N$;" ";A$;TAB( 46);A1$
510 IF LEFT$ (D$,1)< > "Y"THEN N= N+ 1:GOTO 360
520 IF A1$= "RET"OR A1$= "PCHL"THEN 550
530 IF A1= 4THEN F= F+ 1:ST(F)= N+ 1:N= 8* M:GOTO 360
540 N= N+ 1:GOTO 360
550 IF F< > 0THEN N= ST(F):F= F- 1:GOTO 360
560 INPUT "FINISHED. PRESS RETURN ";AB$
570 GOTO 270
580 A2= PEEK (N+ 1):X= A2:GOSUB 250:A2$= X$
590 PRINT TAB( 5);N$;" ";A$;" ";A2$;" ";
600 GOSUB 190:PRINT TAB( 27);N$;" ";A$;" ";A2$;TAB( 46);A1$;TAB( 55);A2$
610 N= N+ 2:GOTO 360
620 REM  LL MMM KKK
630 L= INT (A/ 64)
640 M= INT (A/ 8)AND 7
650 K= AAND 7
660 ON LGOTO 960,990,1010
670 REM  00 MMM KKK
680 ON KGOTO 720,790,830,890,890,920,940
690 REM  00 MMM 000
700 IF M= 0THEN A1$= "NOP":A1= 1:RETURN
710 IF M> 0THEN A1$= "- -":A1= 1:RETURN
720 REM  00 MMM 001
730 K= M/ 2
740 IF AAND 8THEN 770
750 REM  00 KK0 001
760 A1$= "LXI  "+ RP$(K)+ ",":A1= 3:RETURN
770 REM  00 KK1 001
780 A1$= "DAD  "+ RP$(K):A1= 1:RETURN
790 REM  00 MMM 010
800 A1$= X2$(M):REM  STAX OR LDAX
810 IF M< 4THEN A1= 1:RETURN
820 A1= 3:RETURN
830 REM  00 MMM 011
840 K= INT (M/ 2)
850 M= MAND 1
860 IF M= 0THEN A1$= "INX  "
870 IF M= 1THEN A1$= "DCX  "
880 A1$= A1$+ RP$(K):A1= 1:RETURN
890 REM  00 MMM 100 INR   00 MMM 101 DCR
900 IF K= 4THEN A1$= "INR  "+ RG$(M):A1= 1:RETURN
910 IF K= 5THEN A1$= "DCR  "+ RG$(M):A1= 1:RETURN
920 REM  00 MMM 110 MVI
930 A1$= "MVI  "+ RG$(M)+ ",":A1= 2:RETURN
940 REM  00 MMM 111
950 A1$= X7$(M):A1= 1:RETURN
960 REM  01 MMM KKK MOV
970 IF M= 6AND K= 6THEN A1$= "HLT":A1= 1:RETURN
980 A1$= "MOV  "+ RG$(M)+ ","+ RG$(K):A1= 1:RETURN
990 REM  10 MMM KKK
1000 A1$= AI$(M)+ "  "+ RG$(K):A1= 1:RETURN
1010 REM  11 MMM KKK
1020 ON KGOTO 1050,1070,1110,1090,1160,1190,1210
1030 REM  11 MMM 000
1040 A1$= "R"+ CC$(M):A1= 1:RETURN
1050 REM  11 MMM 001
1060 A1$= C1$(M):A1= 1:RETURN
1070 A1$= "J"+ CC$(M)+ "  ":A1= 3:RETURN
1080 A1$= "J"+ CC$(M)+ "  ":A1= 3:RETURN
1090 REM  11 MMM 100
1100 A1$= "C"+ CC$(M)+ "  ":A1= 3:RETURN
1110 REM  11 MMM 011
1120 A1$= C3$(M)+ "  ":A1= 1
1130 IF M= 0THEN A1= 3
1140 IF M= 2OR M= 3THEN A1= 2
1150 RETURN
1160 REM  11 MMM 101
1170 A1$= C5$(M):IF M< > 1THEN A1= 1:RETURN
1180 A1= 3:RETURN
1190 REM  11 MMM 110
1200 A1$= C6$(M)+ "  ":A1= 2:RETURN
1210 REM  11 MMM 111 RST
1220 A1$= "RST  "+ MID$ (STR$ (M),2)
1230 A1= 4:RETURN
1240 FOR I= 0TO 7:READ RG$(I):NEXT
1250 DATA  B,C,D,E,H,L,M,A
1260 FOR I= 0TO 3:READ RP$(I):NEXT
1270 DATA  B,D,H,SP
1280 FOR I= 0TO 7:READ AI$(I):NEXT
1290 DATA  ADD,ADC,SUB,SBB,ANA,XRA,ORA,CMP
1300 FOR I= 0TO 7:READ C6$(I):NEXT
1310 DATA  ADI,ACI,SUI,SBI,ANI,XRI,ORI,CPI
1320 FOR I= 0TO 7:READ CC$(I):NEXT
1330 DATA  "NZ","Z ","NC","C ","PO","PE","P ","M "
1340 FOR I= 0TO 7:READ C1$(I):NEXT
1350 DATA  "POP  B","RET","POP  D","- -","POP  H","PCHL"
1360 DATA  "POP  PSW","SPHL"
1370 FOR I= 0TO 7:READ C3$(I):NEXT
1380 DATA  "JMP","- -",OUT,IN ,XTHL,XCHG,DI,EI
1390 FOR I= 0TO 7:READ C5$(I):NEXT
1400 DATA  "PUSH B","CALL ","PUSH D","- -","PUSH H"
1410 DATA "- -","PUSH PSW","- -"
1420 FOR I= 0TO 7:READ X7$(I):NEXT
1430 DATA  RLC,RRC,RAL,RAR,DAA,CMA,STC,CMC
1440 FOR I= 0TO 7:READ X2$(I):NEXT
1450 DATA  "STAX B","LDAX B","STAX D","LDAX D","SHLD "
1460 DATA "LHLD ","STA  ","LDA  "
1470 FOR I= 0TO 15:READ HX$(I):NEXT
1480 DATA  0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
1490 RETURN