image of READY prompt

Wang2200.org

Listing of file='2229IFR' on disk='vmedia/2229_diagnostics.wvd.zip'

# Sector 96, program filename = '2229IFR'
0010 COM F9$8
   : F9$="2229IFR"
   : LOAD T"2229STRT"
0020 REM % FILE "2229IFR" - Part of 2229 utilities package ver 2.0
0025 REM % COPYRIGHT WANG LABORATORIES, INC., 1986,1987
0030 REM %  Recover file from platter backup tape(s)   -   ST   02/22/1986
0031 REM Changes ---> version 2.0
0032 REM MODIFIED 330/335 FOR SYSTEM ID (VERSION) CHECK
0040 COM D$3,O$3
   : DIM T$32,V$(16),F$(16),K$1,A1$(16,16)64,E$20,V$8,C$2,M$60,V1$8,F2$8,I1$5,
     L$2,S2$2,S6$8,Y$1,C(4),T4$1,J$8,S$30,H$1
0050 LOAD T#1,"2229SUB"5000,8999BEG 60
0060 C1=0
   : REM EXP BC
   : C2=0
   : REM CONTINUATION FLAG OFF
   : S=0
   : REM FIRST SECTOR TO WRITE
   : T2=1
   : REM EXPECTED TAPE FILE SECTION NUMBER
   : V1=1
   : REM EXPECTED VOLUME SEQUENCE
   : F4=0
   : REM STARTING SECTOR
0070 I1$="INDEX"
   : ADD(STR(I1$),80)
0080 T$="RECOVER FILE FROM PLATTER BACKUP"
   : $OPEN #4
   : GOSUB '151
0090 REM % GET OUTPUT DISK ADDRESS
   : A=0
   : PRINT HEX(0F);
   : IF D$=" "THEN D$="D11"
   : PRINT AT(3,0);
   : LINPUT "File output address ",D$
   : IF VER(D$,"HHH")=3THEN 94
   : PRINT AT(3,30);"Illegal address";HEX(07);
   : GOTO 90
0094 SELECT #2<D$>
   : ERRORA=1
   : GOTO 140
0100 VERIFY T#2,(0,0)A
   : ERRORA=1
   : GOTO 140
0110 $OPEN #2
   : DATA LOAD BA T#2,(0)V$()
   : ERRORA=1
   : GOTO 140
0120 DATA SAVE BA T#2,(0)V$()
   : ERRORA=1
   : GOTO 140
0130 $CLOSE#2
   : IF A=0THEN 150
0140 $CLOSE#2
   : ERRORREM
0145 PRINT AT(3,30,40);"ERROR ";ERR;HEX(07);
   : GOTO 90
0150 PRINT HEX(06);AT(3,30,),AT(5,0);
   : PRINTUSING 160,"INDEX SECTORS = ",VAL(STR(V$(1),2,2))
   : PRINTUSING 160,"END CAT. AREA = ",VAL(STR(V$(1),5,2),2)-1
   : PRINTUSING 160,"CURRENT END   = ",VAL(STR(V$(1),3,2),2)-1
0160 %############### #####
0170 K$="Y"
   : PRINT AT(10,0);
   : LINPUT "Is this the correct platter?",K$
   : ERRORGOTO 170
0180 IF K$="Y" OR K$="y"THEN 185
   : IF K$="N"OR K$="n"THEN 80
   : GOTO 170
0185 IF VAL(STR(V$(1),2,2))<>0THEN 190
   : PRINT
   : PRINT "Disk is not scratched!!";HEX(07)
   : $GIO(75FF)
   : GOTO 90
0190 PRINT AT(10,0,);"Insert tape cartridge";V1;"and press ONLINE"
   : GOSUB '152
0200 PRINT HEX(06);AT(3,0,);
   : GOSUB '104
   : REM LOAD TAPE
0210 REM % FILE MARK SHOULD BE FIRST
   : GOSUB '112
   : M$="Tape read error on first tape block"
   : IF E=6THEN 9100
   : M$="File mark expected"
   : IF F3<>1THEN 9100
0220 REM % READ LABEL
   : GOSUB '112
   : M$="Tape read error on Volume Label"
   : IF E=6THEN 9100
   : M$="File mark expected"
   : IF F3=1THEN 9100
0225 M$="Label is not 256 bytes"
   : IF B<>256THEN 9100
   : MAT COPY STR(A1$(),1,256)TO V$()
   : M$="First record is not Volume Header"
   : IF STR(V$(),1,4)<>"VHDR"THEN 9100
0230 T1=1
   : PRINT AT(05,0,);"Tape volume name";AT(5,21);STR(V$(),5,8)
   : PRINT AT(6,0);"Date";AT(6,21);STR(V$(),17,6)
   : PRINT AT(7,0);"Time ";AT(7,21);STR(V$(),23,6)
   : PRINT "Comments"
   : PRINT AT(8,21);STR(V$(),202)
   : IF C2=1THEN 260
0250 IF C2=1THEN 260
   : REM CONT VOL
   : K$="Y"
   : M$="Is this the correct volume? "
   : GOSUB '160
   : PRINT AT(10,28);
   : LINPUT -K$
   : IF K$="Y" OR K$="y"THEN 260
   : IF K$="N"OR K$="n"THEN 270
   : GOTO 250
0260 CONVERT STR(V$(),13,2)TO V
   : IF V1=VTHEN 280
   : M$=" "
   : GOSUB '160
   : PRINT "Expected volume sequence ";V1
   : PRINT "Mounted volume is sequence ";V
   : PRINT "Press RETURN to unload tape"
   : GOSUB '154
0270 GOSUB '105
   : REM UNLOAD TAPE
   : GOTO 190
0280 IF C2=0THEN 290
   : REM JUMP IF FIRST VOL
   : M$="Incorrect volume name "
   : IF STR(V$(),39,8)<>V1$THEN 9100
   : REM CHECK SUBSEQUENT VOLUME NAMES
0290 V1$=STR(V$(),5,8)
   : V=V+1
   : REM EXP SEQ #
   : M$=" "
   : GOSUB '160
   : GOSUB '112
   : M$="Tape read error on File Header File Mark"
   : IF E=6THEN 9100
   : M$="Expected file mark"
   : IF F3<>1THEN 9100
   : GOSUB '112
   : M$="Tape read error on File Header"
   : IF E=6THEN 9100
0300 M$="File label is not 256 bytes"
   : IF B<>256THEN 9100
   : MAT COPY STR(A1$(),1,256)TO F$()
   : I=0
   : IF VAL(STR(F$(),5,2),2)=T1THEN 320
   : IF VAL(STR(F$(),5,2),2)=0THEN 310
   : M$="Tape file sequence number out of order"
   : GOTO 9100
0310 PRINT HEX(06),AT(10,0);"Tape cartridge is file backup, not platter backup
     "
   : PRINT "Run 'Recover files from tape' utility"
   : GOSUB '153
   : STOP
   : GOTO 10
0320 C1=0
   : T1=T1+1
   : IF C2=0THEN 330
   : T2=T2+1
   : M$="Tape file section number incorrect"
   : IF VAL(STR(F$(),7,1))<>T2THEN 9100
0330 M$="File header block count not = 0"
   : IF STR(F$(),28,2)<>HEX(0000)THEN 9100
   : M$="Record format byte wrong"
   : IF STR(F$(),30,1)<>HEX(FF)THEN 9100
0335 M$="Record/Block count incorrect"
   : IF MOD(VAL(STR(F$(),31,2),2),VAL(STR(F$(),33,2),2))<>2THEN 9100
   : M$="System ID incorrect"
   : IF STR(F$(),35,1)<HEX(11)OR STR(F$(),35,1)>HEX(20)THEN 9100
0340 IF C2=0THEN 350
   : REM JUMP IF NEW FILE
   : IF F4=0THEN 560
   : REM JUMP IF START OF FILE NOT FOUND YET
   : GOTO 710
0350 K$="Y"
   : K=1
   : LINPUT "Do you want a catalog listing from the tape? ",-K$
   : IF K$="N"OR K$="n"THEN K=0
   : IF K=0THEN 360
0352 IF K$="Y"OR K$="y"THEN 360
   : GOTO 350
0360 REM % START READING DATA
   : D1=-1
   : REM INIT STARTING SECTOR
   : D2 =-1
   : REM ENDING SECTOR
0370 GOSUB '112
   : M$="Tape read error "
   : IF E=6THEN 9100
   : M$="File mark found - Incomplete platter backup"
   : IF F3=1THEN 9100
   : D1=D2+1
   : REM STARTING SECTOR OF BLOCK
   : D2=D2+B/256
   : REM LAST SECTOR OF BLOCK
   : IF D1>0THEN 410
0380 I=VAL(STR(A1$(),2))-1
   : REM LAST INDEX SECTOR
   : E1=VAL(STR(A1$(),3,2),2)-1
   : REM LAST SECTOR USED
   : E2=VAL(STR(A1$(),5,2),2)-1
   : REM LAST SECTOR ON DISK
0390 PRINT HEX(06),AT(3,0,);
   : IF K=0THEN 480
   : PRINT "TAPE INDEX:"
   : PRINT
   : PRINTUSING 400,"INDEX SECTORS =";I+1
   : PRINTUSING 400,"END CAT. AREA = ";E2
   : PRINTUSING 400,"CURRENT END   = ";E1
   : R=9
   : REM ROW COUNT FOR LISTS
0400 %################ #####
0410 D6=1
   : IF D1=0THEN D6=17
0420 IF STR(A1$(),D6,2)=HEX(1000)THEN S2$=" D"
   : ELSE IF STR(A1$(),D6,2)=HEX(1080)THEN S2$=" P"
   : ELSE IF STR(A1$(),D6,2)=HEX(1100)THEN S2$="SD"
   : ELSE IF STR(A1$(),D6,2)=HEX(1180)THEN S2$="SP"
   : ELSE GOTO 460
0430 S4=VAL(STR(A1$(),D6+2,2),2)
   : S5=VAL(STR(A1$(),D6+4,2),2)
   : S6$=STR(A1$(),D6+8,8)
   : PRINT AT(R,0);
   : PRINTUSING 440,S6$,S2$,S4,S5
0440 %########   ##   #####  #####
0450 R=R+1
   : IF R<18THEN 460
   : PRINT
   : PRINT "Press RETURN to continue"
   : PRINT "Press RUN to skip rest of index";
   : KEYIN K$
   : IF K$=HEX(82)THEN 480
   : PRINT AT(4,0,)
   : R=6
0460 D6=D6+16
   : IF D1+D6/256>I+1THEN 470
   : REM JUMP IF INDEX DONE
   : IF D6>BTHEN 370
   : REM THIS RECORD IS DONE
   : GOTO 420
0470 PRINT
   : PRINT "Press any key to continue";
   : KEYIN K$
0480 GOSUB '111
   : REM SPACE REV FM
   : GOSUB '108
   : GOSUB '108
   : F3=0
   : C1=0
   : REM RECORD COUNT
0490 PRINT HEX(06),AT(3,0,);"Output address ";D$
   : LINPUT "File name     ",-F2$
0500 D1=-1
   : D2=-1
   : REM INIT SECTORS IN THIS BLOCK
0510 GOSUB '112
   : REM READ DATA
   : M$="Incomplete or incorrect platter backup"
   : IF E<>0THEN 9100
   : D1=D2+1
   : D2=D2+B/256
   : L$=ALL(00)
0512 P1=9
   : IF D1=0THEN P1=25
   : REM IF ON FIRST BLOCK, SKIP FIRST ENTRY IN INDEX
0514 H1=P1
   : REM FIX FOR SCRATCHED AND RENAMED FILES (THANKS TO HW)
0515 H2=MIN((B-H1+1),((I+1-D1)*256)-H1+1)
0518 MAT SEARCHSTR(A1$(),H1,H2),=STR(F2$,1,8)TO L$STEP 16
   : REM SEARCH FOR F2$ IN ARRAY
0520 IF VAL(L$,2)=0THEN 530
   : REM JUMP IF FILE NOT FOUND
0523 H3=VAL(L$,2)
   : H$=STR(A1$(),H1+H3-9,1)
   : IF H$=HEX(10)OR H$=HEX(11)THEN 540
   : REM JUMP IF CORRECT FILE NAME FOUND
0524 REM NEW H1
   : H1=H1+H3+16-1
   : IF H1<BTHEN 515
   : REM JUMP IF MORE TO CHECK
   : REM OTHERWISE IS INDEX DONE?
0530 IF I>D2THEN 510
   : M$="File is not in tape index"
   : GOSUB '160
0535 K$="Y"
   : PRINT AT(11,0);"Do you want to try another file name?";
   : LINPUT -K$
   : IF K$="N"OR K$="n"THEN 538
   : IF K$="Y"OR K$="y"THEN 200
   : GOTO 535
0538 GOSUB '153
   : STOP
   : GOTO 10
0540 REM %FILE NAME IS IN THIS BLOCK
   : O=VAL(L$,2)+H1-1
   : E3=VAL(STR(A1$(),O-6,2),2)
   : REM START OF FILE
   : E4=VAL(STR(A1$(),O-4,2),2)
   : REM END OF FILE
   : T4$=STR(A1$(),O-7,1)
   : IF T4$=HEX(80)THEN T4$="P"
   : ELSE T4$="D"
0550 IF E3<=D2THEN 580
0560 PRINT HEX(06),AT(10,0,79);"Searching for file ";F2$
0570 GOSUB '112
   : REM READ
   : IF F3=1THEN 740
   : M$="Tape read error"
   : IF E=6THEN 9100
   : IF E<>0THEN 9100
   : D1=D2+1
   : D2=D2+B/256
   : GOTO 550
0580 LIMITS T#2,F2$,F4,F5,A,A
   : IF A=0THEN 630
   : IF F5-F4+1>=E4-E3+1THEN 670
0590 PRINT HEX(06),AT(10,0,);"Old file is too small"
   : J$="JUNKAAA"
0600 LIMITS T#2,J$,A,A,A,A
   : IF A=0THEN 610
   : A=POS(-J$<"Z")
   : STR(J$,A,1)=ADDHEX(01)
   : IF A<8THEN STR(J$,A+1)=ALL("A")
   : GOTO 600
0610 PRINT HEX(06),AT(11,0);"Can the file be junked (renamed to ";J$;" & scrat
     ched)?";
   : Y$="Y"
   : LINPUT -Y$
   : IF Y$="Y"OR Y$="y"THEN 620
   : IF Y$="N"OR Y$="n"THEN 730
   : GOTO 610
0620 SCRATCH T#2,F2$
   : DATA SAVE DC OPEN T#2,F2$,J$
   : SCRATCH T#2,J$
   : A=0
   : GOTO 640
0630 PRINT HEX(06),AT(10,0,79);F2$;" is not on disk - OK to create new file (Y
     /N) ";
   : Y$="Y"
   : LINPUT -Y$
   : IF Y$="N"OR Y$="n"THEN 730
   : IF Y$="Y"OR Y$="Y"THEN 635
   : GOTO 630
0635 IF A<>0THEN 650
0640 IF A=0AND T4$="D"THEN A=2
   : ELSE A=1
0650 IF INT(A)=1THEN SAVE DC T#2,((E4-E3+1)-3)F2$10,10
   : ELSE DATA SAVE DC OPEN T#2,(E4-E3+1)F2$
0660 GOTO 580
0670 E5=E3-D1
   : PRINT HEX(06),AT(10,0,);"Recovering file ";F2$
0675 PRINT AT(11,0);"Writing disk sectors";F4;" to";MIN(F5,F4+63)
0680 REM %SAVE DATA ON DISK - ENTER WITH F4 = STARTING SECTOR
   : DATA SAVE BA T#2,(F4,F4)STR(A1$(),(E5*256)+1,256)
0690 E5=E5+1
   : IF F4>F5THEN 720
   : REM JUMP IF FILE DONE
   : IF E5+D1<=D2 THEN 680
   : REM JUMP IF MORE DATA TO BE WRITTEN IN THIS BLOCK
0700 E3=D2+1
   : REM NEXT SECTOR WILL BE FIRST IN NEXT RECORD
0710 GOSUB '112
   : M$="Tape read error"
   : IF E=6THEN 9100
   : REM READ NEXT BLOCK
   : IF F3=1THEN 740
   : REM FM
   : D1=D2+1
   : D2=D2+B/256
   : GOTO 670
0720 PRINT HEX(06),AT(10,0,);"File ";F2$;" recovered"
   : C2=0
   : REM FILE IS DONE
0730 PRINT HEX(06),AT(12,0);
   : K$="Y"
   : LINPUT "Do you want to retrieve another file ",-K$
   : IF K$="Y"OR K$="y"THEN 735
   : IF K$="N"OR K$="n"THEN 800
   : GOTO 730
0735 IF V=2THEN 60
   : REM JUMP IF ON CORRECT CARTRIDGE
   : GOSUB '105
   : IF K$="Y"OR K$="y"THEN 60
0738 PRINT HEX(06),AT(10,0);"File recovery done - remove tape cartridge"
   : GOSUB '153
   : STOP
   : GOTO 10
0740 REM FILE MARK JUMPS HERE - SHOULD BE FILE TRAILER
0750 GOSUB '112
   : M$="Tape read error on file trailer"
   : IF E=6THEN 9100
   : MAT COPY STR(A1$(),1,256)TO F$()
   : M$="Expected file trailer record"
   : IF B<>256THEN 9100
0760 M$="File trailer block count incorrect"
   : IF VAL(STR(F$(),28,2),2)<>C1THEN 9100
0770 C2=0
   : IF STR(F$(),44,1)=HEX(00)THEN 780
   : C2=1
0780 GOSUB '112
   : M$="Error - file mark expected"
   : IF F3<>1THEN 9100
0790 GOSUB '112
   : M$="Tape read error on volume trailer"
   : IF E=6THEN 9100
   : M$="Expected volume trailer"
   : IF STR(A1$(),1,4)<>"VEND"THEN 9100
   : REM JUMP IF NOT VOL LABEL
   : MAT COPY STR(A1$(),1,256)TO V$()
0800 GOSUB '105
   : REM UNLOAD TAPE
   : IF E<>0THEN 9050
0810 IF C2=1THEN 820
   : M$="File recovery done -  Remove cartridge"
   : GOSUB '160
   : GOSUB '153
   : STOP
0820 M$="File is continued on next cartridge - remove this cartridge"
   : GOSUB '160
   : PRINT "and insert next cartridge"
   : GOSUB '152
   : V1=V1+1
   : GOTO 200
9000 $CLOSE
   : PRINT AT(10,0,79);"Disk error "; ERR
   : GOSUB '153
   :  STOP
   : GOTO 20
9050 $CLOSE
   : PRINT AT(10,0,79);"Tape error ";E
   : PRINT E$
   : GOSUB '153
   : STOP
   : GOTO 10
9100 REM FATAL ERROR TERMINATOR
   : $CLOSE
   : PRINT AT(10,0,80);M$
   : STOP
   : GOTO 20