image of READY prompt

Wang2200.org

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

# Sector 206, program filename = '2229VER'
0010 COM F9$8
   : F9$="2229VER"
   : LOAD T"2229STRT"
0020 REM % FILE "2229VER" - 2229 utilities ver 2.0
0022 REM % COPYRIGHT (C) WANG LABORATORIES, INC. 1986,1987
0025 REM % ENTER FROM "2229STRT" WITH DT #4 SET TO TAPE ADDRESS
0030 REM %  Verify tape labels and data blocks -   ST    2/22/86
0040 DIM A1$(16,16)64
   : REM DATA BUFFER
   : DIM R$16
   : REM $GIO BUFFER
0041 DIM S$30
   : REM TAPE STATUS BUFFER
   : DIM U8$2
   : REM TAPE STATUS DATA STORAGE
0042 DIM V$(16),F$(16)
   : REM TAPE VOLUME AND FILE LABELS
0043 DIM K$1
   : REM GENERAL PURPOSE "Y/N" INPUT
0045 DIM C$2
   : REM # OF CURRENT TAPE BLOCK (AS READ ON TAPE)
   : C=0
   : REM C IS NUMERIC VALUE OF C$
0046 DIM M$70
   : REM MESSAGE STRINGS
   : DIM E$30
   : REM ERROR MESSAGES
0047 DIM V1$8
   : REM VOLUME NAME BETWEEN TAPES
0048 DIM F2$8
   : REM FILE NAME HOLDER BETWEEN TAPES
0049 DIM L$2
   : REM LOCATER FOR MATSEARCH IN READING INDEX FILEFOR FILE BACKUPS
0050 DIM I1$5
   : I1$="INDEX"
   : ADD(STR(I1$),80)
   : REM FIRST FILE ON FILE BACKUP
0051 M$="VERIFY TAPES"
   : $OPEN #4
   : PRINT HEX(03);AT(0,40-(LEN(M$)/2));HEX(020402040E);M$;HEX(0F)
0052 DIM T1$1
   : REM FILE TYPE (PROGRAM = P, DATA = D, INDEX = I)
0053 DIM B$1
   : REM BACKUP TYPE (PLATTER = P, FILE = F)
   : B$=" "
0060 C2=0
   : REM IF = 1, FILE IS CONTINUED TO NEXT TAPE
0061 C1=0
   : REM COUNT OF BLOCKS IN FILE SHOULD MATCH COUNT IN FILE TRAILER
0063 T2=1
   : REM EXPECTED TAPE FILE SECTION NUMBER (FOR FILES THAT SPAN TAPES)
0064 V=1
   : REM EXPECTED TAPE IN TAPE SET
   : V1=0
   : REM CURRENT VOLUME NUMBER FROM VOLUME HEADER
0066 F3=0
   : REM FILE MARK FLAG
0067 E=0
   : REM ERROR RETURN FROM TAPE OPERATIONS
0068 B=0
   : REM BYTE COUNT OF TAPE RECORD
0069 T1=1
   : REM TAPE FILE SEQUENCE NUMBER - RELATIVE NUMBER OF FILE ON THIS TAPE (STA
     RTS AT 0 IF FIRST FILE IS TAPE INDEX, ELSE STARTS AT 1
0071 F1=0
   : REM STORAGE OF NUMBER OF FILES IN TOTAL TAPE SET (BETTER BE AT LEAST ONE)
0073 S=0
   : REM CURRENT COUNT OF SECTORS IN FILE ON TAPE
0074 L,L4,L5,L6=0
   : REM TEMPORARY VARIABLES FOR SCANNING INDEX RECORDS
0075 C=0
   : REM CURRENT BLOCK IN TAPE FILE
0076 S1=0
   : REM EXPECTED NUMBER OF SECTORS IN TAPE FILE
0077 G1=0
   : REM COUNT OF FILES ON TOTAL TAPE SET
0078 F2=1
   : REM TAPE FILE SECTION NUMBER (FOR FILES THAT SPAN TAPES)
0190 PRINT HEX(06),AT(5,0,)
0200 M$="Insert tape cartridge and press ONLINE"
   : GOSUB '160
   : REM PRINT MESSAGE
   : GOSUB '152
   : REM WAIT FOR KEY PRESS
0210 PRINT HEX(06);AT(5,0,);
   : 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$="First record is not File Mark"
   : IF F3<>1THEN 9100
0230 REM % READ VOL LABEL
   : GOSUB '112
   : M$="Tape read error on Volume Label"
   : IF E=6THEN 9100
0235 M$="Volume label expected -  File mark found"
   : IF F3=1THEN 9100
   : 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
0240 PRINT HEX(06); AT(04,0,);"Tape volume name";AT(4,21);STR(V$(),5,8);AT(4,4
     0);"Tape Sequence number ";STR(V$(),13,2)
   : PRINT AT(5,0);"Date";AT(5,21);STR(V$(),17,6)
   : PRINT AT(6,0);"Time ";AT(6,21);STR(V$(),23,6)
   : PRINT "Comments:"
   : PRINT AT(7,21);STR(V$(),202)
0241 IF S1<>0AND B$="P"THEN PRINT AT(5,39);S1;"sectors in backup"
   : IF F1<>0AND B$="F"THEN PRINT AT(5,39);F1;"files in backup"
0242 M$="Maximum block size incorrect"
   : IF VAL(STR(V$(),15,2),2)<>16386THEN 9100
   : REM BLOCK LENGTH
0243 M$="Volume label format version incorrect"
   : IF STR(V$(),29,1)<>HEX(01)THEN 9100
   : REM LABEL FORMAT VERSION ID
0244 REM ACCESS CONTROL WORD EMPTY FOR NOW
0245 REM IF VAL(STR(V$(),47,1))<>1THENSTOP"ERROR"
   : REM SHOULD BE 4 TRACKS
0247 REM IF STR(V$(),49,6)<>"999999"THEN STOP "ERROR"
   : REM EXPIRATION DATE IS UNUSED
0269 IF V=1THEN 270
   : REM IF STR(V$(),5,8)<>V1$THEN STOP "WRONG VOL"
   : REM NEXT VOLUME NAME UNUSED AT THIS TIME
0270 CONVERT STR(V$(),13,2)TO V1
   : REM CHECK FOR CORRECT ORDER OF MULTIPLE TAPE SETS
   : IF V1=VTHEN 285
0271 PRINT AT(14,0);"Volume mounted is tape sequence number";V1
   : PRINT "Expected sequence number";V
   : PRINT
   : PRINT "PRESS RETURN TO UNLOAD TAPE"
   : GOSUB '154
   : PRINT HEX(06),AT(4,0,)
0280 GOSUB '105
   : REM UNLOAD TAPE
   : GOTO 200
0285 M$=" "
   : GOSUB '160
0290 T1=0
   : REM INIT EXPECTED FIRST FILE NUMBER
   : IF V>1THEN T1=1
0292 PRINT AT(10,0,);"Reading file number "
   : PRINT AT(14,0);"Sectors read";AT(15,0);"Blocks read"
0295 REM % LOOK FOR NEXT FILE ENTRY POINT HERE
0300 GOSUB '112
   : M$="Tape read error on File Label"
   : IF E=6THEN 9100
   : REM LOOK FOR NEXT FILE MARK
   : M$="Record found - Expected file mark"
   : IF F3<>1THEN 9100
   : GOSUB '112
   : REM READ FILE LABEL
   : M$="Tape read error on File label"
   : IF E=6THEN 9100
0305 M$="File mark found - Label expected"
   : IF F3=1THEN 9100
   : M$="Incorrect record length on file label"
   : IF B<>256THEN 9100
0310 IF STR(A1$(),1,4)="VEND"THEN 750
   : REM JUMP IF VOLUME TRAILER FOUND
0315 M$="Unknown record found - expected File Header"
   : IF STR(A1$(),1,4)<>"FHDR"THEN 9100
0318 MAT COPY STR(A1$(),1,256)TO F$()
   : C=0
   : REM NO BLOCKS IN FILE YET
0320 IF T1>0 THEN 322
   : REM JUMP IF NOT FIRST TAPE IN SET
0321 IF VAL(STR(F$(),5,2),2)=0THEN B$="F"
   : IF VAL(STR(F$(),5,2),2)=1THEN B$="P"
   : M$="Unknown Backup Type"
   : IF B$=" "THEN 9100
   : REM DETERMINE BACKUP TYPE (FILE OR PLATTER)
   : IF B$="P"THEN T1=1
   : REM FILE 0 IS INDEX FILE FOR FILE BACKUP ONLY
0322 REM
0340 REM % ONLY ON FIRST FILE - T1 PROBLEM
   : M$="Tape file sequence number incorrect"
   : IF VAL(STR(F$(),5,2),2)<>T1THEN 9100
0360 C1=0
   : REM INIT COUNT OF BLOCKS IN FILE
0400 REM %   IF C2=0THEN 410
   : REM CHECK TAPE FILE SECTION NUMBER FOR CONTINUED TAPES
0410 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
0420 M$="Record/Block count incorrect"
   : IF MOD(VAL(STR(F$(),31,2),2),VAL(STR(F$(),33,2),2))<>2THEN 9100
   : M$="Not a 2200 backup tape"
   : IF STR(F$(),35,1)<HEX(11)OR STR(F$(),35,1)>HEX(20)THEN 9100
0430 IF C2=0THEN 440
   : REM JUMP IF NEW FILE
   : IF STR(F$(),69,8)<>F2$THEN STOP "WRONG CONT FILE"
   : IF VAL(STR(F$(),7,1))<>F2THEN STOP "WRONG CONT FILE SECTION"
0440 REM
0540 REM % START READING DATA
0550 PRINT AT(10,20);
   : IF B$="P"THEN PRINT "1"
   : ELSE PRINT G1
   : PRINT AT(11,0);STR(F$(),69,MAX(POS(STR(F$(),69,80)=HEX(00)),80))
0560 GOSUB '112
   : M$="Unrecoverable read error"
   : IF E=6THEN 9100
   : IF F3=1THEN 650
   : REM JUMP IF LABEL IS HIT
   : M$="Data block not a multiple of 256 bytes"
   : B=B-2
   : REM STRIP BLOCK COUNTER
   : IF MOD(B,256)<>0THEN 9100
   : M$="Missing data block"
   : IF C<>C1THEN 9100
0570 IF T1=0THEN GOSUB '200
   : REM SPECIAL CASE FOR INDEX FILE
0575 IF B$="P"AND T1=1AND V1=1AND C1=1THEN 576
   : GOTO 580
0576 S1=VAL(STR(A1$(),3,2),2)
   : PRINT AT(5,39);S1;"sectors in backup"
0580 S=S+B/256
   : REM MAINTAIN COUNT OF SECTORS IN FILE
   : PRINT AT(14,15,8);S
   : PRINT AT(15,15,6);C
   : GOTO 560
0650 REM % FILE MARK JUMPS HERE - SHOULD BE FILE TRAILER
0660 IF T1<>0THEN 670
   : PRINT AT(5,39);F1;" files in backup"
0670 GOSUB '112
   : M$="File trailer label not 256 bytes"
   : IF B<>256THEN 9100
   : M$="Record found - Expected file trailer"
   : IF STR(A1$(),1,4)<>"FEND"THEN 9100
0672 MAT COPY STR(A1$(),1,256)TO F$()
0675 M$="File trailer block count incorrect"
   : IF VAL(STR(F$(),28,2),2)<>CTHEN 9100
   : REM # OF BLOCKS IN FILE TRAILER SHOULD MATCH C
0677 C2=0
   : IF STR(F$(),44,1)=HEX(FF)THEN C2=1
   : F2$=STR(F$(),69,8)
   : REM SET CONTINUATION FLAG AND SAVE FILE NAME
0680 IF C2<>0THEN 681
   : IF T1=0THEN 681
   : IF B$="P"THEN 681
   : REM JUMP IF INDEX FILE OR PLATTER BACKUP
   : M$="Missing sectors in file"
   : IF S=VAL(STR(F$(),42,2),2)THEN 681
   : IF STR(F$(),35,1)>=HEX(12)THEN 9100
   : REM VER 2 CHECK
   : IF S<>VAL(STR(F$(),42,2),2)-1THEN 9100
   : REM VER 1.1
0681 IF C2<>0THEN F2=F2+1
   : ELSE F2=1
   : REM INC FILE SECTION NUMBER
   : REM RESET FILE SECTION IF NECESSARY
   : IF C2=0AND B$="F"THEN S=0
   : REM RESET SECTOR COUNTER IF END OF FILE
0682 IF C2=0THEN G1=G1+1
   : REM INC TOTAL FILES FOUND
0690 REM PRINT NEXT TO FILE NAME THE # OF SECTORS
0700 T1=T1+1
   : GOTO 300
   : REM LOOK FOR NEXT FILE MARK
0750 REM % VOLUME TRAILER JUMPS HERE
0755 IF B$="F"THEN 780
   : REM JUMP IF FILE BACKUP
   : IF C2<>0THEN 780
   : M$="Sector count doesn't match file trailer"
   : S1=S1
   : IF S<>S1THEN 9100
0780 MAT COPY STR(A1$(),1,256)TO V$()
   : REM GET VOLUME TRAILER
   : V1$=STR(V$(),39,8)
   : REM SAVE VOLUME NAME FOR NEXT VOLUME
   : V=V+1
   : REM INCREMENT EXPECTED VOLUME TRAILER
0790 REM %CHECK VOLUME TRAILER STUFF
   : REM % ALSO CHECK FOR CONTINUED FILES IN LAST FILE TRAILER
0800 GOSUB '105
   : REM UNLOAD TAPE
   : IF E<>0THEN 9050
0810 IF C2=1THEN 830
   : REM CONTINUED FILE
   : IF B$="P"THEN 820
   : IF STR(V$(),39,8)<>" "THEN 830
0815 PRINT AT(10,0,)
   : IF B$="P"THEN 820
   : IF F1=G1-1 THEN 820
   : IF STR(F$(),35,1)=HEX(11)THEN 825
   : REM VERSION 1 CHECK
   : PRINT AT(10,0,);G1-1;"files found"
   : PRINT F1;"files expected"
   : STOP #
0820 M$="Tape verification done - No errors found"
   : GOSUB '160
   : GOSUB '153
   : STOP
0825 IF F1=G1THEN 820
   : PRINT AT(10,0,);G1;"files found"
   : PRINT F1;"files expected"
   : STOP #
0830 PRINT AT(10,0,)
   : M$="Files are continued on next cartridge - Remove this cartridge"
   : GOSUB '160
0840 PRINT "Insert next cartridge and press ONLINE"
   : GOSUB '152
   : GOTO 210
1000 DEFFN'200
   : REM % CALCULATE NUMBER OF FILE NAMES IN INDEX RECORD
1005 MAT SEARCHSTR(A1$(),1,MIN(B,16321)),=HEX(00)TO L$STEP 80
   : L=(VAL(L$,2)-1)/80
   : REM # OF NAMES
   : F1=F1+L
   : REM TOTAL FILES IN TAPE SET
1010 RETURN
5000 REM % SUBROUTINES
5005 REM ST 01/21/1983
5100 DEFFN'102
   : REM % BOARD STATUS
5115 S$=ALL(20)
   : R$=ALL(01)
5120 $GIO#4(4402 8701 1800 C340,R$)STR(S$,1,VAL(STR(R$,1,1)))
   : RETURN
5250 DEFFN'104
   : REM % LOAD TAPE
5260 IF D9<1THEN PRINT HEX(020404000E)
   : M$="Loading Tape"
   : GOSUB '160
   : IF D9=2THEN 5280
   : IF D9=1THEN D9=2
   : $GIO#4(4430 4404 8701,R$)
   : PRINT HEX(0F)
   : GOSUB '222
   : REM GET ERROR
   : IF E=0THEN RETURN
   : IF E<>3THEN 7540
5275 GOSUB '208
   : GOTO 5260
5280 PRINT "*****";
   : $GIO(75FF)
   : STR(R$,1,1)=HEX(00)
   : E=0
   : RETURN
5300 DEFFN'105
   : REM % UNLOAD TAPE
5305 IF D9<1THEN PRINT HEX(020404000E)
   : M$="Unloading tape"
   : GOSUB '160
5310 IF D9>0THEN 5320
   : $GIO#4(4405 8701,R$)
   : PRINT HEX(0F)
   : GOSUB '222
5315 IF E=0THEN RETURN
   : IF E<>3THEN 7540
   : GOSUB '208
   : GOTO 5305
5320 PRINT "*****";
   : $GIO(75FF)
   : STR(R$,1,1)=HEX(00)
   : E=0
   : RETURN
5650 DEFFN'112
   : REM %READ
5660 $GIO#4 (440C 8701,R$)
   : B=0
   : GOSUB '222
   : IF E=0THEN 5680
   : IF E<>7THEN 5665
   : F3=1
   : REM FM FOUND
   : RETURN
5665 IF E=2THEN STOP "Unexpected end of tape"
   : IF E=6THEN RETURN
   : GOSUB '208
   : GOTO 5660
5680 $GIO#4(8703 8704,R$)
   : REM GET BYTE COUNT
   : B=VAL(STR(R$,3,2),2)
   : IF B<16387THEN 5685
   : PRINT AT(10,0,);"ERROR - tape block larger than 16K"
   : PRINT "Possible problem with tape drive or controller"
   : STOP #
5685 IF F3=1THEN 5690
   : REM JUMP IF PREVIOUS  RECORD WAS FM
   : $GIO#4(1800 C340 1936 1801 C340,R$)C$; STR(A1$(),1,VAL(STR(R$,3,2),2))
   : GOTO 5700
5690 REM PREVIOUS RECORD WAS FILE MARK, SO THIS IS LABEL
   : $GIO#4(1800 C340,R$)STR(A1$(),1,VAL(STR(R$,3,2),2))
5700 IF F3=1THEN 5710
   : REM JUMP IF PREVIOUS RECORD WAS FILE MARK
   : C=VAL(C$,2)
   : C1=C1+1
   : REM INC BLOCKS READ
5710 F3=0
   : RETURN
6500 DEFFN'160
   : REM PRINT OUT MESSAGE
   : PRINT HEX(06),AT(10,0,320);M$
   : RETURN
7500 REM % CHECK ERROR RETURN FOR IMMEDIATE MODE COMMANDS
7510 DEFFN'222
   : REM % Check error return
   : E=VAL(STR(R$,1,1))
   : IF E=0THEN RETURN
   : RESTORE LINE7520,E
   : READ E$
   : IF E=8THEN 7600
   : RETURN
7520 DATA "ILLEGAL COMMAND","OUT OF TAPE","TAPE NOT READY","WRITE PROTECTED","
     RESULTS PENDING","DATA ERROR","FILE MARK FOUND","TAPE FAULT"
7530 REM % Errors
7540 PRINT "Error ";E;" - ";E$
   : STOP
7560 DEFFN'152
   : REM % WAIT FOR RETURN KEY
7565 PRINT
   : PRINT "Press RETURN"
7570 DEFFN'154
   : KEYIN K$
7580 KEYIN K$,7580,7580
   : RETURN
   : REM FLUSH EXTRA KEYSTROKES
7600 REM PROCESS DRIVE/CONTROLLER FAULT
7610 PRINT HEX(06),AT(10,0);"Error 8 - Drive/Controller fault"
   : GOSUB '102
   : REM TAKE STATUS
   : PRINT
7620 PRINTUSING 7700,"Controller PROM rev",STR(S$,1,2)
7625 PRINTUSING 7700,"Software rev",STR(S$,3,2)
7630 PRINTUSING 7700,"Tape drive PROM rev",VAL(STR(S$,5,1))
7635 HEXUNPACKSTR(S$,6,1)TO U8$
   : PRINTUSING 7700,"Controller device switch",U8$
7640 HEXUNPACKSTR(S$,7,1)TO U8$
   : PRINTUSING 7700,"Tape drive STATUS 1",U8$
7645 HEXUNPACKSTR(S$,8,1)TO U8$
   : PRINTUSING 7700,"Tape drive STATUS 2",U8$
7650 PRINTUSING 7700,"Drive/controller fault",VAL(STR(S$,10,1))
   : PRINT
   : STOP
7700 %########################   ##
8500 DEFFN'208
   : REM % ERROR MESSAGE FOR TAPE UNIT NOT READY
8510 GOSUB '102
   : M$="Tape drive is not ready "
   : GOSUB '160
   : GOSUB '152
   : RETURN
8600 $CLOSE#2
   : PRINT "DISK ERROR ";ERR
   : STOP #
8700 DEFFN'126
   : RETURN CLEAR ALL
   : GOTO 20
8710 DEFFN'127
   : RETURN CLEAR ALL
   : $PSTAT=".2229"
   : F9$=".2229"
   : LOAD RUN
8720 DEFFN'153
   : PRINT AT(18,0);"Press FN/TAB to restart current utility"
   : PRINT "Press Shift FN/TAB to return to menu"
   : RETURN
9000 $CLOSE
   : PRINT AT(10,0,79);"Disk error "; ERR
   : STOP
   : GOTO 20
9050 $CLOSE
   : PRINT AT(10,0,);"Tape error ";E
   : PRINT E$
   : STOP
   : GOTO 20
9100 REM FATAL ERROR TERMINATOR
   : PRINT AT(10,0,);M$
   : $CLOSE
   : STOP
   : GOTO 20