$CONTROL MAP,CODE,USLINIT                                               00010000
<<memlogan>>                                                            00015000
<< hp32002c mpe source c.00.00 >>                                       00020000
$copyright     "(C) COPYRIGHT HEWLETT-PACKARD CO. 1980. ",            & 00025000
$     "THIS PROGRAM MAY BE USED WITH ONE COMPUTER SYSTEM AT A ",      & 00030000
$     "TIME AND SHALL NOT OTHERWISE BE RECORDED, TRANSMITTED OR ",    & 00035000
$     "STORED IN A RETRIEVAL SYSTEM.  COPYING OR OTHER REPRODUCTION ",& 00040000
$     "OF THIS PROGRAM EXCEPT FOR ARCHIVAL PURPOSES IS PROHIBITED ",  & 00045000
$     "WITHOUT THE PRIOR WRITTEN CONSENT OF HEWLETT-PACKARD COMPANY."   00050000
$control main=memlogan,segment=memlogan                                 00055000
$control privileged,nowarn                                              00060000
$title "- ERROR CORRECTING MEMORY LOG ANALYZER"                         00065000
$thirty                                                                 00070000
begin                                                                   00075000
                                                                        00080000
<<------------------------------------------------------------          00085000
*                                                            *          00090000
*           error correcting memory log analyzer             *          00095000
*                                                            *          00100000
------------------------------------------------------------>>          00105000
                                                                        00110000
define                                                         <<01.01>>00115000
ptitle = ("MEMLOGAN B.01.03 (C) HEWLETT-PACKARD CO., 1980")#;  <<04932>>00120000
$include inclvuf                                               <<04932>>00125000
integer s0 = s-0;                                                       00130000
                                                                        00135000
integer parm = q-4;  <<run parm parameter>>                             00140000
integer logfnum,outfnum;                                                00145000
integer i,rec,chip,banks,fault,errcnt,checkbit,                         00150000
        delay:=0,linecnt:=0,errorcount:=0;                     <<00.05>>00155000
integer bit,row,oldrow,bank,oldbank,board,oldboard,oldcontroller;<<2mb>>00160000
integer                                                        <<03020>>00165000
  old'word = oldrow;                                           <<03020>>00170000
                                                               <<03020>>00175000
integer                                                        <<03020>>00180000
  word     = row;                                              <<03020>>00185000
                                                                        00190000
logical heading:=true,printimes:=true;                         <<00.01>>00195000
                                                                        00200000
double stime,utime,errtime1,errtime2;                          <<01.01>>00205000
                                                                        00210000
integer cpu'type;                                              <<rk2mb>>00215000
                                                               <<rk2mb>>00220000
integer array next'controller(1:6) := 2, 8, 8, 16, %77777, 4;  <<m8068>>00225000
                                                               <<rk2mb>>00230000
define                                                         <<rk2mb>>00235000
     banknum      = absolute (membanknum)#,                    <<03020>>00240000
     pronto       = (cpu'type = 4)#,                           <<01397>>00245000
     pronto'2ndcntlr = logical(mcs'status.(15:1))#,            <<01397>>00250000
     rams'are'16k = (cpu'type > 1)#,                           <<rk2mb>>00255000
     tp'flag      = (cpu'type = 2)#,                           <<rk2mb>>00260000
     two'mb'flag  = (cpu'type = 3)#;                           <<rk2mb>>00265000
equate recsize  =  4112;  <<memlog rec size: 2048 words log  >><<01397>>00270000
array logrec(0:recsize-1);                                              00275000
double array logrecd(*) = logrec;                                       00280000
                                                                        00285000
                                                               <<01169>>00290000
double capd;            << capabilities from who intrinsic >>  <<01169>>00295000
logical cap=capd;                                              <<01169>>00300000
integer mcs'status;    << mem status returned by mcs >>        <<01397>>00305000
define sysmgr = cap.(0:1)#;                                    <<01169>>00310000
define                                                         <<01169>>00315000
sysmgr'msg = (" * PROGRAM REQUIRES SYS. MGR. CAPABILITY *")#;  <<01169>>00320000
                                                               <<01169>>00325000
byte array pbuf(0:71);                                                  00330000
byte array fname(*) = pbuf;                                             00335000
byte array errmsg(*) = pbuf;                                            00340000
array wpbuf (*) = pbuf;                                        <<01.01>>00345000
byte array head1(0:61) :=                                               00350000
     "I       ADDRESS        I           ERROR TYPE        I ERROR I";  00355000
byte array head2(0:61) :=                                               00360000
     "I MEMORY I  LOC  I ROW I  TYPE   BIT   BOARD   CHIP  I COUNT I";  00365000
byte array head3(0:61) :=                                               00370000
     "--------------------------------------------------------------";  00375000
byte array head4(0:61) :=                                               00380000
     "------------------------------------------------------       -";  00385000
byte array head1'16k(0:61) :=                                  <<rk2mb>>00390000
     "I         ADDRESS             I      ERROR TYPE      I ERROR I";  00395000
byte array head2'16k(0:61) :=                                  <<rk2mb>>00400000
     "I CONTROLLER    I BOARD I ROW I  TYPE   BIT   CHIP   I COUNT I";  00405000
                                                                        00410000
equate                                                                  00415000
     fserr    =     0,                                                  00420000
     sysdb    = %1000,  << system db offset.                >> <<03020>>00425000
     outype   =     0,  <<output file type - errmessage>>               00430000
     logtype  =     1,  <<output file type - errmessage>>               00435000
     linemax  =    40,  <<print lines per page>>                        00440000
     membanknum = sysdb + %47,   << number of memory banks. >> <<03020>>00445000
     release  =     4,  <<fclose disposition value>>                    00450000
     foptions = %2001,  <<for memlog fopen>>                            00455000
     icf55    =     5,  << cpu'type returned by thiscpu.    >> <<03020>>00460000
     mm       =     6,  << cpu'type returned by thiscpu     >> <<m8068>>00465000
     filecode = -1234;                                                  00470000
                                                                        00475000
equate                                                                  00480000
     rownum   = 8,                                                      00485000
     rownum'tp= 4,                                             <<rk2mb>>00490000
     checknum = 4;                                                      00495000
                                                                        00500000
equate  << first and second controller boards >>                        00505000
     controller'a  = 0,                                        <<rk2mb>>00510000
     controller'b  = 1;                                        <<rk2mb>>00515000
                                                                        00520000
equate << log record locations >>                                       00525000
     startime  =  2048, <<double location>>                    <<01397>>00530000
     lastime   =  2049, <<double location>>                    <<01397>>00535000
     ferrtime  =  2050, <<double location>>                    <<01397>>00540000
     lerrtime  =  2051, <<double location>>                    <<01397>>00545000
     banknumb  = 4104,                                         <<01397>>00550000
     delayloc  = 4105;                                         <<01397>>00555000
                                                                        00560000
define typef = (0:8)#;                                                  00565000
                                                                        00570000
define  << file information - number and type >>                        00575000
     outfile = (outfnum + outype & lsl(8))#,                            00580000
     logfile = (logfnum + logtype & lsl(8))#;                           00585000
                                                               <<01397>>00590000
                                                               <<01397>>00595000
define mcs  =   assemble(con %20302;con 7;)#;                  <<01397>>00600000
                                                               <<01397>>00605000
                                                               <<01397>>00610000
                                                                        00615000
<< fault condition ranges (faults array values)                         00620000
     0 - 15: data bit errors (data bits 0 - 15)                         00625000
    16 - 20: check bit errors (check bits a -e)                         00630000
         21: double bit error                                           00635000
         22: read clock failure                                         00640000
         23: check bit i/o driver fault                                 00645000
         24: error in memory logging firmware.                          00650000
>>                                                                      00655000
                                                                        00660000
integer array faults(0:31) :=                                           00665000
    <<  0 >>     24,  << logging system error >>                        00670000
    <<  1 >>     16,  << check bit a          >>                        00675000
    <<  2 >>     17,  << check bit b          >>                        00680000
    <<  3 >>      3,  << data bit  3          >>                        00685000
    <<  4 >>     18,  << check bit c          >>                        00690000
    <<  5 >>     21,  << double bit error     >>                        00695000
    <<  6 >>      9,  << data bit  9          >>                        00700000
    <<  7 >>      0,  << data bit  0          >>                        00705000
    <<  8 >>     19,  << check bit d          >>                        00710000
    <<  9 >>      6,  << data bit  6          >>                        00715000
    << 10 >>     22,  << read clock failure   >>                        00720000
    << 11 >>      1,  << data bit  1          >>                        00725000
    << 12 >>     13,  << data bit 13          >>                        00730000
    << 13 >>      4,  << data bit  4          >>                        00735000
    << 14 >>      8,  << data bit  8          >>                        00740000
    << 15 >>     21,  << double bit error     >>                        00745000
    << 16 >>     20,  << check bit e          >>                        00750000
    << 17 >>      7,  << data bit  7          >>                        00755000
    << 18 >>     11,  << data bit 11          >>                        00760000
    << 19 >>      2,  << data bit  2          >>                        00765000
    << 20 >>     14,  << data bit 14          >>                        00770000
    << 21 >>      5,  << data bit  5          >>                        00775000
    << 22 >>     21,  << double bit error     >>                        00780000
    << 23 >>     21,  << double bit error     >>                        00785000
    << 24 >>     15,  << data bit 15          >>                        00790000
    << 25 >>     21,  << double bit error     >>                        00795000
    << 26 >>     10,  << data bit 10          >>                        00800000
    << 27 >>     21,  << double bit error     >>                        00805000
    << 28 >>     12,  << data bit 12          >>                        00810000
    << 29 >>     21,  << double bit error     >>                        00815000
    << 30 >>     23,  << driver fault         >>                        00820000
    << 31 >>     23;  << driver fault         >>                        00825000
                                                                        00830000
integer array faults'tp(0:31) :=                               <<rk2mb>>00835000
    <<  0 >>     16,  << check bit 0          >>                        00840000
    <<  1 >>     21,  << check bit 5          >>                        00845000
    <<  2 >>     20,  << check bit 4          >>                        00850000
    <<  3 >>     15,  << data bit  15         >>                        00855000
    <<  4 >>     19,  << check bit 3          >>                        00860000
    <<  5 >>     25,  << logging system error >>                        00865000
    <<  6 >>     14,  << data bit 14          >>                        00870000
    <<  7 >>     13,  << data bit 13          >>                        00875000
    <<  8 >>     18,  << check bit 2          >>                        00880000
    <<  9 >>     25,  << logging system error >>                        00885000
    << 10 >>     25,  << logging system error >>                        00890000
    << 11 >>     12,  << data bit 12          >>                        00895000
    << 12 >>     11,  << data bit 11          >>                        00900000
    << 13 >>     10,  << data bit 10          >>                        00905000
    << 14 >>      9,  << data bit  9          >>                        00910000
    << 15 >>     25,  << logging system error >>                        00915000
    << 16 >>     17,  << check bit 1          >>                        00920000
    << 17 >>      8,  << data bit  8          >>                        00925000
    << 18 >>     25,  << logging system error >>                        00930000
    << 19 >>      7,  << data bit  7          >>                        00935000
    << 20 >>     25,  << logging system error >>                        00940000
    << 21 >>      6,  << data bit  6          >>                        00945000
    << 22 >>      5,  << data bit 5           >>                        00950000
    << 23 >>     25,  << logging system error >>                        00955000
    << 24 >>      4,  << data bit  4          >>                        00960000
    << 25 >>      3,  << data bit  3          >>                        00965000
    << 26 >>      2,  << data bit  2          >>                        00970000
    << 27 >>     25,  << logging system error >>                        00975000
    << 28 >>      1,  << data bit  1          >>                        00980000
    << 29 >>     25,  << logging system error >>                        00985000
    << 30 >>     25,  << logging system error >>                        00990000
    << 31 >>      0;  << data bit 0           >>                        00995000
                                                                        01000000
integer array faults'2mb(0:31) :=                              <<rk2mb>>01005000
    <<  0 >>     16,  << check bit 0          >>                        01010000
    <<  1 >>     21,  << check bit 5          >>                        01015000
    <<  2 >>     20,  << check bit 4          >>                        01020000
    <<  3 >>      3,  << data bit  3          >>                        01025000
    <<  4 >>     19,  << check bit 3          >>                        01030000
    <<  5 >>     23,  << forced d.e.w         >>                        01035000
    <<  6 >>      9,  << data bit  9          >>                        01040000
    <<  7 >>      0,  << data bit  0          >>                        01045000
    <<  8 >>     18,  << check bit 2          >>                        01050000
    <<  9 >>      6,  << data bit  6          >>                        01055000
    << 10 >>     24,  << missing array board  >>                        01060000
    << 11 >>      1,  << data bit  1          >>                        01065000
    << 12 >>     13,  << data bit 13          >>                        01070000
    << 13 >>      4,  << data bit  4          >>                        01075000
    << 14 >>      8,  << data bit  8          >>                        01080000
    << 15 >>     22,  << double bit error     >>                        01085000
    << 16 >>     17,  << check bit 1          >>                        01090000
    << 17 >>      7,  << data bit  7          >>                        01095000
    << 18 >>     11,  << data bit 11          >>                        01100000
    << 19 >>      2,  << data bit  2          >>                        01105000
    << 20 >>     14,  << data bit 14          >>                        01110000
    << 21 >>      5,  << data bit  5          >>                        01115000
    << 22 >>     22,  << double bit error     >>                        01120000
    << 23 >>     22,  << double bit error     >>                        01125000
    << 24 >>     15,  << data bit 15          >>                        01130000
    << 25 >>     22,  << double bit error     >>                        01135000
    << 26 >>     10,  << data bit 10          >>                        01140000
    << 27 >>     22,  << double bit error     >>                        01145000
    << 28 >>     12,  << data bit 12          >>                        01150000
    << 29 >>     22,  << double bit error     >>                        01155000
    << 30 >>     22,  << double bit error     >>                        01160000
    << 31 >>     22;  << double bit error     >>                        01165000
                                                               <<01397>>01170000
                                                               <<01397>>01175000
integer array faults'pronto(0:63) :=                           <<01397>>01180000
    <<  0 >>     22,  << ***  >>                               <<01397>>01185000
    <<  1 >>     22,  << ***  >>                               <<01397>>01190000
    <<  2 >>     22,  << ***  >>                               <<01397>>01195000
    <<  3 >>     -9,  << data bit  24         >>               <<01397>>01200000
    <<  4 >>     22,  << ***  >>                               <<01397>>01205000
    <<  5 >>     22,  << *** >>                                <<01397>>01210000
    <<  6 >>     22,  << *** >>                                <<01397>>01215000
    <<  7 >>    -13,  << data bit 28 >>                        <<01397>>01220000
    <<  8 >>      2,  << data  bit 2          >>               <<01397>>01225000
    <<  9 >>     22,  << *** >>                                <<01397>>01230000
    << 10 >>     22,  << *** >>                                <<01397>>01235000
    << 11 >>     22,  << *** >>                                <<01397>>01240000
    << 12 >>     22,  << *** >>                                <<01397>>01245000
    << 13 >>     -7,  << data bit 22          >>               <<01397>>01250000
    << 14 >>     12,  << data bit  12         >>               <<01397>>01255000
    << 15 >>    -16,  << data bit 31 >>                        <<01397>>01260000
    << 16 >>     22,  << *** >>                                <<02017>>01265000
    << 17 >>     22,  << *** >>                                <<01397>>01270000
    << 18 >>     22,  << *** >>                                <<01397>>01275000
    << 19 >>    -11,  << data bit  26         >>               <<01397>>01280000
    << 20 >>     22,  << *** >>                                <<01397>>01285000
    << 21 >>     -5,  << data bit  20         >>               <<01397>>01290000
    << 22 >>     22,  << *** >>                                <<01397>>01295000
    << 23 >>    -15,  << data bit 30 >>                        <<01397>>01300000
    << 24 >>      3,  << data bit 3 >>                         <<01397>>01305000
    << 25 >>     -3,  << data bit  18         >>               <<01397>>01310000
    << 26 >>     10,  << data bit  10         >>               <<01397>>01315000
    << 27 >>     22,  << *** >>                                <<01397>>01320000
    << 28 >>      6,  << data bit 6 >>                         <<01397>>01325000
    << 29 >>     22,  << *** >>                                <<01397>>01330000
    << 30 >>     14,  << data bit 14          >>               <<01397>>01335000
    << 31 >>    -18,  << check bit 1          >>               <<01397>>01340000
    << 32 >>     01,  << data bit 1 >>                         <<01397>>01345000
    << 33 >>     22,  << *** >>                                <<01397>>01350000
    << 34 >>     22,  << ***  >>                               <<01397>>01355000
    << 35 >>    -10,  << data bit 25 >>                        <<01397>>01360000
    << 36 >>     22,  << *** >>                                <<01397>>01365000
    << 37 >>     22,  << *** >>                                <<01397>>01370000
    << 38 >>     22,  << *** >>                                <<01397>>01375000
    << 39 >>    -14,  << data bit 29  >>                       <<01397>>01380000
    << 40 >>     22,  << *** >>                                <<01397>>01385000
    << 41 >>     -2,  << data bit 17 >>                        <<01397>>01390000
    << 42 >>      9,  << data bit 9 >>                         <<01397>>01395000
    << 43 >>     22,  << *** >>                                <<01397>>01400000
    << 44 >>      5,  << data bit  5          >>               <<01397>>01405000
    << 45 >>     -8,  << data bit 23 >>                        <<01397>>01410000
    << 46 >>     13,  << data bit 13 >>                        <<01397>>01415000
    << 47 >>    -19,  << check bit 2 >>                        <<01397>>01420000
    << 48 >>     22,  << *** >>                                <<01397>>01425000
    << 49 >>     -1,  << data bit  16         >>               <<01397>>01430000
    << 50 >>      8,  << data bit 8 >>                         <<01397>>01435000
    << 51 >>    -12,  << data bit  27         >>               <<01397>>01440000
    << 52 >>      4,  << data bit 4 >>                         <<01397>>01445000
    << 53 >>     -6,  << data bit 21 >>                        <<01397>>01450000
    << 54 >>     15,  << data bit 15 >>                        <<01397>>01455000
    << 55 >>    -20,  << check bit 3          >>               <<01397>>01460000
    << 56 >>      0,  << data bit   0         >>               <<01397>>01465000
    << 57 >>     -4,  << data bit 19 >>                        <<01397>>01470000
    << 58 >>     11,  << data bit 11  >>                       <<01397>>01475000
    << 59 >>    -21,  << check bit 4 >>                        <<01397>>01480000
    << 60 >>      7,  << data bit  7          >>               <<01397>>01485000
    << 61 >>    -22,  << check bit 5 >>                        <<01397>>01490000
    << 62 >>    -23,  << check bit 6          >>               <<01397>>01495000
    << 63 >>    -17;  << check bit 0          >>               <<01397>>01500000
                                                               <<01397>>01505000
                                                               <<01397>>01510000
                                                               <<01397>>01515000
                                                               <<01397>>01520000
                                                                        01525000
                                                               <<03020>>01530000
comment --                                                     <<03020>>01535000
  this is the faults array for the icf55 (cpu'type =  5).  the <<03020>>01540000
addresses of elements in the array correspond to the six lsb's <<03020>>01545000
of address of elements in the logrec array (which is the first <<03020>>01550000
record of memlog.pub.sys).  the first 4096 elements of  memlog <<03020>>01555000
contain error counts for memory ic chips.  the address of each <<03020>>01560000
of these elements is a mapping from the  address  fed  to  the <<03020>>01565000
error  logging ram in the icf55.  icf55 memory is organized as <<03020>>01570000
follows:  1 to 8 memory array boards, each of which contains 4 <<03020>>01575000
39-bit "words" (this is what  the  icf55  people  call  them). <<03020>>01580000
each  such word consists of 39 1 x n ram's, where n can be 16k <<03020>>01585000
or 64k.  the 39 bits are broken down into 32 data bits  and  7 <<03020>>01590000
check  bits.  the check bits are capable of detecting all mem- <<03020>>01595000
ory errors, and can be used to correct all single-bit  errors. <<03020>>01600000
thus  one  access  to memory will access 1 bit from each of 39 <<03020>>01605000
ram chips.  since there are four such words per  array  board, <<03020>>01610000
each board contains 156 ram chips.                             <<03020>>01615000
  now back to memlog.  the address of each of the  first  4096 <<03020>>01620000
elements  of  logrec  map  to the error logging ram address as <<03020>>01625000
follows:  bits (4:3) designate  one  of  the  8  memory  array <<03020>>01630000
boards.  bits  (7:2)  specify  one  of the 4 39-bit "words" on <<03020>>01635000
that board.  the remaining seven bits (9:7) may specify a par- <<03020>>01640000
ticular chip in the word.  i say "may" because there are  only <<03020>>01645000
39  valid combinations out of 128 possibilities.  faults'icf55 <<03020>>01650000
is reduced to 64 elements by noting that  all  valid  combina- <<03020>>01655000
tions  of  bits  (9:7) possess odd parity, thus it suffices to <<03020>>01660000
check this separately and use  only  bits  (10:6)  to  address <<03020>>01665000
faults'icf55. the 25 forbidden combinations (= 64 - 39) should <<03020>>01670000
never be accessed.  if they are, or if (9:7) has even  parity, <<03020>>01675000
a "multiple-bit error" code (22) is obtained.                  <<03020>>01680000
  so much for addresses in faults'icf55.  what about the  con- <<03020>>01685000
tents?  the  contents range from -23 to 15, as well as 22, and <<03020>>01690000
are mapped to the data and check bits of a memory word as fol- <<03020>>01695000
lows:  -23 to -17 correspond to check bits 6 to 0, respective- <<03020>>01700000
ly.  -16 to -1 correspond to data bits 31 to 16.  0 to 15 cor- <<03020>>01705000
respond to data bits 0 to 15.  finally, 22 is the no-no  which <<03020>>01710000
causes "multiple-bit error" to be displayed. (this is the same <<03020>>01715000
numbering scheme used in the faults'pronto  array,  used  with <<03020>>01720000
cpu'type  =  4, the icf44 with pronto memory, although the ad- <<03020>>01725000
dresses of -23 to 15 and 22 differ in that  array).  a  number <<03020>>01730000
between  -23 and 15 obtained from this array is used, together <<03020>>01735000
with bits (7:2) of the logrec address, to enter the data'icf55 <<03020>>01740000
array (see below) and retrieve  the  proper  u  (chip)  number <<03020>>01745000
which corresponds to this data bit in this "word". since the u <<03020>>01750000
numbers are the same for each board, we only need one  board's <<03020>>01755000
worth of u numbers.  the board address, shown elsewhere in the <<03020>>01760000
user display, is obtained from bits (4:3) of the logrec array. <<03020>>01765000
;                                                              <<03020>>01770000
                                                               <<03020>>01775000
integer array faults'icf55 (0:63) :=                           <<03020>>01780000
    <<  0 >>    -17,  << check bit  0.        >>               <<03020>>01785000
    <<  1 >>    -23,  << check bit  6.        >>               <<03020>>01790000
    <<  2 >>    -22,  << check bit  5.        >>               <<03020>>01795000
    <<  3 >>     22,                                           <<03020>>01800000
    <<  4 >>    -21,  << check bit  4.        >>               <<03020>>01805000
    <<  5 >>     22,                                           <<03020>>01810000
    <<  6 >>     22,                                           <<03020>>01815000
    <<  7 >>     22,                                           <<03020>>01820000
    <<  8 >>    -20,  << check bit  3.        >>               <<03020>>01825000
    <<  9 >>     22,                                           <<03020>>01830000
    << 10 >>     22,                                           <<03020>>01835000
    << 11 >>     22,                                           <<03020>>01840000
    << 12 >>     22,                                           <<03020>>01845000
    << 13 >>     22,                                           <<03020>>01850000
    << 14 >>     22,                                           <<03020>>01855000
    << 15 >>     22,                                           <<03020>>01860000
    << 16 >>    -19,  << check bit  2.        >>               <<03020>>01865000
    << 17 >>     22,                                           <<03020>>01870000
    << 18 >>     22,                                           <<03020>>01875000
    << 19 >>     22,                                           <<03020>>01880000
    << 20 >>     22,                                           <<03020>>01885000
    << 21 >>     22,                                           <<03020>>01890000
    << 22 >>     22,                                           <<03020>>01895000
    << 23 >>     22,                                           <<03020>>01900000
    << 24 >>      0,  << data  bit  0.        >>               <<03020>>01905000
    << 25 >>      1,  << data  bit  1.        >>               <<03020>>01910000
    << 26 >>      2,  << data  bit  2.        >>               <<03020>>01915000
    << 27 >>      3,  << data  bit  3.        >>               <<03020>>01920000
    << 28 >>      4,  << data  bit  4.        >>               <<03020>>01925000
    << 29 >>      5,  << data  bit  5.        >>               <<03020>>01930000
    << 30 >>      6,  << data  bit  6.        >>               <<03020>>01935000
    << 31 >>      7,  << data  bit  7.        >>               <<03020>>01940000
    << 32 >>    -18,  << check bit  1.        >>               <<03020>>01945000
    << 33 >>     22,                                           <<03020>>01950000
    << 34 >>     22,                                           <<03020>>01955000
    << 35 >>     22,                                           <<03020>>01960000
    << 36 >>     22,                                           <<03020>>01965000
    << 37 >>     22,                                           <<03020>>01970000
    << 38 >>     22,                                           <<03020>>01975000
    << 39 >>     22,                                           <<03020>>01980000
    << 40 >>      8,  << data  bit  8.        >>               <<03020>>01985000
    << 41 >>      9,  << data  bit  9.        >>               <<03020>>01990000
    << 42 >>     10,  << data  bit 10.        >>               <<03020>>01995000
    << 43 >>     11,  << data  bit 11.        >>               <<03020>>02000000
    << 44 >>     12,  << data  bit 12.        >>               <<03020>>02005000
    << 45 >>     13,  << data  bit 13.        >>               <<03020>>02010000
    << 46 >>     14,  << data  bit 14.        >>               <<03020>>02015000
    << 47 >>     15,  << data  bit 15.        >>               <<03020>>02020000
    << 48 >>     -1,  << data  bit 16.        >>               <<03020>>02025000
    << 49 >>     -2,  << data  bit 17.        >>               <<03020>>02030000
    << 50 >>     -3,  << data  bit 18.        >>               <<03020>>02035000
    << 51 >>     -4,  << data  bit 19.        >>               <<03020>>02040000
    << 52 >>     -5,  << data  bit 20.        >>               <<03020>>02045000
    << 53 >>     -6,  << data  bit 21.        >>               <<03020>>02050000
    << 54 >>     -7,  << data  bit 22.        >>               <<03020>>02055000
    << 55 >>     -8,  << data  bit 23.        >>               <<03020>>02060000
    << 56 >>     -9,  << data  bit 24.        >>               <<03020>>02065000
    << 57 >>    -10,  << data  bit 25.        >>               <<03020>>02070000
    << 58 >>    -11,  << data  bit 26.        >>               <<03020>>02075000
    << 59 >>    -12,  << data  bit 27.        >>               <<03020>>02080000
    << 60 >>    -13,  << data  bit 28.        >>               <<03020>>02085000
    << 61 >>    -14,  << data  bit 29.        >>               <<03020>>02090000
    << 62 >>    -15,  << data  bit 30.        >>               <<03020>>02095000
    << 63 >>    -16;  << data  bit 31.        >>               <<03020>>02100000
                                                               <<03020>>02105000
integer array datab(0:135) :=                                           02110000
<<                            row (bits 8:3)                     >>     02115000
<<               000   001   010   011   100   101   110   111   >>     02120000
<<     fault     ---   ---   ---   ---   ---   ---   ---   ---   >>     02125000
                                                                        02130000
    <<  0 >>     93,   83,   73,   63,   43,   33,   23,   13,          02135000
    <<  1 >>     94,   84,   74,   64,   44,   34,   24,   14,          02140000
    <<  2 >>     95,   85,   75,   65,   45,   35,   25,   15,          02145000
    <<  3 >>     96,   86,   76,   66,   46,   36,   26,   16,          02150000
    <<  4 >>     97,   87,   77,   67,   47,   37,   27,   17,          02155000
    <<  5 >>     98,   88,   78,   68,   48,   38,   28,   18,          02160000
    <<  6 >>     99,   89,   79,   69,   49,   39,   29,   19,          02165000
    <<  7 >>    910,  810,  710,  610,  410,  310,  210,  110,          02170000
    <<  8 >>    911,  811,  711,  611,  411,  311,  211,  111,          02175000
    <<  9 >>    912,  812,  712,  612,  412,  312,  212,  112,          02180000
    << 10 >>    913,  813,  713,  613,  413,  313,  213,  113,          02185000
    << 11 >>    914,  814,  714,  614,  414,  314,  214,  114,          02190000
    << 12 >>    915,  815,  715,  615,  415,  315,  215,  115,          02195000
    << 13 >>    916,  816,  716,  616,  416,  316,  216,  116,          02200000
    << 14 >>    917,  817,  717,  617,  417,  317,  217,  117,          02205000
    << 15 >>    918,  818,  718,  618,  418,  318,  218,  118,          02210000
    <<  a >>    919,  819,  719,  619,  419,  319,  219,  119;          02215000
                                                               <<01397>>02220000
                                                               <<01397>>02225000
integer array data'pronto(-23:15) :=                           <<01397>>02230000
                                                               <<01397>>02235000
<<  fault #    chip u-       bit description  >>               <<01397>>02240000
                                                               <<01397>>02245000
      <<-23>>     53,    << check bit 6>>                      <<01397>>02250000
      <<-22>>     63,    << check bit 5>>                      <<01397>>02255000
      <<-21>>     73,    << check bit 4 >>                     <<01397>>02260000
      <<-20>>     83,    << check bit 3 >>                     <<01397>>02265000
      <<-19>>     93,    << check bit 2 >>                     <<01397>>02270000
      <<-18>>    103,    << check bit 1 >>                     <<01397>>02275000
      <<-17>>    113,    << check bit 0 >>                     <<01397>>02280000
      <<-16>>    123,    << data bit 31 >>                     <<01397>>02285000
      <<-15>>    133,    << data bit 30 >>                     <<01397>>02290000
      <<-14>>    143,    << data bit 29 >>                     <<01397>>02295000
      <<-13>>    153,    << data bit 28 >>                     <<01397>>02300000
      <<-12>>    163,    << data bit 27 >>                     <<01397>>02305000
      <<-11>>    173,    << data bit 26 >>                     <<01397>>02310000
      <<-10>>    183,    << data bit 25 >>                     <<01397>>02315000
      <<- 9>>    193,    << data bit 24 >>                     <<01397>>02320000
      <<- 8>>    203,    << data bit 23 >>                     <<01397>>02325000
      <<- 7>>    213,    << data bit 22 >>                     <<01397>>02330000
      <<- 6>>    223,    << data bit 21 >>                     <<01397>>02335000
      <<- 5>>    233,    << data bit 20 >>                     <<01397>>02340000
      <<- 4>>     42,    << data bit 19 >>                     <<01397>>02345000
      <<- 3>>     52,    << data bit 18 >>                     <<01397>>02350000
      <<- 2>>     62,    << data bit 17 >>                     <<01397>>02355000
      <<- 1>>     72,    << data bit 16 >>                     <<01397>>02360000
      <<  0>>    232,    << data bit  0 >>                     <<01397>>02365000
      <<  1>>    222,    << data bit  1 >>                     <<01397>>02370000
      <<  2>>    212,    << data bit  2 >>                     <<01397>>02375000
      <<  3>>    202,    << data bit  3 >>                     <<01397>>02380000
      <<  4>>    192,    << data bit  4 >>                     <<01397>>02385000
      <<  5>>    182,    << data bit  5 >>                     <<01397>>02390000
      <<  6>>    172,    << data bit  6 >>                     <<01397>>02395000
      <<  7>>    162,    << data bit  7 >>                     <<01397>>02400000
      <<  8>>    152,    << data bit  8 >>                     <<01397>>02405000
      <<  9>>    142,    << data bit  9 >>                     <<01397>>02410000
      << 10>>    132,    << data bit 10 >>                     <<01397>>02415000
      << 11>>    122,    << data bit 11 >>                     <<01397>>02420000
      << 12>>    112,    << data bit 12 >>                     <<01397>>02425000
      << 13>>    102,    << data bit 13 >>                     <<01397>>02430000
      << 14>>     92,    << data bit 14 >>                     <<01397>>02435000
      << 15>>     82;    << data bit 15 >>                     <<01397>>02440000
                                                               <<01397>>02445000
                                                               <<01397>>02450000
                                                                        02455000
comment --                                                     <<03020>>02460000
  this is the data array for the icf55.  its contents are  the <<03020>>02465000
u numbers of the ram chips on a memory array board, or rather, <<03020>>02470000
one-fourth of the u numbers, the numbers for  icf55  "word"  0 <<03020>>02475000
only.  (see  the capsule description of icf55 memory preceding <<03020>>02480000
the faults'icf55 array).  the u number for word 1, 2 or  3  is <<03020>>02485000
obtained by adding two, four or six, respectively, to the num- <<03020>>02490000
ber obtained from word 0.  the element address for  data'icf55 <<03020>>02495000
is obtained from the contents of faults'icf55  (fault,  below) <<03020>>02500000
and  the  word field (7:2) of the logrec array element address <<03020>>02505000
(word). the chip number is then obtained from data'icf55, add- <<03020>>02510000
ing the appropriate increment if other than word 0 is  indica- <<03020>>02515000
ted.  the statement is as follows:                             <<03020>>02520000
                                                               <<03020>>02525000
     chip := data'icf55 (fault) + word*2;                      <<03020>>02530000
                                                               <<03020>>02535000
integer array data'icf55 (-23:15) :=                           <<03020>>02540000
                                                               <<03020>>02545000
<<          word 0                                          >> <<03020>>02550000
<< fault    chip u-    description                          >> <<03020>>02555000
<< -------------------------------------------------------- >> <<03020>>02560000
                                                               <<03020>>02565000
 << -23 >>   403,      << check bit  6.                     >> <<03020>>02570000
 << -22 >>   503,      << check bit  5.                     >> <<03020>>02575000
 << -21 >>   603,      << check bit  4.                     >> <<03020>>02580000
 << -20 >>   703,      << check bit  3.                     >> <<03020>>02585000
 << -19 >>   803,      << check bit  2.                     >> <<03020>>02590000
 << -18 >>   903,      << check bit  1.                     >> <<03020>>02595000
 << -17 >>  1003,      << check bit  0.                     >> <<03020>>02600000
 << -16 >>  1103,      << data  bit 31.                     >> <<03020>>02605000
 << -15 >>  1203,      << data  bit 30.                     >> <<03020>>02610000
 << -14 >>  1303,      << data  bit 29.                     >> <<03020>>02615000
 << -13 >>  1403,      << data  bit 28.                     >> <<03020>>02620000
 << -12 >>  1503,      << data  bit 27.                     >> <<03020>>02625000
 << -11 >>  1603,      << data  bit 26.                     >> <<03020>>02630000
 << -10 >>  1703,      << data  bit 25.                     >> <<03020>>02635000
 << - 9 >>  1803,      << data  bit 24.                     >> <<03020>>02640000
 << - 8 >>  1903,      << data  bit 23.                     >> <<03020>>02645000
 << - 7 >>  2003,      << data  bit 22.                     >> <<03020>>02650000
 << - 6 >>  2103,      << data  bit 21.                     >> <<03020>>02655000
 << - 5 >>  2203,      << data  bit 20.                     >> <<03020>>02660000
 << - 4 >>   302,      << data  bit 19.                     >> <<03020>>02665000
 << - 3 >>   402,      << data  bit 18.                     >> <<03020>>02670000
 << - 2 >>   502,      << data  bit 17.                     >> <<03020>>02675000
 << - 1 >>   602,      << data  bit 16.                     >> <<03020>>02680000
 <<   0 >>  2202,      << data  bit  0.                     >> <<03020>>02685000
 <<   1 >>  2102,      << data  bit  1.                     >> <<03020>>02690000
 <<   2 >>  2002,      << data  bit  2.                     >> <<03020>>02695000
 <<   3 >>  1902,      << data  bit  3.                     >> <<03020>>02700000
 <<   4 >>  1802,      << data  bit  4.                     >> <<03020>>02705000
 <<   5 >>  1702,      << data  bit  5.                     >> <<03020>>02710000
 <<   6 >>  1602,      << data  bit  6.                     >> <<03020>>02715000
 <<   7 >>  1502,      << data  bit  7.                     >> <<03020>>02720000
 <<   8 >>  1402,      << data  bit  8.                     >> <<03020>>02725000
 <<   9 >>  1302,      << data  bit  9.                     >> <<03020>>02730000
 <<  10 >>  1202,      << data  bit 10.                     >> <<03020>>02735000
 <<  11 >>  1102,      << data  bit 11.                     >> <<03020>>02740000
 <<  12 >>  1002,      << data  bit 12.                     >> <<03020>>02745000
 <<  13 >>   902,      << data  bit 13.                     >> <<03020>>02750000
 <<  14 >>   802,      << data  bit 14.                     >> <<03020>>02755000
 <<  15 >>   702;      << data  bit 15.                     >> <<03020>>02760000
                                                               <<03020>>02765000
                                                               <<03020>>02770000
integer array data'tp(0:87):=                                  <<rk2mb>>02775000
<<              row (bits 9:2)             >>                           02780000
<<               000   001   010   011     >>                           02785000
<<     fault     ---   ---   ---   ---     >>                           02790000
                                                                        02795000
    <<  0 >>     11,   12,   13,   14,                                  02800000
    <<  1 >>     21,   22,   23,   24,                                  02805000
    <<  2 >>     31,   32,   33,   34,                                  02810000
    <<  3 >>     41,   42,   43,   44,                                  02815000
    <<  4 >>     51,   52,   53,   54,                                  02820000
    <<  5 >>     61,   62,   63,   64,                                  02825000
    <<  6 >>     91,   92,   93,   94,                                  02830000
    <<  7 >>    101,  102,  103,  104,                                  02835000
    <<  8 >>    111,  112,  113,  114,                                  02840000
    <<  9 >>    121,  122,  123,  124,                                  02845000
    << 10 >>    131,  132,  133,  134,                                  02850000
    << 11 >>    161,  162,  163,  164,                                  02855000
    << 12 >>    171,  172,  173,  174,                                  02860000
    << 13 >>    181,  182,  183,  184,                                  02865000
    << 14 >>    191,  192,  193,  194,                                  02870000
    << 15 >>    201,  202,  203,  204,                                  02875000
    << h0 >>    211,  212,  213,  214,                                  02880000
    << h1 >>    241,  242,  243,  244,                                  02885000
    << h2 >>    251,  252,  253,  254,                                  02890000
    << h3 >>    261,  262,  263,  264,                                  02895000
    << h4 >>    271,  272,  273,  274,                                  02900000
    << h5 >>    281,  282,  283,  284;                                  02905000
                                                                        02910000
integer array data'2mb(0:175) :=                               <<rk2mb>>02915000
<<                            row (bits 8:3)                            02920000
<<               000   001   010   011   100   101   110   111          02925000
<<     fault     ---   ---   ---   ---   ---   ---   ---   ---          02930000
                                                                        02935000
    <<  0 >>     19,   18,   17,   16,   15,   14,   13,   12,          02940000
    <<  1 >>     29,   28,   27,   26,   25,   24,   23,   22,          02945000
    <<  2 >>     39,   38,   37,   36,   35,   34,   33,   32,          02950000
    <<  3 >>     49,   48,   47,   46,   45,   44,   43,   42,          02955000
    <<  4 >>     59,   58,   57,   56,   55,   54,   53,   52,          02960000
    <<  5 >>     69,   68,   67,   66,   65,   64,   63,   62,          02965000
    <<  6 >>     79,   78,   77,   76,   75,   74,   73,   72,          02970000
    <<  7 >>     89,   88,   87,   86,   85,   84,   83,   82,          02975000
    <<  8 >>     99,   98,   97,   96,   95,   94,   93,   92,          02980000
    <<  9 >>    109,  108,  107,  106,  105,  104,  103,  102,          02985000
    << 10 >>    119,  118,  117,  116,  115,  114,  113,  112,          02990000
    << 11 >>    149,  148,  147,  146,  145,  144,  143,  142,          02995000
    << 12 >>    159,  158,  157,  156,  155,  154,  153,  152,          03000000
    << 13 >>    169,  168,  167,  166,  165,  164,  163,  162,          03005000
    << 14 >>    179,  178,  177,  176,  175,  174,  173,  172,          03010000
    << 15 >>    189,  188,  187,  186,  185,  184,  183,  182,          03015000
    << c0 >>    199,  198,  197,  196,  195,  194,  193,  192,          03020000
    << c1 >>    209,  208,  207,  206,  205,  204,  203,  202,          03025000
    << c2 >>    219,  218,  217,  216,  215,  214,  213,  212,          03030000
    << c3 >>    229,  228,  227,  226,  225,  224,  223,  222,          03035000
    << c4 >>    239,  238,  237,  236,  235,  234,  233,  232,          03040000
    << c5 >>    249,  248,  247,  246,  245,  244,  243,  242;          03045000
                                                                        03050000
integer array checkb(0:127) :=                                          03055000
<<                   bit b      bit c      bit d      bit e      >>     03060000
<<     (6:5)         -----      -----      -----      -----      >>     03065000
                                                                        03070000
    << 00000 >>       93,        94,        95,        96,              03075000
    << 00001 >>       83,        84,        85,        86,              03080000
    << 00010 >>       73,        74,        75,        76,              03085000
    << 00011 >>       63,        64,        65,        66,              03090000
    << 00100 >>       43,        44,        45,        46,              03095000
    << 00101 >>       33,        34,        35,        36,              03100000
    << 00110 >>       23,        24,        25,        26,              03105000
    << 00111 >>       13,        14,        15,        16,              03110000
    << 01000 >>       97,        98,        99,       910,              03115000
    << 01001 >>       87,        88,        89,       810,              03120000
    << 01010 >>       77,        78,        79,       710,              03125000
    << 01011 >>       67,        68,        69,       610,              03130000
    << 01100 >>       47,        48,        49,       410,              03135000
    << 01101 >>       37,        38,        39,       310,              03140000
    << 01110 >>       27,        28,        29,       210,              03145000
    << 01111 >>       17,        18,        19,       110,              03150000
    << 10000 >>      911,       912,       913,       914,              03155000
    << 10001 >>      811,       812,       813,       814,              03160000
    << 10010 >>      711,       712,       713,       714,              03165000
    << 10011 >>      611,       612,       613,       614,              03170000
    << 10100 >>      411,       412,       413,       414,              03175000
    << 10101 >>      311,       312,       313,       314,              03180000
    << 10110 >>      211,       212,       213,       214,              03185000
    << 10111 >>      111,       112,       113,       114,              03190000
    << 11000 >>      915,       916,       917,       918,              03195000
    << 11001 >>      815,       816,       817,       818,              03200000
    << 11010 >>      715,       716,       717,       718,              03205000
    << 11011 >>      615,       616,       617,       618,              03210000
    << 11100 >>      415,       416,       417,       418,              03215000
    << 11101 >>      315,       316,       317,       318,              03220000
    << 11110 >>      215,       216,       217,       218,              03225000
    << 11111 >>      115,       116,       117,       118;              03230000
                                                                        03235000
intrinsic fopen,fclose,freaddir,fwrite,fwritedir,              <<01.01>>03240000
          flock,funlock;                                       <<01.01>>03245000
intrinsic print,ascii,terminate,print'file'info,who;           <<01169>>03250000
                                                                        03255000
integer procedure thiscpu;                                     <<rk2mb>>03260000
option external;                                               <<rk2mb>>03265000
                                                               <<rk2mb>>03270000
procedure help;                                                         03275000
 option external;                                                       03280000
                                                                        03285000
procedure space(spacenum);                                              03290000
value spacenum; integer spacenum;                                       03295000
begin                                                                   03300000
     integer i;                                                         03305000
     array blank(0:0);                                         <<01.01>>03310000
                                                                        03315000
     blank(0) := "  ";                                         <<01.01>>03320000
     for i:=1 until spacenum do fwrite(outfnum,blank,-1,0);             03325000
end  <<space >>;                                                        03330000
                                                                        03335000
procedure errmessage(filenum,errnumb);                                  03340000
value filenum,errnumb;                                                  03345000
integer filenum,errnumb;                                                03350000
begin                                                                   03355000
     if errnumb = fserr then  <<file system problem>>                   03360000
     begin                                                              03365000
          print'file'info(filenum.(8:8));                               03370000
          if filenum.typef = outype then  <<out file error>>            03375000
          move pbuf:="* OUT",2 else         <<log file error>>          03380000
          move pbuf:="* LOG",2;                                         03385000
          move * :=" FILE ERROR *";                                     03390000
          print(wpbuf,-18,0);                                  <<01.01>>03395000
     end else                                                           03400000
     begin                                                              03405000
          move errmsg:="* MEMLOGAN ERROR:     *";                       03410000
          ascii(errnumb,10,errmsg(18));                                 03415000
          print(wpbuf,-22,0);                                  <<01.01>>03420000
     end;                                                               03425000
     terminate;                                                         03430000
end <<errmessage>>;                                                     03435000
                                                                        03440000
procedure getimeinfo;                                          <<00.04>>03445000
begin                                                          <<00.04>>03450000
     double ftime,ltime;                                       <<00.04>>03455000
     integer                                                   <<00.04>>03460000
          ftime1 = ftime,                                      <<00.04>>03465000
          ltime1 = ltime;                                      <<00.04>>03470000
                                                               <<00.04>>03475000
     errtime1:=errtime2:=0d;                                   <<00.04>>03480000
     for rec:=controller'a until controller'b do               <<rk2mb>>03485000
     begin                                                     <<00.04>>03490000
          freaddir(logfnum,logrec,recsize,double(rec));        <<00.04>>03495000
          if < then errmessage(logfile,fserr);                 <<00.04>>03500000
          if rec = controller'a then <<get start/update times>><<rk2mb>>03505000
          begin                                                <<00.05>>03510000
               stime:=logrecd(startime);  <<start time>>       <<00.05>>03515000
               utime:=logrecd(lastime);   <<last update>>      <<00.05>>03520000
               delay:=logrec(delayloc);   <<timing interval>>  <<00.05>>03525000
          end;                                                 <<00.05>>03530000
          ftime:=logrecd(ferrtime);                            <<00.04>>03535000
          ltime:=logrecd(lerrtime);                            <<00.04>>03540000
          ftime1.(0:1):=0;  <<for date comparison (> 0d)>>     <<00.04>>03545000
          ltime1.(0:1):=0;  <<for date comparison (> 0d)>>     <<00.04>>03550000
          errtime1:=if ftime = 0d then errtime1 else           <<00.04>>03555000
                    if errtime1=0d then logrecd(ferrtime) else <<00.04>>03560000
                    if errtime1 < logrecd(ferrtime) then       <<00.05>>03565000
                    logrecd(ferrtime) else errtime1;           <<00.05>>03570000
          errtime2:=if ltime = 0d then errtime2 else           <<00.05>>03575000
                    if errtime2=0d then logrecd(lerrtime) else <<00.05>>03580000
                    if errtime2 > logrecd(lerrtime) then       <<00.05>>03585000
                    logrecd(lerrtime) else errtime2;           <<00.05>>03590000
     end;                                                      <<00.04>>03595000
end << getimeinfo >>;                                          <<00.04>>03600000
                                                               <<00.04>>03605000
procedure fill'date'time(datetime,loc);                        <<00.04>>03610000
value datetime,loc;                                            <<00.04>>03615000
double datetime;                                               <<00.04>>03620000
integer loc;                                                   <<00.04>>03625000
begin                                                                   03630000
                                                               <<00.04>>03635000
                                                                        03640000
     integer                                                            03645000
          date  = datetime,                                             03650000
          time  = datetime + 1;                                         03655000
                                                                        03660000
     integer m,d,y;                                                     03665000
     integer array dtab(0:11)=pb:=                                      03670000
            0,  31,  59,  90, 120, 151, 181,                            03675000
          212, 243, 273, 304, 334;                                      03680000
                                                                        03685000
                                                               <<00.04>>03690000
     move pbuf(loc):="DATE:   /  /     TIME:   :0     ";                03695000
     << fill date >>                                                    03700000
     y:=date.(0:7);                                                     03705000
     d:=date.(7:9);                                                     03710000
     if y.(14:2) = 0 and d >= 60 then d:=d-1;  <<leap year>>            03715000
     m:=12;  <<assume december>>                                        03720000
     do  m:=m-1 until dtab(m) < d;  <<find correct month>>              03725000
     d:=d-dtab(m);  <<day of the month>>                                03730000
     m:=m+1;  <<fix month for output purposes>>                         03735000
     ascii(m,-10,pbuf(loc+7));                                          03740000
     ascii(d,-10,pbuf(loc+10));                                         03745000
     ascii(y,-10,pbuf(loc+13));                                         03750000
     << fill time of day information>>                                  03755000
     ascii(time.(0:8),-10,pbuf(loc+24));                                03760000
     ascii(time.(8:8),-10,pbuf(loc+27));                                03765000
     fwrite(outfnum,wpbuf,-50,0);                              <<01.01>>03770000
end << fill'date'time >>;                                               03775000
                                                                        03780000
procedure open'files;                                                   03785000
begin                                                                   03790000
     move fname:="MEMLOG.PUB.SYS ";                                     03795000
     logfnum:=fopen(fname,foptions,%744,recsize,,,,,,,,,filecode);      03800000
     if <> then errmessage(logfile,fserr);                              03805000
     move fname:="OUT ";                                                03810000
     outfnum:=fopen(fname,%414,%1); <<fopt:cctl,$stdlist,ascii;aopt:wr>>03815000
     if <> then errmessage(outfile,fserr);                              03820000
end << open'files >>;                                                   03825000
                                                                        03830000
procedure print'times;                                         <<00.01>>03835000
begin                                                          <<00.01>>03840000
     integer h,m;                                              <<00.05>>03845000
                                                               <<00.02>>03850000
     printimes:=false;  <<print time info only once>>          <<00.01>>03855000
     move pbuf:="LOGGING STARTED    - ";                       <<00.01>>03860000
     fill'date'time(stime,21);  <<log start time>>             <<00.05>>03865000
     if errtime1 <> 0d then  <<at least one error>>            <<00.04>>03870000
     begin                                                     <<00.01>>03875000
          move pbuf:="FIRST ERROR LOGGED - ";                  <<00.01>>03880000
          fill'date'time(errtime1,21);                         <<00.04>>03885000
          move pbuf:="LAST ERROR LOGGED  - ";                  <<00.01>>03890000
          fill'date'time(errtime2,21);                         <<00.04>>03895000
     end;                                                      <<00.01>>03900000
     move pbuf:="LAST LOG UPDATE    - ";                       <<00.01>>03905000
     fill'date'time(utime,21);  <<last update time>>           <<00.05>>03910000
     move pbuf:="TIMING INTERVAL    -  0:00:00 ";              <<00.01>>03915000
                                                               <<00.05>>03920000
     h:=delay/3600;          <<hours >>                        <<00.01>>03925000
     delay:=delay-(h * 3600);                                  <<00.01>>03930000
     m:=delay/60;            <<minutes>>                       <<00.01>>03935000
     delay:=delay-(m * 60);  <<seconds>>                       <<00.01>>03940000
     ascii(h,-10,pbuf(22));                                    <<00.01>>03945000
     ascii(m,-10,pbuf(25));                                    <<00.01>>03950000
     ascii(delay,-10,pbuf(28));                                <<00.01>>03955000
     fwrite(outfnum,wpbuf,-29,0);                              <<01.01>>03960000
     space(2);  <<double space output device>>                 <<00.01>>03965000
end <<print'times>>;                                           <<00.01>>03970000
                                                               <<00.01>>03975000
procedure print'heading;                                                03980000
begin                                                                   03985000
                                                                        03990000
     move pbuf:=head3,(62);                                             03995000
     fwrite(outfnum,wpbuf,-62,0);                              <<01.01>>04000000
     if rams'are'16k then                                      <<rk2mb>>04005000
     move pbuf:=head1'16k,(62) else                            <<rk2mb>>04010000
     move pbuf:=head1,(62);                                             04015000
     fwrite(outfnum,wpbuf,-62,0);                              <<01.01>>04020000
     move pbuf:=head4,(62);                                             04025000
     fwrite(outfnum,wpbuf,-62,0);                              <<01.01>>04030000
     if rams'are'16k then                                      <<rk2mb>>04035000
     move pbuf:=head2'16k,(62) else                            <<rk2mb>>04040000
     move pbuf:=head2,(62);                                             04045000
     fwrite(outfnum,wpbuf,-62,0);                              <<01.01>>04050000
     move pbuf:=head3,(62);                                             04055000
     fwrite(outfnum,wpbuf,-62,0);                              <<01.01>>04060000
     pbuf:=" "; move pbuf(1):=pbuf,(71);                                04065000
     if rams'are'16k then                                      <<rk2mb>>04070000
     pbuf:=pbuf(16):=pbuf(24):=pbuf(30):=pbuf(53):=pbuf(61):="I" <<2mb>>04075000
     else                                                      <<rk2mb>>04080000
     pbuf:=pbuf(9):=pbuf(17):=pbuf(23):=pbuf(53):=pbuf(61):="I";        04085000
end <<print'heading>>;                                                  04090000
$page                                                          <<03020>>04095000
procedure print'head'icf55;                                    <<03020>>04100000
begin comment                                                  <<03020>>04105000
  print'head'icf55 is, as its name suggests, analogous to  the <<03020>>04110000
print'heading procedure, but for the icf55. it has been made a <<03020>>04115000
separate procedure because all the record lengths and spacings <<03020>>04120000
are  different,  and i felt that this was more straightforward <<03020>>04125000
than including a bunch of special-case code in print'heading.  <<03020>>04130000
;                                                              <<03020>>04135000
move pbuf := head3, (47);   << "--------...---------------" >> <<03020>>04140000
fwrite (outfnum, wpbuf, -47, 0);                               <<03020>>04145000
                                                               <<03020>>04150000
move pbuf := "I    ADDRESS   I      ERROR TYPE      I ERROR I";<<03020>>04155000
                                                                        04160000
fwrite (outfnum, wpbuf, -47, 0);                               <<03020>>04165000
                                                               <<03020>>04170000
move pbuf := head4(15), (47);                                  <<03020>>04175000
fwrite (outfnum, wpbuf, -47, 0);                               <<03020>>04180000
                                                               <<03020>>04185000
move pbuf := "I BOARD I WORD I  TYPE   BIT   CHIP   I COUNT I";<<03020>>04190000
fwrite (outfnum, wpbuf, -47, 0);                               <<03020>>04195000
                                                               <<03020>>04200000
move pbuf := head3, (47);                                      <<03020>>04205000
fwrite (outfnum, wpbuf, -47, 0);                               <<03020>>04210000
end;   << of print'head'icf55.                              >> <<03020>>04215000
procedure print'head'mm;                                       <<m8068>>04220000
begin comment                                                  <<m8068>>04225000
  print'head'mm is, as its name suggests, analogous to  the    <<m8068>>04230000
print'heading procedure, but for the mm. it has been made a    <<m8068>>04235000
separate procedure because all the record lengths and spacings <<m8068>>04240000
are  different,  and i felt that this was more straightforward <<m8068>>04245000
than including a bunch of special-case code in print'heading.  <<m8068>>04250000
;                                                              <<m8068>>04255000
move pbuf := head3, (47);   << "--------...---------------" >> <<m8068>>04260000
fwrite (outfnum, wpbuf, -47, 0);                               <<m8068>>04265000
                                                               <<m8068>>04270000
move pbuf := "I    ADDRESS   I      ERROR TYPE      I ERROR I";<<m8068>>04275000
                                                                        04280000
fwrite (outfnum, wpbuf, -47, 0);                               <<m8068>>04285000
                                                               <<m8068>>04290000
move pbuf := head4(15), (47);                                  <<m8068>>04295000
fwrite (outfnum, wpbuf, -47, 0);                               <<m8068>>04300000
                                                               <<m8068>>04305000
move pbuf := "I BOARD I ROW  I  TYPE   BIT   CHIP   I COUNT I";<<m8068>>04310000
fwrite (outfnum, wpbuf, -47, 0);                               <<m8068>>04315000
                                                               <<m8068>>04320000
move pbuf := head3, (47);                                      <<m8068>>04325000
fwrite (outfnum, wpbuf, -47, 0);                               <<m8068>>04330000
end;   << of print'head'mm.                                 >> <<m8068>>04335000
procedure print'logrec(memrec);                                         04340000
value memrec; integer memrec;                                           04345000
begin                                                                   04350000
                                                               <<00.01>>04355000
     byte array dataerr(0:1)=pb:=    "DATA                     ";       04360000
     byte array checkerr(0:1)=pb:=   "CHECK                    ";       04365000
     byte array multiplerr(0:1)=pb:= "MULTIPLE BIT ERROR       ";       04370000
     byte array clockerr(0:1)=pb:=   "READ CLOCK FAILURE       ";       04375000
     byte array driverr(0:1)=pb:=    "I/O DRIVER FAULT         ";       04380000
     byte array logsyserr(0:1)=pb:=  "LOGGING SYSTEM ERROR     ";       04385000
                                                                        04390000
     errcnt:=0;                                                         04395000
     if memrec = 0 then  <<first record - print time stamp>>            04400000
     if logrecd(startime) = 0d then  <<null log>>                       04405000
     begin                                                              04410000
          move pbuf:="* NO ENTRIES IN MEMLOG FILE *";                   04415000
          fwrite(outfnum,wpbuf,-29,0);                         <<01.01>>04420000
          rec:=controller'b;  << stop outer block loop >>      <<rk2mb>>04425000
          errorcount:=-1;  <<for cleanupoutput procedure>>     <<00.01>>04430000
     end;                                                      <<00.01>>04435000
     if logrecd(startime) = 0d then return;  <<null record>>            04440000
     for i:=0 until 1023 do                                             04445000
     if logrec(i) <> 0 then  <<error occurred at address i>>            04450000
     begin                                                              04455000
          errcnt:=errcnt+1;                                             04460000
          errorcount:=errorcount+1;  <<both controllers>>      <<rk2mb>>04465000
     end;                                                               04470000
     if errcnt <> 0 then  <<errors logged>>                             04475000
     begin                                                              04480000
          if printimes then print'times;                       <<00.01>>04485000
          oldbank:=oldboard:=oldrow:=-1;                                04490000
          for i:=0 until 1023 do                                        04495000
          begin                                                         04500000
               if logrec(i) <> 0 then  <<errors occurred>>              04505000
               begin                                                    04510000
                    if heading then                                     04515000
                    begin                                               04520000
                         heading:=false;                                04525000
                         print'heading;                                 04530000
                    end;                                                04535000
                    if (board:=i.(6:2)) <> oldboard then                04540000
                    begin                                               04545000
                         oldboard:=board;                               04550000
                         bank:=(board & lsr(1)) + (memrec & lsl(1));    04555000
                         if bank <> oldbank then                        04560000
                         begin                                          04565000
                              oldbank:=bank;                            04570000
                              move pbuf(2):="BANK  ";                   04575000
                              ascii(bank,10,pbuf(7));                   04580000
                         end else                                       04585000
                         move pbuf(2):="      ";  <<blank bank no.>>    04590000
                         move pbuf(13):="32K";                          04595000
                         pbuf(12):=if logical(board) then "U" else "L"; 04600000
                    end else                                            04605000
                    begin                                               04610000
                         move pbuf(2):="      ";  <<blank bank number>> 04615000
                         move pbuf(12):="    ";  <<blank 32k number>>   04620000
                    end;                                                04625000
                    row:=i.(8:3);                                       04630000
                    fault:=faults(i.(11:5));                            04635000
                    if (0<=fault<=20) then  <<data/check bit error>>    04640000
                    begin                                               04645000
                         if (0<=fault<=16) then  <<data/check a error>> 04650000
                         begin                                          04655000
                              chip:=datab((fault*rownum)+row);          04660000
                              if fault = 16 then  <<check bit a>>       04665000
                              begin                                     04670000
                                   move pbuf(26):=checkerr,(25);        04675000
                                   pbuf(35):="A";                       04680000
                              end else                                  04685000
                              begin                                     04690000
                                   move pbuf(26):=dataerr,(25);         04695000
                                   ascii(fault,-10,pbuf(35));           04700000
                              end;                                      04705000
                         end else  <<check bits b,c,d, or e>>           04710000
                         begin                                          04715000
                              checkbit:=fault-17;                       04720000
                              chip:=checkb((i.(6:5)*checknum)+checkbit);04725000
                              move pbuf(26):=checkerr,(25);             04730000
                              pbuf(35):=(fault-16) + %101;  <<ascii>>   04735000
                         end;                                           04740000
                         if (0<=fault<=16) then                         04745000
                         move pbuf(40):="SMA" else                      04750000
                         move pbuf(40):="FCA";                          04755000
                         pbuf(47):="U";                                 04760000
                         ascii(chip,10,pbuf(48));                       04765000
                    end else                                            04770000
                    case * (fault-21) of                                04775000
                    begin                                               04780000
                         move pbuf(26):=multiplerr,(25);                04785000
                         move pbuf(26):=clockerr,(25);                  04790000
                         move pbuf(26):=driverr,(25);                   04795000
                         move pbuf(26):=logsyserr,(25);                 04800000
                    end  <<case statement>>;                            04805000
                    move pbuf(19):="   ";  <<blank row number>>         04810000
                    move pbuf(55):="    "; <<blank error count>>        04815000
                    ascii(row,-10,pbuf(21));                            04820000
                    ascii(logrec(i),-10,pbuf(59));                      04825000
                    fwrite(outfnum,wpbuf,-62,0);               <<01.01>>04830000
                    if (linecnt:=linecnt+1) = linemax then              04835000
                    begin                                               04840000
                         linecnt:=0;                                    04845000
                         move pbuf:=head3,(62);                         04850000
                         fwrite(outfnum,wpbuf,-62,%61);        <<01.01>>04855000
                         heading:=true;                                 04860000
                         oldbank:=oldboard:=-1;                         04865000
                    end;                                                04870000
               end;                                                     04875000
          end;                                                          04880000
     end;                                                               04885000
end  << print'logrec >>;                                                04890000
logical procedure odd'parity(i);                               <<01397>>04895000
 value i;                                                      <<01397>>04900000
 logical i;                                                    <<01397>>04905000
 begin;                                                        <<01397>>04910000
  tos := i;                                                    <<01397>>04915000
  assemble(  dup;                                              <<01397>>04920000
             csr  4;                                           <<01397>>04925000
             xor,dup;                                          <<01397>>04930000
             csr  2;                                           <<01397>>04935000
             xor,dup;                                          <<01397>>04940000
             csr 1;                                            <<01397>>04945000
             xor,dup;                                          <<01397>>04950000
             csr 8;                                            <<01397>>04955000
             xor;);                                            <<01397>>04960000
  odd'parity := tos;                                           <<01397>>04965000
 end;                                                          <<01397>>04970000
                                                               <<rk2mb>>04975000
procedure print'logrec'16k(memrec);                            <<rk2mb>>04980000
value memrec; integer memrec;                                           04985000
begin                                                                   04990000
                                                                        04995000
     equate multiple'bit'err = 22;                             <<01397>>05000000
     equate log'sys'err = 25;                                  <<02017>>05005000
                                                               <<01397>>05010000
      integer pronto'fault;                                    <<01397>>05015000
     byte array dataerr(0:1)=pb:=    "DATA                ";            05020000
     byte array checkerr(0:1)=pb:=   "CHECK               ";            05025000
     byte array multiplerr(0:1)=pb:= "MULTIPLE BIT ERROR  ";            05030000
     byte array dewerr(0:1)=pb:=     "FORCED D.E.W.       ";            05035000
     byte array noboarderr(0:1)=pb:= "MISSING ARRAY BOARD ";            05040000
     byte array logsyserr(0:1)=pb:=  "LOGGING SYSTEM ERROR";            05045000
     integer array mla'high'adr(0:4)=pb :=                     <<01397>>05050000
                    1023,1023,4095,1023,4095;                  <<01397>>05055000
                                                                        05060000
     errcnt:=0;                                                         05065000
     if memrec = 0 then  <<first record - print time stamp>>            05070000
     if logrecd(startime) = 0d then  <<null log>>                       05075000
     begin                                                              05080000
          move pbuf:="* NO ENTRIES IN MEMLOG FILE *";                   05085000
          fwrite(outfnum,wpbuf,-29,0);                                  05090000
          rec:=controller'b;  << stop outer block loop >>               05095000
          errorcount:=-1;  <<for cleanupoutput procedure>>              05100000
     end;                                                               05105000
     if logrecd(startime) = 0d then return;  <<null record>>            05110000
     for i:=0 until mla'high'adr(cpu'type)  do                 <<01397>>05115000
     if logrec(i) <> 0 then  <<error occurred at address i>>            05120000
     begin                                                              05125000
          errcnt:=errcnt+1;                                             05130000
          errorcount:=errorcount+1;  <<controller a and b >>            05135000
     end;                                                               05140000
     if errcnt <> 0 then  <<errors logged>>                             05145000
     begin                                                              05150000
          if printimes then print'times;                                05155000
          oldcontroller:=oldboard:=oldrow:=-1;                          05160000
          for i:=0 until mla'high'adr(cpu'type)  do            <<01397>>05165000
          begin                                                         05170000
               if logrec(i) <> 0 then  <<errors occurred>>              05175000
               begin                                                    05180000
                    if heading then                                     05185000
                    begin                                               05190000
                         heading:=false;                                05195000
                         print'heading;                                 05200000
                    end;                                                05205000
                    board:=if tp'flag then i.(6:3) else i.(6:2);        05210000
                    if pronto then   board := i.(4:3);         <<01397>>05215000
                    if board <> oldboard then                           05220000
                    begin                                               05225000
                         oldboard:=board;                               05230000
                         ascii(board,10,pbuf(20));                      05235000
                         if memrec <> oldcontroller then                05240000
                         begin                                          05245000
                              oldcontroller:=memrec;                    05250000
                              move pbuf(2):="CONTROLLER   ";            05255000
                              pbuf(13):=%101+memrec;<<a or b>>          05260000
                         end else                                       05265000
                         move pbuf(2):="             ";                 05270000
                    end else                                            05275000
                    begin                                               05280000
                         move pbuf(2):="            ";                  05285000
                         move pbuf(20):="  ";<<blank board #>>          05290000
                    end;                                                05295000
                    row:=if tp'flag then i.(9:2) else i.(8:3);          05300000
                    if pronto then   row := i.(7:2);           <<01397>>05305000
                    fault:=if tp'flag then faults'tp(i.(11:5))          05310000
                           else faults'2mb(i.(11:5));                   05315000
                    if pronto then                             <<01397>>05320000
                       if odd'parity(i.(9:7))                  <<01397>>05325000
                         then fault := multiple'bit'err        <<01397>>05330000
                         else fault := faults'pronto(i.(10:6));<<01397>>05335000
                    if pronto and i.(9:7)=%177                 <<02017>>05340000
                      then fault := log'sys'err;               <<02017>>05345000
                    pronto'fault := fault;                     <<01397>>05350000
                    if (-23<=fault<=21) then <<data/chk error>><<01397>>05355000
                    begin                                               05360000
                         if fault >= 16  or   <<check bit>>    <<01397>>05365000
                  fault < -16  then <<pronto c. bit>>          <<01397>>05370000
                         begin                                          05375000
                              move pbuf(33):=checkerr,(20);             05380000
                     if fault<-16 then fault:= -fault-1;       <<01397>>05385000
                              ascii((fault-16),-10,pbuf(42));           05390000
                         end else                                       05395000
                         begin                                          05400000
                     if fault < 0 then fault:=-fault+15;       <<01397>>05405000
                              move pbuf(33):=dataerr,(20);              05410000
                              ascii(fault,-10,pbuf(42));                05415000
                         end;                                           05420000
                         pbuf(46):="U";                                 05425000
                         chip:=if tp'flag then                          05430000
                               data'tp((fault*rownum'tp)+row)           05435000
                          else data'2mb((fault*rownum)+row);            05440000
                    if pronto then                             <<01397>>05445000
                      chip := data'pronto(pronto'fault)+row*2; <<01397>>05450000
                         ascii(chip,10,pbuf(47));                       05455000
                    end else                                            05460000
                    case  (fault-22) of                                 05465000
                    begin                                               05470000
                         move pbuf(33):=multiplerr,(20);                05475000
                         move pbuf(33):=dewerr,(20);                    05480000
                         move pbuf(33):=noboarderr,(20);                05485000
                         move pbuf(33):=logsyserr,(20);                 05490000
                    end  <<case statement>>;                            05495000
                    move pbuf(26):="   ";  <<blank row number>>         05500000
                    move pbuf(55):="     "; <<blank err count>>         05505000
                    ascii(row,-10,pbuf(27));                            05510000
                    ascii(logrec(i),-10,pbuf(59));                      05515000
                    fwrite(outfnum,wpbuf,-62,0);                        05520000
                    if (linecnt:=linecnt+1) = linemax then              05525000
                    begin                                               05530000
                         linecnt:=0;                                    05535000
                         move pbuf:=head3,(62);                         05540000
                         fwrite(outfnum,wpbuf,-62,%61);<<eject>>        05545000
                         heading:=true;                                 05550000
                         oldcontroller:=oldboard:=-1;                   05555000
                    end;                                                05560000
               end;                                                     05565000
          end;                                                          05570000
     end;                                                               05575000
end; << print'logrec'16k >>                                    <<03020>>05580000
procedure print'mm(memrec);                                    <<m8068>>05585000
value memrec; integer memrec;                                  <<m8068>>05590000
begin                                                          <<m8068>>05595000
                                                               <<m8068>>05600000
  byte array dataerr(0:1)=pb :=      "DATA                ";   <<m8068>>05605000
  byte array checkerr(0:1)=pb :=     "CHECK               ";   <<m8068>>05610000
  byte array multiplerr(0:1)=pb :=   "MULTIPLE BIT ERROR  ";   <<m8068>>05615000
  byte array blanks(0:61)=pb :=                                <<m8068>>05620000
"                                                            ";<<m8068>>05625000
  integer array fault'array(0:77)=pb :=                        <<m8068>>05630000
  << 0 >>  1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008,     <<*8720>>05635000
  << 1 >>  901, 902, 903, 904, 905, 906, 907, 908, <<block 1>> <<*8720>>05640000
  << 2 >>  801, 802, 803, 804, 805, 806, 807, 808, <<block 0>> <<*8720>>05645000
  << 3 >>  701, 702, 703, 704, 705, 706, 707, 708, <<block 1>> <<*8720>>05650000
  << 4 >>  601, 602, 603, 604, 605, 606, 607, 608, <<block 0>> <<*8720>>05655000
  << 5 >>  501, 502, 503, 504, 505, 506, 507, 508, <<block 1>> <<*8720>>05660000
  << 6 >>  401, 402, 403, 404, 405, 406, 407, 408, <<block 0>> <<*8720>>05665000
  << 7 >>  301, 302, 303, 304, 305, 306, 307, 308, <<block 1>> <<*8720>>05670000
  << 8 >>  201, 202, 203, 204, 205, 206, 207,    <<check bit>> <<*8720>>05675000
  << 9 >>  101, 102, 103, 104, 105, 106, 107;      <<block 1>> <<*8720>>05680000
                                                               <<m8068>>05685000
                                                               <<m8068>>05690000
  equate entries = 79;                                         <<m8068>>05695000
                                                               <<m8068>>05700000
  integer                                                      <<m8068>>05705000
    chip,       i,       index,        offset,                 <<m8068>>05710000
    remainder,  row;                                           <<m8068>>05715000
                                                               <<m8068>>05720000
  if memrec = 0 then  <<first record - print time stamp>>      <<m8068>>05725000
  if logrecd(startime) = 0d then                               <<m8068>>05730000
    begin                                                      <<m8068>>05735000
      move pbuf := "* NO ENTRIES IN MEMLOG FILE *";            <<m8068>>05740000
      fwrite(outfnum,wpbuf,-29,0);                             <<m8068>>05745000
      rec := controller'b;                                     <<m8068>>05750000
      errorcount := -1;  <<for cleanupoutput procedure>>       <<m8068>>05755000
    end;                                                       <<m8068>>05760000
  if logrecd(startime) = 0d then return;                       <<m8068>>05765000
  if banks >= 8 then next'controller(cpu'type) := 16;          <<m8068>>05770000
  for i := 0 until entries do                                  <<m8068>>05775000
    begin                                                      <<m8068>>05780000
      if logrec(i) <> 0 then   << error detected >>            <<m8068>>05785000
        begin                                                  <<m8068>>05790000
          errorcount := errorcount + 1;                        <<m8068>>05795000
          if printimes then print'times;                       <<m8068>>05800000
          if heading then                                      <<m8068>>05805000
          begin                                                <<m8068>>05810000
            heading := false;                                  <<m8068>>05815000
            print'head'mm;                                     <<m8068>>05820000
          end;                                                 <<m8068>>05825000
        pbuf := " ";  move pbuf(1) := pbuf, (61);              <<m8068>>05830000
        pbuf := pbuf(8) := pbuf(15) := pbuf(38) := pbuf(46)    <<m8068>>05835000
             := "I";                                           <<m8068>>05840000
        ascii(memrec,10,pbuf(4));                              <<m8068>>05845000
        move pbuf(11) := " ";     << clear row no >>           <<m8068>>05850000
        move pbuf(41) := "     "; << clear count no >>         <<m8068>>05855000
        if (i = 39 or i = 79) then                             <<m8068>>05860000
          begin                                                <<m8068>>05865000
            move pbuf(18) := multiplerr,(20);                  <<m8068>>05870000
          end                                                  <<m8068>>05875000
        else                << data or check bit error >>      <<m8068>>05880000
          begin                                                <<m8068>>05885000
            if i < 40 then                                     <<m8068>>05890000
              begin                                            <<m8068>>05895000
                offset := 0;                                   <<m8068>>05900000
                index := i;                                    <<m8068>>05905000
              end                                              <<m8068>>05910000
            else                                               <<m8068>>05915000
              begin                                            <<m8068>>05920000
                offset := 1;                                   <<m8068>>05925000
                index := i - 40;                               <<m8068>>05930000
              end;                                             <<m8068>>05935000
            if index < 32 then                                 <<m8068>>05940000
              begin                                            <<m8068>>05945000
                move pbuf(18) := dataerr,(20);                 <<m8068>>05950000
                ascii(index,-10,pbuf(27));                     <<m8068>>05955000
              end                                              <<m8068>>05960000
            else                                               <<m8068>>05965000
              begin                                            <<m8068>>05970000
                move pbuf(18) := checkerr,(20);                <<m8068>>05975000
                ascii((index-32),-10,pbuf(27));                <<m8068>>05980000
              end;                                             <<m8068>>05985000
            row := index / 8;                                  <<m8068>>05990000
            remainder := index mod 8;                          <<m8068>>05995000
            row := row * 2 + offset;                           <<m8068>>06000000
            if row = 9 then remainder := remainder - 1;        <<m8068>>06005000
            chip := row * 8 + remainder;                       <<m8068>>06010000
            pbuf(31) := "U";                                   <<m8068>>06015000
            ascii(row,-10,pbuf(11));                           <<m8068>>06020000
            ascii(fault'array(chip),10,pbuf(32));              <<m8068>>06025000
            ascii(logrec(i),-10,pbuf(44));                     <<m8068>>06030000
          end;              << data or check bit error >>      <<m8068>>06035000
                                                               <<m8068>>06040000
          fwrite(outfnum,wpbuf,-47,0);                         <<m8068>>06045000
                                                               <<m8068>>06050000
          if ( linecnt := linecnt + 1) = linemax then          <<m8068>>06055000
            begin                                              <<m8068>>06060000
              linecnt := 0;                                    <<m8068>>06065000
              move pbuf := head3,(47);                         <<m8068>>06070000
              fwrite(outfnum,wpbuf,-47,%61);                   <<m8068>>06075000
              heading := true;                                 <<m8068>>06080000
            end;                                               <<m8068>>06085000
        end;                << error detected          >>      <<m8068>>06090000
    end;  << for >>                                            <<m8068>>06095000
end;                                                           <<m8068>>06100000
$page                                                          <<03020>>06105000
procedure print'logrec'icf55;                                  <<03020>>06110000
begin comment --                                               <<03020>>06115000
  as with print'head'icf55, print'logrec'icf55 has been made a <<03020>>06120000
separate procedure to avoid further cluttering  of  print'log- <<03020>>06125000
rec'16k. i at first thought to restructure print'logrec'16k as <<03020>>06130000
a case statement based on cpu'type. icf55 would then be a log- <<03020>>06135000
ical extension of this construct.  the idea fell through  when <<03020>>06140000
the  display  record length was shortened from 62 to 47 bytes. <<03020>>06145000
the flow in here is similar to earlier  print'log'rec's,  with <<03020>>06150000
allowances  for  a  different  display record length, only one <<03020>>06155000
memory controller, and such as that.                           <<03020>>06160000
;                                                              <<03020>>06165000
equate                                                         <<03020>>06170000
  multiple'bit'err = 22;                                       <<03020>>06175000
                                                               <<03020>>06180000
if logrecd (startime) = 0d then                                <<03020>>06185000
   begin   << null log.                                     >> <<03020>>06190000
   move pbuf := "* NO ENTRIES IN MEMLOG FILE *";               <<03020>>06195000
   fwrite (outfnum, wpbuf, -29, 0);                            <<03020>>06200000
   errorcount := -1;   << for cleanupoutput procedure.      >> <<03020>>06205000
   return;                                                     <<03020>>06210000
   end;                                                        <<03020>>06215000
for i := 0 until 4095 do                                       <<03020>>06220000
  if logrec(i) <> 0 then errorcount := errorcount + 1;         <<03020>>06225000
if errorcount <> 0 then                                        <<03020>>06230000
   begin   << got at least one error.                       >> <<03020>>06235000
   if printimes then print'times;                              <<03020>>06240000
   oldboard := old'word := -1;                                 <<03020>>06245000
   for i := 0 until 4095 do                                    <<03020>>06250000
     if logrec(i) <> 0 then                                    <<03020>>06255000
      begin   << at least one error at this address.        >> <<03020>>06260000
      if heading then                                          <<03020>>06265000
         begin   << new page, print a new heading.          >> <<03020>>06270000
         heading := false;                                     <<03020>>06275000
         print'head'icf55;                                     <<03020>>06280000
         end;                                                  <<03020>>06285000
      pbuf := " ";  move pbuf(1) := pbuf, (61);                <<03020>>06290000
      pbuf := pbuf(8) := pbuf(15) := pbuf(38) := pbuf(46)      <<03020>>06295000
        := "I";                                                <<03020>>06300000
      if (board := i.(4:3)) <> oldboard then                   <<03020>>06305000
         begin   << board number changed, add to display.   >> <<03020>>06310000
         oldboard := board;   << so we don't repeat display >> <<03020>>06315000
         ascii (board, 10, pbuf(4));                           <<03020>>06320000
         end;                                                  <<03020>>06325000
      if (word := i.(7:2)) <> old'word then                    <<03020>>06330000
         begin   << word number changed, add to display.    >> <<03020>>06335000
         old'word := word;   << so we don't repeat display. >> <<03020>>06340000
         ascii (word, 10, pbuf(11));                           <<03020>>06345000
         end;                                                  <<03020>>06350000
      if odd'parity (i.(9:7))                                  <<03020>>06355000
        then fault := faults'icf55 (i.(10:6))                  <<03020>>06360000
        else fault := multiple'bit'err;                        <<03020>>06365000
      if fault = multiple'bit'err                              <<03020>>06370000
        then move pbuf(18) := "MULTIPLE BIT ERROR"             <<03020>>06375000
        else                                                   <<03020>>06380000
         begin  << single-bit error, get type, bit and chip >> <<03020>>06385000
                                                               <<03020>>06390000
<< see comments at the declaration of data'icf55 for an ex- >> <<03020>>06395000
<< planation of how we arrive at the following statement.   >> <<03020>>06400000
                                                               <<03020>>06405000
         chip := data'icf55 (fault) + word*2;                  <<03020>>06410000
         if -23 <= fault <= -17                                <<03020>>06415000
           then                                                <<03020>>06420000
            begin   << check bit failed.                    >> <<03020>>06425000
            move pbuf(18) := "CHECK";                          <<03020>>06430000
            fault := -fault - 17;                              <<03020>>06435000
            end                                                <<03020>>06440000
           else                                                <<03020>>06445000
            begin   << data bit failed.                     >> <<03020>>06450000
            move pbuf(18) := "DATA";                           <<03020>>06455000
            if fault < 0 then fault := -fault + 15;            <<03020>>06460000
            end;                                               <<03020>>06465000
         ascii (fault, -10, pbuf(27));                         <<03020>>06470000
         ascii (chip,  -10, pbuf(35));                         <<03020>>06475000
         pbuf(31) := "U";                                      <<03020>>06480000
         ascii (logrec(i), -10, pbuf(44));                     <<03020>>06485000
         fwrite (outfnum, wpbuf, -47, 0);                      <<03020>>06490000
         if (linecnt := linecnt + 1) >= linemax then           <<03020>>06495000
            begin   << time to start a new page.            >> <<03020>>06500000
            linecnt := 0;                                      <<03020>>06505000
            move pbuf := head3, (47);                          <<03020>>06510000
            fwrite (outfnum, wpbuf, -47, %61);                 <<03020>>06515000
            heading := true;                                   <<03020>>06520000
            oldboard := old'word := -1;                        <<03020>>06525000
            end;   << of starting new page.                 >> <<03020>>06530000
         end;      << of single-bit error.                  >> <<03020>>06535000
      end;         << of <> 0 error count in this logrec(i) >> <<03020>>06540000
   end;            << of at least one error.                >> <<03020>>06545000
end;               << of print'logrec'icf55.                >> <<03020>>06550000
$page                                                          <<03020>>06555000
procedure cleanupoutput;                                                06560000
begin                                                                   06565000
                                                               <<03020>>06570000
integer                                                        <<03020>>06575000
  length;                                                      <<03020>>06580000
                                                               <<03020>>06585000
     if errorcount = 0 then  <<no errors found in any bank>>            06590000
     begin                                                              06595000
          print'times;  <<print time info>>                    <<00.01>>06600000
          move pbuf:="*** NO ERRORS LOGGED ***";                        06605000
          fwrite(outfnum,wpbuf,-24,0);                         <<01.01>>06610000
     end else                                                           06615000
     if errorcount > 0 then  <<some errors found>>                      06620000
     begin                                                              06625000
          if (cpu'type = icf55 or cpu'type = mm) then          <<m8068>>06630000
             length := 47                                      <<m8068>>06635000
          else                                                 <<m8068>>06640000
             length := 62;                                     <<m8068>>06645000
          move pbuf := head3, (length);                        <<03020>>06650000
          fwrite (outfnum, wpbuf, -length, 0);                 <<03020>>06655000
     end;                                                               06660000
end  << cleanupoutput >>;                                      <<00.04>>06665000
     move pbuf := ptitle,2;                                    <<01.01>>06670000
     i := tos-@pbuf;                                           <<01.01>>06675000
     move pbuf(9) := official'vuuff; << put vuf into title >>  <<04932>>06680000
     print(wpbuf,-i,%60);                                      <<01.01>>06685000
                                                               <<01169>>06690000
     who(,capd);                                               <<01169>>06695000
     if not sysmgr then                                        <<01169>>06700000
       begin                                                   <<01169>>06705000
       move pbuf := sysmgr'msg,2;                              <<01169>>06710000
       i := tos - @pbuf;                                       <<01169>>06715000
       print(wpbuf,-i,0);                                      <<01169>>06720000
       terminate;                                              <<01169>>06725000
       end;                                                    <<01169>>06730000
     open'files;                                               <<00.03>>06735000
     flock(logfnum,1);                                                  06740000
     if < then errmessage(logfile,1);                                   06745000
     getimeinfo;                                               <<00.04>>06750000
     for rec:=controller'a until controller'b do               <<rk2mb>>06755000
     begin                                                              06760000
          freaddir(logfnum,logrec,recsize,double(rec));                 06765000
          if < then errmessage(logfile,fserr);                          06770000
          banks:=logrec(banknumb);                                      06775000
     cpu'type := thiscpu;                                      <<02017>>06780000
     if cpu'type = 2 or cpu'type = 4                           <<03020>>06785000
       then                                                    <<02017>>06790000
        begin                                                  <<02017>>06795000
         if banknum >= next'controller (4)                     <<03020>>06800000
          then tos := %4000000d                                <<02017>>06805000
          else tos := %0d;                                     <<02017>>06810000
         mcs;                                                  <<02017>>06815000
         mcs'status := tos;  << save status returned by mcs >> <<02017>>06820000
         if 8<=mcs'status.(12:4)<=9 then cpu'type:=4 <<pronto>><<02017>>06825000
          else cpu'type := 2;  << amigo memory >>              <<02017>>06830000
         assemble(ddel;);                                      <<02017>>06835000
        end;                                                   <<02017>>06840000
          if cpu'type = icf55                                  <<03020>>06845000
            then print'logrec'icf55                            <<03020>>06850000
            else                                               <<03020>>06855000
          if cpu'type = mm then print'mm(rec)                  <<m8068>>06860000
          else                                                 <<m8068>>06865000
          if rams'are'16k then                                 <<rk2mb>>06870000
          print'logrec'16k(rec) else                           <<rk2mb>>06875000
          print'logrec(rec);                                            06880000
          if parm = 1 then  <<reset logging info>>                      06885000
          begin                                                         06890000
               logrecd(startime):=0d;  <<for logging process>>          06895000
               for i:=0 until (recsize-1) do logrec(i):=0;              06900000
               fwritedir(logfnum,logrec,recsize,double(rec));           06905000
               if < then errmessage(logfile,fserr);                     06910000
          end;                                                          06915000
          if banks < next'controller(cpu'type) then            <<rk2mb>>06920000
             rec:=controller'b;                                <<rk2mb>>06925000
          if pronto and not pronto'2ndcntlr <<only one cntlr>> <<01397>>06930000
             then rec:=controller'b;                           <<01397>>06935000
     end;                                                               06940000
     funlock(logfnum);                                                  06945000
     if < then errmessage(logfile,2);                                   06950000
     cleanupoutput;                                                     06955000
end.                                                                    06960000
