image of READY prompt

Wang2200.org

Listing of file='@GENPART' on disk='vmedia/mvp-boot-2.5.3.wvd.zip'

# Sector sector 537, program filename = '@GENPART'
0010 REM % Prog = @GENPART    By PLS     Date = 05/13/81    Time = 00.00.00 PM
         Rel 2.4
0020 DIM A$17,S(16),C$16,X$1,S$32,T$16,F$8,F1$8,F2$8,P$(16)8,D$4,D$(33)3,D1$4,
     E$1,M$78
0030 DIM A(8),B$(16)1,R(8),B,L$52,P$8,M$(3)80
0040 REM -- MAX NO. OF PARTITIONS
   : U1=16
0050 REM -- MIN PARTITION SIZE
   : M=1.25
0060 REM -- MAX NUMBER OF TERMINALS
   : T1=13
0070 REM -- M1 MAX NO. OF CONFIGURATIONS TO BE SAVED ON DISK
   : M1=10
0090 REM -- STR(A$,I,1) = SIZE OF PARTITION I (BINARY NO. OF PAGES)
   : REM -- S(I) SIZE OF PARTITION I
   : REM -- S9 = TOTAL AVAILABLE MEMORY IN SYSTEM
   : REM -- B = NUMBER OF MEMORY BANKS
   : REM -- A() = AVAILABLE MEMORY IN EACH BANK
0140 REM -- R() = REMAINING MEMORY IN EACH BANK
   : REM -- P$(I) = NAME OF PROGRAM TO LOAD FOR PARTITION I
   : REM -- STR(C$,I,1) = PROGRAMMABILITY ('Y' OR 'N') OF PARTITION I
   : REM -- K = CURRENT PARTITION
   : REM -- STR(T$,I,1) = TERMINAL NUMBER FOR PARTITION I
0190 REM -- L = LOAD FLAG (FOR DISPLAYING MESSAGES)
   : REM -- F$,F1$,F2$ = CONFIGURATION NAME
   : REM -- E$ = DISPLAY FLAG (' '=PARTITIONS, 'E'=DEVICE TABLE, 'H'=HELP, 'L'
     =CONFIGURATION MENU
   : REM -- B$() = DISPLAY FLAGS (BANK BOUNDARIES)
0230 REM -- U = NO. OF PARTITIONS
   : REM -- T2= NO. OF TERMINALS
   : REM -- P$ = RECONFIGURATION PASSWORD
   : P$="SYSTEM"
0250 REM %*** INITIALIZATION (AND POSSIBLE AUTOMATIC EXECUTION) ***
0260 M$=$MSG
   : X$=$PSTAT(2)
   : ERROR$MSG,M$=" "
0270 GOSUB 420
   : GOTO 310
   : REM DELETE GOTO TO PROMPT FOR MEMORY SIZE
0280 GOSUB 2230
   : L$=HEX(0000)
   : PRINTUSING TO L$,"###.##",S9
0290 PRINT AT(3,0);
   : LINPUT "Amount of memory available for partitioning (in K)?"STR(L$,3,6)
   : CONVERT STR(L$,3,6) TO S9
   : ERRORGOTO 290
0300 S9=FNT(S9)
   : IF S9>229 THEN 290
   : GOSUB 440
   : GOTO 340
0310 REM INITIALLY LOAD A DEFAULT CONFIGURATION (PASS NAME TO SUBROUTINE '205)
   : GOSUB '205("current")
   : IF F1$<>F$ THEN 340
   : E$="?"
   : L=1
0320 GOTO 1150
   : REM DELETE GOTO FOR AUTOMATIC EXECUTION
0325 GOTO 780
   : REM DELETE GOTO TO RANDOMIZE PASSWORD
0330 CONVERT RND(1) TO P$,(.#######)
   : GOTO 790
0340 GOSUB 590
   : GOSUB 390
   : L=0
   : IF F$=" " THEN GOTO 380
   : ELSE GOTO 1150
0360 PRINT AT(U6,0,80);
   : IF L=0 THEN RETURN
   : PRINT "Configuration '";F$; "' loaded.  ";
   : L=0
   : RETURN
0370 REM %*** CLEAR ALL PARTITIONS ***
0380 DEFFN'00
   : RETURN  CLEAR  ALL
   : GOSUB 390
   : GOSUB '204
   : GOTO 470
0390 MAT S=ZER
   : C$=ALL("Y")
   : P$()=ALL(" ")
0400 U,L=0
   : U6=20
   : MAT MOVE A() TO R()
   : B$()=ALL(" ")
   : E$=" "
   : RETURN
0410 REM % *** CALCULATE MEMORY SIZE ***
0420 S9=0
   : FOR I=1 TO U1
   : L$=$PSTAT(I)
   : ERRORI=U1
   : L$=ALL(00)
0430 UNPACK (##.##) STR(L$,12,2) TO X
   : S9=S9+X
   : NEXT I
   : S9=MAX(S9,SPACEK)
0440 MAT A=ZER
   : A(1)=MIN(S9,61)
   : J=S9-61
   : B=1
0450 IF J<=0 THEN RETURN
   : B=B+1
   : A(B)=MIN(J,56)
   : J=J-56
   : GOTO 450
0460 REM %*** CHANGE TERMINAL DATA ***
0470 DEFFN'04
   : RETURN  CLEAR  ALL
   : GOSUB '204
   : K=1+MOD(K,U)
0480 GOSUB 360
0490 IF E$<>" " OR U=0 THEN 470
   : IF K=0THEN K=1
   : PRINT HEX(0E);"Edit which partition (default =";K;")";
   : INPUT K
   : ERRORGOTO 480
0500 IF K<>INT(K) OR K<=0 OR K>U THEN 480
   : PRINT HEX(0E);
   : GOSUB '206(K)
   : PRINT AT(4+K,1);"*";
0510 X=S(K)
   : PRINT AT(U6,0,80);
   : PRINT "Partition size (default =";X;"K)";
   : INPUT X
   : ERRORGOTO 510
0520 IF X<M AND X<>0 THEN 510
   : X=FNT(X)
   : IF S(K)=X THEN 530
   : S(K)=X
   : GOSUB 1920
   : PRINT HEX(0E);
   : GOSUB '206(K)
   : PRINT AT(4+K,1);"*"
0530 T=VAL(STR(T$,K))
   : PRINT AT(U6,0,80);"Terminal (default =";T;")";
   : INPUT T
   : ERRORGOTO 530
0540 IF T<>INT(T) OR T<0 OR T>T2 THEN 530
   : IF VAL(STR(T$,K,1))=T THEN 550
   : STR(T$,K,1)=BIN(T)
   : PRINT HEX(0E);
   : GOSUB '206(-K)
   : PRINT AT(K+4,1);"*"
0550 X$=STR(C$,K,1)
   : PRINT AT(U6,0,80);
   : INPUT "Enable programming (Y or N) ",X$
   : $TRAN(X$,"YyNn")R
   : IF POS("YN"=X$)=0THEN 550
   : IF STR(C$,K,1)=X$ THEN 560
   : STR(C$,K,1)=X$
   : PRINT HEX(0E);
   : GOSUB '206(-K)
   : PRINT AT(K+4,1);"*"
0560 PRINT AT(U6,0,80)
   : LINPUT "Name of program to load?"?-P$(K)
   : GOSUB '206(-K)
   : PRINT AT(K+4,1);"*"
   : GOTO 470
0570 REM %*** DEFAULT DEVICE TABLE ***
0580 DEFFN'01
   : GOSUB 590
   : E$="?"
   : GOTO 1390
0590 D$()=ALL(00)
   : D$(1)=HEX(021500)
   : D$(2)=HEX(031000)
   : D$(3)=HEX(032000)
   : RETURN
0600 REM %*** ALLOCATE REMAINING MEMORY ***
0610 DEFFN'02
   : RETURN  CLEAR  ALL
   : GOSUB '204
   : L$=HEX(0000)
   : B$(U)="Y"
   : MAT SEARCH B$(),="Y" TO STR(L$,3)
   : B$(U)="N"
0620 IF B=1 THEN 700
   : X$="A"
   : PRINT AT(U6,0,80);
   : INPUT "Divide memory evenly in which bank (default = all)",X$
0630 IF X$="A" OR X$="a" THEN 700
   : CONVERT X$ TO J
   : ERRORGOTO 620
0640 GOSUB 650
   : GOTO 710
0650 N=0
   : X=VAL(STR(L$,2*J+1),2)
   : IF X=0 THEN 710
   : FOR I=VAL(STR(L$,2*(J-1)+1),2)+1 TO X
   : IF S(I)=0 THEN N=N+1
   : NEXT I
0660 IF N=0 THEN RETURN
   : S2=FNT(R(J)/N)
0670 IF S2>=MTHEN 680
   : S2=J
   : GOSUB 1920
   : GOSUB '200
   : PRINT AT(U6,0,80);"TOO LITTLE REMAINING MEMORY";
   : IF B>1 THEN PRINTUSING " IN BANK #",S2;
   : PRINT ".   ";
   : GOTO 490
0680 IF R(J)-(S2*N)<0 THEN S2=S2-.25
0690 FOR I=VAL(STR(L$,2*(J-1)+1),2)+1 TO VAL(STR(L$,2*J+1),2)
   : IF S(I)=0 THEN S(I)=S2
   : NEXT I
   : RETURN
0700 FOR J=1 TO B
   : GOSUB 650
   : NEXT J
0710 K=0
   : GOSUB 1920
   : GOSUB '200
   : GOTO 470
0720 REM %*** CONFIGURE PARTITIONS ***
0730 DEFFN'15
   : RETURN  CLEAR  ALL
   : GOSUB '204
   : X$=$PSTAT(2)
   : ERRORGOTO 750
0740 PRINT AT(U6,0,80);"SYSTEM HAS ALREADY BEEN CONFIGURED.  ";HEX(07);
   : GOTO 490
0750 GOSUB 1860
   : IF X$="T" THEN GOSUB '200
0760 PRINT AT(U6,0,80);"Check configuration.  OK to execute (Y or N)";
0770 KEYIN X$,770,770
   : X$="N"
   : INPUT X$
   : ON POS("YyNn"=X$) GOTO 780,780,480,480
   : GOTO 760
0780 PRINT AT(U6,0,80);
   : LINPUT "Reconfiguration password?"?-P$
0790 FOR K=1 TO U
   : IF S(K)>=M THEN 800
   : PRINT AT(U6,0,80);HEX(07);"SIZE OF PARTITION";K;"IS ILLEGAL.  ";
   : GOTO 490
0800 NEXT K
0810 FOR I=1 TO B
   : IF R(I)>=0 THEN 820
   : PRINT AT(U6,0,80);HEX(07);"AVAILABLE MEMORY EXCEEDED IN BANK";I;".   ";
   : GOTO 490
0820 NEXT I
0830 A$=ALL(00)
   : FOR I=1TO U
   : STR(A$,I,1)=BIN(S(I)*4)
   : NEXT I
0840 D$(33)=ALL(00)
   : I=1
   : FOR D=1TO 32
   : IF STR(D$(D),2,1)=HEX(00) THEN 850
   : D$=D$(D)
   : D$(D)=ALL(00)
   : D$(I)=D$
   : I=I+1
   : GOTO 860
0850 D$(D)=ALL(00)
0860 NEXT D
   : PACK(##.##) S$ FROM S()
0870 DATA LOAD DC OPEN T "@SYSFILE"
   : ERRORGOTO 890
0880 DATA SAVE DC "current ",U,S$,T$,C$,P$(),D$()
   : ERRORREM WRITE PROTECT
0890 $TRAN(C$,HEX(014E0059))R
   : FOR I=1 TO 16
   : IF P$(I)<>" " THEN STR(C$,I,1)=OR HEX(02)
   : NEXT I
0900 $MSG=M$
   : $INIT (A$,T$,C$,P$(),D$(),P$)
   : REM THIS STATEMENT NOT LEGAL IN 2200VP
   : REM NOT LEGAL ON 2200MVP IF SYSTEM ALREADY CONFIGURED -- EXECUTE IMMEDIAT
     E MODE $INIT "password" STATEMENT.
0910 REM %*** SAVE CONFIGURATION ON DISK ***
0920 DEFFN'09
   : RETURN  CLEAR  ALL
   : GOSUB '204
   : GOSUB 1860
   : IF X$="T" THEN GOSUB '200
   : PACK(##.##) S$ FROM S()
0930 PRINT AT(U6,0,80);"Check configuration to save.  Configuration name?";
   : LINPUT ?-F$
   : IF F$=" " THEN 930
0940 LIMITS T"@SYSFILE",D,I,D2,D3
   : ERRORGOSUB 1120
   : GOTO 940
0950 IF D3>0 THEN 980
   : IF D3=-2THEN 970
   : DATA SAVE DC OPEN T (2*(M1+1)+2)"@SYSFILE"
   : ERRORGOSUB 1120
   : GOTO 940
0960 DATA SAVE DC "current ",U,S$,T$,C$,P$(),D$()
   : DATA SAVE DC END
   : GOTO 940
0970 DATA SAVE DC OPEN T "@SYSFILE","@SYSFILE"
   : GOTO 960
0980 DATA LOAD DC OPEN T "@SYSFILE"
   : D,I=0
0990 DATA LOAD DC F1$
   : IF END  THEN 1020
   : D=D+2
   : IF F1$=" "AND I=0THEN I=D
   : IF F$<>F1$ THEN 990
1000 PRINT AT(U6,0,80);"Configuration '";F$;"' already exists.  Overwrite it (
     Y or N)";
   : INPUT X$
   : ON POS("YyNn"=X$) GOTO 1050,1050,1010,1010
   : GOTO 1000
1010 PRINT AT(U6,0,80);
   : GOTO 1030
1020 IF I>0THEN 1070
   : IF D2<2*(M1+1)+2 THEN 1090
   : GOSUB 1340
   : PRINT AT(U6,0,80);"CONFIGURATION FILE FULL.  ";
1030 F1$=" "
   : LINPUT "Old configuration to overwrite?"?-F1$
   : IF F1$="current" OR F1$=" " THEN 1010
   : DBACKSPACE BEG
1040 DATA LOAD DC F2$
   : IF END  THEN 1080
   : IF F2$<>F1$ THEN 1040
1050 DBACKSPACE 2S
   : DATA SAVE DC F$,U,S$,T$,C$,P$(),D$()
   : ERRORGOSUB 1120
   : GOTO 980
1060 GOTO 1110
1070 DBACKSPACE BEG
   : DSKIP IS
   : GOTO 1050
1080 PRINT AT(U6,0,80);"'";F1$;"' DOES NOT EXIST.  ";
   : GOTO 1030
1090 DATA SAVE DC F$,U,S$,T$,C$,P$(),D$()
   : ERRORGOSUB 1120
   : GOTO 980
1100 DATA SAVE DC END
1110 PRINT AT(U6,0,80);"Configuration '";F$;"' saved.  ";
   : GOTO 490
1120 PRINT AT(U6,0,80);
   : X=ERR
   : IF X=95 THEN PRINT "DISK IS WRITE PROTECTED, ";
   : ELSE PRINT "ERROR";X;
1130 X$=" "
   : LINPUT "Key 'RETURN' to retry."?X$
   : RETURN
1140 REM %*** LOAD CONFIGURATION FROM DISK ***
1150 DEFFN'08
   : RETURN  CLEAR  ALL
   : GOSUB 1340
1160 GOSUB 360
   : F1$=" "
1170 LINPUT "Name of configuration to load?"?-F1$
   : IF F1$=" " THEN 1190
   : PRINT AT(U6,0,80);
1180 GOSUB '205(F1$)
   : IF F$<>F1$ THEN 1190
   : L=1
   : GOTO 470
1190 PRINT AT(U6,0,80);"'";F1$;"' DOES NOT EXIST.  ";
   : GOTO 1170
1200 REM %*** LOAD SUBROUTINE ***
1210 DEFFN'205(F1$)
   : F$=" "
   : DATA LOAD DC OPEN T"@SYSFILE"
   : ERRORPRINT AT(U6,0,80);"NO CONFIGURATIONS SAVED.  ";
   : RETURN
1220 DATA LOAD DC F$,U,S$,T$,C$,P$(),D$()
   : IF END  THEN 1230
   : IF F$<>F1$ THEN 1220
1230 U6=MAX(20,U+6)
   : UNPACK(##.##) S$ TO S()
   : T2=T1
   : B$()=ALL(" ")
   : GOSUB 1920
   : RETURN
1240 REM %*** DELETE CONFIGURATION ***
1250 DEFFN'10
   : RETURN  CLEAR  ALL
   : GOSUB 1340
1260 PRINT AT(U6,0,80);
1270 F$,F1$=" "
   : LINPUT "Delete which configuration? "?-F1$
1280 IF F1$="current" THEN 1260
   : DBACKSPACE BEG
1290 DATA LOAD DC F2$
   : IF END  THEN 1320
   : IF F1$<>F2$ THEN 1290
1300 DBACKSPACE 2S
   : DATA SAVE DC F$,U,S$,T$,C$,P$(),D$()
   : ERRORGOSUB 1120
   : GOTO 1280
1310 E$="?"
   : GOTO 1150
1320 PRINT AT(U6,0,80);"CONFIGURATION '";F1$;"' DOES NOT EXIST.   ";
   : GOTO 1270
1330 REM %*** LIST STORED CONFIGURATIONS ***
1340 DATA LOAD DC OPEN T "@SYSFILE"
   : ERRORPRINT AT(U6,0,80);"NO CONFIGURATIONS SAVED.  ";
   : IF U=0 THEN 380
   : GOTO 490
1350 IF E$="L" THEN RETURN
   : E$="L"
1360 GOSUB '201
   : PRINT AT(4,0);"LIST OF STORED CONFIGURATIONS (#PARTITIONS)"
1370 DATA LOAD DC F2$,T
   : IF END  THEN RETURN
   : IF F2$>" " THEN PRINT ,F2$,"(";T;")"
   : GOTO 1370
1380 REM %*** EDIT DEVICE TABLE ***
1390 DEFFN'05
   : RETURN  CLEAR  ALL
   : IF E$="E" THEN 1480
   : E$="E"
1400 GOSUB '201
   : PRINT AT(2,0);"      DEVICE PARTITION        DEVICE PARTITION"
   : GOSUB '202(0)
   : D=1
1410 PRINT AT(20,0,80);HEX(0E);"Edit which entry (default =";D;")";
   : INPUT D
   : ERRORGOTO 1410
1420 IF D<>INT(D) OR D<=0 OR D>32 THEN 1410
   : PRINT HEX(0E);
   : GOSUB '202(D)
   : IF D<17 THEN PRINT AT(2+D,0);"*"
   : ELSE PRINT AT(2+D-16,24);"*"
1430 HEXUNPACK STR(D$(D),1,2) TO D$
   : P=VAL(STR(D$(D),3))
1440 D1$="/" & STR(D$,2)
   : PRINT AT(20,0,80);"Device address (default = /";STR(D$,2);", /000 to dele
     te entry)";
   : INPUT D1$
   : IF VERD1$,"/HHH")<>4 THEN 1440
   : IF D1$="/000" THEN 1500
   : STR(D$,2)=STR(D1$,2)
   : PRINT HEX(0E);
   : GOSUB '203(D)
   : HEXPACK D$(D) FROM D$
   : STR(D$(D),3)=HEX(00)
1450 X=0
   : PRINT AT(20,0,80);"Allocate device to which partition (default = all)";
   : INPUT X
   : ERRORGOTO 1450
1460 IF X<0 OR X>16 OR X<>INT(X) THEN 1450
   : P=X
   : GOSUB '203(D)
1470 HEXPACK D$(D) FROM D$
   : STR(D$(D),3)=BIN(P)
1480 IF D<17 THEN PRINT AT(2+D,0);" ";
   : ELSE PRINT AT(2+D-16,24);" "
1490 D=1+MOD(D,32)
   : GOTO 1410
1500 FOR J=D TO 32
   : D$(J)=D$(J+1)
   : GOSUB '202(J)
   : NEXT J
   : GOTO 1410
1510 REM %*** EDIT $MSG ***
1520 DEFFN'06
   : RETURN  CLEAR  ALL
   : GOSUB '204
1530 PRINT AT(MIN(21,U6),0,80);"Broadcast message:"
   : LINPUT -M$
   : PRINT AT(MIN(21,U6),0,159);
   : GOTO 470
1540 REM %*** DISPLAY DEVICE TABLE ***
1550 DEFFN'202(I)
   : IF I=0 THEN 1580
1560 HEXUNPACK STR(D$(I),1,2) TO D$
   : P=VAL(STR(D$(I),3))
1570 DEFFN'203(I)
   : PRINT HEX(06);AT(3+MOD((I-1),16),24*INT((I-1)/16),18);
   : PRINTUSING "  ##.",I;
   : IF STR(D$,2,3)="000"THEN RETURN
   : PRINT "  /";STR(D$,2,3);"    ";
   : IF P=0 THEN PRINT "all"
   : ELSE PRINT P
   : RETURN
1580 FOR I=1 TO 32
   : GOSUB 1560
   : NEXT I
   : RETURN
1590 REM % *** DISPLAY TITLE & OPTIONS ***
1600 DEFFN'201
   : K=0
   : GOSUB 2230
1610 PRINT AT(3,52);BOX(16,27);"       #PIRND(STR(ATN(PRINT TAN(LOG(PRINT TAN(
     SIN(ATN(RND(TAN(DEFFNSTR(:"
1620 PRINT AT(4,53);"SF'00 - clear partitions";AT(5,53);"SF'01 - clear device
     table";
1630 PRINT AT(7,53);"SF'02 - divide mem. evenly";AT(9,53);"SF'04 - edit partit
     ions";
1640 PRINT AT(10,53);"SF'05 - edit device table";AT(11,53);"SF'06 - edit $MSG"
     ;
1650 PRINT AT(13,53);"SF'08 - load configuration";AT(14,53);"SF'09 - save conf
     iguration";
1660 PRINT AT(15,53);"SF'10 - delete config.";
1670 PRINT AT(17,53);"SF'15 - execute"
1680 RETURN
1690 REM %*** DISPLAY PARTITIONS ***
1700 REM '200 DISPLAYS ALL PARTITIONS
1710 DEFFN'200
   : FOR I=MIN(2,U) TO U
   : GOSUB '206(-I)
   : NEXT I
   : GOSUB '206(1)
   : RETURN
1720 REM '206 DISPLAYS ONLY ONE PARTITION
1730 DEFFN'206(I)
   : J=ABS(I)
   : L$=HEX(0000)
1740 IF S(J)>0 THEN PRINTUSING TO L$,1820,J,S(J),VAL(STR(T$,J)),STR(C$,J,1),P$
     (J);
   : ELSE PRINTUSING TO L$,1820,J,"  -",VAL(STR(T$,J)),STR(C$,J,1),P$(J);
1750 IF B$(J)="Y" THEN STR(L$,5)= OR ALL(80)
1760 PRINT HEX(06);AT(4+J,0);STR(L$,3);TAB(50);HEX(0F);
1770 IF I<0 THEN 1780
   : PRINT AT(2,17);
   : FOR J=1 TO B
   : PRINTUSING "-##.## ",R(J);
   : NEXT J
1780 IF ABS(I)>INT(5/M) OR B=1 THEN 1810
   : X=0
   : FOR J=1 TO INT(5/M)
   : X=X+S(J)
1790 IF X<=5 AND S(J)>0 THEN X$="u"
   : ELSE X$=" "
   : IF B$(J)="Y" THEN 1810
1800 PRINT AT(4+J,7);STR(X$,,1)
   : IF B$(J)="Y" THEN J=U
   : NEXT J
1810 I=ABS(I)
   : E$=" "
   : RETURN
1820 %   ##     ###.##    ###        #        ##########
1830 REM %*** TRUNCATE TO PAGES ***
1840 DEFFNT(X)=-.25*INT(-4*X)
1850 REM %*** PAD MEMORY BANKS ***
1860 X$="F"
   : MAT SEARCH B$(),="Y" TO L$
1870 FOR I=0 TO B-2
   : J=VAL(STR(L$,2*I+1),2)
   : IF J=0 THEN 1900
1880 IF R(I+1)=0 THEN 1890
   : S(J)=S(J)+R(I+1)
   : X$="T"
1890 NEXT I
1900 GOSUB 1920
   : RETURN
1910 REM %*** CALCULATE REMAINING SPACE ***
1920 MAT MOVE A() TO R()
   : J=1
   : IF B$(1)=" " THEN 1970
1930 FOR I=1 TO U
   : R(J)=R(J)-S(I)
1940 IF B$(I)="N" THEN 1950
   : J=J+1
   : IF J<=B THEN 1950
   : RETURN
1950 NEXT I
   : RETURN
1960 REM ESTABLISH BANK BOUNDARIES
1970 B$()=ALL("N")
   : FOR I=1 TO U
   : IF R(J)-S(I)>=0 OR J+1>B THEN 1980
   : J=J+1
   : B$(I-1)="Y"
1980 R(J)=R(J)-S(I)
   : NEXT I
   : RETURN
1990 REM %*** PARTITION DISPLAY ***
2000 DEFFN'204
   : IF E$<>" " OR U=0 THEN 2010
   : IF K<=0 OR K>UTHEN RETURN
   : PRINT AT(K+4,0,2);
   : GOSUB '206(K)
   : E$=" "
   : RETURN
2010 E$=" "
   : GOSUB '201
   : PRINT AT(1,0);"Available memory:";
2020 FOR I=1 TO B
   : PRINTUSING "-##.## ",A(I);
   : NEXT I
2030 PRINT AT(2,0);"Remaining memory:";
2040 FOR I=1 TO B
   : PRINTUSING "-##.## ",A(I);
   : NEXT I
2050 IF U>0 THEN 2120
   : PRINT AT(4,0,52);
   : INPUT "No. of terminals",T2
   : ERRORGOTO 2050
2060 IF T2>T1 OR T2<1 THEN 2050
   : B$()=ALL("N")
   : U=0
   : FOR I=1 TO B
   : X=-1
2070 PRINT AT(4+I,0,52);"No. of partitions";
   : IF B>1 THEN PRINT " in bank";I;
   : INPUT X
   : ERRORGOTO 2070
2080 IF X<0 THEN 2070
   : IF X=0 THEN 2090
   : U=U+X
   : B$(MIN(U1,U))="Y"
   : NEXT I
   : B$(MIN(U1,U))="N"
2090 B$(MIN(U1,U))="N"
   : U6=MAX(20,U+6)
   : IF U<=U1 THEN 2100
   : U=0
   : U6=19
   : PRINT HEX(07);"NUMBER OF PARTITIONS EXCEEDS";U1
   : GOTO 2060
2100 FOR I=5 TO 10
   : PRINT AT(I,0,52);
   : NEXT I
2110 T$=ALL(00)
   : FOR I=1 TO U
   : STR(T$,I,1)=BIN(MOD(I-1,T2)+1)
   : NEXT I
2120 IF U<>INT(U) OR U<=0 OR U>U1 THEN 2050
2130 PRINT AT(4,0,52);"PARTITION SIZE(K) TERMINAL PROGRAMMABLE PROGRAM"
2140 GOSUB '200
   : RETURN
2150 REM %*** OPERATOR HELP ***
2160 REM DEFFN'126
   : E$="H"
   : GOSUB 2230
2170 DATA LOAD DC OPEN T "@HELP"
   : ERRORPRINT AT(21,0);
   : X$=" "
   : LINPUT "File '@HELP' not found; key 'RETURN' to continue."?X$
   : GOTO 480
2180 DATA LOAD DC M$()
2190 FOR X=1 TO 3
   : IF POS(M$(X) = HEX(8C))=0 THEN 2200
   : GOSUB 2220
   : $TRAN(M$(X),HEX(008C2020)) R
2200 IF POS(M$(X)=HEX(8B))>0 THEN GOSUB '4
2210 PRINT M$(X)
   : NEXT X
   : GOTO 2180
2220 F$=" "
   : PRINT AT(23,0);HEX(0E);
   : LINPUT "Key 'RETURN' to continue, SF'04 to exit."?F$
2230 PRINT HEX(03060E);TAB(14);"*** WANG 2200MVP PARTITION GENERATION PROGRAM
     ***"
   : PRINT
   : RETURN