image of READY prompt

Wang2200.org

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

# Sector 63, program filename = '2229PR'
0010 COM F9$8
   : F9$="2229PR"
   : LOAD T"2229STRT"
0020 REM % FILE "2229PR" - 2229 utilities ver 2.0
   : REM  ST 02/22/1986
   : REM % Recover complete platter from tape(s)
0022 REM % COPYRIGHT WANG LABORATORIES, INC., 1986,1987
0025 REM Changes ---> version 2.0
0026 REM CHANGED LINE 420 FOR PROPER SYSTEM ID CHECK
0027 REM ADDED READ ERROR RECOVERY (SKIP) AROUND STATEMENTS 465
0028 REM MODIFIED 490 FOR SECTOR ADDRESS CALCULATION TO SKIP BAD BLOCKS
0030 COM D$3,O$3
   : DIM T$30,V$(16),F$(16),K$1,A1$(16,16)64,E$20,V$8,C$2,M$60,V1$8,C(4),S$30
0040 LOAD T#1,"2229SUB"5000,8999BEG 50
0050 C1=0
   : REM EXP BC
   : C2=0
   : REM CONTINUATION FLAG
   : V1=1
   : REM EXP TAPE SEQUENCE
0060 S=0
   : REM FIRST SECTOR TO WRITE
   : T1=0
   : REM EXPECTED TAPE FILE SECTION NUMBER
   : REM T$ TITLE
   : REM D$ SOURCE ADDRESS
   : REM A1$() DATA BUFFER
   : S8=0
   : REM SECTOR OFFSET FOR WRITE DISK ROUTINE
0070 T$="RECOVER PLATTER FROM TAPE"
   : $OPEN #4
   : GOSUB '151
   : REM TITLE
0080 REM % GET DISK ADDRESS
   : PRINT HEX(0F);
   : A=0
0090 IF D$=" "THEN D$="D11"
   : PRINT AT(2,0);
   : LINPUT "Destination platter address ",D$
   : IF VER(D$,"HHH")=3THEN 95
   : PRINT AT(2,35,40);"Illegal address";HEX(07);
   : GOTO 90
0095 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(2,35,40);"ERROR ";ERR;HEX(07);
   : GOTO 80
0150 PRINT HEX(06);AT(2,35,),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 M$="ALL DATA WILL BE OVERWRITTEN"
   : GOSUB '160
0180 K$="Y"
   : PRINT AT(12,0);
   : LINPUT "Is this the correct platter?",K$
   : ERRORGOTO 180
0190 IF K$="Y" OR K$="y"THEN 200
0195 IF K$="N"OR K$="n"THEN 70
   : GOTO 180
0200 PRINT HEX(06),AT(4,0,)
   : M$="Insert first tape cartridge and press ONLINE"
   : GOSUB '160
   : GOSUB '152
0210 GOSUB '104
   : REM LOAD TAPE
0220 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
0230 REM % READ LABEL
   : M$="Reading volume label"
   : GOSUB '160
   : GOSUB '112
   : M$="Tape read error on Volume Label"
   : IF E=6THEN 9100
   : M$="Expected volume label"
   : IF F3=1THEN 9100
0240 M$="Label is not 256 bytes"
   : IF B<>256THEN 9100
0250 MAT COPY STR(A1$(),1,256)TO V$()
   : M$="First record is not Volume Header"
   : IF STR(V$(),1,4)<>"VHDR"THEN 9100
0260 CONVERT STR(V$(),13,2)TO V
   : M$="  "
   : GOSUB '160
   : PRINT AT(4,0);
   : PRINTUSING 270,"Tape volume name",STR(V$(),5,8)
   : PRINTUSING 270,"Date ",STR(V$(),17,6)
   : PRINTUSING 270,"Time ",STR(V$(),23,6)
   : PRINTUSING 270,"Comments",STR(V$(),202,55)
   : PRINT
   : IF V=V1THEN 300
0270 %#################     ##################################################
     #####
0280 M$=" "
   : GOSUB '160
   : PRINT "Expected volume sequence ";V1
   : PRINT "Mounted volume is sequence ";V
   : PRINT "Press return to unload tape"
   : GOSUB '154
0290 GOSUB '105
   : REM UNLOAD
   : GOTO 620
0300 PRINT AT(9,0);
   : PRINTUSING 310,V
   : IF C2=1THEN 320
   : PRINT AT(13,0);
   : K$="Y"
   : LINPUT "Is this the correct volume? ",K$
   : IF K$="Y" OR K$="y"THEN 340
0305 IF K$="N"OR K$="n"THEN 290
   : GOTO 300
0310 %Tape sequence number  #
0320 REM JUMP HERE IF NOT FIRST VOLUME
   : IF STR(V$(),5,8)=V1$THEN 340
0330 PRINT "Incorrect volume mounted "
   : GOTO 620
0340 V1=V1+1
   : V1$=STR(V$(),5,8)
   : PRINT HEX(06),AT(5,0,);
   : PRINTUSING 310,V
   : REM SAVE THIS VOLUME NAME
   : M$=" "
   : GOSUB '160
   : GOSUB '112
   : M$="Tape Read error on File Header"
   : IF E=6THEN 9100
   : M$="Expected file mark"
   : IF F3<>1THEN 9100
0350 GOSUB '112
   : REM READ FILE LABEL
   : M$="Tape Read error on File Header"
   : IF E=6THEN 9100
0360 M$="File label not 256 bytes"
   : IF B<>256THEN 9100
0370 MAT COPY STR(A1$(),1,256)TO F$()
0375 IF VAL(STR(F$(),5,2),2)<>0THEN 380
   : PRINT HEX(06),AT(8,0,);"Tape cartridge is file backup, not platter backup
     "
   : PRINT "Run 'Recover files from tape' utility"
   : GOSUB '153
   : STOP
   : GOTO 10
0380 T1=T1+1
   : M$="Tape file section incorrect"
   : IF VAL(STR(F$(),7,1))<>T1THEN 9100
0390 M$="File header block count not = 0"
   : IF STR(F$(),28,2)<>HEX(0000)THEN 9100
0400 M$="Record format byte wrong"
   : IF STR(F$(),30,1)<>HEX(FF)THEN 9100
0410 M$="Record/Block count incorrect"
   : IF MOD(VAL(STR(F$(),31,2),2),VAL(STR(F$(),33,2),2))<>2THEN 9100
0420 M$="System ID incorrect "
   : IF STR(F$(),35,1)<HEX(11)OR STR(F$(),35,1)>HEX(20)THEN 9100
0430 GOTO 450
   : M$="File name is:"
   : GOSUB '160
   : PRINTUSING 440,STR(F$(),69,MIN(POS(STR(F$(),69)=HEX(00)),80))
0440 %########################################################################
     ########
0450 REM % START READING DATA
   : REM NEXT SECTOR TO WRITE IS S
   : PRINT AT(10,0,);
   : C1=0
   : REM EXPECTED PHYSICAL RECORD COUNT
0460 PRINT AT(10,0,80);"Reading tape"
   : GOSUB '112
   : IF STR(R$,1,1)=HEX(07)THEN 520
   : REM JUMP IF LABEL IS HIT
0465 IF E<>6THEN 470
   : REM JUMP IF NOT READ ERROR
   : PRINT AT(10,0,);"Unrecoverable tape read error"
   : PRINT "Sectors ";S;" to ";S+63;" cannot be recovered"
   : PRINT
   : K$="Y"
   : LINPUT "Skip sectors and continue (Y/N) ",-K$
0466 IF K$="Y"OR K$="y"THEN 469
0467 IF K$="N"OR K$="n"THEN 468
   : GOTO 465
0468 GOSUB '153
   : GOTO 10
0469 C1=C1+1
   : REM INC EXPECTED BLOCK COUNT
   : S=S+64
   : REM ADD TO EXPECTED SECTOR ADDRESS
   : PRINT AT(10,0,);
   : GOTO 460
0470 M$="Data not on page boundary"
   : IF MOD(B,256)<>0THEN 9100
0480 B1=1
   : REM POINTER INTO ARRAY
   : IF D9>0THEN PRINT AT(9,0);"Expected record ";C1,"Actual record ";C
0490 GOSUB '103
   : REM START NEXT TAPE READ
   : $OPEN #2
   : S=S8+(C-1)*64
   : PRINT HEX(06),AT(10,0);"Writing disk sectors ";S;" to ";S+(B/256)-1
0500 DATA SAVE BA T#2,(S,S)STR(A1$(),B1,256)
   : ERRORGOTO 9000
0510 B1=B1+256
   : IF B1<BTHEN 500
   : $CLOSE#2
   : GOTO 460
   : REM GET NEXT BLOCK
0520 REM % FILE MARK JUMPS HERE, SHOULD BE END LABEL
0530 GOSUB '112
   : MAT COPY STR(A1$(),1,256)TO F$()
   : M$="File trailer label not 256 bytes"
   : IF B<>256THEN 9100
0540 M$="File trailer block count incorrect"
   : REM IF VAL(STR(F$(),28,2),2)<>C1THEN 9100
   : REM REMOVED FOR BAD RECORD OVERRIDE BY USER
0550 C2=1
   : IF STR(F$(),44,1)=HEX(00)THEN C2=0
   : REM CONTINUATION FLAG
0560 GOSUB '112
   : REM LOOK FOR FILE MARK
   : M$="Tape read error on expected Volume Trailer File Mark"
   : IF E=6THEN 9100
   : M$="Expected file mark"
   : IF F3<>1THEN 9100
0570 GOSUB '112
   : M$="Tape read error on Volume Trailer Label"
   : IF E=6THEN 9100
   : MAT COPY STR(A1$(),1,256)TO V$()
   : REM VOLUME TRAILER
   : M$="Expected volume trailer label"
   : IF F3<>0THEN 9100
0580 MAT COPY STR(A1$(),1,256)TO V$()
0590 STR(V$(),39,8)=STR(V$(),5,8)
   : REM NEXT VOLUME NAME
   : S=VAL(STR(F$(),28,2),2)
   : REM BLOCKS ON THIS TAPE
   : S8=S8+(S)*64
   : REM SAVE NEXT WRITE SECTOR
0600 GOSUB '105
   : REM UNLOAD TAPE
0610 IF C2=1THEN 620
   : M$="Platter recovery done - remove cartridge"
   : GOSUB '160
   : GOSUB '153
   : STOP
   : GOTO 10
0620 PRINT HEX(06);AT(9,0,);
   : M$="Insert next tape cartridge"
   : GOSUB '160
   : GOSUB '152
   : GOTO 210
9000 PRINT AT(10,0,79);"Disk error "; ERR
   : $CLOSE
   : GOSUB '153
   : STOP
   : GOTO 10
9050 PRINT AT(10,0,79);"Tape error ";E
   : PRINT E$
   : $CLOSE
   : GOSUB '153
   : STOP
   : GOTO 10
9100 REM FATAL ERROR TERMINATOR
   : PRINT AT(10,0,80);M$
   : $CLOSE
   : STOP
   : GOTO 10