8-Bit Software Online Conversion
:2.$.BACKUP - Listing
10REM 'FASTBAK'
20REM Speedy back-up of part or whole
of one side
30:
40REM Change the beep
50*FX213,10
60*FX214,1
70:
80MODE7
90ON ERROR PROCanother
100HIMEM=&2C00:DIM block% 12 :REM data
block for disk operations
110:
120PRINT CHR$(141);" DISK BACKU
P UTILITY"
130PRINT CHR$(141);" DISK BACKU
P UTILITY"
140REMPRINT''"Ensure SOURCE disk is wr
ite-protected"
150VDU28,0,24,39,6,12
160:
170REPEAT *FX15,0
180INPUT'"Enter SOURCE drive (0 to 3):
"sdr%
190UNTIL sdr%>-1 AND sdr%<4
200:
210REPEAT *FX15,0
220INPUT''"Enter DESTINATION drive (0
to 3): "ddr%
230UNTIL ddr%>-1 AND ddr%<4
240:
250PROCloadcat
260PROCwhich`track
270PROCcopy
280PROCanother
290END
300:
310DEF PROCloadcat :REM checking disk
catalogue
320?block%=sdr% :REM source drive
330block%!1=&900 :REM load address in
RAM
340block%?5=3 :REM number of parame
ters
350block%?6=&53 :REM 'read' command b
yte
360block%?7=0 :REM track /2nd page
of-
370block%?8=1 :REM sector /disk cat
alogue
380block%?9=&21 :REM 1 sector of 256
bytes
390A%=&7F :REM Read/Write opera
tion required
400X%=block% MOD &100 :REM address of-
410Y%=block% DIV &100 :REM data block
420CALL &FFF1
430ENDPROC
440:
450DEF PROCwhich`track
460B%=&90C
470sectors%=(B%?2/&10 AND &3)*&100+(B%
?1)+ABS(?B%>0)+(B%?2 AND &3)*&100+(B%?3)
480trk%=sectors% DIV 10+ABS(sectors% M
OD 10>-1)
490IF trk%>80 trk%=80
500ENDPROC
510:
520DEF PROCcopy
530store%=0
540IF trk%<8 GOTO 810
550FOR main%=1 TO trk% DIV 8
560track%=store%
570buffer%=&2C00
580CLS
590PRINT TAB(0,4)"Number of tracks"
600PRINT TAB(0,5)"to be backed up:-"
610PRINT CHR$(141);" ";trk%-track
%
620PRINT CHR$(141);" ";trk%-track
%
630REM PROCinsert("SOURCE")
640FOR loop%=0 TO 7
650address%=buffer%+(loop%*&A00)
660PROCtransfer(sdr%,address%,&53,trac
k%)
670track%=track%+1
680NEXT
690:
700buffer%=&2C00
710track%=store%
720REM PROCinsert("DESTINATION")
730FOR loop%=0 TO 7
740address%=buffer%+(loop%*&A00)
750PROCtransfer(ddr%,address%,&4B,trac
k%)
760track%=track%+1
770NEXT
780store%=track%
790NEXT
800IF trk% MOD 8=0 ENDPROC
810track%=store%
820buffer%=&2C00
830CLS
840PRINT TAB(0,4)"Number of tracks"
850PRINT TAB(0,5)"to be backed up:-"
860PRINT CHR$(141);" ";trk%-track
%
870PRINT CHR$(141);" ";trk%-track
%
880REM PROCinsert("SOURCE")
890FOR loop%=1 TO trk% MOD 8
900address%=buffer%+(loop%*&A00)
910PROCtransfer(sdr%,address%,&53,trac
k%)
920track%=track%+1
930NEXT
940:
950buffer%=&2C00
960track%=store%
970REM PROCinsert("DESTINATION")
980FOR loop%=1 TO trk% MOD 8
990address%=buffer%+(loop%*&A00)
1000PROCtransfer(ddr%,address%,&4B,trac
k%)
1010track%=track%+1
1020NEXT
1030ENDPROC
1040:
1050DEF PROCinsert(A$)
1060PRINT''"Please insert the ";A$;" di
sk and press a key":VDU7
1070diskin=GET
1080ENDPROC
1090:
1100DEF PROCtransfer(drive%,address%,co
mmand,track%)
1110?block%=drive% :REM sdr% or ddr%
1120block%!1=address% :REM address in R
AM
1130block%?5=3 :REM number of pa
rameters
1140block%?6=command :REM &53 or &4B
1150block%?7=track% :REM track
1160block%?8=0 :REM sector(alway
s zero)
1170block%?9=&2A :REM 10 sectors o
f 256 bytes
1180block%?10=0 :REM error-check
byte
1190A%=&7F :REM Read/Write o
peration required
1200X%=block% MOD 256 :REM address of-
1210Y%=block% DIV 256 :REM data block
1220CALL&FFF1
1230IF block%?10=18 PRINT''"Make certai
n that DESTINATION disk is not write-p
rotected, and try again":END
1240IF block%?10<>0 PRINT''"Disc error,
please check and try again":END
1250ENDPROC
1260:
1270DEF PROCanother
1280CLS:PRINT''''"Do you want to backup
another disk?(Y/N)":repeat$=GET$
1290IFINSTR("Yy",repeat$)THEN RUN ELSE
PAGE=&6000:CHAIN"$.CONTROL"
1300ENDPROC
1310:
1320DEF PROCerror
1330CLOSE#0
1340REPORT:PRINT" at line ";ERL
1350ENDPROC