10DEFFNS="Tcopy"
20MODE7+128
30VDU23;8202;0;0;0;
40A$="D"
50REPEAT
60IFA$<>"" READ A$
70IFA$<>"" PROCprt(A$)
80K%=INKEY0
90UNTILK%=89 OR K%=78
100IF K%=89 ?&73=2 ELSE ?&73=3
110CLS
120RESTORE 2130
130A$="D"
140REPEAT
150IFA$<>"" READ A$
160IFA$<>"" PROCprt(A$)
170A%=INKEY0
180UNTILA%>64 AND A%<91
190A%=A%-1
200PROCa
210CLS
220PROCprt("Tape Backup by C.J.Richard
son")
230CALL start
240END
250DEFPROCa
260FORL%=0TO2STEP 2
270P%=&B00
280[
290OPT L%
300½
310.start
320LDA#28:JSR&FFEE ½ DEFINE TEXT WINDO
W
330LDA#0:JSR&FFEE
340LDA#24:JSR&FFEE
350LDA#39:JSR&FFEE
360LDA#18:JSR&FFEE
370LDY#0:LDX#1:LDA#&D2:JSR&FFF4 ½ SOUN
D OFF BECAUSE IT'S ANNOYING
380LDA#&83:JSR&FFF4 ½ READ
OSHWM
390STY&72
400LDA#1 ½ SOUR
CE FILING SYSTEM (CFS)
410STA&70 ½ SOUR
CE FILING SYSTEM FLAG AT &70
420LDA#0
430LDY#0
440JSR&FFDA ½ READ
PRESENT (DESTINATION) FILING SYSTEM.
450STA&71 ½ STOR
E IT IN &71 1=CFS 4=DFS 8=ADFS
460½
470.main
480LDA&70 ½ GET
SOURCE FILING SYSTEM
490JSR change`filing`system ½ CHAN
GE TO SOURCE SYSTEM
500LDA#&8B:LDX#1:LDY#2:JSR&FFF4 ½ SET
*OPT TO 1 2 FOR DISPLAY PURPOSES
510JSR unlock`tape ½ NAUG
HTY BIT JUST IN CASE IT'S A LOCKED TAPE
520JSR load ½ LOAD
FROM SOURCE SYSTEM
530JSR output`name ½ PRIN
T THE NAME IF THE PRINTER IS ON
540LDA&71 ½ GET
DESTINATION SYSTEM
550JSR change`filing`system ½ CHAN
GE TO DESTINATION SYSTEM
560JSR save ½ SAVE
TO DESTINATION SYSTEM
570JMP main
580½
590.change`filing`system ½ Y CO
NTAINS SYSTEM NUMBER
600CMP#1
610BEQ ctt
620CMP#4
630BEQ ctd
640LDX#adfs MOD 256
650LDY#adfs DIV 256
660JMP&FFF7
670.ctd
680LDX#dfs MOD 256
690LDY#dfs DIV 256
700JMP&FFF7
710.ctt
720LDX#0
730LDA#&8C
740JMP&FFF4
750.adfs
760EQUB ASC"A"
770EQUB ASC"D"
780EQUB ASC"."
790EQUB 13
800.dfs
810EQUB ASC"D"
820EQUB ASC"I"
830EQUB ASC"."
840EQUB 13
850½
860.unlock`tape
870LDA#&0D:LDX#4:JSR&FFF4 ½ DISABLE EV
ENT SO WE DON'T CRASH IF IT'S RUN TWICE
880LDA#unlock MOD 256
890STA&220
900LDA#unlock DIV256
910STA&221
920LDA#&0E
930LDX#4
940JSR&FFF4 ½ SET AN INTERRUPT TO LOOK
FOR A LOCKED FILE
950.unlock ½ UNLOCK A TAPE FILE
960LDA&3CA
970AND#254
980STA&3CA
990RTS
1000½
1010.parameter`block ½ PROBABLY A BETTE
R WAY. BUT I CAN KEEP AN EYE ON IT HERE
1020NOP:NOP:NOP:NOP:NOP:NOP:NOP:NOP:NOP
:NOP:NOP:NOP:NOP:NOP:NOP:NOP:NOP:NOP
1030½
1040.file`name
1050EQUB&D:EQUB A%:EQUB32:EQUB&D ½ FILE
NAME STORE.
1060½
1070.load
1080LDA#0
1090LDY#17
1100.loop
1110STA parameter`block,Y
1120DEY
1130BNE loop ½ BLANK
1140LDA#file`name MOD 256
1150STA parameter`block ½ LSB FIL
ENAME
1160LDA#file`name DIV 256
1170STA parameter`block+1 ½ MSB FIL
ENAME
1180LDA#0
1190STA parameter`block+2 ½ LSB LOA
D ADDRESS
1200LDA&72
1210STA parameter`block+3 ½ MSB LOA
D ADDRESS
1220LDA#&FF
1230½
1240.doit
1250LDX#parameter`block MOD 256 ½ LSB P
ARAMETER BLOCK
1260LDY#parameter`block DIV 256 ½ MSB P
ARAMETER BLOCK
1270JMP&FFDD ½ DO IT
1280½
1290.save
1300LDA&71
1310CMP#1
1320BEQ cfs
1330INC file`name+1 ½ CHANG
E TO NEXT FILE NAME
1340LDA file`name+1
1350CMP#91
1360BNE no`need`to`change
1370LDA#97:STA file`name+1
1380LDA#ASC"1"
1390STA file`name+2 ½ TO ST
OP ODD FILE NAMES
1400.no`need`to`change
1410CMP#123
1420BNE still`no`need`to`change
1430LDA#65
1440STA file`name+1
1450LDA#32
1460STA file`name+2 ½ START
AT A AGAIN
1470.still`no`need`to`change
1480LDA file`name+1:JSR&FFEE
1490LDA file`name+2:JSR&FFEE
1500LDA file`name+3:JSR&FFEE
1510LDA#10:JSR&FFEE
1520LDA#3:JSR&FFEE
½ PRINT IT
1530LDA#(file`name+1) MOD 256:STA param
eter`block ½ LSB FILENAME
1540LDA#(file`name+1) DIV 256:STA param
eter`block+1 ½ MSB FILENAME
1550. not`cfs
1560LDA parameter`block+10:STA paramete
r`block+14 ½ SHIFT LENGTH LSB
1570LDA parameter`block+11:ADC&72:STA p
arameter`block+15 ½ SHIFT LENGTH MSB
1580LDA#0:STA parameter`block+10
½ LSB LOAD ADDRESS
1590LDA&72:STA parameter`block+11
½ MSB LOAD ADDRESS
1600LDA#&0:JMPdoit
1610½
1620.cfs
1630LDA#&B2:STA parameter`block
1640LDA#3:STA parameter`block+1
1650LDY#&FF
1660LDA#32
1670.loop3
1680JSR&FFEE
1690INY
1700LDA &3B2,Y
1710CMP#0
1720BNE loop3
1730LDA#&D
1740JSR&FFEE
1750STA&3B2,Y
1760LDA#10:JSR&FFEE
1770LDA#3:JSR&FFEE
1780LDA#&B2:STA parameter`block
1790LDA#3:STA parameter`block+1
1800JMP not`cfs
1810½
1820.output`name
1830LDA&73:JSR&FFEE ½ EITHER SWITCH THE
PRINTER ON OR NOT AS THE CASE MAY BE
1840LDY#0 ½ INITIALISE A COUN
T
1850.loop2 ½ INITIALISE A LOOP
1860LDA&3B2,Y ½ &3B2 IS WHERE THE
FILE NAME ENDS UP
1870INY ½ INCREASE THE COUN
T
1880CMP#0 ½ END OF THE NAME W
HY CAN'T THEY TERMINATE IT WITH &D?
1890BEQ out ½ IF IT IS THE END
LET'S GET OUT OF IT QUICK
1900CMP#32
1910BMI miss:JSR&FFEE
1920.miss ½ IF IT ISN'T LET'S
SEND IT TO THE SCREEN
1930JMP loop2 ½ CARRY ON COZ WE H
AVEN'T FINISHED YET
1940.out ½ LET'S CLEAR OFF W
HILE THE GOING'S GOOD.
1950LDA #ASC" ":JSR&FFEE ½ PRI
NT Now>
1960LDA #ASC"N":JSR&FFEE
1970LDA #ASC"o":JSR&FFEE
1980LDA #ASC"w":JSR&FFEE
1990LDA #ASC">":JSR&FFEE
2000LDA #ASC" ":JMP&FFEE
2010]
2020NEXT
2030ENDPROC
2040DEFPROCprt(A$):A$=A$+STRING$(LENA$M
OD2," "):FORL%=1TOLENA$:PRINTTAB(18-L%/2
);"
,L%/2):VDU11,11:NEXT:VDU10,10:ENDPROC
2050REM
2060REM
2070DATATape Backup by C.J.Richardson
2080DATAThis program will backup from t
ape
2090DATAto the present filing system.
2100DATAIt will not do it for ALL files
.
2110DATAPRINTER ON? Y/N
2120DATA
2130DATATa. When you've done. Rename al
l
2140DATAThe files accordingly. But you
2150DATAwill have to change the program
s
2160DATAyourself sometimes.
2170DATAIf copying tape to tape then
2180DATAfile names are not changed.
2190DATAThe new file names run from A t
o z1
2200DATASelect first file name:
2210DATAA to Z
2220DATA