<< LINES .001/.009 ARE RESERVED FOR SYSTEMS INTEGRATION>>               00000001
DEFINE OFFICIAL'VUUFF = "  03.03"#;                            <<07401>>00112000
                                                               <<07072>>00325000
<<**********************************************************>> <<07072>>00325100
<< For CSTX micro-code, bit (1:1) of the Delta P must be    >> <<07072>>00325200
<< set to 1.  If CST extention micro-code is in effect, then>> <<07072>>00325300
<< QI-9 is set to 1.  Sadutil alters Delta P in two places  >> <<07072>>00325400
<< and will set bit 1 depending on this value.              >> <<07072>>00325500
<<**********************************************************>> <<07072>>00325600
                                                               <<07072>>00325700
DEFINE                                                         <<07072>>00325800
   QI = ABSOLUTE(5)#,  << Absolute location of QI.          >> <<07072>>00325900
   CSTXFLAG = ABSOLUTE(QI-9)#,                                 <<07072>>00326000
   DST'LOC  = ABSOLUTE(2)#,                                    <<07072>>00326100
   SYSGLOB  = %1000#,                                          <<07072>>00326200
   SYSDSTLOC = ABSOLUTE(SYSGLOB + 2)#;                         <<07072>>00326300
   SYS'ACCT'INDEX:=3;<< Offset from DIRBASE to sysaccount.  >> <<07118>>00456000
     INDEXBLOCK(0:9*%200),    << Storage for 9 sectors.     >> <<07118>>00462000
     ENTRYBLOCK(0:9*%200);    << Storage for 9 sectors.     >> <<07118>>00464000
   NCS80SUBTYPES    = 6;   << 7911, 7912, 7914, 7935,     >>   <<07401>>00618000
                           << 7940, 7941                  >>   <<07401>>00619000
   72,  2,  0,  1,  923,  923,    << 7940 (subtype 5).   >>    <<07401>>00629100
   72,  4,  0,  1,  923,  923,    << 7941 (subtype 6).   >>    <<07401>>00629200
      := -1, 0, 1, -1,  2,  3, << translation of CS80 sub->>   <<07401>>00640000
          4, -1, 5, -1, -1;    << types into indexes into >>   <<07401>>00642000
BYTE ARRAY PREAMBLE(0:18):="SADUTIL 03.03";                    <<07401>>00770000
     VTABASELOC'V=24,  << Dbl loc of VTAB address, MPE-V.   >> <<07401>>00978000
     VTABASELOC'IV=19, << "    "   "   "     "   , MPE-IV.  >> <<07401>>00979000
     VTABMAXLOC'V=45,  << Offset to VTAB size, MPE-V.       >> <<07401>>00982000
     VTABMAXLOC'IV=36; <<   "     "   "   "  , MPE-IV.      >> <<07401>>00984000
     ST7974     =  3,                                          <<07401>>01022100
     ST7978     =  2,                                          <<07401>>01022200
LOGICAL PROCEDURE GETMEMORY(MEM'SIZE);                         <<07072>>01432100
VALUE MEM'SIZE;LOGICAL MEM'SIZE;                               <<07072>>01432200
OPTION EXTERNAL;                                               <<07072>>01432300
   IF SECTBUF(1) > %150 THEN                                   <<07401>>03227000
      BEGIN  << This is an MPE-V system.                    >> <<07401>>03227100
      IF VSIZESPEC THEN VSIZE:=TABLE(VTABMAXLOC'V);            <<07401>>03228000
      IF VADDRSPEC THEN VADDR:=TABLED(VTABASELOC'V);           <<07401>>03230000
      END                                                      <<07401>>03230100
   ELSE                                                        <<07401>>03230200
      BEGIN  << This is an MPE-IV system.                   >> <<07401>>03230300
      IF VSIZESPEC THEN VSIZE:=TABLE(VTABMAXLOC'IV);           <<07401>>03230400
      IF VADDRSPEC THEN VADDR:=TABLED(VTABASELOC'IV);          <<07401>>03230500
      END;                                                     <<07401>>03230600
$EDIT VOID=03370000                                            <<07118>>03326000
$IF X1=OFF    << Set CST extention flag for HPIB only.      >> <<07072>>03872100
              RETURNP.(1:1) := CSTXFLAG;                       <<07072>>03873000
$IF                                                            <<07072>>03873100
$EDIT VOID=04050000                                            <<07437>>03898000
$IF X1=OFF  << Set CST expansion flag for HPIB only.       >>  <<07437>>04332100
              RETURNP.(1:1) := CSTXFLAG;                       <<07437>>04332200
$IF                                                            <<07437>>04332300
        BYTE ARRAY MHEAD1(*)=PB:=                              <<07072>>04472000
          ADDR:=DIRADDR+DOUBLE(SYS'ACCT'INDEX);                <<07118>>05276000
          INDEXADDR:=SYS'ACCT'INDEX;                           <<07118>>05488000
$EDIT                                                          <<07118>>06981000
$EDIT VOID=07056000                                            <<07118>>07040000
    IF LPDTYPE.DTYPEF=MAGTAPE AND (LPDTYPE.STYPEF=ST7974 OR    <<07401>>07092000
       LPDTYPE.STYPEF=ST7976 OR LPDTYPE.STYPEF=ST7978) THEN    <<07401>>07094000
    BEGIN << Clear device,  density=1600, immediate report  >> <<07401>>07096000
       PERFORMIO (SERIAL'DEV,17<<Clear>>, COPYBUF, 0 );        <<07401>>07098000
       PERFORMIO (SERIAL'DEV,16<<1600>>,  COPYBUF, 0 );        <<07401>>07100000
       IF LPDTYPE.STYPEF=ST7974 OR LPDTYPE.STYPEF=ST7978       <<07401>>07101000
          THEN PERFORMIO(SERIAL'DEV,18<<Report>>,COPYBUF,0);   <<07401>>07101100
$EDIT VOID=9080000                                             <<07118>>09070000
    IF SAVE'FILES AND NOT TAPECHECKED AND NOTHP7976 THEN       <<07401>>10964000
       BEGIN                                                   <<07401>>10966000
       MOVE PBUF:="Place serial device on line and ";          <<07401>>10968000
       MOVE PBUF(32):="prepare it for write";                  <<07401>>10970000
       PRINT(PBUF,-52,CRLF);                                   <<07401>>10972000
       TAPE'READY'CHECK;                                       <<07401>>10974000
       END;                                                    <<07401>>10976000
    TAPECHECKED:=TRUE; <<Tape is ready to write!            >> <<07401>>10980000
    IF LPDTYPE.DTYPEF=MAGTAPE AND (LPDTYPE.STYPEF=ST7974 OR    <<07401>>10980100
       LPDTYPE.STYPEF=ST7976 OR LPDTYPE.STYPEF=ST7978) THEN    <<07401>>10980200
       BEGIN << Clear device, density=1600, immediate report>> <<07401>>10980300
       PERFORMIO(SERIAL'DEV,17<<Clear>>,COPYBUF,0);            <<07401>>10980400
       PERFORMIO (SERIAL'DEV,16<<1600>>,COPYBUF,0);            <<07401>>10980500
       IF LPDTYPE.STYPEF=ST7974 OR LPDTYPE.STYPEF=ST7978       <<07401>>10980600
          THEN PERFORMIO (SERIAL'DEV,18 <<Report>>,COPYBUF,0); <<07401>>10980700
       END;                                                    <<07401>>10980900
        << of the system directory. The group and file index>> <<07118>>11436000
        << blocks could be 1 or 3 sectors, depending on if  >> <<07118>>11437000
        << it was created after or before MPE-V.            >> <<07118>>11437100
        XBLOCK(GTYPE):=@INDEXBLOCK(3*%200);                    <<07118>>11444000
        XBLOCK(FTYPE):=@INDEXBLOCK(6*%200);                    <<07118>>11446000
        EBLOCK(GTYPE):=@ENTRYBLOCK(3*%200);                    <<07118>>11450000
        EBLOCK(FTYPE):=@ENTRYBLOCK(6*%200);                    <<07118>>11452000
    << Also, make sure that DUS has enouph room when the    >> <<07191>>11988100
    << file manager (FMGR) is called from the STOP command. >> <<07191>>11988200
    << This can be easily verified by entering STOP and     >> <<07191>>11988300
    << checking that we get back to DUS with halting.       >> <<07191>>11988400
    EQUATE GOOD'Z'VALUE = 21000,                               <<07191>>11994000
           DST'SIZE     = 68;                                  <<07072>>11995000
    ARRAY CST(*) = PB := 0,0,0,0,0,0,0,0;                      <<07072>>12026000
    INTEGER ARRAY DST(0:DST'SIZE-1);                           <<07072>>12030000
    INTEGER ARRAY DST'32WORD(0:DST'SIZE+32);                   <<07237>>12031000
    LOGICAL DST'ADDR;                                          <<07072>>12033000
$EDIT VOID=12346000                                            <<07237>>12318000
   <<------------------------------------------------------->> <<07237>>12319000
   << We must perform one more kludge.  The DST must be on  >> <<07237>>12320000
   << a 32 word boundry for the MPE-V LST/SST micro-code.   >> <<07237>>12321000
   << Therefore, we must obtain the absolute address of the >> <<07237>>12322000
   << new DST array and round it up.  Then, we will move the>> <<07237>>12323000
   << old array into the new one using MABS.  Finally, store>> <<07237>>12324000
   << the new address into absolute location 2, DST'LOC.    >> <<07237>>12325000
   <<------------------------------------------------------->> <<07237>>12326000
                                                               <<07237>>12327000
   PUSH(DB);          << Get bank and absolute address of   >> <<07237>>12328000
   TOS := TOS+LOGICAL(@DST'32WORD);  << the new array.      >> <<07237>>12329000
   TOS := (LOGICAL(TOS+31)&LSR(5))&LSL(5);                     <<07237>>12330000
   DST'ADDR := S0;    << Save the absolute address of DST.  >> <<07237>>12331000
   PUSH(DB);          << Get bank and absolute address of   >> <<07237>>12332000
   TOS := TOS+LOGICAL(@DST);  << of the old array.          >> <<07237>>12333000
   TOS := DST'SIZE;   << Move the full array.               >> <<07237>>12334000
   ASMB(MABS 5);      << Off to its new home.               >> <<07237>>12335000
   DST'LOC := DST'ADDR;       << Set the absolute address.  >> <<07237>>12336000
                                                               <<07237>>12337000
   <<------------------------------------------------------->> <<07237>>12338000
   << Now we store the bank and address of SADUTIL's DB in- >> <<07237>>12339000
   << to the DST at SADUTIL's pre-defined DST entry, %20.   >> <<07237>>12340000
   <<------------------------------------------------------->> <<07237>>12341000
                                                               <<07237>>12342000
   PUSH(DB);          << Again get the bank and address.    >> <<07237>>12343000
   ABS(DST'LOC + SADUTILDST*4 +3) := TOS;                      <<07237>>12344000
   ABS(X-1) := TOS;                                            <<07237>>12345000
                                                               <<07072>>12350000
    TOS := 0;          << X register.                       >> <<07072>>12365000
    TOS := CONTINUEP;  << Delta P, continue point in OB'.   >> <<07072>>12366000
    PUSH( STATUS );    << Keep the same segment and bits.   >> <<07072>>12368000
    TOS := 4;          << Delta Q, we will NEVER return!    >> <<07072>>12370000
    PUSH( S ); SET( Q ); << Set Q to current TOS and exit.  >> <<07072>>12372000
    RETURNP.(1:1) := CSTXFLAG; << Set CST extension bit.    >> <<07072>>12373000
<< is finally set up correctly.                             >> <<07072>>12560000
$EDIT VOID=12564000                                            <<07072>>12562000
   INITIALIZEGLOBAL(,,SADUTILDST,SADUTILDST);                  <<07237>>12574000
