image of READY prompt

Wang2200.org

Listing of file='2229FB' on disk='vmedia/mvp-diag-2.6.2.wvd.zip'

# Sector 1474, program filename = '2229FB'
0010 COM F9$
   : F9$="2229FB"
   : LOAD T"2229STRT"
0020 REM % FILE "2229FB"  -  Part of 2229 utilities package  ST 01/21/1983
0030 REM % Back up files to tape
0040 SELECT PRINT 005(80),CO 005(80),LIST 005(80)
   : RETURN CLEAR ALL
0050 DIM T$30,K$1,A1$(16,16)64,E$20,C$2,D$3,C(4),S$30,F$8,F1$(2048)8,L$2,I1$8,
     M$60,V$(16),D1$6,T1$6,L1$3,F$(16),F2$(16)
0060 LOAD T#1,"2229SUB"5000,8999BEG 70
0070 INIT(00)V$()
   : FOR D=1TO 4
   : C(D)=0
   : NEXT D
   : REM CLEAR OUT SECTOR ARRAY
0080 T$="BACKUP FILES TO TAPE"
   : $OPEN #4
   : GOSUB '151
   : V=1
   : REM EXPECTED TAPE SEQUENCE #
0090 F$=" "
   : PRINT AT(2,0);"Reference file name";
   : PRINT AT(2,22);
   : LINPUT -F$
   : ERRORGOTO 90
0100 REM % Get source disk address
   : PRINT HEX(0F),AT(2,32,49);
0110 A=0
   : IF D$=" "THEN D$="D11"
   : PRINT AT(3,0);
   : PRINT "Reference file address  ";AT(3,22);
   : LINPUT -D$
   : SELECT #2<D$>
   : ERRORA=1
   : GOTO 130
0120 VERIFY T#2,(0,0)A
   : ERRORA=1
0130 IF A=0THEN 140
   : PRINT AT(3,30);"ERROR ";ERR;HEX(07);
   : GOTO 100
0140 LIMITS T#2,F$,D,D,D,D
   : IF D=2THEN 150
   : PRINT AT(2,33);"File not on disk";HEX(07);
   : GOTO 90
0150 PRINT AT(2,33,40);
   : PRINT AT(3,30,40);
   : I1$="INDEX"
   : ADD(STR(I1$,1,5),80)
0160 DATA LOAD DC OPEN T#2,F$
   : ERRORGOTO 9000
0170 F1$(),F$=ALL(00)
   : DATA LOAD DC #2,D$,F1$()
   : ERRORGOTO 9000
0180 SELECT #2<D$>
   : REM FILES ARE LOCATED ON THIS PLATTER
   : MAT SEARCHF1$(),=F$TO L$STEP 8
   : REM FIND LAST NAME
   : L2=VAL(L$,2)
   : C2=0
   : IF L2>0THEN 190
   : STOP "No file names present in reference file"
   : GOTO 80
0190 L2=(L2-1)/8
   : REM # OF FILE NAMES
   : PRINT AT(2,45);"Number of files ";AT(2,64);L2
   : PRINT AT(3,45);"Files located on ";
   : PRINT AT(3,65);D$
   : PRINT HEX(06),AT(4,0,);AT(6,0);"Checking reference file:"
   : L3=0
0200 L3=L3+1
   : IF L3>L2THEN 220
   : LIMITS T#2,STR(F1$(),(L3-1)*8+1,8),D,D,D,D
   : PRINT HEX(06);AT(10,0);
   : PRINTUSING 210,L3,STR(F1$(),(L3-1)*8+1,8)
   : IF D<>0THEN 200
   : PRINT "File ";STR(F1$(),(L3-1)*8+1,8);" is not on disk"
   : STOP #
   : GOTO 80
0210 %File ####   ########
0220 L3=1
   : REM FIRST FILE
   : I=1
   : REM DO INDEX FIRST
   : GOSUB '240
   : REM SET UP VOLUME LABEL
   : GOSUB '241
   : REM SET UP FILE LABEL
   : MAT COPY F$()TO F2$()
   : REM COPY TO INDEX LABEL
   : STR(F2$(),1,4)="FHDR"
0230 STR(F2$(),5,2)=BIN(0,2)
   : REM INDEX ALWAYS FIRST FILE
   : STR(F2$(),7,1)=HEX(01)
   : REM SEQ ALWAYS 1
   : STR(F2$(),44,1)=HEX(00)
   : REM NO CONT FLAG
   : STR(F2$(),69,5)=I1$
   : STR(F2$(),8,8)=STR(V$(),5,8)
   : C=0
   : STR(F2$(),28,2)=BIN(C,2)
0240 GOSUB '102
   : REM TAKE STATUS
   : IF V>1THEN 250
   : PRINT HEX(06);AT(05,0,)
   : M$="Insert cartridge and press ONLINE"
   : GOSUB '160
   : GOSUB '152
0250 GOSUB '104
   : REM LOAD TAPE
   : C3=0
   : REM OUT OF TAPE FLAG OFF
0260 K$=HEX(10)
   : STR(S$,08,1)=AND K$
   : IF STR(S$,08,1) =HEX(00)THEN 270
   : M$="Tape is write protected"
   : GOSUB '160
   : GOSUB '152
   : GOTO 250
0270 PRINT HEX(06);AT(06,0,);
   : PRINTUSING 280,V
   : STR(F$(),5,2)=BIN(0,2)
   : REM CLEAR FIRST FILE SEQ ON TAPE
0280 %Tape sequence number  ##
0290 REM WRITE FILE MARK
   : GOSUB '115
   : IF E=0THEN 300
   : IF E<>3THEN 9050
   : GOSUB '208
   : GOTO 290
0300 CONVERT VTO STR(V$(),13,2),(##)
   : MAT COPY V$()TO A1$()
   : REM MOVE LABEL INTO DATA BLOCK
   : V=V+1
0310 GOSUB '213
   : REM WRITE VOLUME HEADER LABEL AND DO ENDWRITE
   : IF E=0THEN 320
   : IF E<>3THEN 9050
   : GOSUB '208
   : GOTO 310
0320 REM % START WRITING FILE
   : GOSUB '115
   : REM WRITE FILE MARK
   : IF E=0THEN 330
   : IF E=2THEN 570
   : REM IF OUT OF TAPE, WRITE FM AND VOL TRAILER
   : IF E<>3THEN 9050
   : GOSUB '208
   : GOTO 320
0330 IF I=0THEN 340
   : REM INDEX ON VOL SEQ 1 ONLY
   : MAT COPY F2$()TO A1$()
   : GOTO 380
0340 STR(F$(),69,8)=STR(F1$(),(L3-1)*8+1,8)
   : STR(F$(),77,1)=HEX(00)
   : REM MOVE FILE NAME TO FILE HEADER
   : STR(F$(),5,2)=ADDCHEX(01)
   : IF C2=1THEN 370
   : REM IF FILE PARTIALLY DONE DON'T GET LIMITS
0350 REM % GET FILE START AND END
   : LIMITS T#2,STR(F$(),69,8),S1,G3,D,D
   : ERRORM$="File is not on disk"
   : GOSUB '160
   : REM SHOULD HAVE BEEN PICKED UP EARLIER
0360 STR(F$(),42,2)=BIN(G3-S1+1,2)
   : REM SAVE FILE SIZE IN USER DEFINED BYTES
   : IF ABS(D)=2THEN STR(F$(),36,1)="D"
   : ELSE STR(F$(),36,1)="P"
0370 GOSUB '245
   : REM SET UP FILE HEADER
   : MAT COPY F$()TO A1$()
   : REM MOVE LABEL INTO DATA ARRAY
0380 M$=" "
   : GOSUB '160
   : IF I=1THEN PRINTUSING 390,Q8
   : ELSE PRINTUSING 390,L3
   : PRINT HEX(020402000E);STR(A1$(),69,8);HEX(0F)
   : GOSUB '213
   : REM WRITE FILE HEADER
   : IF E=0THEN 400
   : IF E=2THEN 580
   : REM OUT JUMP IF OUT OF TAPE
   : IF E<>3THEN 9050
   : GOSUB '208
   : GOTO 380
0390 %File number ####
0400 IF I=0THEN 430
   : L3=0
0410 A1$()=ALL(00)
   : L7,L9=1
0420 STR(A1$(),L9,8)=STR(F1$(),(L7-1)*8+1,8)
   : REM COPY FILE NAME
   : L3=L3+1
   : L7=L7+1
   : L9=L9+80
   : IF L9>=16320THEN 440
   : REM DATA BUFFER FULL
   : IF L3>L2THEN 440
   : REM ALL FILE NAMES MOVED
   : GOTO 420
0430 GOSUB '225
   : REM GET DATA BLOCK
   : B=P-1
   : REM # OF BYTES FROM DISK
0440 IF I=1THEN B=16384
   : GOSUB '113
   : REM WRITE DATA
   : IF E<>0THEN 470
   : IF I=0THEN 450
   : IF L3>L2THEN 460
   : GOTO 410
0450 IF S1<G3THEN 430
   : REM IF NOT DONE, GET MORE DATA
0460 REM ELSE GET RESULTS OF WRITE
   : GOSUB '220
0470 REM % EXAMINE  WRITE RESULTS
   : IF E=0THEN 480
   : IF E=2THEN 480
   : IF E<>3THEN 9050
   : GOSUB '208
   : GOTO 440
0480 REM % Out of tape or finished file - finish off file labels and continue
     on next cartridge if not done
0490 IF STR(R$,2,1)=HEX(00)THEN 500
   : S1=C(VAL(STR(R$,2,1))+1)
   : REM RESET STARTING SECTOR ADDRESS TO ACCOUNT FOR BLOCKS NOT WRITTEN
   : C=C-VAL(STR(R$,2,1))
   : REM CORRECT WRITTEN BLOCK COUNT
0500 GOSUB '115
   : REM WRITE FILE MARK
   : IF E=0THEN 510
   : IF E=2THEN 500
   : REM IF OUT OF TAPE, REPEAT AND FINISH THIS TAPE
   : IF E<>3THEN 9050
   : GOSUB '208
   : GOTO 500
0510 IF I=0THEN 520
   : STR(F2$(),1,4)="FEND"
   : STR(F2$(),28,2)=BIN(C,2)
   : MAT COPY F2$()TO A1$()
   : GOTO 530
0520 GOSUB '242
   : REM SET UP FILE TRAILER FOR NON INDEX FILES
   : MAT COPY F$()TO A1$()
0530 REM % Write file trailer
0540 GOSUB '213
   : IF E=0THEN 550
   : IF E=2THEN 540
   : REM IF OUT OF TAPE, REPEAT AND FINISH
   : IF E<>3THEN 9050
   : GOSUB '208
   : GOTO 540
0550 IF I=0THEN 560
   : I=0
   : L3=1
   : REM START WITH FIRST REAL FILE
   : GOTO 320
0560 IF S1>G3THEN L3=L3+1
   : REM INC FILE POINTER IF ALL SECTORS WRITTEN
   : IF C3<>0THEN 570
   : REM IF OUT OF TAPE, CONTINUE
   : IF L3<=L2THEN 320
   : REM JUMP IF ALL FILES NOT DONE
0570 GOSUB '115
   : REM WRITE FILE MARK
   : IF E=0THEN 580
   : IF E=2THEN 570
   : REM IF OUT OF TAPE, REPEAT AND FINISH
   : IF E<>3THEN 9050
   : GOSUB '208
   : GOTO 570
0580 REM % Write volume trailer
0590 STR(V$(),1,4)="VEND"
   : STR(V$(),39,8)=STR(V$(),5,8)
   : IF L3<L2THEN 600
   : IF S1<=G3THEN 600
   : STR(V$(),39,8)=ALL(20)
   : REM CLEAR NEXT VOLUME NAME
0600 MAT COPY V$()TO A1$()
0610 GOSUB '213
   : REM WRITE LABEL
   : IF E=0THEN 620
   : IF E=2THEN 610
   : REM OUT OF TAPE - REPEAT
   : IF E<>3THEN 9050
   : GOSUB '208
   : GOTO 590
0620 GOSUB '105
   : IF S1<=G3THEN 630
   : REM JUMP IF THIS FILE NOT DONE
   : C2=0
   : IF L3<L2THEN  630
   : REM JUMP IF ALL FILES NOT DONE
   : M$="Backup done - remove cartridge"
   : GOSUB '160
   : GOSUB '153
   : $CLOSE#4
   : STOP
0630 M$="Insert next cartridge"
   : GOSUB '160
   : GOSUB '152
   : V1$=STR(V$(),5,8)
   : REM SAVE THIS VOLUME NAME
   : STR(V$(),1,4)="VHDR"
   : GOTO 240
   : REM CONTINUE WITH NEXT CARTRIDGE
9000 $CLOSE
   : PRINT AT(10,0,79);"Disk error ";ERR;
   : STOP #
   : GOTO 10
9050 PRINT AT(10,0,79);"Tape error ";E
   : PRINT E$
   : STOP
   : GOTO 10
9060 PRINT "Tape error ";E;" - ";E$;" on line ";L1
   : STOP