home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel Volume 2 #1
/
carousel.iso
/
comdore
/
64utils
/
diskread.prg
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1988-12-02
|
10KB
|
316 lines
100 IFPEEK(56)=127THENPOKE56,160:CLR:X=FRE(0)
110 REM* DISPLAY ANY TRACK $ SECTOR *
120 REM* ON THE DISK TO THE SCREEN *
130 REM* OR THE PRINTER *
140 REM******************************
150 PRINT"[147][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210][210]";
160 PRINT"DISPLAY BLOCK CONTENTS IN HEX & ALPHA"CHR$(13)SPC(10)"S[146]CREEN OR P[146]RINTER"
165 PRINT"[197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197][197]";
166 PRINT"(OR F1[146] SCALPEL F2[146] TRACE LINKS F3[146] END F5[146] LOAD ADDRESS";
167 PRINT" F7[146] 8K COPY)"
180 REM* SET PROGRAM CONSTANT *
190 REM******************************
200 SP$=" ":NL$=CHR$(0):HX$="0123456789ABCDEF"
210 FS$="":FORI=64 TO 95:FS$=FS$+""+CHR$(I)+"[146]":NEXT I
220 SS$=" ":FOR I=192 TO 223:SS$=SS$+""+CHR$(I)+"[146]":NEXT I
240 DIM A$(15),NB(2)
251 D$="0"
254 GETJJ$:IF JJ$="" THEN254
255 IF JJ$="S"THENPRINT" SCREEN[146]"
256 IF JJ$="P"THENPRINT" PRINTER[146]"
257 IFJJ$="[133]"THENRUN1000
258 IFJJ$="[134]"THENPRINT"END":@"I":END
259 IFJJ$="[137]"THENRUN2000
260 IFJJ$="[135]"THENRUN3000
261 IFJJ$="[136]"THENRUN4000
264 OPEN15,8,15,"I"+D$:GOSUB 650
265 OPEN4,4
270 OPEN 2,8,2,"#":GOSUB 650
280 REM******************************
290 REM* LOAD TRACK AND SECTOR *
300 REM* INTO DISK BUFFER *
310 REM******************************
320 INPUT"TRACK, SECTOR";T,S
330 IF T=0 OR T>35 THEN PRINT#15,"I"D$:CLOSE2:CLOSE4:CLOSE15:PRINT"END":END
340 IF JJ$="S" THEN PRINT"TRACK"T" SECTOR"S""
341 IF JJ$="P" THEN PRINT#4:PRINT#4,"TRACK"T" SECTOR"S:PRINT#4
350 PRINT#15,"U1:2,"D$;T;S:GOSUB650
360 REM******************************
370 REM* READ BYTE 0 OF DISK BUFFER *
390 REM******************************
400 PRINT#15,"B-P:2,1"
410 PRINT#15,"M-R"CHR$(0)CHR$(5)
420 GET#15,A$(0):IFA$(0)=""THENA$(0)=NL$
428 IF JJ$="S"THEN430
430 IF JJ$="P"THEN460
431 REM******************************
432 REM* READ & CRT DISPLAY *
433 REM* REST OF THE DISK BUFFER *
434 REM******************************
436 K=1:NB(1)=ASC(A$(0))
438 FOR J=0 TO 63:IF J=32 THEN GOSUB 710:IF Z$="N"THEN J=80:GOTO 458
440 FOR I=K TO 3
442 GET#2,A$(I):IF A$(I)="" THEN A$(I)=NL$
444 IF K=1 AND I<2 THEN NB(2)=ASC(A$(I))
446 NEXT I:K=0
448 A$="":B$=":":N=J*4:GOSUB 790:A$=A$+":"
450 FOR I=0 TO 3:N=ASC(A$(I)):GOSUB 790
452 C$=A$(I):GOSUB 850:B$=B$+C$
454 NEXT I:IF JJ$="S" THEN PRINTA$B$
458 NEXT J:GOTO571
460 REM******************************
462 REM* READ & PRINTER DISPLAY *
464 REM******************************
466 K=1:NB(1)=ASC(A$(0))
468 FOR J=0 TO 15
470 FOR I=K TO 15
472 GET#2,A$(I):IF A$(I)="" THEN A$(I)=NL$
474 IF K=1 AND I<2 THEN NB(2)=ASC(A$(I))
476 NEXT I:K=0
478 A$="":B$=":":N=J*16:GOSUB 790:A$=A$+":"
480 FOR I=0 TO 15:N=ASC(A$(I)):GOSUB 790:IF Z$="N"THEN J=40:GOTO 571
482 C$=A$(I):GOSUB 850:B$=B$+C$
484 NEXT I
486 IF JJ$="P" THEN PRINT#4,A$B$
488 NEXT J:GOTO571
571 REM******************************
572 REM* NEXT TRACK AND SECTOR *
573 REM******************************
575 PRINT"NEXT TRACK AND SECTOR"NB(1)NB(2) ""
580 PRINT"DO YOU WANT NEXT TRACK AND SECTOR (Y/N) F3[146] TO END ";
590 GET Z$:IF Z$="" THEN590
600 IF Z$="Y" THEN T=NB(1):S=NB(2):GOTO330
610 IF Z$="N" THEN 320
615 IFZ$="[134]"THENRUN
620 GOTO 590
630 REM******************************
640 REM* SUBROUTINES *
650 REM******************************
660 REM* ERROR ROUTINE *
670 REM******************************
680 INPUT#15,EN,EM$,ET,ES:IF EN=0 THEN RETURN
690 PRINT"DISK ERROR[146]"EN,EM$,ET,ES
700 END
710 REM******************************
720 REM* SCREEN CONTINUE MESSAGE *
730 REM******************************
740 PRINT"CONTINUE(Y/N)"
750 GETZ$:IF Z$="" THEN 750
760 IF Z$="N" THEN RETURN
770 IF Z$<>"Y" THEN 750
780 PRINT"[147]TRACK" T " SECTOR"S "[147]":RETURN
790 REM******************************
800 REM* DISK BYTE TO HEX PRINT *
810 REM******************************
820 A1=INT(N/16):A$=A$+MID$(HX$,A1+1,1)
830 A2=INT(N-16*A1):A$=A$+MID$(HX$,A2+1,1)
840 A$=A$+SP$:RETURN
850 REM******************************
860 REM* DISK BYTE TO ASC DISPLAY *
870 REM* CHARACTER *
880 REM******************************
890 IF ASC(C$)<32 THEN C$=" ":RETURN
910 IF ASC(C$)<128 OR ASC(C$)>159 THEN RETURN
920 C$=MID$(SS$,3*(ASC(C$)-127),3):RETURN
1000 REM *********SCALPEL*********
1002 BL$=" "
1003 DIMH$(16):H$="0123456789ABCDEF"
1010 PRINT"[147]"SPC(10)"SCALPEL[146] (J.MCA)"
1020 PRINTSPC(6)"(FOR DISK FILE SURGERY)"
1021 FORX=0TO15:H$(X)=MID$(H$,X+1,1):NEXT:EC=0
1022 PRINT SPC(8)"S[146]CREEN OR P[146]RINTER ? S[146]"
1023 PRINTSPC(8)"ERROR C[146]HECK[145][145]";SPC(9);
1024 GETP$:IFP$=""THEN1024
1025 PRINT"S[157]";:IFP$="P"THENP=1:OPEN4,4:PRINT"P";
1026 IFP$="C"THENEC=1:PRINT"C";
1027 PRINT:PRINTSPC(7)"B[146]LOCK OR DISK M[146]EMORY B[146][157]";
1028 GETM$:IFM$=""THEN1028
1029 PRINT"B[157]";:IFM$="M"THENM=1:PRINT"M";
1030 PRINT:IFMTHENPRINTSPC(10)"HIBYTE,LOBYTE";:GOTO1035
1031 PRINTSPC(10)"TRACK,SECTOR";
1035 INPUTT,S
1040 OPEN15,8,15:IFMTHENLB=S:HB=T:PRINT"[147]":GOTO1090
1050 OPEN3,8,3,"#"
1060 PRINT#15,"U1:"3;8;T;S:PRINT"[147]";
1070 INPUT#15,A$,B$,C$,D$:EN=VAL(A$)+EC
1080 PRINT""T"[157],"S"[157]:"A$B$C$","D$ "
1081 [139]EN[167][153][166]6)"CWAITONTINUE OR RWAITEPEAT ? CWAIT"
1082 [139]EN[167][153][166]6)"SWAITCALPEL MENU":[153][166]6)"MWAITAIN MENU"
1083 [139]EN[167][161]AN$:[139]AN$[178]""[167]1083
1085 [139]EN[167][139]AN$[178]"R"[167]1060
1087 [139]EN[167][139]AN$[178]"S"[167][160]3:[160]15:[138]1000
1088 [139]EN[167][139]AN$[178]"M"[167][160]3:[160]15:[138]
1090 Z$[178][199](0):[153]" 0: ";
1091 [139]P[167][152]4," 0: ";
1120 [129]Y[178]1[164]22:[129]X[178]1[164]12
1130 [139]M[167][152]15,"M-R"[199](LB)[199](HB):[161]#15,D$:[137]1140
1135 [161]#3,D$
1140 A[178][198](D$[170]Z$):H[178][181](A[173]16):L[178]A[171]H[172]16
1170 [153]H$(H)H$(L)" ";:[139]P[167][152]4,H$(H)H$(L)" ";
1175 [139]M[167]LB[178]LB[170]1:[139]LB[178]256[167]LB[178]0:HB[178]HB[170]1
1180 D[178]D[170]1:[139]D[178]256[167]1200
1190 [130]:[153]"CMD"[201]([196](D),3)": ";
1192 [139]P[167][152]4,[199](13)[201]([196](D),3)": ";
1195 [130]
1200 [139]P[167][152]4,[199](13):[160]4
1205 [139][168]M[167][160]3
1206 [160]15
1210 [153][199](13)"F1WAIT=AGAIN F2WAIT=WRITE F3WAIT=QUIT F4WAIT=XFER BLK ";
1215 [153][166]4)"F5WAIT/F6WAIT ON/OFF MEMORY MODE";
1220 P[178]1024[170]39[170]6:SC[178]1024:E[178]1919:B[178]1069
1250 [161]K$:[139]K$[178]""[167]C[178][194](P):[151]P,C[170]128:[129]I[178]0[164]40:[130]:[151]P,C:[129]I[178]0[164]40:[130]:[137]1250
1260 [139]K$[178]"INPUT"[167][138]1000
1261 [139]K$[178]"READ"[167]M[178]1
1262 [139]K$[178]"IF"[167]M[178]0
1263 [139]K$[178]"GOTO"[167]1500
1265 [139]K$[178]"DIM"[167][138]
1266 [139]K$[178]"RUN"[167][153]BL$;:[153]"TRACK,SECTOR ? ";
1267 [139]K$[178]"RUN"[167][139]M[167][153]BL$;:[153]"HIBYTE,LOBYTE ? ";
1269 [139]K$[178]"RUN"[167][159]6,0:[132]6,T,S:[160]6:[137]1500
1270 [139]K$[178]""[175]P[179]E[167]P[178]P[170]1
1271 [139]K$[178]"CMD"[175]P[177]B[167]P[178]P[171]1
1275 P1[178]P[171]SC:PI[178]40[172][181](P1[173]40):PD[178]P1[171]PI
1277 [139]K$[178]"CMD"[175]PD[179]5[167]P[178]P[171]5:[137]1250
1278 [139]PD[179]5[167] P[178]P[170]5:[137]1250
1279 [139]K$[179][177]"CMD"[167][139](PD[171]7)[173]3[178][181]((PD[171]7)[173]3)[167]P[178]P[170]1:[137]1250
1280 [139]K$[178]""[175]P[179](E[171]39)[167]P[178]P[170]40:[137]1250
1290 [139]K$[178]"ON"[175]P[177](B[170]39)[167]P[178]P[171]40:[137]1250
1300 K[178][198](K$)
1310 [139]K[178]32[167]K$[178]"":[137]1270
1320 [139]K[177]47[175]K[179]58[167][151]P,K:K$[178]"":[137]1270
1330 [139]K[177]64[175]K[179]71[167][151]P,K[171]64:K$[178]"":[137]1270
1450 [137]1250
1500 :[153]BL$"WRITING";T"CMD,"S"CMD WAIT";
1550 [159]15,8,15:[139]M[167]LB[178]S:HB[178]T:P[178]B:[137]1570
1555 [159]6,8,6,"#"
1560 [152]15,"B-P:"6;0:P[178]B
1570 [129]Y[178]1[164]22:[129]X[178]1[164]12:[139]P[177]E[167]P[178]0:D[178]0:[137]1691
1600 CH[178][194](P):CL[178][194](P[170]1):[151]P,32:[151]P[170]1,32
1630 [139]CH[177]47[167]H[178]16[172](CH[171]48)
1640 [139]CL[177]47[167]L[178]CL[171]48
1650 [139]CH[179]7[167]H[178]16[172](9[170]CH)
1660 [139]CL[179]7[167]L[178]9[170]CL
1665 [139]M[167]:[152]15,"M-W"[199](LB)[199](HB)[199](1)[199](H[170]L)
1666 [139]M[167]LB[178]LB[170]1:[139]LB[178]256[167]LB[178]0:HB[178]HB[170]1:[137]1680
1667 [139]M[167]1680
1670 [152]6,[199](H[170]L);
1680 P[178]P[170]3
1690 [130]:P[178]P[170]4:[130]
1691 [139]M[167][160]15:[137]1040
1700 [152]15,"U2:"6;8;T;S
1750 [132]15,A$,B$,C$,D$
1800 [153]BL$""T"CMD,"S"CMD:"A$B$C$","D$" (WRITE) WAIT"
1820 [160]6:[160]15:D[178]0
1850 [159]15,8,15:[159]3,8,3,"#"
1860 [152]15,"U1:"3;8;T;S
1861 [132]15,A$,B$,C$,D$:D$[178]D$[170]" READBACK ":EN[178][197](A$)
1900 [137]1080
2000 [153]"LOAD"[166]9)"TRACE LINKS (J MCA)":[153][166]9)"ONONSWAITCREEN OR PWAITRINTER"
2001 [161]ANS$:[139]ANS$[178]""[167]2001
2002 [153]"NWAITAME (*) OR TWAITRACK & SECTOR"
2003 [161]RE$:[139]RE$[178]""[167]2003
2004 [139]RE$[178]"T"[167]2010
2005 [153]"NAME(*)";:[133]NA$:[139]NA$[178]"$"[167]T[178]18:S[178]1:[137]2012
2006 [159]15,8,15:[159]1,8,3,NA$:[160]1
2007 [152]15,"M-R"[199](24)[199](0)[199](2):[161]#15,T$,S$:[160]15
2008 T[178][198](T$[170][199](0)):S[178][198](S$[170][199](0))
2009 [137]2012
2010 [153]"TRACK,SECTOR";
2011 [133]T,S
2012 [139]ANS$[178]"S"[167]2200
2015 [159]15,8,15:[159]4,4
2020 [159]3,8,3,"#"
2030 [152]15,"U1:"3;8;T;S
2040 [132]15,A$,B$,C$,D$:B[178]B[170]1
2050 [152]4,"BLK#"B":"T","S;" "A$;B$;C$;D$" ";
2090 [161]#3,T$,S$:T[178][198](T$[170][199](0)):S[178][198](S$[170][199](0))
2095 [152]4,T;","S
2096 [139]T[178]0[167]2120
2100 [137]2030
2120 [152]4:[160]4:[160]3:[160]15:[138]
2200 :
2215 [153]"HOLD DOWN SHIFT KEY TO STOP SCROLL"
2220 [159]15,8,15
2230 [159]3,8,3,"#"
2240 [152]15,"U1:"3;8;T;S
2250 [132]15,A$,B$,C$,D$
2255 B[178]B[170]1:[153]"BLK#"B":";
2260 [153]T","S;" "A$;B$;C$;D$" ";
2270 [161]#3,T$,S$:T[178][198](T$[170][199](0)):S[178][198](S$[170][199](0))
2280 [153]T;","S
2290 [139]T[178]0[167]2310
2295 [139][194](654)[178]1[167]2295
2300 [137]2240
2310 [160]3:[160]15
2320 [153]"F3WAIT TO END F1WAIT=AGAIN";
2325 [161]ANS$:[139]ANS$[178]""[167]2325
2330 [139]ANS$[178]"INPUT"[167][138]2000
2335 [139]ANS$[178]"DIM"[167][138]
2340 [137]2325
3000 [153] "LOADDISPLAY 'LOAD ADDRESS' OF A FILE"
3015 [153] "FILE ";:[133]F$
3018 [153] "LOAD ADDRESS:";
3020 [159]1,8,3,"0:"[170]F$
3030 [161] #1,L$,H$
3050 X$[178]H$:[141]3100:H[178]X[172]256
3060 X$[178]L$:[141]3100:L[178]X:[153]H[170]L
3080 [160]1:[153]"F1WAIT AGAIN F3WAIT END
3090 GETANS$:IFANS$=""THEN3090
3093 IFANS$="[133]"THENRUN3000
3094 IFANS$="[134]"THENRUN
3095 GOTO3090
3100 IF X$="" THEN X=0:RETURN
3110 X=ASC(X$):RETURN
4000 REM***** 8K COPY ********
4010 IFPEEK(56)<>127THENPOKE56,127:A=FRE(0):RUN4010
4015 BL$=" "
4020 PRINT"[147]"SPC(10)"COPY*8*[146] (J.MCA)"
4025 PRINTSPC(6)"(COPIES 8K OF DISK DATA)":GOSUB4500
4030 PRINTSPC(6)"START AT TRACK,SECTOR";
4040 INPUTT,S:TS=T:SS=S:SA=32768:Z$=CHR$(0):AD=SA
4050 OPEN15,8,15:OPEN3,8,3,"#"
4055 FORBK=1TO32
4060 PRINT#15,"U1:"3;8;T;S
4070 INPUT#15,A,B$,C$,D$
4080 PRINT"[147]"T"[157],"S"[157]:"A"[157]"B$C$","D$" ST:"ST"[157] BLOCK# "BK"[146]"
4090 IFA=0THENES=0:GOTO4110
4100 ES$="R":ES=1:GOTO4200
4110 TL=T:SL=S:BL=BK
4115 GET#3,T$,S$:T=ASC(T$+Z$):S=ASC(S$+Z$)
4120 IFT=0THENBK=32
4130 POKEAD,T:AD=AD+1:POKEAD,S:POKE840,127+BL
4140 SYS828
4160 AD=AD+255:NEXTBK
4200 PRINT:PRINT"LAST BLOCK SUCESSFULY READ:"
4201 PRINT"TRACK"TL"SECTOR"SL"BLOCK#"BL
4202 IFES=0 THEN PRINT"NO READ ERRORS"
4203 IFES=1THENPRINT"STOPED BY READ ERROR"
4205 PRINT"EXCHANGE DISKS F1[146] TO WRITE"
4210 CLOSE3:CLOSE15
4220 GETAN$:IFAN$=""THEN4220
4230 IFAN$<>"[133]"THENSTOP
4240 AD=SA:T=TS:S=SS
4250 OPEN15,8,15:OPEN6,8,6,"#"
4260 FORX=1TOBL
4270 PRINT#15,"B-P:"6;0
4280 TN=PEEK(AD):AD=AD+1:SN=PEEK(AD)
4290 POKE857,127+X
4300 SYS848
4310 AD=AD+255
4330 PRINT#15,"U2:"6;8;T;S
4340 INPUT#15,A,B$,C$,D$
4350 PRINTBL$""T"[157],"S"[157]:"A"[157]"B$C$","D$" ST:"ST"[157] BLOCK# [157]"X"[146]"
4352 FORL=0TONE:IFNE<>0THENPRINT
4353 NEXT
4355 IFA<>0THENPRINT"ERROR"T","S:NE=NE+1
4360 T=TN:S=SN:NEXT
4370 CLOSE6:CLOSE15:POKE56,160:CLR:F=FRE(0)
4380 PRINT:PRINT"F1[146]=AGAIN F3[146]=END";
4390 GETAN$:IFAN$=""THEN4390
4400 IFAN$="[133]"THENRUN4010
4410 RUN
4500 FORA=828TO867:READB:POKEA,B:NEXT
4510 DATA 162,3,32,198,255,160,2,32,165,255,153,0,48,200,208,247,32,204,255,96
4520 DATA 162,6,32,201,255,160,0,185,0,48,32,168,255,200,208,247,32,204,255,96
4530 RESTORE:RETURN