$PAGE "PRINTTBUF : Format the terminal buffers"                <<RWP31>>30856000
$control segment=tablesds                                      <<*8912>>30858000
procedure printtbuf;                                           <<03752>>30860000
begin                                                          <<03752>>30862000
comment                                                                 30864000
                                                               <<rwp31>>30866000
                  *** printtbuf ***                            <<rwp31>>30868000
                                                               <<rwp31>>30870000
   this procedure finds and prints all terminal buffers on the <<rwp31>>30872000
   system, whether they are in sysdb memory or in atp terminal <<rwp31>>30874000
   data segments.                                              <<rwp31>>30876000
                                                               <<rwp31>>30878000
   tbuf's are printed from tail to head, free-list first, then <<rwp31>>30880000
   the in-use list. any tbuf not part of the linked free list  <<rwp31>>30882000
   is assumed to be "in-use". adcc (or atc) tbuf's existing in <<rwp31>>30884000
   sysdb memory are printed first, followed by the tbuf's for  <<rwp31>>30886000
   each atp subsystem present.                                 <<rwp31>>30888000
                                                               <<rwp31>>30890000
   tbuf's are printed in ascii, less the "link" word. any non- <<rwp31>>30892000
   printable bytes are replaced by "." .                       <<rwp31>>30894000
                                                               <<rwp31>>30896000
   for the adcc (or atc), the tbuf table in sysdb memory holds <<rwp31>>30898000
   all the relevant pointers, and this table always resides at <<rwp31>>30900000
   the address specified in system dst entry %14. for the      <<rwp31>>30902000
   atp, there is one tbuf table in each terminal data segment, <<rwp31>>30904000
   pointed to by a segment-relative pointer in word 2 of that  <<rwp31>>30906000
   segment. up to 2 tds's may exist for each atp subsystem     <<rwp31>>30908000
   (channel) present on the system. only the oldest tds version<<rwp31>>30910000
   (version is in word 0) had one tds per atp subsystem. the   <<rwp31>>30912000
   version number of that tds was -1, and version 0 wasn't     <<rwp31>>30914000
   used. as of version +1, up to two tds's may exist on each   <<rwp31>>30916000
   channel.                                                    <<rwp31>>30918000
                                                               <<rwp31>>30920000
input parameters:                                              <<rwp31>>30922000
   none.                                                       <<rwp31>>30924000
                                                               <<rwp31>>30926000
output parameters:                                             <<rwp31>>30928000
   none.                                                       <<rwp31>>30930000
                                                               <<rwp31>>30932000
globals referenced:                                            <<rwp31>>30934000
  series'33'thru'mm  algorithm to return system model number.  <<s7919>>30936000
  new'ilt'format  algorithm to return format of ilt.           <<rwp31>>30938000
  pageno  current page# of output listing.                     <<rwp31>>30940000
  lnsperpg  number of lines per page of output listing.        <<rwp31>>30942000
  linecount  number of lines on the current page.              <<rwp31>>30944000
                                                               <<rwp31>>30946000
globals altered:                                               <<rwp31>>30948000
  indxaray  array of page numbers of parts of the listing.     <<rwp31>>30950000
                                                               <<rwp31>>30952000
procedures called:                                             <<rwp31>>30954000
   verifyp                                                     <<rwp31>>30956000
   warning                                                     <<rwp31>>30958000
   noformt'                                                    <<rwp31>>30960000
   test'drt'info                                               <<rwp31>>30962000
   getdrt                                                      <<rwp31>>30964000
   core                                                        <<rwp31>>30966000
   printline                                                   <<rwp31>>30968000
   skiplines                                                   <<rwp31>>30970000
   newpage                                                     <<rwp31>>30972000
   ascii                                                       <<rwp31>>30974000
   putnump                                                     <<rwp31>>30976000
   putnum                                                      <<rwp31>>30978000
   dascii                                                      <<rwp31>>30980000
   putchar                                                     <<rwp31>>30982000
                                                               <<rwp31>>30984000
data structures:                                               <<rwp31>>30986000
  tbufindex  array of 0's and tailptrs of tbuf's in free list, <<rwp31>>30988000
             one word per tbuf, lowest-addr tbuf in element 0. <<rwp31>>30990000
  loctds     absolute addresses of atp tds's for one drt.      <<rwp31>>30992000
             element 0 is addr of tds for units 0-47 if        <<rwp31>>30994000
             split, or units 0-95 if not split. element 1      <<rwp31>>30996000
             is addr of tds for units 48-95 if split, and      <<rwp31>>30998000
             is not used if not split.                         <<rwp31>>31000000
  loctbuf    absolute addresses of tbuf tables in lower and    <<rwp31>>31002000
             upper tds's of an atp drt, same structure as      <<rwp31>>31004000
             used for array loctds.                            <<rwp31>>31006000
                                                               <<rwp31>>31008000
algorithm used:                                                <<rwp31>>31010000
                                                               <<rwp31>>31012000
   finding the tbuf's:                                         <<rwp31>>31014000
   -------------------                                         <<rwp31>>31016000
   the dst is checked to see if any adcc (or atc) tbuf's are   <<rwp31>>31018000
   on the system. if cce comes back from verifyp, we have the  <<rwp31>>31020000
   address of the adcc tbuf table in loctds, so we set the     <<rwp31>>31022000
   "Atp" flag false and go format the adcc tbuf's.             <<rwp31>>31024000
                                                               <<rwp31>>31026000
   if the dst check fails but we didn't get a zero address, we <<rwp31>>31028000
   assume the system dst entry is bad, print a warning msg and <<rwp31>>31030000
   go look for atp's. if it failed but we did get a zero addres<<rwp31>>31032000
   then there are no adcc's on the system, so we skip this and <<rwp31>>31034000
   just go look for atp's.                                     <<rwp31>>31036000
                                                               <<rwp31>>31038000
   to look for atp's, we have to scan all the drt's on the     <<rwp31>>31040000
   system, look at each ilt, find each iltx, and see if we     <<rwp31>>31042000
   can match the last word of the iltx with the plabel in the  <<rwp31>>31044000
   drt entry. if so, that drt is an atp.                       <<rwp31>>31046000
                                                               <<rwp31>>31048000
   any drt with a value of -1 in word 0 is skipped. any drt    <<rwp31>>31050000
   that shows up with an "old" ilt format exits the procedure, <<rwp31>>31052000
   since atp cannot exist under pre-mpe-iv software. any ilt   <<rwp31>>31054000
   which does not have its drt number stored in it is assumed  <<rwp31>>31056000
   to be bad and is skipped.                                   <<rwp31>>31058000
                                                               <<rwp31>>31060000
   if all these checks pass, we can safely look into the iltx  <<rwp31>>31062000
   for atp pointers. if word 11 of the iltx matches word 5,    <<rwp31>>31064000
   then not only do we have an atp, but we have an atp with a  <<rwp31>>31066000
   split tds.                                                  <<rwp31>>31068000
                                                               <<rwp31>>31070000
   for however many tds's we have, we load the data segment #'s<<rwp31>>31072000
   and absolute addresses of each, then verify that neither of <<rwp31>>31074000
   these values are zero before we try to look for tbuf's. if  <<rwp31>>31076000
   a tds address or dst number is zero, then either the system <<rwp31>>31078000
   wasn't up yet when the dump was made, that section of a     <<rwp31>>31080000
   split tds doesn't exist, or else the iltx was clobbered.    <<rwp31>>31082000
   in these cases, we have no other way to find an atp tds, so <<rwp31>>31084000
   we skip that drt.                                           <<rwp31>>31086000
                                                               <<rwp31>>31088000
   if we find any atp's, then we set the "Atp" flag true and   <<rwp31>>31090000
   go format the tbuf's in each (nonzero) tds we found.        <<rwp31>>31092000
                                                               <<rwp31>>31094000
   printing the tbuf's:                                        <<rwp31>>31096000
   --------------------                                        <<rwp31>>31098000
   we format all the appropriate values from the tbuf table    <<rwp31>>31100000
   into a multi=line header and print it out.                  <<rwp31>>31102000
                                                               <<rwp31>>31104000
   next we make sure we didn't get some ridiculous entry size, <<rwp31>>31106000
   since if we did, then part of the tbuf table is clobbered,  <<rwp31>>31108000
   and we have to assume the whole thing is, and skip these    <<rwp31>>31110000
   tbuf's. adcc tbuf's are 40 words long, and atp tbuf's are   <<rwp31>>31112000
   69 words, so the range of 0 to 80 is used for the check.    <<rwp31>>31114000
                                                               <<rwp31>>31116000
   next we step through all the tbuf's, starting at the tail of<<rwp31>>31118000
   the free list. each is printed in ascii, along with its     <<rwp31>>31120000
   address and link, and its tail pointer is stored in a       <<rwp31>>31122000
   previously-zeroed local array.                              <<rwp31>>31124000
                                                               <<rwp31>>31126000
   then we scan all the tbuf's to make sure we have a tbuf     <<rwp31>>31128000
   linked to the one we just found. if not, the link is broken,<<rwp31>>31130000
   we haven't found the whole free list, so we can't print a   <<rwp31>>31132000
   valid in-use list, and we have to skip these tbuf's. if we  <<rwp31>>31134000
   do find the link, we print that tbuf next and repeat the    <<rwp31>>31136000
   process until we find a tbuf that's linked to the head ptr, <<rwp31>>31138000
   in which case we've found the whole free list.              <<rwp31>>31140000
                                                               <<rwp31>>31142000
   if we do manage to find our way through the linked tbuf's   <<rwp31>>31144000
   from the tail to the head, our local array is filled with   <<rwp31>>31146000
   tail pointers to all free tbuf's we found, but the ones that<<rwp31>>31148000
   weren't linked still have zero elements in the array. now we<<rwp31>>31150000
   know these are either in-use or "lost", so we print them    <<rwp31>>31152000
   all, calculating the index to the tbuf from the index of the<<rwp31>>31154000
   zero array element. this is printed as the "in-use" list,   <<rwp31>>31156000
   each tbuf being printed in ascii with its relative (sysdb or<<rwp31>>31158000
   tds) address.                                               <<rwp31>>31160000
                                                               <<rwp31>>31162000
   in-use printing continues until the number of tbuf's in the <<rwp31>>31164000
   table have been covered. this has nothing to do with the    <<rwp31>>31166000
   size of the index array, rather the number of entries that  <<rwp31>>31168000
   comes from the tbuf table itself.                           <<rwp31>>31170000
                                                               <<rwp31>>31172000
modification history:                                          <<rwp31>>31174000
   23mar82 - randy pawell, ind                                 <<rwp31>>31176000
     rewrote entire procedure to also format atp tbuf's, and   <<rwp31>>31178000
     cleaned up the code. changed the print routiune to a      <<rwp31>>31180000
     subroutine, was formerly all in-line code. no major chgs  <<rwp31>>31182000
     to the algorithm itself.                                  <<rwp31>>31184000
                                                               <<rwp31>>31186000
   27jan83 - randy pawell, ind                                 <<rwp31>>31188000
     updated to work with split tds on atp. replaced use of    <<rwp31>>31190000
     global array ioqix with local array tbufindex, to fix     <<rwp31>>31192000
     bug which appeared when atp had more than 255 tbuf's.     <<rwp31>>31194000
     additional checks for good tds addresses.                 <<rwp31>>31196000
                                                               <<rwp31>>31198000
                                                               << adcc>>31200000
   07jun83 - winson lau, ind    adcc enhancement               << adcc>>31202000
     Printed out "ATP TERMINAL BUFFERS" or "ADCC TERMINAL      << ADCC>>31204000
     BUFFERS" accordingly.  Added subroutine to identify       << ADCC>>31206000
     the correct channel type.  added code to format           << adcc>>31208000
     tbuf in relation to terminal segment number instead       << adcc>>31210000
     of drt number.                                            << adcc>>31212000
                                                               << adcc>>31214000
                                                               << adcc>>31216000
   12jul83 - wwl                                               << adcc>>31218000
     added codes to handles the return of cce and loctbuf      << adcc>>31220000
     of zero by dsttoaddr. note, new adcc driver dose not      << adcc>>31222000
     use sys-global %14 for tbuf table location storage.       << adcc>>31224000
                                                               <<r8331>>31226000
  11jan84 - randy pawell, ind                                  <<r8331>>31228000
    updated get'channel'type subr. to accept mighty-mouse      <<r8331>>31230000
    tic channel i.d.                                           <<r8331>>31232000
                                                               <<r8331>>31234000
                                                               << adcc>>31236000
;                                                                       31238000
                                                               <<03752>>31240000
logical                                                        <<03752>>31242000
       scratchl,    << type logical scratch variable.      >>  <<03752>>31244000
       split'tds,       << true only if two tds's on per atp >><<rwp31>>31246000
       taptr,       << link word from last tbuf read.      >>  <<03752>>31248000
       hdptr,       << tbuf head pointer, from table.      >>  <<03752>>31250000
       valid'drts,  << flag returned from test'drt'info.   >>  <<03752>>31252000
       atp,         << flag for table structure, 0=non-atp.>>  <<03752>>31254000
       tds'seg'num, << data-sgmt # of tds for current drt. >>  <<03752>>31256000
       tds'found,                                              << adcc>>31258000
  type1,      <<chan type for 1st atp tds>>                    << adcc>>31260000
  type2,      <<chan type for 2nd atp tds>>                    << adcc>>31262000
  channel'type,     <<adcc, atp, or neither>>                  << adcc>>31264000
       offset'to'1st'tbuf;  << displacement from loctbuf to>>  <<03752>>31266000
                            << word 0 of 1st tbuf.         >>  <<03752>>31268000
                                                               <<03752>>31270000
double                                                         <<03752>>31272000
       loctbuf,     << abs addr of start of tbuf table for >>  <<03752>>31274000
                    << adcc, atc, and atp. is chg'd to abs >>  <<03752>>31276000
                    << addr of tds for printing atp tbufs. >>  <<03752>>31278000
       scratchd,    << type double scratch variable.       >>  <<03752>>31280000
       locilt,      << abs addr of ilt, from drt.          >>  <<03752>>31282000
       lociltx,     << abs addr of iltx, calc. from ilt.   >>  <<03752>>31284000
       lociltxl,    << abs addr of iltx for units (0-47) >>    <<rwp31>>31286000
       lociltxu,    << abs addr of iltx for units (48-95) >>   <<rwp31>>31288000
       loctds;      << abs addr of tds, from iltx.         >>  <<03752>>31290000
                                                               <<03752>>31292000
equate                                                         <<rwp31>>31294000
       max'pos'tds = %21,                                      << adcc>>31296000
  adcc'id = %(16)8001,                                         << adcc>>31298000
  adcc'extend'id = %(16)8011,                                  << adcc>>31300000
  atp'id = %(16)500f,                                          << adcc>>31302000
  tic'id = %(16)5004,        <<channel id of mighty-mouse atp>><<r8331>>31304000
  neither'type = 0,                                            << adcc>>31306000
  adcc'type = 2,                                               << adcc>>31308000
  atp'type = 4,                                                << adcc>>31310000
  atp'old'id = 0,                                              << adcc>>31312000
  iltx'chan'type = 4,                                          << adcc>>31314000
       tbufindexsize = 1024;  <<max possible # of tbuf's>>     <<rwp31>>31316000
                                                               <<rwp31>>31318000
logical array                                                  <<03752>>31320000
       tbufindex(0:tbufindexsize-1),  <<logs all tbuf links>>  <<rwp31>>31322000
       loctbuf0(*) = loctbuf,    << access to msw of loctbuf>> <<03752>>31324000
       loctbuf1(*) = loctbuf0(1),<< access to lsw of loctbuf>> <<03752>>31326000
       scrd0  (*) = scratchd,     << access to msw of totreq>> <<03752>>31328000
       scrd1  (*) = scrd0 (1),    << access to lsw of totreq>> <<03752>>31330000
       loctds0(*) = loctds,       << access to msw of loctds>> <<03752>>31332000
       loctds1(*) = loctds0 (1);  << access to lsw of loctds>> <<03752>>31334000
                                                               <<03752>>31336000
array                                                          << adcc>>31338000
   tds'nums'done(0:max'pos'tds-1);                             << adcc>>31340000
                                                               << adcc>>31342000
integer                                                        <<03752>>31344000
       esize,       << size (in words) of each tbuf.       >>  <<03752>>31346000
       tds'count,   << counter to format both atp tds's >>     <<rwp31>>31348000
       cinuse,      << number of currently-in-use tbufs.   >>  <<03752>>31350000
       totale,      << total# tbufentries in table.        >>  <<03752>>31352000
       indx,        << loop counter for free list chaining.>>  <<03752>>31354000
       ix,          << loop ctr for byte-load, link scan.  >>  <<03752>>31356000
       scratchi,    << type integer scratch variable.      >>  <<03752>>31358000
       drtno,       << drt# for loop counter in atp scan.  >>  <<03752>>31360000
       num'tds'done := -1,                                     << adcc>>31362000
       index,                                                  << adcc>>31364000
       highdrt,     << highest drt#, from fixed low memory.>>  <<03752>>31366000
       lowdrt,      << lowest drt#, according to cpu type. >>  <<03752>>31368000
       pi'offset,   << offset within drt entry for pi word.>>  <<03752>>31370000
       dbi'offset,  << offset within drt entry for dbi wd. >>  <<03752>>31372000
       bytecount;   << counter for printing tbuf contents. >>  <<03752>>31374000
                                                               <<03752>>31376000
equate                                                         <<03752>>31378000
                                                               <<03752>>31380000
<< the following equates define the order of words in the >>   <<03752>>31382000
<< tbuf table for the adcc (or atc):  >>                       <<03752>>31384000
                                                               <<03752>>31386000
       tnum'adcc      = 0,                                     <<03752>>31388000
       tsize'adcc     = 1,                                     <<03752>>31390000
       tpnum'adcc     = 2,                                              31392000
       thead'adcc     = 4,                                     <<03752>>31394000
       ttail'adcc     = 5,                                     <<03752>>31396000
       tmuse'adcc     = 6,                                     <<03752>>31398000
       tcuse'adcc     = 7,                                              31400000
       tovflw'adcc    = 8,                                     <<03752>>31402000
       trqsts'adcc    = 9,    << double word >>                <<03752>>31404000
       table'len'adcc = 12,                                    <<03752>>31406000
                                                               <<03752>>31408000
       tbuf'dst'num'adcc = %14, << dst number of tbuf table >> <<03752>>31410000
                                << for adcc (or atc). >>       <<03752>>31412000
                                                               <<03752>>31414000
<< the following equates define the tbuf table for the atp: >> <<03752>>31416000
                                                               <<03752>>31418000
       tnum'atp      = 0,                                      <<03752>>31420000
       tsize'atp     = 1,                                      <<03752>>31422000
       thead'atp     = 2,                                      <<03752>>31424000
       ttail'atp     = 3,                                      <<03752>>31426000
       tmaxuse'atp   = 4,                                      <<03752>>31428000
       tinuse'atp    = 5,                                      <<03752>>31430000
       trqsts'atp    = 6,      << double word >>               <<03752>>31432000
       tdenied'atp   = 8,                                      <<03752>>31434000
       table'len'atp = 10,                                     <<03752>>31436000
                                                               <<03752>>31438000
                                                               <<03752>>31440000
<< the following equates define the iltx for the atp: >>       <<03752>>31442000
                                                               <<03752>>31444000
       iltx'tdsdseg = 0,                                       <<rwp31>>31446000
       iltx'tdsbank = 1,                                       <<rwp31>>31448000
       iltx'tdsaddr = 2,                                       <<rwp31>>31450000
       iltx'iplab = 5,                                         <<rwp31>>31452000
       assumed'iltx'size = 6,                                  <<rwp31>>31454000
                                                               <<03752>>31456000
<< the following equates define words in other tables: >>      <<03752>>31458000
                                                               <<03752>>31460000
       tds'tbuf'table  = 2, <<offset to tbuf table ptr in tds>><<03752>>31462000
                                                               <<03752>>31464000
       ilt'drt         = 7, <<offset to icntrl word in ilt.  >><<03752>>31466000
       ilt'isiop       = 8, <<offset to isiop word in ilt.   >><<03752>>31468000
                                                               <<03752>>31470000
       drt'dbi'hpib    = 1, <<offset to drt's dbi wd for hpib>><<03752>>31472000
       drt'pi'hpib     = 2, <<offset to pi wd in drt for hpib>><<03752>>31474000
       drt'dbi'nonhpib = 2, <<offset to drt's dbi wd for siii>><<03752>>31476000
       drt'pi'nonhpib  = 1; <<offset to pi wd in drt for siii>><<03752>>31478000
                                                               <<03752>>31480000
$page                                                          <<r8331>>31482000
subroutine fmt'tbufs;                                          <<03752>>31484000
begin                                                          <<03752>>31486000
                                                               <<03752>>31488000
newpage;              <<for normal tbufs and each atp system>> <<03752>>31490000
                                                               <<03752>>31492000
                                                               <<03752>>31494000
<< build and output title header >>                            <<03752>>31496000
if atp then                                                    <<03752>>31498000
   begin                                                       << adcc>>31500000
   if channel'type = atp'type then                             << adcc>>31502000
      move dbuffer(23) :=                                      << adcc>>31504000
        "******  ATP TERMINAL BUFFERS  ******"                 << adcc>>31506000
   else                                                        << adcc>>31508000
      if channel'type = adcc'type then                         << adcc>>31510000
         move dbuffer(23) :=                                   << adcc>>31512000
           "******  ADCC TERMINAL BUFFERS  ******"             << adcc>>31514000
   end                                                         << adcc>>31516000
  else                                                         <<03752>>31518000
  begin                                                        <<rwp31>>31520000
    move dbuffer(23) :=                                        <<03752>>31522000
      "******    TERMINAL BUFFERS    ******";                  <<03752>>31524000
  end;                                                         <<03752>>31526000
printline;   << output title header>>                          <<03752>>31528000
skiplines(3);                                                  <<03752>>31530000
                                                               <<03752>>31532000
                                                               <<03752>>31534000
                                                               <<03752>>31536000
<< load #entries in table and #in use from tbuf table >>       <<03752>>31538000
<< the #entries is saved for later use. >>                     <<03752>>31540000
                                                               <<03752>>31542000
move bbuf := "NUMBER OF ELEMENTS IN TABLE";                    <<03752>>31544000
scratchl := core( loctbuf + double(( if atp then               <<03752>>31546000
                     tnum'atp else tnum'adcc )));              <<03752>>31548000
if atp then totale := integer( scratchl )                      <<03752>>31550000
  else totale := integer( scratchl);                     <<03752>>      31552000
@pbuf := @bbuf + 40;                                           <<03752>>31554000
ascii( totale, 10, pbuf );                                     <<03752>>31556000
                                                               <<03752>>31558000
move bbuf(52) := "MAXIMUM NUMBER OF ELEMENTS IN USE";          <<03752>>31560000
scratchl := core( loctbuf + double(( if atp then               <<03752>>31562000
                     tmaxuse'atp else tmuse'adcc )));          <<03752>>31564000
if atp then scratchi:= integer( scratchl )                     <<03752>>31566000
  else scratchi := integer( scratchl);                   <<03752>>      31568000
@pbuf := @bbuf + 92;                                           <<03752>>31570000
ascii( scratchi, 10, pbuf );                                   <<03752>>31572000
printline;                                                     <<03752>>31574000
                                                               <<03752>>31576000
                                                               <<03752>>31578000
                                                               <<03752>>31580000
<< load # tbufs in primary area and # in use from tbuf table >><<03752>>31582000
<< the # in-use is saved for later use. >>                     <<03752>>31584000
                                                               <<03752>>31586000
move bbuf := "ELEMENTS IN PRIMARY AREA";                       <<03752>>31588000
scratchl := core( loctbuf + double( tpnum'adcc ));             <<03752>>31590000
if atp then scratchi := totale                                 <<03752>>31592000
  else scratchi := integer( scratchl);                   <<03752>>      31594000
@pbuf := @bbuf + 40;                                           <<03752>>31596000
ascii( scratchi, 10, pbuf );                                   <<03752>>31598000
                                                               <<03752>>31600000
move bbuf(52) := "CURRENT NUMBER OF ELEMENTS IN USE";          <<03752>>31602000
scratchl := core( loctbuf + double(( if atp then               <<03752>>31604000
                     tinuse'atp else tcuse'adcc )));           <<03752>>31606000
if atp then cinuse := integer( scratchl )                      <<03752>>31608000
  else cinuse := integer( scratchl);                     <<03752>>      31610000
@pbuf := @bbuf + 92;                                           <<03752>>31612000
ascii( cinuse, 10, pbuf );                                     <<03752>>31614000
printline;                                                     <<03752>>31616000
                                                               <<03752>>31618000
                                                               <<03752>>31620000
                                                               <<03752>>31622000
<< load tbuf size and overflows/#denied from tbuf table. >>    <<03752>>31624000
<< the entry-size is saved for later use. >>                   <<03752>>31626000
                                                               <<03752>>31628000
move bbuf := "SIZE OF EACH ELEMENT (WORDS)";                   <<03752>>31630000
scratchl := core( loctbuf + double(( if atp then               <<03752>>31632000
                     tsize'atp else tsize'adcc )));            <<03752>>31634000
esize := integer (scratchl).(8:8);                             << mpev>>31636000
@pbuf := @bbuf + 40;                                           <<03752>>31638000
ascii( esize, 10, pbuf );                                      <<03752>>31640000
                                                               <<03752>>31642000
scratchl := core( loctbuf + double((if atp then                <<03752>>31644000
                     tdenied'atp else tovflw'adcc )));         <<03752>>31646000
if atp then                                                    <<03752>>31648000
    move bbuf(52) :=                                           <<03752>>31650000
      "NUMBER OF TBUF REQUESTS DENIED"                         <<03752>>31652000
  else                                                         <<03752>>31654000
    move bbuf(52) := "OVERFLOWS";                              <<03752>>31656000
@pbuf := @bbuf + 92;                                           <<03752>>31658000
ascii( scratchl, 10, pbuf );                                   <<03752>>31660000
printline;                                                     <<03752>>31662000
                                                               <<03752>>31664000
                                                               <<03752>>31666000
                                                               <<03752>>31668000
<< load head pointer and total #requests from tbuf table. >>   <<03752>>31670000
<< the head pointer is saved for later use. >>                 <<03752>>31672000
                                                               <<03752>>31674000
move bbuf := "INDEX OF FIRST FREE ELEMENT";                    <<03752>>31676000
hdptr := core( loctbuf + double(( if atp then                  <<03752>>31678000
                  thead'atp else thead'adcc )));               <<03752>>31680000
@pbuf := @bbuf + 36;                                           <<03752>>31682000
putnump( hdptr );                                              <<03752>>31684000
                                                               <<03752>>31686000
move bbuf(52) := "TOTAL NUMBER OF REQUESTS";                   <<03752>>31688000
scratchl := (if atp then trqsts'atp else trqsts'adcc );        <<03752>>31690000
scrd0 := core( loctbuf + double( scratchl ));                  <<03752>>31692000
scrd1 := core( loctbuf + double( scratchl + 1 ));              <<03752>>31694000
@pbuf := @bbuf + 92;                                           <<03752>>31696000
dascii ( scratchd, 10, pbuf );                                 <<03752>>31698000
printline;                                                     <<03752>>31700000
                                                               <<03752>>31702000
                                                               <<03752>>31704000
                                                               <<03752>>31706000
<< load tail pointer (and tds bank# if atp) from tbuf  >>      <<03752>>31708000
<< table. the tail pointer is saved as a starting point for >> <<03752>>31710000
<< the free-list chained printout later. >>                    <<03752>>31712000
                                                               <<03752>>31714000
move bbuf := "INDEX TO LAST FREE ELEMENT";                     <<03752>>31716000
taptr := core( loctbuf + double(( if atp then                  <<03752>>31718000
                  ttail'atp else ttail'adcc )));               <<03752>>31720000
@pbuf := @bbuf + 36;                                           <<03752>>31722000
putnump( taptr );                                              <<03752>>31724000
                                                               <<03752>>31726000
if atp then                                                    <<03752>>31728000
begin                                                          <<03752>>31730000
  move bbuf(52) := "TBUF TABLE BANK NUMBER";                   <<03752>>31732000
  @pbuf := @bbuf+ 89;                                          <<03752>>31734000
  putnump( loctbuf0 );   << bank# of tbuf table >>             <<03752>>31736000
end;                                                           <<03752>>31738000
printline;                                                     <<03752>>31740000
                                                               <<03752>>31742000
                                                               <<03752>>31744000
                                                               <<03752>>31746000
<< if atp, then also load and output data-segment# of the >>   <<03752>>31748000
<< tds and the offset to the start of the tbuf table. >>       <<03752>>31750000
                                                               <<03752>>31752000
if atp then                                                    <<03752>>31754000
begin                                                          <<03752>>31756000
  move bbuf := "DATA SEGMENT NUMBER (OCTAL)";                  <<03752>>31758000
  @pbuf := @bbuf + 36;                                         <<03752>>31760000
  putnump( tds'seg'num );     << data-sgmt # of tds >>         <<03752>>31762000
                                                               <<03752>>31764000
  move bbuf(52) := "TBUF TABLE OFFSET";                        <<03752>>31766000
  @pbuf := @bbuf + 89;                                         <<03752>>31768000
  putnump( loctbuf1 );        << offset to tbuf table >>       <<03752>>31770000
  printline;                                                   <<03752>>31772000
end;                                                           <<03752>>31774000
                                                               <<03752>>31776000
skiplines (1);                                                 <<03752>>31778000
                                                               <<03752>>31780000
                                                               <<03752>>31782000
                                                               <<03752>>31784000
<< check entry size. if too large then assume bad data  >>     <<03752>>31786000
<< and don't print these tbufs. >>                             <<03752>>31788000
                                                               <<03752>>31790000
if not ( 0 <= esize <= 80 ) then                               <<03752>>31792000
begin                                                          <<03752>>31794000
  move bbuf := "ERROR: INVALID ENTRY SIZE";                    <<03752>>31796000
  printline;                                                   <<03752>>31798000
  go bailout;                                                  <<03752>>31800000
end;                                                           <<03752>>31802000
                                                               <<03752>>31804000
                                                               <<03752>>31806000
<< output headers for free list >>                             <<03752>>31808000
                                                               <<03752>>31810000
move bbuf(46) := "FREE LIST";                                  <<03752>>31812000
printline;                                                     <<03752>>31814000
skiplines (1);                                                 <<03752>>31816000
                                                               <<03752>>31818000
move bbuf := "TABLE";                                          <<03752>>31820000
if atp then move bbuf(20) := "TABLE";                          <<03752>>31822000
printline;                                                     <<03752>>31824000
                                                               <<03752>>31826000
move bbuf := "INDEX    LINK";                                  <<03752>>31828000
if atp then move bbuf(20) := "ADDRESS";                        <<03752>>31830000
move bbuf(44) := "TERMINAL BUFFER";                            <<03752>>31832000
printline;                                                     <<03752>>31834000
skiplines (1);                                                 <<03752>>31836000
                                                               <<03752>>31838000
                                                               <<03752>>31840000
                                                               <<03752>>31842000
<<   any tbuf with a nonzero link to another tbuf is con-  >>  <<03752>>31844000
<< sidered to be part of the 'free list', and the index in >>  <<03752>>31846000
<< array tbufindex corresponding to the tbuf# (0-1023) is  >>  <<rwp31>>31848000
<< appropriately flagged. later, any element of this array >>  <<03752>>31850000
<< which is still 0 is assumed to indicate an in-use tbuf. >>  <<03752>>31852000
                                                               <<03752>>31854000
                                                               <<03752>>31856000
tbufindex := 0;   <<load tbuf index array with zeroes>>        <<rwp31>>31858000
move tbufindex(1) := tbufindex(0),(tbufindexsize-1);           <<rwp31>>31860000
                                                               <<03752>>31862000
                                                               <<03752>>31864000
<< since atp tbuf pointers are tds-relative, we now >>         <<03752>>31866000
<< redefine loctbuf as the start of the tds. we also >>        <<03752>>31868000
<< calculate the offset from loctbuf to the 1st tbuf. >>       <<03752>>31870000
                                                               <<03752>>31872000
if atp then   <<adjust pointers to find atp tbufs >>           <<03752>>31874000
  begin                                                        <<03752>>31876000
    offset'to'1st'tbuf :=           << length of atp tds >>    <<03752>>31878000
      logical( loctbuf - loctds) +   << up to and including >> <<03752>>31880000
                  table'len'atp;      << the tbuf table. >>    <<03752>>31882000
    loctbuf := loctds;       << pointers are tds-relative >>   <<03752>>31884000
  end                                                          <<03752>>31886000
  else  offset'to'1st'tbuf :=     <<tbuf table header length>> <<03752>>31888000
              table'len'adcc;     <<for adcc and atc. >>       <<03752>>31890000
                                                               <<03752>>31892000
<< chain through free tbuf list, starting with the first >>    <<03752>>31894000
<< physical tbuf. print all tbufs in the free list. >>         <<03752>>31896000
                                                               <<03752>>31898000
indx := 1;                                                     <<03752>>31900000
while indx <= ( totale - cinuse )  do                          <<03752>>31902000
begin                                                          <<03752>>31904000
                                                               <<03752>>31906000
<< load index /link ptrs for next tbuf into the output line. >><<03752>>31908000
<< for the atp we also load the absolute address. this is not>><<03752>>31910000
<< needed for the atc or adcc, which are always sysdb-rel.   >><<03752>>31912000
                                                               <<03752>>31914000
  @pbuf := @bbuf;                                              <<03752>>31916000
  putnump( taptr );                        <<load index>>      <<03752>>31918000
  scratchd := double( taptr );  <<use index to get link word>> <<03752>>31920000
  scratchl := core( loctbuf + scratchd );                      <<03752>>31922000
  @pbuf := @bbuf + 8;                                          <<03752>>31924000
  putnump( scratchl );                     <<load link>>       <<03752>>31926000
  if atp then        <<calculate and load absolute address>>   <<03752>>31928000
    begin                                                      <<03752>>31930000
      @pbuf := @bbuf + 20;                                     <<03752>>31932000
      putnum( loctds1 + taptr );           <<load address>>    <<03752>>31934000
    end;  <<address load>>                                     <<03752>>31936000
                                                               <<03752>>31938000
                                                               <<03752>>31940000
<< load this tbuf, word-by-word, and print it out. >>          <<03752>>31942000
<< dump words 1 through last. last should be zero. >>          <<03752>>31944000
                                                               <<03752>>31946000
  @pbuf := @bbuf + 36;  <<set pointer for byte dump>>          <<03752>>31948000
  bytecount := 0;                                              <<03752>>31950000
  for ix := 1 until ( esize - 1 ) do                           <<03752>>31952000
  begin                                                        <<03752>>31954000
    scratchl := core( loctbuf + scratchd + double( ix ));      <<03752>>31956000
    putchar( scratchl );  <<load next 2 bytes>>                <<03752>>31958000
    bytecount := bytecount + 2;                                <<03752>>31960000
    if bytecount > 66 then  <<this line is full>>              <<03752>>31962000
      begin                                                    <<03752>>31964000
        printline;                                             <<03752>>31966000
        skiplines (1);                                         <<03752>>31968000
        bytecount := 0;                                        <<03752>>31970000
        @pbuf := @bbuf + 36;                                   <<03752>>31972000
      end;  << if line full >>                                 <<03752>>31974000
    end;  <<for>>                                              <<03752>>31976000
    if bytecount > 0 then  <<flush partial line>>              <<03752>>31978000
      begin                                                    <<03752>>31980000
        printline;                                             <<03752>>31982000
        skiplines (1);                                         <<03752>>31984000
      end;  <<flush>>                                          <<03752>>31986000
                                                               <<03752>>31988000
                                                               <<03752>>31990000
<< mark this tbuf as 'free' by storing its link in the >>      <<03752>>31992000
<< index array. >>                                             <<03752>>31994000
                                                               <<03752>>31996000
   tbufindex( integer( taptr - offset'to'1st'tbuf )            <<rwp31>>31998000
                          / esize ) := taptr;                  <<03752>>32000000
                                                               <<03752>>32002000
                                                               <<03752>>32004000
<< scan list to look for a link to match this index >>         <<03752>>32006000
<< unless we've found the head entry. >>                       <<03752>>32008000
                                                               <<03752>>32010000
  if taptr = hdptr then go do'inuse'list;                      <<03752>>32012000
                                                               <<03752>>32014000
  ix := integer( offset'to'1st'tbuf );                         <<03752>>32016000
  while ix < ( totale * esize                                  <<03752>>32018000
                 + integer( offset'to'1st'tbuf ))   do         <<03752>>32020000
  begin                                                        <<03752>>32022000
    scratchl := core( loctbuf + double( ix ));                 <<03752>>32024000
    if scratchl = taptr then go see'if'link'broken             <<03752>>32026000
      else ix := ix + esize;                                   <<03752>>32028000
  end;                                                         <<03752>>32030000
                                                               <<03752>>32032000
  see'if'link'broken:                                          <<03752>>32034000
  if scratchl = taptr then taptr := logical( ix )              <<03752>>32036000
    else                                                       <<03752>>32038000
    begin                                                      <<03752>>32040000
      move bbuf := "ERROR: BROKEN TERMINAL BUFFER LINK";       <<03752>>32042000
      printline;                                               <<03752>>32044000
      go bailout;                                              <<03752>>32046000
    end;                                                       <<03752>>32048000
                                                               <<03752>>32050000
  indx := indx + 1;                                            <<03752>>32052000
end;  << while >>                                              <<03752>>32054000
                                                               <<03752>>32056000
                                                               <<03752>>32058000
<< print headers for in-use list. >>                           <<03752>>32060000
                                                               <<03752>>32062000
do'inuse'list:                                                 <<03752>>32064000
if linecount > ( lnsperpg - 18 ) then newpage;                 <<03752>>32066000
skiplines (3);                                                 <<03752>>32068000
                                                               <<03752>>32070000
if atp then                                                    <<03752>>32072000
   if channel'type = atp'type then                             << adcc>>32074000
      move dbuffer(23) :=                                      << adcc>>32076000
        "******  ATP TERMINAL BUFFERS  ******"                 << adcc>>32078000
   else                                                        << adcc>>32080000
      if channel'type = adcc'type then                         << adcc>>32082000
         move dbuffer(23) :=                                   << adcc>>32084000
           "******  ADCC TERMINAL BUFFERS  ******"             << adcc>>32086000
  else                                                         <<03752>>32088000
  move dbuffer(23) :=                                          <<03752>>32090000
    "******    TERMINAL BUFFERS    ******";                    <<03752>>32092000
printline;                                                     <<03752>>32094000
skiplines (3);                                                 <<03752>>32096000
                                                               <<03752>>32098000
move bbuf(46) := "IN-USE LIST";                                <<03752>>32100000
printline;                                                     <<03752>>32102000
skiplines (1);                                                 <<03752>>32104000
                                                               <<03752>>32106000
move bbuf := "TABLE";                                          <<03752>>32108000
if atp then move bbuf(20) := "TABLE";                          <<03752>>32110000
printline;                                                     <<03752>>32112000
                                                               <<03752>>32114000
move bbuf := "INDEX    LINK";                                  <<03752>>32116000
if atp then move bbuf(20) := "ADDRESS";                        <<03752>>32118000
move bbuf(44) := "TERMINAL BUFFER";                            <<03752>>32120000
printline;                                                     <<03752>>32122000
skiplines (1);                                                 <<03752>>32124000
                                                               <<03752>>32126000
                                                               <<03752>>32128000
<< step through index array and print the tbufs which >>       <<03752>>32130000
<< correspond to elements which were left zero by the >>       <<03752>>32132000
<< free-list routine. >>                                       <<03752>>32134000
                                                               <<03752>>32136000
indx := 0;                                                     <<03752>>32138000
while indx <= ( totale - 1 )   do                              <<03752>>32140000
begin                                                          <<03752>>32142000
  if tbufindex( indx ) = 0 then  <<this is not a free tbuf>>   <<rwp31>>32144000
    begin                                                      <<03752>>32146000
                                                               <<03752>>32148000
<< set the pointer to the link word of this in-use tbuf. >>    <<03752>>32150000
                                                               <<03752>>32152000
      taptr := logical( indx * esize )                         <<03752>>32154000
                            + offset'to'1st'tbuf;              <<03752>>32156000
                                                               <<03752>>32158000
<< load index pointers for this in-use tbuf. >>                <<03752>>32160000
                                                               <<03752>>32162000
      @pbuf := @bbuf;                                          <<03752>>32164000
      putnump( taptr  + ( if atp then 0    << load index >>    <<03752>>32166000
                      else ( loctbuf1 - %1000 )));             <<03752>>32168000
      scratchd := double( taptr );                             <<03752>>32170000
      scratchl := core( loctbuf + scratchd );                  <<03752>>32172000
      @pbuf := @bbuf + 8;                                      <<03752>>32174000
      putnump( scratchl );               <<load link>>         <<03752>>32176000
      if atp then                                              <<03752>>32178000
        begin                                                  <<03752>>32180000
          @pbuf := @bbuf + 20;                                 <<03752>>32182000
          putnum( loctds1 + taptr );     <<load address>>      <<03752>>32184000
        end;  <<if atp>>                                       <<03752>>32186000
                                                               <<03752>>32188000
                                                               <<03752>>32190000
<< load and print in-use tbuf, word-by-word. >>                <<03752>>32192000
                                                               <<03752>>32194000
      @pbuf := @bbuf + 36;                                     <<03752>>32196000
      bytecount := 0;                                          <<03752>>32198000
      for ix := 1 until ( esize - 1 )  do                      <<03752>>32200000
      begin                                                    <<03752>>32202000
        scratchl := core( loctbuf + scratchd + double( ix ));  <<03752>>32204000
        putchar( scratchl );  <<load next 2 bytes>>            <<03752>>32206000
        bytecount := bytecount + 2;                            <<03752>>32208000
        if bytecount > 66 then   <<this line is full>>         <<03752>>32210000
          begin                                                <<03752>>32212000
            printline;                                         <<03752>>32214000
            skiplines (1);                                     <<03752>>32216000
            bytecount := 0;                                    <<03752>>32218000
            @pbuf := @bbuf + 36;                               <<03752>>32220000
          end;  <<if full line>>                               <<03752>>32222000
      end;  <<for>>                                            <<03752>>32224000
      if bytecount > 0 then  <<flush partial line>>            <<03752>>32226000
        begin                                                  <<03752>>32228000
          printline;                                           <<03752>>32230000
          skiplines (1);                                       <<03752>>32232000
        end;  <<flush>>                                        <<03752>>32234000
      end;  <<if tbufindex(ix) = 0>>                           <<rwp31>>32236000
                                                               <<03752>>32238000
  indx := indx + 1;                                            <<03752>>32240000
end;   << while >>                                             <<03752>>32242000
                                                               <<03752>>32244000
bailout:                                                       <<03752>>32246000
end;  <<subroutine fmt'tbufs>>                                 <<03752>>32248000
$page                                                          <<r8331>>32250000
subroutine get'channel'type;                                   <<r8331>>32252000
                                                               <<r8331>>32254000
comment *******************************************************<<r8331>>32256000
*                                                              <<r8331>>32258000
* get'channel'type --                                          <<r8331>>32260000
*                                                              <<r8331>>32262000
* determines the channel type from the iltx, where the actual  <<r8331>>32264000
* channel i.d. has been stored.                                <<r8331>>32266000
*                                                              <<r8331>>32268000
* three possible channel types are possible: atp/tic, adcc,    <<r8331>>32270000
* or neither. the earliest versions of atp did not store the   <<r8331>>32272000
* channel type, so that word is zero.                          <<r8331>>32274000
*                                                              <<r8331>>32276000
***************************************************************<<r8331>>32278000
;                                                              <<r8331>>32280000
                                                               <<r8331>>32282000
begin                                                          << adcc>>32284000
                                                               << adcc>>32286000
  type1:= core(lociltxl+double(iltx'chan'type)); <<1st tds>>   << adcc>>32288000
  type2:= core(lociltxu+double(iltx'chan'type)); <<2nd tds>>   << adcc>>32290000
                                                               << adcc>>32292000
  if type1 = adcc'id or type1 = adcc'extend'id then            << adcc>>32294000
     channel'type:= adcc'type                                  << adcc>>32296000
  else                                                         << adcc>>32298000
    if type1 = atp'id or type1 = tic'id then                   <<r8331>>32300000
       channel'type:= atp'type                                 << adcc>>32302000
    else  <<error, old atp, or 1st tds not built>>             << adcc>>32304000
      if type1 <> atp'old'id then                              << adcc>>32306000
         channel'type:= neither'type  <<**error**>>            << adcc>>32308000
      else                                                     << adcc>>32310000
        if not split'tds then                                  << adcc>>32312000
           channel'type:= atp'type <<earlier version>>         << adcc>>32314000
        else   <<split tds>>                                   << adcc>>32316000
        if type2 = adcc'id or type2 = adcc'extend'id then      << adcc>>32318000
           channel'type:= adcc'type                            << adcc>>32320000
        else                                                   << adcc>>32322000
        if type2 = atp'id or type2 = tic'id                    <<r8331>>32324000
             or type2 = atp'old'id then                        <<r8331>>32326000
           channel'type:= atp'type                             << adcc>>32328000
        else                                                   << adcc>>32330000
           channel'type:= neither'type;  <<**error**>>         << adcc>>32332000
                                                               << adcc>>32334000
  <<note: the above coding ignored the possibility of not  >>  << adcc>>32336000
 <<   atp type but has zero in both iltx channel type.     >>  << adcc>>32338000
                                                               << adcc>>32340000
end;                                                           << adcc>>32342000
                                                               << adcc>>32344000
$page                                                                   32346000
                 << ****** main ****** >>                      <<03752>>32348000
                                                               <<03752>>32350000
    indxaray ( tbuf'dst'num'adcc * 2 ) := pageno;              <<rwp31>>32352000
                                                               <<03752>>32354000
<< verify system db and dst pointers agree, >>                 <<03752>>32356000
<< obtain absolute address of dst %14 >>                       <<03752>>32358000
                                                               <<03752>>32360000
loctbuf := dsttoaddr(tbuf'dst'num'adcc);                       <<03752>>32362000
if <> then                                                     <<03752>>32364000
  begin  <<dst return address not zero>>                       << adcc>>32366000
  if loctbuf <> 0d then warning else                           <<03752>>32368000
  begin                                                        <<03752>>32370000
    noformt';                                                  <<03752>>32372000
    go do'atp'tbufs;                                           <<03752>>32374000
  end;                                                         <<03752>>32376000
  end                                                          << adcc>>32378000
else                                                           << adcc>>32380000
  begin  <<global tbuf area empty>>                            << adcc>>32382000
    if  loctbuf = 0d then                                      << adcc>>32384000
          go do'atp'tbufs;                                     << adcc>>32386000
  end;                                                         << adcc>>32388000
                                                               <<03752>>32390000
atp := false;                                                  <<03752>>32392000
fmt'tbufs;   << do non-atp tbufs >>                            <<03752>>32394000
                                                               <<03752>>32396000
                                                               <<03752>>32398000
<< obtain lowest drt# according to cpu type and >>             <<03752>>32400000
<< highest drt# from fixed low memory. quit if bad data.>>     <<03752>>32402000
                                                               <<03752>>32404000
do'atp'tbufs:                                                  <<03752>>32406000
test'drt'info( lowdrt, highdrt, valid'drts, 0 );               <<03752>>32408000
if not valid'drts then go bailout1;                            <<03752>>32410000
                                                               <<03752>>32412000
                                                               <<03752>>32414000
                                                               <<03752>>32416000
<< get correct orientation of pi and dbi words in drt entry.>> <<03752>>32418000
                                                               <<03752>>32420000
dbi'offset := (if series'33'thru'mm then                       <<s7919>>32422000
                drt'dbi'hpib  else  drt'dbi'nonhpib );         <<03752>>32424000
pi'offset := (if series'33'thru'mm then                        <<s7919>>32426000
                drt'pi'hpib  else  drt'pi'nonhpib );           <<03752>>32428000
                                                               <<03752>>32430000
                                                               <<03752>>32432000
                                                               <<03752>>32434000
<< scan through drt table, looking for atp subsystems >>       <<03752>>32436000
                                                               <<03752>>32438000
for drtno := lowdrt until highdrt  do                          <<03752>>32440000
begin                                                          <<03752>>32442000
  if integer( getdrt( drtno, 0 )) = -1 then go next'drt;       <<03752>>32444000
                                                               <<03752>>32446000
                                                               <<03752>>32448000
                                                               <<03752>>32450000
<< load ilt abs addr from dbi word of drt entry >>             <<03752>>32452000
                                                               <<03752>>32454000
  locilt := double( getdrt( drtno, dbi'offset ));              <<03752>>32456000
                                                               <<03752>>32458000
                                                               <<03752>>32460000
                                                               <<03752>>32462000
<< atp software does not run on series iii and uses only >>    <<03752>>32464000
<< the 'new' ilt format. quit if conditions not met. >>        <<03752>>32466000
                                                               <<03752>>32468000
  if not (series'33'thru'mm) or not (new'ilt'format)           <<s7919>>32470000
           then go bailout1;                                   <<03752>>32472000
                                                               <<03752>>32474000
                                                               <<03752>>32476000
                                                               <<03752>>32478000
<< check drt word in ilt for the expected value. skip if >>    <<03752>>32480000
<< the values do not match. >>                                 <<03752>>32482000
                                                               <<03752>>32484000
  scratchl := core( locilt + double( ilt'drt ));               <<03752>>32486000
  if integer (scratchl.(7:9)) <> drtno then go next'drt;       <<03752>>32488000
                                                               <<03752>>32490000
                                                               <<03752>>32492000
                                                               <<03752>>32494000
<< use isiop pointer word in ilt as pointer to iltx. >>        <<03752>>32496000
                                                               <<03752>>32498000
  tos := 0;                                                    <<03752>>32500000
  tos := core( locilt + double( ilt'isiop ));                  <<03752>>32502000
  tos := tos + %1000;  << isiop is sysdb-rel iltx pointer >>   <<*9092>>32504000
  lociltx := tos;                                              <<03752>>32506000
                                                               <<*9092>>32508000
                                                               <<03752>>32510000
                                                               <<03752>>32512000
                                                               <<03752>>32514000
<< attempt to load pi pointer from last word of iltx. if >>    <<03752>>32516000
<< software is for atp, then this matches the pi word >>       <<03752>>32518000
<< in the current drt entry. else not an atp.         >>       <<03752>>32520000
                                                               <<03752>>32522000
  scratchl := core( lociltx + double( iltx'iplab ));           <<rwp31>>32524000
  atp := (if getdrt( drtno, pi'offset ) = scratchl             <<03752>>32526000
               then true else false);                          <<03752>>32528000
                                                               <<03752>>32530000
                                                               <<03752>>32532000
                                                               <<03752>>32534000
<< load pointers and print tbufs if atp, else fall through >>  <<03752>>32536000
<< to next drt entry. >>                                       <<03752>>32538000
                                                               <<03752>>32540000
  if atp then                                                  <<03752>>32542000
  begin                                                        <<03752>>32544000
                                                               <<rwp31>>32546000
    lociltxl := lociltx;                                       <<rwp31>>32548000
    lociltxu := lociltx + double(assumed'iltx'size);           <<rwp31>>32550000
                                                               <<rwp31>>32552000
    split'tds := if core(lociltxl + double(iltx'iplab)) =      <<rwp31>>32554000
                core(lociltxu + double(iltx'iplab)) then       <<rwp31>>32556000
                true else false;                               <<rwp31>>32558000
                                                               <<rwp31>>32560000
    get'channel'type;                                          << adcc>>32562000
                                                               << adcc>>32564000
    tds'found := false;                                        << adcc>>32566000
    tds'count := 0;                                            <<rwp31>>32568000
    while tds'count < integer(if split'tds then 2 else 1)  do  <<rwp31>>32570000
    begin   <<each tds>>                                       <<rwp31>>32572000
                                                               <<rwp31>>32574000
      lociltx := if tds'count = 0 then lociltxl else lociltxu; <<rwp31>>32576000
                                                               <<rwp31>>32578000
      tds'seg'num := core(lociltx + double(iltx'tdsdseg));     <<rwp31>>32580000
                                                               <<rwp31>>32582000
  for index := 0 until max'pos'tds - 1 do                      << adcc>>32584000
      begin                                                    << adcc>>32586000
        if tds'seg'num <> 0 and                                << adcc>>32588000
           tds'seg'num = tds'nums'done(index)  then            << adcc>>32590000
           begin                                               << adcc>>32592000
             tds'found := true;                                << adcc>>32594000
             index := 99;                                      << adcc>>32596000
           end;                                                << adcc>>32598000
      end;                                                     << adcc>>32600000
                                                               << adcc>>32602000
  if not tds'found then                                        << adcc>>32604000
      begin   <<tds exists>>                                   <<rwp31>>32606000
                                                               <<rwp31>>32608000
        tos := core(lociltx + double(iltx'tdsbank));           <<rwp31>>32610000
        tos := core(lociltx + double(iltx'tdsaddr));           <<rwp31>>32612000
                                                               <<rwp31>>32614000
        loctds := tos;                                         <<rwp31>>32616000
                                                               <<rwp31>>32618000
        if loctds <> 0d then                                   <<rwp31>>32620000
        begin   <<assume tds ok>>                              <<rwp31>>32622000
                                                               <<rwp31>>32624000
<< load location of tbuf table from tds. this is a tds-rel. >> <<rwp31>>32626000
<< pointer which is changed before printing the actual tbuf. >><<rwp31>>32628000
                                                               <<rwp31>>32630000
          loctbuf := loctds +  <<tbuf-table ptr word from tds>><<rwp31>>32632000
            double( core( loctds + double( tds'tbuf'table ))); <<rwp31>>32634000
                                                               <<rwp31>>32636000
          fmt'tbufs;   << do atp tbufs >>                      <<rwp31>>32638000
                                                               << adcc>>32640000
          tds'nums'done( num'tds'done +1) := tds'seg'num;      << adcc>>32642000
                                                               <<rwp31>>32644000
        end;   <<assume tds ok>>                               <<rwp31>>32646000
                                                               <<rwp31>>32648000
      end;  <<tds exists>>                                     <<rwp31>>32650000
                                                               <<rwp31>>32652000
      tds'count := tds'count + 1;   <<next tds on this drt>>   <<rwp31>>32654000
                                                               <<rwp31>>32656000
    end;  <<each tds>>                                         <<rwp31>>32658000
                                                               <<rwp31>>32660000
  end;  << if atp >>                                           <<rwp31>>32662000
                                                               <<03752>>32664000
next'drt:  << done or not atp, try next drt entry >>           <<03752>>32666000
end;  << for >>                                                <<03752>>32668000
                                                               <<03752>>32670000
bailout1:                                                      <<03752>>32672000
end;  << procedure printtbuf >>                                <<03752>>32674000
                                                                        32676000
$page "PRINTDIT: Format DIT"                                            32678000
$control segment=tablestg                                               32680000
comment                                                                 32682000
                                                                        32684000
purpose:                                                       <<rwp31>>32686000
                   ***  printdit  ***                          <<rwp31>>32688000
                                                               <<rwp31>>32690000
   this procedure finds and prints all device information      <<rwp31>>32692000
   tables on the system. it also serves as a caller for        <<rwp31>>32694000
   other specialized procedures which also do this, such       <<rwp31>>32696000
   as do'atp'dits, dodsdit, and do'mrje'dits.                  <<rwp31>>32698000
                                                               <<rwp31>>32700000
input parameters:                                              <<rwp31>>32702000
   none.                                                       <<rwp31>>32704000
                                                               <<rwp31>>32706000
output parameters:                                             <<rwp31>>32708000
   none.                                                       <<rwp31>>32710000
                                                               <<rwp31>>32712000
globals referenced:                                            <<rwp31>>32714000
   pageno    current page number of dpan listing.              <<rwp31>>32716000
   series'33'thru'mm  algorithm to return system model number. <<s7919>>32718000
   new'ilt'format  alogrithm to return format of ilt.          <<rwp31>>32720000
                                                               <<rwp31>>32722000
globals altered:                                               <<rwp31>>32724000
   ditfpg    page number of start of dit formatting.           <<rwp31>>32726000
   bbuf(*)  output buffer for printing.                        <<rwp31>>32728000
   pbuf      pointer into output buffer.                       <<rwp31>>32730000
   dbuffer(*)  output buffer for printing.                     <<rwp31>>32732000
                                                               <<rwp31>>32734000
procedures called:                                             <<rwp31>>32736000
   printline                                                   <<rwp31>>32738000
   skiplines                                                   <<rwp31>>32740000
   putnum                                                      <<rwp31>>32742000
   putnump                                                     <<rwp31>>32744000
   ascii                                                       <<rwp31>>32746000
   newpage                                                     <<rwp31>>32748000
   test'drt'info                                               <<rwp31>>32750000
   core                                                        <<rwp31>>32752000
   getdrt                                                      <<rwp31>>32754000
   blankbuf                                                    <<rwp31>>32756000
   do'atp'dits                                                 <<rwp31>>32758000
   print'octal'dit                                             <<rwp31>>32760000
   dodsdit                                                     <<rwp31>>32762000
   do'mrje'dits                                                <<rwp31>>32764000
                                                               <<rwp31>>32766000
data structures:                                               <<rwp31>>32768000
   none.                                                       <<rwp31>>32770000
                                                               <<rwp31>>32772000
algorithm:                                                     <<rwp31>>32774000
   the device reference table is scanned from lowest to        <<rwp31>>32776000
   highest drt entry. for every active drt, the drt is used    <<rwp31>>32778000
   to get to the ilt.                                          <<rwp31>>32780000
                                                               <<rwp31>>32782000
   from the ilt we get the number of units, the first active   <<rwp31>>32784000
   unit, and the address of the iltx. from the iltx we         <<rwp31>>32786000
   determine whether the drt is an atp or not.                 <<rwp31>>32788000
                                                               <<rwp31>>32790000
   we use the ilt to get to the dit for the first active unit, <<rwp31>>32792000
   and then use the dit to get to the dlt. from the dlt we     <<rwp31>>32794000
   get the device type of the first active device, so we know  <<rwp31>>32796000
   a little more about what we want to print in the header for <<rwp31>>32798000
   that drt (do we need controller status, etc).               <<rwp31>>32800000
                                                               <<rwp31>>32802000
   next we enter a large loop to step through every active     <<rwp31>>32804000
   unit in that ilt. from each dit, we get the ldev and use it <<rwp31>>32806000
   to get to the lpdt. from the lpdt we get the subtype for    <<rwp31>>32808000
   that ldev. also for each unit we get the device type for    <<rwp31>>32810000
   that ldev (can have printers/terminals mixed on a drt) from <<rwp31>>32812000
   the dlt.                                                    <<rwp31>>32814000
                                                               <<rwp31>>32816000
   finally we print a header for that unit, with its ldev/unit,<<rwp31>>32818000
   device type, subtype, and what all that is in english. we   <<rwp31>>32820000
   also find and print the important pointers in the dit in a  <<rwp31>>32822000
   second header.                                              <<rwp31>>32824000
                                                               <<rwp31>>32826000
   at this point, if the device is an atp, we call do'atp'dits <<rwp31>>32828000
   to handle all the nitty-gritty atp stuff and print the dit. <<rwp31>>32830000
   otherwise we print the dit ourselves.                       <<rwp31>>32832000
                                                               <<rwp31>>32834000
   next we call dodsdit to print any nitty-gritty ds stuff, and<<rwp31>>32836000
   go on to the next unit.                                     <<rwp31>>32838000
                                                               <<rwp31>>32840000
   before exiting, we call do'mrje'dits to let them do all this<<rwp31>>32842000
   for themselves.                                             <<rwp31>>32844000
                                                               <<rwp31>>32846000
error checking:                                                <<rwp31>>32848000
1. all dit printing will be skipped if the drt's can't be read,<<rwp31>>32850000
   but do'mrje'dits will still be called.                      <<rwp31>>32852000
2. if word 0 of a drt entry is -1, the entire drt is skipped.  <<rwp31>>32854000
3. if the drt# stored in the ilt doesn't match the expected drt<<rwp31>>32856000
   number, the entire drt is skipped.                          <<rwp31>>32858000
4. a bad ilt may result in a bad calculation of the number of  <<rwp31>>32860000
   units in that ilt. if the number of units found exceeds the <<rwp31>>32862000
   number of bits allowed for it, the entire drt is skipped.   <<rwp31>>32864000
5. a dit pointer of zero, or one pointing into low core below  <<rwp31>>32866000
   sysdb skips that one unit.                                  <<rwp31>>32868000
6. an unknown device type/subtype prints it as "NON-STANDARD". <<rwp31>>32870000
7. an atp subsystem cannot exist using the "old" ilt format.   <<rwp31>>32872000
                                                               <<rwp31>>32874000
modification history:                                          <<rwp31>>32876000
  23mar82 - randy pawell                                       <<rwp31>>32878000
    rewrote all of printdit to work with atp. fixed bugs that  <<rwp31>>32880000
    prohibited printing of random dit's. changed global algo-  <<rwp31>>32882000
    rithm new'ilt'format, which used an obsolete method to     <<rwp31>>32884000
    determine format of ilt. added procedure print'octal'dit   <<rwp31>>32886000
    to do the actual outputs, and included absolute address    <<rwp31>>32888000
    in its outputs. added calls to print'octal'dit for dodsdit <<rwp31>>32890000
    and do'mrje'dits so format would be same throughout the    <<rwp31>>32892000
    listing. also updated printtbuf for atp and included fixes <<rwp31>>32894000
    from this procedure.                                       <<rwp31>>32896000
                                                               <<rwp31>>32898000
  16jan83 - randy pawell, ind                                  <<rwp31>>32900000
    moved bulk of code for atp formatting to new procedure     <<rwp31>>32902000
    do'atp'dits, since it was getting too complex for a generic<<rwp31>>32904000
    dit-printing procedure. added code for device type 3, which<<rwp31>>32906000
    is now a 7933 disc. there are also changes to the          <<rwp31>>32908000
    print'octal'dit procedure to let it do hexadecimal & bytes.<<rwp31>>32910000
    also now allow 32 units (full 5 bits) on non-atp ilt's,    <<rwp31>>32912000
    this was only 16.                                          <<rwp31>>32914000
                                                               <<rwp31>>32916000
;                                                                       32918000
                                                               <<03752>>32920000
procedure printdit;                                            <<03752>>32922000
begin                                                          <<03752>>32924000
                                                               <<03752>>32926000
  double                                                       <<03752>>32928000
                                                               <<03752>>32930000
<< absolute addresses of word 0 of the specified tables: >>    <<03752>>32932000
                                                               <<03752>>32934000
         locilt,      << interrupt linkage table from drt   >> <<03752>>32936000
         lociltx,     << interrupt linkage table extension  >> <<03752>>32938000
         locdit,      << device information table from ilt  >> <<03752>>32940000
         locdlt,      << driver linkage table from dit      >> <<03752>>32942000
                                                               <<03752>>32944000
<< miscellaneous: >>                                           <<03752>>32946000
         nunits,      << number of units for drt from addr's>> <<03752>>32948000
         scratchd;    << type double scratch variable       >> <<03752>>32950000
                                                               <<03752>>32952000
integer                                                        <<03752>>32954000
         highdrt,     << highest drt# from fixed low memory >> <<03752>>32956000
         lowdrt,      << lowest drt# according to cpu type  >> <<03752>>32958000
         drtno,       << drt# for loop counter              >> <<03752>>32960000
         pi'offset,   << offset within drt entry for pi wd  >> <<03752>>32962000
         dbi'offset,  << offset within drt entry for dbi wd >> <<03752>>32964000
         ditsize,     << # words in dit, from dlt           >> <<03752>>32966000
         devtype,     << device type, from dlt              >> <<03752>>32968000
         devsubtype,  << device subtype, from lpdt          >> <<03752>>32970000
         devunit,     << device unit#, for loop counter     >> <<03752>>32972000
         ldev,        << logical device# from dit           >> <<03752>>32974000
         syscon,      << ldev# of sys console from fixed mem>> <<03752>>32976000
         ix,          << loop cntr for active-dit lookahead >> <<03752>>32978000
         scratchi;    << type integer scratch variable      >> <<03752>>32980000
                                                               <<03752>>32982000
logical                                                        <<03752>>32984000
         icf,         << flag for cpu type: 0=siii, 1=hpib  >> <<03752>>32986000
         atp,         << flag for table structure, 0=non-atp>> <<03752>>32988000
         valid'drts,  << flag returned from test'drt'info   >> <<03752>>32990000
         ditnotfound, << flag for first-active-dit lookahead>> <<03752>>32992000
         scratchl;    << type logical scratch variable      >> <<03752>>32994000
                                                               <<03752>>32996000
logical array                                                  <<03752>>32998000
         scrd0(*) = scratchd,  << access to msw of scratchd >> <<03752>>33000000
         scrd1(*) = scrd0(1),  << access to lsw of scratchd >> <<03752>>33002000
         lunits(*)= nunits;    << access to lsw of nunits   >>          33004000
                                                               <<03752>>33006000
                                                               <<03752>>33008000
equate                                                         <<03752>>33010000
                                                               <<03752>>33012000
<< these equates define the order of words in the drt entry >> <<03752>>33014000
<< for hpib systems (s30, 33, 40, 44, 64, starfish) and non->> <<03752>>33016000
<< hpib systems (sii, siii): >>                                <<03752>>33018000
                                                               <<03752>>33020000
       drt'dbi'hpib     = 1,  <<disp to drt's dbi wd for hpib>><<03752>>33022000
       drt'pi'hpib      = 2,  <<disp to drt's pi wd for hpib >><<03752>>33024000
                                                               <<03752>>33026000
       drt'dbi'nonhpib  = 2,  <<disp to drt's dbi wd for siii>><<03752>>33028000
       drt'pi'nonhpib   = 1,  <<disp to drt's pi wd for siii >><<03752>>33030000
                                                               <<03752>>33032000
<< the following equates define the order of words in the >>   <<03752>>33034000
<< 'old' ilt format: >>                                        <<03752>>33036000
                                                               <<03752>>33038000
       ilt'icntrl'old   = 0,                                   <<03752>>33040000
       ilt'isiop'old    = 1,                                   <<03752>>33042000
       ilt'iditp0'old   = 4,                                   <<03752>>33044000
                                                               <<03752>>33046000
<< these equates define the order of words in the 'new' ilt >> <<03752>>33048000
<< format: >>                                                  <<03752>>33050000
                                                               <<03752>>33052000
       ilt'icntrl'new   = 7,                                   <<03752>>33054000
       ilt'isiop'new    = 8,                                   <<03752>>33056000
       ilt'istap'new    = 9,                                   <<03752>>33058000
       ilt'iditp0'new   = 14,                                  <<03752>>33060000
                                                               <<03752>>33062000
<< these equates define the order of words in the >>           <<03752>>33064000
<< ilt extension (iltx) as used with the atp: >>               <<03752>>33066000
                                                               <<03752>>33068000
       iltx'iplab       = 5,                                   <<rwp31>>33070000
                                                               <<03752>>33072000
<< these equates define the order of words in the dit header,>><<03752>>33074000
<< according to the semi-standard format: >>                   <<03752>>33076000
                                                               <<03752>>33078000
       dit'dflags       = 0,                                   <<03752>>33080000
       dit'dlink        = 1,                                   <<03752>>33082000
       dit'dioqp        = 2,                                   <<03752>>33084000
       dit'dldev        = 3,                                   <<03752>>33086000
       dit'ddltp        = 4,                                   <<03752>>33088000
       dit'diltp        = 5,                                   <<03752>>33090000
       dit'dstat        = 6,                                   <<03752>>33092000
       dit'dserr        = 7,                                   <<03752>>33094000
       dit'cnfgunit     = 10,                                  <<mpev >>33096000
                                                               <<03752>>33098000
<< the following equates define the order of words in >>       <<03752>>33100000
<< other applicable tables: >>                                 <<03752>>33102000
                                                               <<03752>>33104000
       dlt'dtype      = 5,   <<offset to dtype word in dlt>>   <<03752>>33106000
                                                               <<03752>>33108000
       maxunits'atp     = 96,  <<max #units in atp subsystem >><<03752>>33110000
       maxunits'nonatp  = 32,  <<max #units, other subsystems>><<rwp31>>33112000
                                                               <<03752>>33114000
       lpdt'dst        = %10,  <<fixed low mem lpdt address>>  <<mpev >>33116000
       sysconsole'wd   = %1074; <<fixed low mem console ldev#>><<03752>>33118000
                                                               <<03752>>33120000
                                                               <<03752>>33122000
                                                               <<03752>>33124000
                                                               <<03752>>33126000
                     <<******* main *******>>                  <<03752>>33128000
                                                               <<03752>>33130000
                                                               <<03752>>33132000
newpage;                                                       <<03752>>33134000
ditfpg := pageno;  <<store global page# for index >>           <<03752>>33136000
                                                               <<03752>>33138000
                                                               <<03752>>33140000
move dbuffer(23) :=                                            <<03752>>33142000
  "******    DEVICE INFORMATION TABLES    ******";             <<03752>>33144000
printline;                                                     <<03752>>33146000
skiplines (3);                                                 <<03752>>33148000
                                                               <<03752>>33150000
                                                               <<03752>>33152000
test'drt'info(lowdrt,highdrt,valid'drts,0);                    <<03752>>33154000
                                                               <<03752>>33156000
if not valid'drts                                              <<03752>>33158000
then go bailout;                                               <<03752>>33160000
                                                               <<03752>>33162000
for drtno := lowdrt until highdrt <<step 1>> do                <<03752>>33164000
 begin                                                         <<03752>>33166000
   icf := ( series'33'thru'mm );                               <<s7919>>33168000
   if integer (getdrt(drtno,0)) = -1  <<get drt word 0 >>      <<03752>>33170000
   then go bump;                                               <<03752>>33172000
                                                               <<03752>>33174000
                                                               <<03752>>33176000
                                                               <<03752>>33178000
                                                               <<03752>>33180000
  << dbi and pi words are reversed for siii, hpib systems,>>   <<03752>>33182000
  << so get correct offsets here. >>                           <<03752>>33184000
                                                               <<03752>>33186000
   dbi'offset := ( if series'33'thru'mm then                   <<s7919>>33188000
                    drt'dbi'hpib  else  drt'dbi'nonhpib );     <<03752>>33190000
   pi'offset  := ( if series'33'thru'mm then                   <<s7919>>33192000
                    drt'pi'hpib  else  drt'pi'nonhpib );       <<03752>>33194000
                                                               <<03752>>33196000
                                                               <<03752>>33198000
                                                               <<03752>>33200000
  << load address of word 0 of ilt for this drt >>             <<03752>>33202000
  << from dbi word in drt entry                 >>             <<03752>>33204000
                                                               <<03752>>33206000
   locilt := double(getdrt(drtno,dbi'offset));                 <<03752>>33208000
                                                               <<03752>>33210000
                                                               <<03752>>33212000
                                                               <<03752>>33214000
<< check for old ilt format or series iii. set     >>          <<03752>>33216000
<< icf false if these conditions exist, else true. >>          <<03752>>33218000
<< new ilt format is determined by a global define.>>          <<03752>>33220000
                                                               <<03752>>33222000
icf := if (series'33'thru'mm) or new'ilt'format                <<s7919>>33224000
          then true else false;                                <<03752>>33226000
                                                               <<03752>>33228000
                                                               <<03752>>33230000
                                                               <<03752>>33232000
<< load channel/device (drt number) from correct kind >>       <<03752>>33234000
<< of ilt table. >>                                            <<03752>>33236000
<< compare loop's actve drt# with drt# stored in the ilt.  >>  <<03752>>33238000
<< if not the same, assume bad data and skip this drt. >>      <<03752>>33240000
                                                               <<03752>>33242000
scratchl := core(locilt + double(( if icf then                 <<03752>>33244000
             ilt'icntrl'new  else  ilt'icntrl'old )));         <<03752>>33246000
                                                               <<03752>>33248000
                                                               <<03752>>33250000
if integer(scratchl).(7:9) <> drtno then go bump;              <<03752>>33252000
                                                               <<03752>>33254000
                                                               <<03752>>33256000
                                                               <<03752>>33258000
<< load double dit pointer for unit 0 from ilt >>              <<03752>>33260000
                                                               <<03752>>33262000
tos := 0;                                                      <<03752>>33264000
tos := core(  locilt + double(( if icf then                    <<03752>>33266000
               ilt'iditp0'new  else  ilt'iditp0'old )))        <<03752>>33268000
         + %1000;    << later calc's use sysdb addresses  >>   <<03752>>33270000
locdit := tos;                                                 <<03752>>33272000
                                                               <<03752>>33274000
                                                               <<03752>>33276000
                                                               <<03752>>33278000
<< load isiop word from ilt. will be used to find the >>       <<03752>>33280000
<< number of units and for the atp check.             >>       <<03752>>33282000
<< note that isiop is a sysdb-rel. address.           >>       <<03752>>33284000
                                                               <<03752>>33286000
tos := 0;                                                      <<03752>>33288000
tos := core( locilt + double(( if icf then                     <<03752>>33290000
              ilt'isiop'new  else  ilt'isiop'old )));          <<03752>>33292000
nunits := tos;       << save for #units calculation.     >>    <<03752>>33294000
                                                               <<03752>>33296000
<< save absolute address of iltx word 0 >>                              33298000
lociltx := double(logical(nunits) + %1000);                             33300000
                                                               <<03752>>33302000
                                                               <<03752>>33304000
                                                               <<03752>>33306000
<< calculate number of units in this ilt                 >>    <<03752>>33308000
<< by subtracting address of iltx from 1st ditp          >>    <<03752>>33310000
                                                               <<03752>>33312000
   if icf then << new ilt format >>                            <<03752>>33314000
   begin                                                       <<03752>>33316000
   nunits := nunits - (locilt + double( ilt'iditp0'new )       <<03752>>33318000
              - %1000d);   << since nunits was sysdb-rel.  >>  <<03752>>33320000
                                                               <<03752>>33322000
<< subtract length of istap area if exists >>                  <<03752>>33324000
   if core( locilt + double( ilt'istap'new )) <> 0             <<03752>>33326000
     then nunits := nunits                                     <<03752>>33328000
    - double(core( locilt + double( ilt'isiop'new )))          <<03752>>33330000
    + double(core( locilt + double( ilt'istap'new )));         <<03752>>33332000
   end                                                         <<03752>>33334000
                                                               <<03752>>33336000
   else  << old ilt format >>                                  <<03752>>33338000
     nunits := nunits - ( locilt + double( ilt'iditp0'old )    <<03752>>33340000
                      -%1000d); << dit ptrs are sysdb-rel. >>  <<03752>>33342000
                                                               <<03752>>33344000
                                                               <<03752>>33346000
                                                               <<03752>>33348000
<< atp-software devices all duplicate the pi word in the >>    <<03752>>33350000
<< drt entry in word 5 of the iltx. check for this here  >>    <<03752>>33352000
<< and set flag if atp. >>                                     <<03752>>33354000
                                                               <<03752>>33356000
scratchl := core( lociltx + double( iltx'iplab ));             <<rwp31>>33358000
                                                               <<03752>>33360000
atp := (if getdrt(drtno, pi'offset) = scratchl                 <<03752>>33362000
        then true else false);                                 <<03752>>33364000
                                                               <<03752>>33366000
                                                               <<03752>>33368000
                                                               <<03752>>33370000
<< scan through unit ditp's for first configured unit# >>      <<03752>>33372000
                                                               <<03752>>33374000
ix := 1;                                                       <<03752>>33376000
ditnotfound := true;                                           <<03752>>33378000
                                                               <<03752>>33380000
while ix <= integer(nunits)     << exit if no units cnfg'd >>  <<03752>>33382000
            and ditnotfound do  << exit if find cnfg'd unit>>  <<03752>>33384000
                                                               <<03752>>33386000
   if (locdit - %1000d) > %377d    << true if locdit less  >>  <<03752>>33388000
     then ditnotfound := false     << than or = to %1000d  >>  <<03752>>33390000
                                                               <<03752>>33392000
   else                                                        <<03752>>33394000
   begin                                                       <<03752>>33396000
   << load next double ditp in case it is active >>            <<03752>>33398000
     tos := 0;                                                 <<03752>>33400000
     tos := core( locilt + double(( if icf then                <<03752>>33402000
               ilt'iditp0'new  else  ilt'iditp0'old )          <<03752>>33404000
                    + ix )) << offset into unit list in ilt>>  <<03752>>33406000
                   + %1000; << since sysdb-relative        >>  <<03752>>33408000
     locdit := tos;                                            <<03752>>33410000
     ix := ix + 1;   << next unit's dit pointer >>             <<03752>>33412000
  end;                                                         <<03752>>33414000
                                                               <<03752>>33416000
                                                               <<03752>>33418000
                                                               <<03752>>33420000
<< at this point we hopefully have the ditp to a configured>>  <<03752>>33422000
<< unit. now we wish to find out the device type to see if >>  <<03752>>33424000
<< controller information should be printed along with the >>  <<03752>>33426000
<< drt-number header. device type comes from the dlt...    >>  <<03752>>33428000
                                                               <<03752>>33430000
tos := 0;                                                      <<03752>>33432000
tos := core( locdit + double( dit'ddltp ))                     <<03752>>33434000
                 +%1000;  << since dlt addr is sysdb-rel.  >>  <<03752>>33436000
locdlt := tos;                                                 <<03752>>33438000
scratchl := core( locdlt + double( dlt'dtype ));               <<03752>>33440000
devtype :=                                                     <<03752>>33442000
  integer (scratchl.(8:8));  << get device type from dlt   >>  <<03752>>33444000
                                                               <<03752>>33446000
                                                               <<03752>>33448000
                                                               <<03752>>33450000
<< device types 17 through 19 have only one unit   >> <<*?*>>  <<03752>>33452000
<< configured.  the above algorithm, in these      >>          <<03752>>33454000
<< cases, would return garbage to 'nunits'.        >>          <<03752>>33456000
                                                               <<03752>>33458000
if 17 <= devtype <= 19 then nunits := 1d;                      <<03752>>33460000
                                                               <<03752>>33462000
                                                               <<03752>>33464000
                                                               <<03752>>33466000
<< if nunits calculated out to more than maximum number >>     <<03752>>33468000
<< expected, then assume bad data and skip this drt. >>        <<03752>>33470000
                                                               <<03752>>33472000
if lunits(1) > ( if atp then maxunits'atp                      <<03752>>33474000
                      else maxunits'nonatp )  then go bump;    <<03752>>33476000
                                                               <<03752>>33478000
                                                               <<03752>>33480000
                                                               <<03752>>33482000
<< load active drt# into output buffer >>                      <<03752>>33484000
                                                               <<03752>>33486000
blankbuf;                                                      <<03752>>33488000
move bbuf := "DRT NO";         << stuff header >>              <<03752>>33490000
@pbuf := @bbuf + 8;                                            <<03752>>33492000
ascii ( drtno, 10, pbuf );     << stuff value >>               <<03752>>33494000
                                                               <<03752>>33496000
                                                               <<03752>>33498000
                                                               <<03752>>33500000
<< load dflags word from dit. if not a terminal, sslc, or>>    <<03752>>33502000
<< hsi then also print controller status if there are    >>    <<03752>>33504000
<< multiple units on this drt entry.                     >>    <<03752>>33506000
                                                               <<03752>>33508000
scratchl := core( locdit + double( dit'dflags ));              <<03752>>33510000
if scratchl.(0:1) = 0         << bit 0 = 1 for terminals >>    <<03752>>33512000
  then if (not(18<=devtype<=19))  << skip if sslc or hsi >>    <<03752>>33514000
        and ix < integer(nunits) then                          <<03752>>33516000
  begin                                                        <<03752>>33518000
    if not icf then                                            <<03752>>33520000
    begin                                                      <<03752>>33522000
      move bbuf(40) := "CONTROLLER STATUS =";                  <<03752>>33524000
      @pbuf := @bbuf + 60;                                     <<03752>>33526000
      scratchl := core( locdit + double( dit'dstat ));         <<03752>>33528000
      putnum (scratchl);     << load device status >>          <<03752>>33530000
    end;                                                       <<03752>>33532000
    move bbuf(70) := "CONTROLLER ERROR STATUS =";              <<03752>>33534000
    @pbuf := @bbuf + 96;                                       <<03752>>33536000
    scratchl := core(locdit + double( dit'dserr ));            <<03752>>33538000
    putnum (scratchl);       << load error status >>           <<03752>>33540000
  end;                                                         <<03752>>33542000
                                                               <<03752>>33544000
printline;    <<output the drt / controller header>>           <<03752>>33546000
skiplines (1);                                                 <<03752>>33548000
                                                               <<03752>>33550000
                                                               <<03752>>33552000
<< if atp, also output data relevant to the tds(s), since >>   <<rwp31>>33554000
<< there's only one (or two) per drt. >>                       <<rwp31>>33556000
                                                               <<rwp31>>33558000
if atp then                                                    <<rwp31>>33560000
begin                                                          <<rwp31>>33562000
  do'atp'drt'hdr(lociltx, locdit);                             <<rwp31>>33564000
end;                                                           <<rwp31>>33566000
                                                               <<rwp31>>33568000
                                                               <<rwp31>>33570000
                                                               <<rwp31>>33572000
                                                               <<03752>>33574000
<< obtain the ldev# of the system console from fixed low >>    <<03752>>33576000
<< memory, for use later during the unit loop.           >>    <<03752>>33578000
                                                               <<03752>>33580000
scratchd := double( sysconsole'wd );                           <<03752>>33582000
syscon := integer(core(scratchd));                             <<03752>>33584000
                                                               <<03752>>33586000
                <<*******************>>                        <<03752>>33588000
                                                               <<03752>>33590000
                                                               <<03752>>33592000
                                                               <<03752>>33594000
<< print all dit's for all configured units in this ilt >>     <<03752>>33596000
                                                               <<03752>>33598000
for devunit := ix until integer (nunits) do                    <<03752>>33600000
begin                                                          <<03752>>33602000
                                                               <<03752>>33604000
<< skip any absent dit's encountered along the way >>          <<03752>>33606000
                                                               <<03752>>33608000
  if (locdit-%1000d) < 1d  then go bumpa;                      <<03752>>33610000
                                                               <<03752>>33612000
                                                               <<03752>>33614000
<<get the ldev# from the dldev word of the dit >>              <<03752>>33616000
                                                               <<03752>>33618000
ldev := integer (core(locdit + double(dit'dldev)));            <<mpev >>33620000
                                                               <<03752>>33622000
<< use the ldev# as an index into the lpdt to >>               <<03752>>33624000
<< get the subtype.                           >>               <<03752>>33626000
                                                               <<03752>>33628000
scratchd := dsttoaddr(%15);  << get lpdt base >>               <<mpev >>33630000
devsubtype:=integer(core(double(ldev*4+1)+scratchd)).(12:4);   <<03752>>33632000
                                                               <<03752>>33634000
<< get the dlt address from the ddltp word of the dit. then >> <<03752>>33636000
<< use the dtype word from the dlt to get the device type >>   <<03752>>33638000
<< and the length of the dit (for the octal dump).        >>   <<03752>>33640000
                                                               <<03752>>33642000
tos := 0;                                                      <<03752>>33644000
tos := core( locdit + double( dit'ddltp ))                     <<03752>>33646000
                 +%1000;  << since dlt addr is sysdb-rel.  >>  <<03752>>33648000
locdlt := tos;                                                 <<03752>>33650000
scratchl := core(locdlt + double( dlt'dtype ));                <<03752>>33652000
devtype :=                                                     <<03752>>33654000
  integer (scratchl.(8:8));  << get device type from dlt   >>  <<03752>>33656000
ditsize := integer(scratchl.(0:8));                            <<03752>>33658000
                                                               <<03752>>33660000
                                                               <<03752>>33662000
                                                               <<03752>>33664000
<< decode each unit's device type into a readable name. >>     <<03752>>33666000
                                                               <<03752>>33668000
if devtype = 0 then                                            <<03752>>33670000
begin                                                          <<03752>>33672000
  if 0 <= devsubtype <= 2 then                                 <<03752>>33674000
    move bbuf(12) := "(CARTRIDGE DISC DRIVE)"                  <<03752>>33676000
  else                                                         <<03752>>33678000
  if devsubtype = 3 then                                       <<03752>>33680000
    move bbuf(12) := "(DISC FILE)"                             <<03752>>33682000
  else                                                         <<03752>>33684000
  if 4 <= devsubtype <= 12 then                                <<03752>>33686000
    move bbuf(12) := "(DISC DRIVE)"                            <<03752>>33688000
  else   <<unknown subtype>>                                   <<03752>>33690000
    move bbuf(12) := "(NON-STANDARD DISC)";                    <<03752>>33692000
end;   <<if devtype=0>>                                        <<03752>>33694000
                                                               <<03752>>33696000
if devtype = 1                                                 <<03752>>33698000
   then move bbuf(12) :=                                       <<03752>>33700000
           "(FIXED-HEAD DISC)";                                <<03752>>33702000
if devtype = 2                                                 <<03752>>33704000
   then move bbuf(12) :=                                       <<03752>>33706000
           "(FLEXIBLE DISC DRIVE)";                            <<03752>>33708000
if devtype = 3                                                 <<rwp31>>33710000
   then move bbuf(12) :=                                       <<rwp31>>33712000
           "(DISC DRIVE)";                                     <<rwp31>>33714000
if devtype = 8                                                 <<03752>>33716000
   then move bbuf(12) :=                                       <<03752>>33718000
           "(CARD READER)";                                    <<03752>>33720000
if devtype = 9                                                 <<03752>>33722000
   then move bbuf(12) :=                                       <<03752>>33724000
           "(PAPER-TAPE READER)";                              <<03752>>33726000
if devtype = 16                                                <<03752>>33728000
   then move bbuf(12) :=                                       <<03752>>33730000
           "(TERMINAL)";                                       <<03752>>33732000
if devtype = 17                                                <<03752>>33734000
   then move bbuf(12) :=                                       <<03752>>33736000
           "(INTELLIGENT NETWK PROCESSOR)";                    <<03752>>33738000
if devtype = 18                                                <<03752>>33740000
   then move bbuf(12) :=                                       <<03752>>33742000
           "(SYNC. SINGLE-LINE CNTRL)";                        <<03752>>33744000
if devtype = 19                                                <<03752>>33746000
   then move bbuf(12) :=                                       <<03752>>33748000
           "(HARDWIRED SERIAL INTERFACE)";                     <<03752>>33750000
if devtype = 20                                                <<03752>>33752000
   then move bbuf(12) :=                                       <<03752>>33754000
           "(PRINTING READER/PUNCH)";                          <<03752>>33756000
if devtype = 23                                                <<03752>>33758000
   then move bbuf(12) :=                                       <<03752>>33760000
           "(PROGRAMMABLE CONTROLLER)";                        <<03752>>33762000
if devtype = 24                                                <<03752>>33764000
   then move bbuf(12) :=                                       <<03752>>33766000
           "(MAGNETIC TAPE UNIT)";                             <<03752>>33768000
if devtype = 32                                                <<03752>>33770000
   then move bbuf(12) :=                                       <<03752>>33772000
           "(LINE PRINTER)";                                   <<03752>>33774000
if devtype = 33                                                <<03752>>33776000
   then move bbuf(12) :=                                       <<03752>>33778000
           "(CARD PUNCH)";                                     <<03752>>33780000
if devtype = 34                                                <<03752>>33782000
   then move bbuf(12) :=                                       <<03752>>33784000
           "(PAPER TAPE PUNCH)";                               <<03752>>33786000
if 35 <= devtype <= 37                                         <<03752>>33788000
   then move bbuf(12) :=                                       <<03752>>33790000
           "(PLOTTER)";                                        <<03752>>33792000
                                                               <<03752>>33794000
                                                               <<03752>>33796000
if bbuf(12) = "  "       <<unknown type>>                      <<03752>>33798000
    then move bbuf(12) :=                                      <<03752>>33800000
                   "(NON-STANDARD DEVICE)";                    <<03752>>33802000
                                                               <<03752>>33804000
                                                               <<03752>>33806000
<< whether the device type has been recognized or not, we   >> <<03752>>33808000
<< print device as 'system disc' if ldev is 1, or as 'system>> <<03752>>33810000
<< console' if the ldev is the same as that in low memory.  >> <<03752>>33812000
<< we need enough trailing blanks to cover "DISC DRIVE" msgs>> <<rwp31>>33814000
                                                               <<03752>>33816000
if ldev = 1                                                    <<03752>>33818000
   then move bbuf(12) :=                                       <<03752>>33820000
           "(SYSTEM DISC)               ";                     <<03752>>33822000
if ldev = syscon                                               <<03752>>33824000
   then move bbuf(12) :=                                       <<03752>>33826000
           "(SYSTEM CONSOLE/TERMINAL)   ";                     <<03752>>33828000
                                                               <<03752>>33830000
                                                               <<03752>>33832000
                                                               <<03752>>33834000
<< now add the type and subtype to the unit header. >>         <<03752>>33836000
                                                               <<03752>>33838000
move bbuf(45) := "TYPE";                                       <<03752>>33840000
@pbuf := @bbuf + 50;                                           <<03752>>33842000
ascii ( devtype, 10, pbuf );                                   <<03752>>33844000
                                                               <<03752>>33846000
move bbuf(57) := "SUBTYPE";                                    <<03752>>33848000
@pbuf := @bbuf + 65;                                           <<03752>>33850000
ascii ( devsubtype, 10, pbuf );                                <<03752>>33852000
                                                               <<03752>>33854000
printline;    <<output the device-type header>>                <<03752>>33856000
skiplines (1);                                                 <<03752>>33858000
                                                               <<03752>>33860000
                                                               <<03752>>33862000
                                                               <<03752>>33864000
<< get unit# from the dldev word of the dit. >>                <<03752>>33866000
                                                               <<03752>>33868000
  move bbuf (12) := "UNIT";                                    <<03752>>33870000
  scratchl :=                                                  <<03752>>33872000
    core (locdit + double (dit'cnfgunit));                     <<mpev >>33874000
  if atp then                                                  <<03752>>33876000
    scratchi := integer (scratchl)                             <<mpev >>33878000
      else scratchi := integer(scratchl.(8:8));                <<03752>>33880000
  @pbuf := @bbuf + 17;                                         <<03752>>33882000
  ascii ( scratchi, 10, pbuf );                                <<03752>>33884000
                                                               <<03752>>33886000
<< output the ldev# obtained earlier from the dit. >>          <<03752>>33888000
  move bbuf (20) := "LOGICAL DEV";                             <<03752>>33890000
  @pbuf := @bbuf + 32;                                         <<03752>>33892000
  ascii ( ldev, 10, pbuf );                                    <<03752>>33894000
                                                               <<03752>>33896000
<< output the dflags word from the dit in octal. >>            <<03752>>33898000
  move bbuf (37) := "FLAGS =";                                 <<03752>>33900000
  scratchl := core( locdit + double( dit'dflags ));            <<03752>>33902000
  @pbuf := @bbuf + 45;                                         <<03752>>33904000
  putnum (scratchl);                                           <<03752>>33906000
                                                               <<03752>>33908000
<< output the next ditp in octal, unless hsi or >> <<*?*>>     <<03752>>33910000
<< sslc, which have only one unit. >>                          <<03752>>33912000
  if not (17 <= devtype <= 19) then                            <<03752>>33914000
  begin                                                        <<03752>>33916000
    move bbuf (55) := "NEXT DIT =";                            <<03752>>33918000
    scratchl := core( locdit + double( dit'dlink ));           <<03752>>33920000
    @pbuf := @bbuf + 66;                                       <<03752>>33922000
    putnum (scratchl);                                         <<03752>>33924000
  end;                                                         <<03752>>33926000
                                                               <<03752>>33928000
<< output pointer to dlt from dit in octal. >>                 <<03752>>33930000
  move bbuf (74) := "DLTP =";                                  <<03752>>33932000
  scratchl := core( locdit + double( dit'ddltp ));             <<03752>>33934000
  @pbuf := @bbuf + 81;                                         <<03752>>33936000
  putnum (scratchl);                                           <<03752>>33938000
                                                               <<03752>>33940000
<< output ilt entry pointer from dit in octal. >>              <<03752>>33942000
  move bbuf (89) := "ILTP =";                                  <<03752>>33944000
  scratchl := core( locdit + double( dit'diltp ));             <<03752>>33946000
  @pbuf := @bbuf + 96;                                         <<03752>>33948000
  putnum (scratchl);                                           <<03752>>33950000
                                                               <<03752>>33952000
<< output ioq head pointer from dit in octal. >>               <<03752>>33954000
  move bbuf (104) := "IOQP =";                                 <<03752>>33956000
  scratchl := core( locdit + double( dit'dioqp ));             <<03752>>33958000
  @pbuf := @bbuf + 111;                                        <<03752>>33960000
  putnum (scratchl);                                           <<03752>>33962000
                                                               <<03752>>33964000
  printline;  << output the line of standard pointers >>       <<03752>>33966000
  skiplines (1);                                               <<03752>>33968000
                                                               <<03752>>33970000
                                                               <<03752>>33972000
                                                               <<03752>>33974000
<< load additional pointers for atp >>                         <<03752>>33976000
  if atp then                                                  <<03752>>33978000
  begin                                                        <<03752>>33980000
                                                               <<03752>>33982000
                                                               <<rwp31>>33984000
  do'atp'dits(lociltx, locdit);                                <<rwp31>>33986000
                                                               <<rwp31>>33988000
end                                                            <<rwp31>>33990000
                                                               <<rwp31>>33992000
else                                                           <<rwp31>>33994000
begin    <<non-atp>>                                           <<rwp31>>33996000
                                                               <<03752>>33998000
                                                               <<03752>>34000000
                                                               <<03752>>34002000
                                                               <<03752>>34004000
<< now do octal dump of dit's >>                               <<03752>>34006000
                                                               <<03752>>34008000
move bbuf(12) := "DIT :";                                      <<03752>>34010000
printline;                                                     <<03752>>34012000
print'octal'dit ( locdit, logical(locdit-%1000d), ditsize );   <<03752>>34014000
                                                               <<03752>>34016000
end;  <<non-atp>>                                              <<rwp31>>34018000
                                                               <<03752>>34020000
move bbuf(20) := "           ";                                <<03752>>34022000
if 17 <= devtype <= 19 then                                    <<03752>>34024000
begin                                                          <<03752>>34026000
  skiplines (2);                                               <<03752>>34028000
  dodsdit (ldev, devtype );                                    <<03752>>34030000
end;                                                           <<03752>>34032000
                                                               <<03752>>34034000
                                                               <<03752>>34036000
                                                               <<03752>>34038000
  skiplines (2);   << we are done with this unit >>            <<03752>>34040000
                                                               <<03752>>34042000
                                                               <<03752>>34044000
bumpa:                                                         <<03752>>34046000
                                                               <<03752>>34048000
<< get next ditp from ilt >>                                   <<03752>>34050000
                                                               <<03752>>34052000
  tos := 0;                                                    <<03752>>34054000
  tos := core(  locilt + double(( if icf then                  <<03752>>34056000
                  ilt'iditp0'new  else  ilt'iditp0'old )       <<03752>>34058000
                       + devunit)) + %1000;                    <<03752>>34060000
                                                               <<03752>>34062000
  locdit := tos;     <<assign new dit address>>                <<03752>>34064000
                                                               <<03752>>34066000
end; <<for devunit>>                                           <<03752>>34068000
                                                               <<03752>>34070000
                                                               <<03752>>34072000
bump:  << go get next drt entry in drt table >>                <<03752>>34074000
                                                               <<03752>>34076000
end;  << while drt >>                                          <<03752>>34078000
                                                               <<03752>>34080000
                                                               <<03752>>34082000
bailout:  << quit because done or fatal error >>               <<03752>>34084000
                                                               <<03752>>34086000
do'mrje'dits;                                                  <<03752>>34088000
                                                               <<03752>>34090000
end;  <<procedure printdit>>                                   <<03752>>34092000
                                                                        34094000
$page "PRINT'OCTAL'DIT : Print DIT information to the listfile"<<rwp31>>34096000
$control segment=tablestg                                      <<r8331>>34098000
comment                                                                 34100000
                                                                        34102000
purpose:                                                       <<rwp31>>34104000
                 *** print'octal'dit ***                       <<rwp31>>34106000
                                                               <<rwp31>>34108000
   this procedure dumps a numeric listing of dump memory       <<rwp31>>34110000
   to the list file, 8 words per line, in hex, decimal, or     <<rwp31>>34112000
   octal (default), and in bytes or words (default), with      <<rwp31>>34114000
   optional ascii data included. the absolute address          <<rwp31>>34116000
   of the first word of each line is also printed, and a       <<rwp31>>34118000
   relative offset accompanies the address.                    <<rwp31>>34120000
                                                               <<rwp31>>34122000
input parameters:                                              <<rwp31>>34124000
   dit'start'addr  double-word start address for the area to   <<rwp31>>34126000
                   be printed.                                 <<rwp31>>34128000
   relative'index  this is a word counter for printing purposes<<rwp31>>34130000
                   only. the relative index typically used is  <<rwp31>>34132000
                   the offset from to the start address from th<<rwp31>>34134000
                   the beginning of the data structure the     <<rwp31>>34136000
                   start address resides in.                   <<rwp31>>34138000
   dit'length      (+) : number of words to print, in word     <<rwp31>>34140000
                   format (8 words max per line).              <<rwp31>>34142000
                   (-) : number of bytes to print, in byte     <<rwp31>>34144000
                   format (16 bytes max per line).             <<rwp31>>34146000
   asciiflag       (optional) : pass true to include an ascii  <<rwp31>>34148000
                   dump along the right margin. defaults to    <<rwp31>>34150000
                   no ascii dump if not passed, or if false.   <<rwp31>>34152000
   dispbase        (optional) : base to print display in.      <<rwp31>>34154000
                   (8)  : octal (default).                     <<rwp31>>34156000
                   (16) : hexadecimal.                         <<rwp31>>34158000
                   (10) : decimal.                             <<rwp31>>34160000
   rightbyte       (optional) : only applicable for byte-format<<rwp31>>34162000
                   dumps (when dit'length < 0). signals that   <<rwp31>>34164000
                   the dump should start on the right byte of  <<rwp31>>34166000
                   the first word if true, defaults to left    <<rwp31>>34168000
                   byte if not passed or if false. if start on <<rwp31>>34170000
                   right byte of word 0, next byte is left byte<<rwp31>>34172000
                   of word 1, then right byte of word 1, etc.  <<rwp31>>34174000
                                                               <<rwp31>>34176000
output parameters:                                             <<rwp31>>34178000
   returns an integer completion status, which may not be      <<rwp31>>34180000
   of much use unless one suspects a problem with this         <<rwp31>>34182000
   procedure. cannot detect output file i/o errors, since      <<rwp31>>34184000
   uses printline to do outputs, but can detect unusual error  <<rwp31>>34186000
   conditions or bad calling parameters. values returned are:  <<rwp31>>34188000
                                                               <<rwp31>>34190000
      0 ... no error.                                          <<rwp31>>34192000
      1 ... some sort of unexpected error.                     <<rwp31>>34194000
      2 ... bad calling parameters.                            <<rwp31>>34196000
      3 ... printline didn't work right (shouldn't occur).     <<rwp31>>34198000
                                                               <<rwp31>>34200000
globals referenced:                                            <<rwp31>>34202000
   none.                                                       <<rwp31>>34204000
                                                               <<rwp31>>34206000
globals altered:                                               <<rwp31>>34208000
   bbuf(*)  byte-oriented output buffer.                       <<rwp31>>34210000
   pbuf  byte pointer for output buffer.                       <<rwp31>>34212000
                                                               <<rwp31>>34214000
procedures called:                                             <<rwp31>>34216000
   hascii                                                      <<rwp31>>34218000
   putnum                                                      <<rwp31>>34220000
   ascii                                                       <<rwp31>>34222000
   printline                                                   <<rwp31>>34224000
   blankbuf                                                    <<rwp31>>34226000
                                                               <<rwp31>>34228000
data structures:                                               <<rwp31>>34230000
   columns used in the output record are fixed by equates,     <<rwp31>>34232000
   and some differ between byte dumps and word dumps, for      <<rwp31>>34234000
   readability.                                                <<rwp31>>34236000
                                                               <<rwp31>>34238000
algorithm:                                                     <<rwp31>>34240000
   first check the optional parameters, and set any that were  <<rwp31>>34242000
   not passed to default values. if anything is illegal,       <<rwp31>>34244000
   then return with bad status and don't print anything.       <<rwp31>>34246000
                                                               <<rwp31>>34248000
   next set up the procedure to dump bytes if dit'length was   <<rwp31>>34250000
   negative, or words if it was positive. this involves        <<rwp31>>34252000
   setting the number of fields per line (16 if bytes or       <<rwp31>>34254000
   8 if words), and the length of each field. if bytes,        <<rwp31>>34256000
   then dit'length is changed to a positive value, but we      <<rwp31>>34258000
   will be counting bytes, not words, so we'll only            <<rwp31>>34260000
   really be stepping through half as many memory words.       <<rwp31>>34262000
                                                               <<rwp31>>34264000
   the procedure splits a byte dump in half with 3 extra       <<rwp31>>34266000
   spaces down the center, for readability, so if bytes, we    <<rwp31>>34268000
   also set this up now.                                       <<rwp31>>34270000
                                                               <<rwp31>>34272000
   now we enter a loop to read words from memory and load      <<rwp31>>34274000
   them into the output record, in the appropriate display     <<rwp31>>34276000
   base, and including the ascii equivalent if requested.      <<rwp31>>34278000
                                                               <<rwp31>>34280000
   it is important to note that in byte mode, we only load     <<rwp31>>34282000
   one byte per pass through the loop, and the byte that       <<rwp31>>34284000
   we load is the one referenced by a toggling flag,           <<rwp31>>34286000
   "left'right" which is toggled after each loop pass.         <<rwp31>>34288000
                                                               <<rwp31>>34290000
   after printing a value, we step the word counter to         <<rwp31>>34292000
   get the next memory word if in word mode, but if we         <<rwp31>>34294000
   are in byte mode, we don't step this counter until the      <<rwp31>>34296000
   left'right flag shows we've just printed the right-byte     <<rwp31>>34298000
   of a word.                                                  <<rwp31>>34300000
                                                               <<rwp31>>34302000
   when a line is filled, we print it out instead of loading   <<rwp31>>34304000
   the next word. then we loop some more to load more words.   <<rwp31>>34306000
                                                               <<rwp31>>34308000
   when the count is exhausted, we exit, but flush the last    <<rwp31>>34310000
   record if our field pointer has been incremented past the   <<rwp31>>34312000
   first field (indicating some data is loaded).               <<rwp31>>34314000
                                                               <<rwp31>>34316000
   no extra linefeeds are output--just data. any linefeeds     <<rwp31>>34318000
   should be done by the caller according to his particular    <<rwp31>>34320000
   requirements, before and/or after calling this procedure.   <<rwp31>>34322000
                                                               <<r8331>>34324000
modification history:                                          <<r8331>>34326000
  23mar82 - randy pawell                                       <<r8331>>34328000
    new procedure, replaces duplicate code in all dit          <<r8331>>34330000
    formatters.                                                <<r8331>>34332000
                                                               <<r8331>>34334000
  16jan83 - randy pawell, ind                                  <<r8331>>34336000
    updated with latest version from atpdsm. now does bytes    <<r8331>>34338000
    and ascii, and includes relative address printing.         <<r8331>>34340000
                                                               <<r8331>>34342000
                                                               <<rwp31>>34344000
;                                                                       34346000
                                                               <<03752>>34348000
                                                               <<03752>>34350000
                                                               <<03752>>34352000
integer procedure print'octal'dit                              <<rwp31>>34354000
   (dit'start'addr, relative'index, dit'length,                <<rwp31>>34356000
                      asciiflag, dispbase, rightbyte);         <<rwp31>>34358000
   value  dit'start'addr, relative'index, dit'length,          <<rwp31>>34360000
                      asciiflag, dispbase, rightbyte;          <<rwp31>>34362000
   double dit'start'addr;                                      <<rwp31>>34364000
   logical relative'index;                                     <<rwp31>>34366000
   integer dit'length;                                         <<rwp31>>34368000
   logical asciiflag;                                          <<rwp31>>34370000
   integer dispbase;                                           <<rwp31>>34372000
   logical rightbyte;                                          <<rwp31>>34374000
                                                               <<rwp31>>34376000
   option variable;                                            <<rwp31>>34378000
                                                               <<rwp31>>34380000
                                                               <<rwp31>>34382000
begin                                                          <<rwp31>>34384000
                                                               <<rwp31>>34386000
equate                                                         <<rwp31>>34388000
  dflt'base = 8,     <<default output base is octal>>          <<rwp31>>34390000
                                                               <<rwp31>>34392000
<<return condition codes, in case of problems>>                <<rwp31>>34394000
  fmt'success = 0,                                             <<rwp31>>34396000
  fmt'unusual = 1,                                             <<rwp31>>34398000
  fmt'bad'parms = 2,                                           <<rwp31>>34400000
  fmt'bad'write = 3,                                           <<rwp31>>34402000
                                                               <<rwp31>>34404000
<<equates for word-oriented dumps>>                            <<rwp31>>34406000
  words'per'line = 8,     <<# data items (words) per line>>    <<rwp31>>34408000
  word'fieldlen = 7,      <<# buf bytes avail per data item>>  <<rwp31>>34410000
  word'ascii'start = 98,  <<start pos in buf for ascii dump>>  <<rwp31>>34412000
                                                               <<rwp31>>34414000
<<equates for byte-oriented dumps>>                            <<rwp31>>34416000
  bytes'per'line = 16,    <<# data items (bytes) per line>>    <<rwp31>>34418000
  byte'fieldlen = 4,      <<# bytes in buf avail for bytes>>   <<rwp31>>34420000
  byte'ascii'start = 109, <<start pos in buf for ascii dump>>  <<rwp31>>34422000
  byteval'hexlen = 2,     <<8 bits = max 2 digits in hex>>     <<rwp31>>34424000
  byteval'nonhexlen = 3,  <<8 bits = max 3 digits in dec/oct>> <<rwp31>>34426000
  center'width = 3,       <<# extra spaces to split byte dump>><<rwp31>>34428000
                                                               <<rwp31>>34430000
  start'of'indices = 14,  <<left margin for rel. index output>><<rwp31>>34432000
  start'of'dump = 40,     <<left margin for data items>>       <<rwp31>>34434000
                                                               <<rwp31>>34436000
  first'parms'mask = %70, <<required parameters>>              <<rwp31>>34438000
  parm4'mask = %4,        <<(opt.) asciiflag>>                 <<rwp31>>34440000
  parm5'mask = %2,        <<(opt.) dispbase>>                  <<rwp31>>34442000
  parm6'mask = %1;        <<(opt.) rightbyte>>                 <<rwp31>>34444000
                                                               <<rwp31>>34446000
logical                                                        <<rwp31>>34448000
  row,               <<ongoing counter for rel.index>>         <<rwp31>>34450000
  data,              <<data word from core>>                   <<rwp31>>34452000
  bitmask = q-4,     <<variable parm mask for spl>>            <<rwp31>>34454000
  byteflag,          <<true only if doing byte dump>>          <<rwp31>>34456000
  center'written,    <<false until extra spaces loaded>>       <<rwp31>>34458000
  asciibyte;         <<byte derived from data word>>           <<rwp31>>34460000
                                                               <<rwp31>>34462000
double                                                         <<rwp31>>34464000
  addr;                <<bank/address for index printing>>     <<rwp31>>34466000
                                                               <<rwp31>>34468000
logical array                                                  <<rwp31>>34470000
  addr0(*) = addr,     <<access to msw of addr>>               <<rwp31>>34472000
  addr1(*) = addr0(1); <<access to lsw of addr>>               <<rwp31>>34474000
                                                               <<rwp31>>34476000
byte array                                                     <<rwp31>>34478000
  bdata(*) = data,    <<byte-oriented form of data word>>      <<rwp31>>34480000
  tempbbuf(0:7);      <<for hascii conversions>>               <<rwp31>>34482000
                                                               <<rwp31>>34484000
equate                                                         <<rwp31>>34486000
  left = 0,          <<use left byte of data word>>            <<rwp31>>34488000
  right = 1;         <<use right byte of data word>>           <<rwp31>>34490000
                                                               <<rwp31>>34492000
integer                                                        <<rwp31>>34494000
  addr'count,        <<word counter to step thru core>>        <<rwp31>>34496000
  field'length,      <<# bytes avail for each data item>>      <<rwp31>>34498000
  start'of'ascii,    <<ptr to start of ascii dump>>            <<rwp31>>34500000
  left'right,        <<toggles to split words into bytes>>     <<rwp31>>34502000
  fieldpntr,         <<ptr to buf pos of next data item>>      <<rwp31>>34504000
  asciipntr,         <<ptr to next byte in ascii dump>>        <<rwp31>>34506000
  true'len,          <<max len of hascii conv, for base>>      <<rwp31>>34508000
  fields'per'line,   <<# data items to dump per line>>         <<rwp31>>34510000
  line'end,          <<ptr to end of fully-loaded buffer>>     <<rwp31>>34512000
  centerpntr,        <<ptr to middle of byte dump>>            <<rwp31>>34514000
  length;            <<lengths returned from hascii>>          <<rwp31>>34516000
$page                                                          <<rwp31>>34518000
subroutine output'line;                                        <<rwp31>>34520000
                                                               <<rwp31>>34522000
comment:                                                       <<rwp31>>34524000
                                                               <<rwp31>>34526000
  this subroutine loads the index numbers into the line which  <<rwp31>>34528000
  has already been filled with data, and outputs the line.     <<rwp31>>34530000
                                                               <<rwp31>>34532000
  indices are positioned in the line as follows:               <<rwp31>>34534000
                                                               <<rwp31>>34536000
  ______________(000000)___000_000000_____dataandmoredata      <<rwp31>>34538000
                ^          ^   ^          ^                    <<rwp31>>34540000
               (14)      (25) (29)      (40)                   <<rwp31>>34542000
                                                               <<rwp31>>34544000
  column 14 gets the relative index in parenthesis (), using   <<rwp31>>34546000
     the display base. decimal uses only the significant       <<rwp31>>34548000
     digits, left-justified. hex gets 4 digits and octal 6.    <<rwp31>>34550000
  column 25 gets the absolute bank, in octal, allowing for     <<rwp31>>34552000
     3 digits with no leading zeroes, left-justified.          <<rwp31>>34554000
  column 29 gets the absolute offset, in octal, for 6 digits   <<rwp31>>34556000
     with leading zeroes.                                      <<rwp31>>34558000
                                                               <<rwp31>>34560000
  data starts at column 40. all these columns are adjustable   <<rwp31>>34562000
  by changing equates, but remember printline only writes 132  <<rwp31>>34564000
  bytes.                                                       <<rwp31>>34566000
;                                                              <<rwp31>>34568000
                                                               <<rwp31>>34570000
  begin                                                        <<rwp31>>34572000
                                                               <<rwp31>>34574000
  <<load relative index>>                                      <<rwp31>>34576000
    length := hascii(row, dispbase, tempbbuf(0));              <<rwp31>>34578000
    move bbuf(start'of'indices) := "(";                        <<rwp31>>34580000
    if dispbase = 8 then                                       <<rwp31>>34582000
      move bbuf(start'of'indices + 1) :=                       <<rwp31>>34584000
        tempbbuf(true'len-length),(length);                    <<rwp31>>34586000
    if dispbase = 10 then                                      <<rwp31>>34588000
      move bbuf(start'of'indices + 1) :=                       <<rwp31>>34590000
        tempbbuf(0),(length);                                  <<rwp31>>34592000
    if dispbase = 16 then                                      <<rwp31>>34594000
      move bbuf(start'of'indices + 1) :=                       <<rwp31>>34596000
        tempbbuf(true'len-length),(length);                    <<rwp31>>34598000
    move bbuf(start'of'indices + 1 + length) := ")";           <<rwp31>>34600000
                                                               <<rwp31>>34602000
  <<load absolute bank>>                                       <<rwp31>>34604000
    @pbuf := @bbuf + start'of'indices + 11;                    <<rwp31>>34606000
    length := ascii(addr0, 8, tempbbuf(0));                    <<rwp31>>34608000
    move pbuf := tempbbuf(6 - length),(length);                <<rwp31>>34610000
                                                               <<rwp31>>34612000
  <<load absolute offset>>                                     <<rwp31>>34614000
    @pbuf := @bbuf + start'of'indices + 15;                    <<rwp31>>34616000
    putnum(addr1);                                             <<rwp31>>34618000
                                                               <<rwp31>>34620000
    print'octal'dit := fmt'bad'write;                          <<rwp31>>34622000
    printline;   <<output the completed line>>                 <<rwp31>>34624000
    print'octal'dit := fmt'unusual;                            <<rwp31>>34626000
                                                               <<rwp31>>34628000
  end; <<subroutine output'line>>                              <<rwp31>>34630000
                                                               <<rwp31>>34632000
$page                                                          <<rwp31>>34634000
<< check to see if optional parameters were passed. if they    <<rwp31>>34636000
<< were, leave them alone. if not, set them to default values. <<rwp31>>34638000
<< exit if missing required parms. >>                          <<rwp31>>34640000
                                                               <<rwp31>>34642000
print'octal'dit := fmt'bad'parms;                              <<rwp31>>34644000
                                                               <<rwp31>>34646000
if bitmask < first'parms'mask then return;                     <<rwp31>>34648000
if ( bitmask land parm4'mask ) = 0 then asciiflag := false;    <<rwp31>>34650000
if ( bitmask land parm5'mask ) = 0 then dispbase  := dflt'base;<<rwp31>>34652000
if ( bitmask land parm6'mask ) = 0 or not rightbyte then       <<rwp31>>34654000
   left'right := left                                          <<rwp31>>34656000
      else left'right := right;                                <<rwp31>>34658000
                                                               <<rwp31>>34660000
                                                               <<rwp31>>34662000
<< exit if bad display base was passed >>                      <<rwp31>>34664000
                                                               <<rwp31>>34666000
if (dispbase <> 8) and (dispbase <> 10) and (dispbase <> 16)   <<rwp31>>34668000
       then return;                                            <<rwp31>>34670000
                                                               <<rwp31>>34672000
                                                               <<rwp31>>34674000
print'octal'dit := fmt'unusual;                                <<rwp31>>34676000
                                                               <<rwp31>>34678000
<<set appropriate actual length of converted #'s from hascii>> <<rwp31>>34680000
<< (for decimal, hascii returns the true length anyway). >>    <<rwp31>>34682000
                                                               <<rwp31>>34684000
true'len := 0;                                                 <<rwp31>>34686000
if dispbase = 8  then true'len := 6;                           <<rwp31>>34688000
if dispbase = 16 then true'len := 4;                           <<rwp31>>34690000
                                                               <<rwp31>>34692000
                                                               <<rwp31>>34694000
if dit'length < 0 then    <<neg #words specifies byte format>> <<rwp31>>34696000
begin                                                          <<rwp31>>34698000
  byteflag := true;                                            <<rwp31>>34700000
  dit'length := -dit'length;                                   <<rwp31>>34702000
  field'length := byte'fieldlen;                               <<rwp31>>34704000
  fields'per'line := bytes'per'line;                           <<rwp31>>34706000
  start'of'ascii := byte'ascii'start;                          <<rwp31>>34708000
  centerpntr := field'length*fields'per'line/2                 <<rwp31>>34710000
                  + start'of'dump;                             <<rwp31>>34712000
end  <<byte format>>                                           <<rwp31>>34714000
else                                                           <<rwp31>>34716000
begin                                                          <<rwp31>>34718000
  byteflag := false;                                           <<rwp31>>34720000
  field'length := word'fieldlen;                               <<rwp31>>34722000
  fields'per'line := words'per'line;                           <<rwp31>>34724000
  start'of'ascii := word'ascii'start;                          <<rwp31>>34726000
  centerpntr := 0;                                             <<rwp31>>34728000
end; <<word format>>                                           <<rwp31>>34730000
                                                               <<rwp31>>34732000
                                                               <<rwp31>>34734000
blankbuf;                                                      <<rwp31>>34736000
addr'count := 0;                                               <<rwp31>>34738000
addr := dit'start'addr;                                        <<rwp31>>34740000
row := relative'index;                                         <<rwp31>>34742000
asciipntr := start'of'ascii;                                   <<rwp31>>34744000
fieldpntr := start'of'dump;                                    <<rwp31>>34746000
line'end := fields'per'line*field'length + start'of'dump;      <<rwp31>>34748000
if byteflag then line'end := line'end + center'width;          <<rwp31>>34750000
                                                               <<rwp31>>34752000
while addr'count < dit'length do <<fill buffers and write out>><<rwp31>>34754000
begin                                                          <<rwp31>>34756000
                                                               <<rwp31>>34758000
  if fieldpntr < line'end then  <<not end of line yet>>        <<rwp31>>34760000
  begin                             <<so load next value>>     <<rwp31>>34762000
                                                               <<rwp31>>34764000
    data := core(dit'start'addr +                              <<rwp31>>34766000
                    double(addr'count));                       <<rwp31>>34768000
                                                               <<rwp31>>34770000
    length := hascii ((if byteflag then                        <<rwp31>>34772000
               logical(bdata(left'right)) else data),          <<rwp31>>34774000
                    dispbase, tempbbuf(0));                    <<rwp31>>34776000
                                                               <<rwp31>>34778000
                                                               <<rwp31>>34780000
<<need to copy value from temporary buffer to output buffer>>  <<rwp31>>34782000
<<to eliminate leading zeroes for byte format. >>              <<rwp31>>34784000
                                                               <<rwp31>>34786000
<<in word-mode we copy across the buffer for the true length>> <<rwp31>>34788000
<<in base 8 and 16, or the actual length in base 10. >>        <<rwp31>>34790000
                                                               <<rwp31>>34792000
<<in byte-mode we copy across the least significant 2 >>       <<rwp31>>34794000
<<bytes in hex, or 3 bytes in decimal and octal. >>            <<rwp31>>34796000
                                                               <<rwp31>>34798000
    move bbuf( fieldpntr ) :=                                  <<rwp31>>34800000
       tempbbuf(( if not byteflag then 0                       <<rwp31>>34802000
           else  true'len-byteval'hexlen )),                   <<rwp31>>34804000
              ((if not byteflag then                           <<rwp31>>34806000
                 (if dispbase = 10 then                        <<rwp31>>34808000
                   length else true'len)                       <<rwp31>>34810000
                      else if dispbase = 16 then               <<rwp31>>34812000
                         byteval'hexlen                        <<rwp31>>34814000
                            else byteval'nonhexlen));          <<rwp31>>34816000
                                                               <<rwp31>>34818000
<< add decoded ascii to buffer if requested: >>                <<rwp31>>34820000
<< for byte format, only the current byte is decoded. for >>   <<rwp31>>34822000
<< word format, both the left and right bytes are decoded. >>  <<rwp31>>34824000
                                                               <<rwp31>>34826000
    if asciiflag then                                          <<rwp31>>34828000
    begin                                                      <<rwp31>>34830000
                                                               <<rwp31>>34832000
      asciibyte := ( if byteflag then                          <<rwp31>>34834000
         bdata( left'right )                                   <<rwp31>>34836000
            else  data & lsr (8));  <<left byte>>              <<rwp31>>34838000
                                                               <<rwp31>>34840000
      if (asciibyte < 32) or (asciibyte > 126) then            <<rwp31>>34842000
         bbuf( asciipntr ) := "."                              <<rwp31>>34844000
            else bbuf( asciipntr ) := asciibyte.(8:8);         <<rwp31>>34846000
      asciipntr := asciipntr + 1;                              <<rwp31>>34848000
                                                               <<rwp31>>34850000
      if not byteflag then   <<also do right byte>>            <<rwp31>>34852000
      begin                                                    <<rwp31>>34854000
        asciibyte := data land %377;                           <<rwp31>>34856000
        if ( asciibyte < 32 ) or ( asciibyte > 126 ) then      <<rwp31>>34858000
           bbuf( asciipntr ) := "."                            <<rwp31>>34860000
              else bbuf( asciipntr ) := asciibyte.(8:8);       <<rwp31>>34862000
        asciipntr := asciipntr + 1;                            <<rwp31>>34864000
      end;  <<right byte>>                                     <<rwp31>>34866000
                                                               <<rwp31>>34868000
    end; <<if asciiflag>>                                      <<rwp31>>34870000
                                                               <<rwp31>>34872000
                                                               <<rwp31>>34874000
  <<shift load pointer to start of next item>>                 <<rwp31>>34876000
    fieldpntr := fieldpntr + field'length;                     <<rwp31>>34878000
                                                               <<rwp31>>34880000
  <<split a byte dump down the middle with extra spaces>>      <<rwp31>>34882000
    if byteflag and (fieldpntr >= centerpntr) and              <<rwp31>>34884000
       (not center'written) then                               <<rwp31>>34886000
    begin                                                      <<rwp31>>34888000
      fieldpntr := fieldpntr + center'width;                   <<rwp31>>34890000
      center'written := true;                                  <<rwp31>>34892000
    end;                                                       <<rwp31>>34894000
                                                               <<rwp31>>34896000
  <<skip to next word>>                                        <<rwp31>>34898000
    if (not byteflag) or (left'right = right)                  <<rwp31>>34900000
        then addr'count := addr'count + 1;                     <<rwp31>>34902000
                                                               <<rwp31>>34904000
  <<toggle left'right byte indicator>>                         <<rwp31>>34906000
    if byteflag then                                           <<rwp31>>34908000
    begin                                                      <<rwp31>>34910000
      if left'right = left then                                <<rwp31>>34912000
      left'right := right                                      <<rwp31>>34914000
      else left'right := left;                                 <<rwp31>>34916000
    end;                                                       <<rwp31>>34918000
                                                               <<rwp31>>34920000
  end  <<not end of line yet>>                                 <<rwp31>>34922000
                                                               <<rwp31>>34924000
  else                                                         <<rwp31>>34926000
  begin  <<end of line, so print it out and reset>>            <<rwp31>>34928000
                                                               <<rwp31>>34930000
    output'line;                                               <<rwp31>>34932000
    blankbuf;                                                  <<rwp31>>34934000
    fieldpntr := start'of'dump;                                <<rwp31>>34936000
    asciipntr := start'of'ascii;                               <<rwp31>>34938000
    center'written := false;                                   <<rwp31>>34940000
    row := row + logical(fields'per'line);                     <<rwp31>>34942000
    addr := dit'start'addr + double(addr'count);               <<rwp31>>34944000
                                                               <<rwp31>>34946000
  end; <<end of line>>                                         <<rwp31>>34948000
                                                               <<rwp31>>34950000
end;  <<while>>                                                <<rwp31>>34952000
                                                               <<rwp31>>34954000
<<check whether last line must be flushed>>                    <<rwp31>>34956000
                                                               <<rwp31>>34958000
if fieldpntr > start'of'dump then output'line;                 <<rwp31>>34960000
                                                               <<rwp31>>34962000
print'octal'dit := fmt'success;  <<return successful status>>  <<rwp31>>34964000
                                                               <<rwp31>>34966000
end; <<procedure print'octal'dit>>                             <<rwp31>>34968000
$page "HASCII : Do base 16, 10, 8 - to - ASCII conversions"    <<rwp31>>34970000
$control segment=tablestg                                      <<r8331>>34972000
comment                                                                 34974000
                                                                        34976000
purpose:                                                                34978000
                       *** hascii ***                                   34980000
                                                                        34982000
   hascii is the functional equaivalent of the system                   34984000
   intrinsic ascii, except that it also performs single-word            34986000
   conversions in base 16.                                              34988000
                                                                        34990000
output parameters:                                                      34992000
   if base=10 or -10 : number of digits converted.                      34994000
             8 or 16 : number of significant digits, excluding          34996000
                       leading zeroes.                                  34998000
                                                                        35000000
globals referenced:                                                     35002000
   none.                                                                35004000
                                                                        35006000
globals altered:                                                        35008000
   none.                                                                35010000
                                                                        35012000
procedures called:                                                      35014000
   ascii                                                                35016000
                                                                        35018000
input parameters:                                                       35020000
   binval  logical word to be converted, pass by value.                 35022000
   base    numeric base to use for conversion: 8 for octal,             35024000
           (6 digits returned), 16 for hexadecimal (4 digits            35026000
           returned), 10 for left-justified decimal, -10 for            35028000
           right-justified decimal, as with ascii.                      35030000
                                                                        35032000
algorithm:                                                              35034000
   if the base is not 16, then everything passed is just                35036000
   passed on to ascii, which does the 8, 10, -10 conversions.           35038000
                                                                        35040000
   otherwise, hascii steps through the passed word value,               35042000
   4 bits at a time, and converts each 4 bits to an ascii               35044000
   character, which is stuffed into the destination buffer.             35046000
                                                                        35048000
   initially, the number of significant digits for base 16 is           35050000
   set to one, accounting for one "zero" in case the whole              35052000
   word is zero. then the stepping proceeds right-to-left,              35054000
   and any time a nonzero 4-bit nibble is found, the signifi-           35056000
   cant-digit total is updated to indicate the new number of            35058000
   significant digits.                                                  35060000
                                                                        35062000
modification history:                                                   35064000
   30dec81 - randy pawell, ind.                                         35066000
     initial version, from atpdsm.                                      35068000
                                                                        35070000
   31jan83 - randy pawell, ind                                          35072000
     incorporated into dpan4 for r-mit, no changes.                     35074000
                                                                        35076000
;                                                                       35078000
                                                                        35080000
                                                                        35082000
integer procedure hascii ( binval, base, destbuf );            <<rwp31>>35084000
   value binval, base;                                         <<rwp31>>35086000
   byte array destbuf;  << array to put converted number into ><<rwp31>>35088000
   logical binval    ;  << word to convert >>                  <<rwp31>>35090000
   integer base      ;  << 8, 10, or 16 >>                     <<rwp31>>35092000
                                                               <<rwp31>>35094000
                                                               <<rwp31>>35096000
begin  <<procedure hascii>>                                    <<rwp31>>35098000
                                                               <<rwp31>>35100000
integer index := 3;                                            <<rwp31>>35102000
integer workval;                                               <<rwp31>>35104000
                                                               <<rwp31>>35106000
if base <> 16 then                                             <<rwp31>>35108000
  begin                                                        <<rwp31>>35110000
    hascii := ascii ( binval, base, destbuf );                 <<rwp31>>35112000
    return;                                                    <<rwp31>>35114000
  end   <<if>>                                                 <<rwp31>>35116000
  else                                                         <<rwp31>>35118000
  begin                                                        <<rwp31>>35120000
    move destbuf := "????";                                    <<rwp31>>35122000
    hascii := 1;                                               <<rwp31>>35124000
    while index >=0 do                                         <<rwp31>>35126000
    begin                                                      <<rwp31>>35128000
      case index of                                            <<rwp31>>35130000
      begin                                                    <<rwp31>>35132000
        workval := binval.(0:4);                               <<rwp31>>35134000
        workval := binval.(4:4);                               <<rwp31>>35136000
        workval := binval.(8:4);                               <<rwp31>>35138000
        workval := binval.(12:4);                              <<rwp31>>35140000
      end;                                                     <<rwp31>>35142000
      if workval < 10 then                                     <<rwp31>>35144000
          destbuf(index) := workval.(8:8) + 48                 <<rwp31>>35146000
            else destbuf(index) := workval.(8:8) + 55;         <<rwp31>>35148000
      if workval > 0 then hascii := 4 - index;                 <<rwp31>>35150000
      index := index - 1;                                      <<rwp31>>35152000
    end;  << while >>                                          <<rwp31>>35154000
  end; <<else >>                                               <<rwp31>>35156000
                                                               <<rwp31>>35158000
                                                               <<rwp31>>35160000
end;  <<procedure hascii >>                                    <<rwp31>>35162000
$page "DECODE'FILENAME : Get an MPE Filename from memory data" <<rwp31>>35164000
$control segment=tablestg                                      <<r8331>>35166000
comment:                                                                35168000
                  *** decode'filename ***                               35170000
                                                                        35172000
purpose:                                                                35174000
   given an mpe filename that's stored in consecutive memory            35176000
   locations, decodes it from the raw octal data into a byte            35178000
   array, deblanked, upshifted, and of known length, in the             35180000
   format of:                                                           35182000
                                                                        35184000
          filename.groupnam.acctname                                    35186000
                                                                        35188000
   only alphanumeric bytes within the filename are converted.           35190000
   non-alphanumeric bytes are ignored. typical application              35192000
   is for memory block of 12 words that contains a filename,            35194000
   groupname, and accountname, and is padded with blanks.               35196000
                                                                        35198000
input parameters:                                                       35200000
   inbuf(*)  logical array containing the filename to be                35202000
             loaded.                                                    35204000
   boutbuf(*) destination byte array for the conversion.                35206000
                                                                        35208000
output paramters:                                                       35210000
   returns number of bytes in the converted filename.                   35212000
                                                                        35214000
procedures called:                                                      35216000
   none.                                                                35218000
                                                                        35220000
globals referenced:                                                     35222000
   none.                                                                35224000
                                                                        35226000
globals altered:                                                        35228000
   none.                                                                35230000
                                                                        35232000
alogrithm:                                                              35234000
   load up a work array with blanks and dots in fixed                   35236000
   positions. then move the word-oriented data directly from            35238000
   the source buffer into the byte-oriented data buffer, in             35240000
   three 8-byte chunks.                                                 35242000
                                                                        35244000
   finally copy the local data buffer nto the destination               35246000
   buffer, deblanking, upshifting, and stripping illegal                35248000
   characters as we go, and pass back the total number of               35250000
   bytes copied across.                                                 35252000
                                                                        35254000
modification history:                                                   35256000
   30sep82 - randy pawell, ind                                          35258000
     initial version.                                                   35260000
                                                                        35262000
   31jan83 - randy pawell, ind                                          35264000
     added to dpan4 for r-mit, from atpdsm, no changes.                 35266000
                                                                        35268000
;                                                                       35270000
                                                                        35272000
                                                                        35274000
                                                                        35276000
integer procedure decode'filename( inbuf, boutbuf );           <<rwp31>>35278000
logical array  inbuf;  <<start of word array holding name>>    <<rwp31>>35280000
byte array    boutbuf;  <<mpe filename with blanks removed>>   <<rwp31>>35282000
                       <<# bytes in name is returned>>         <<rwp31>>35284000
                                                               <<rwp31>>35286000
begin  <<decode'filename>>                                     <<rwp31>>35288000
                                                               <<rwp31>>35290000
  equate                                                       <<rwp31>>35292000
     maxnamelen = 26;                                          <<rwp31>>35294000
                                                               <<rwp31>>35296000
  byte array                                                   <<rwp31>>35298000
     bbuffer(0:maxnamelen-1),                                  <<rwp31>>35300000
     binbuf(*) = inbuf;                                        <<rwp31>>35302000
                                                               <<rwp31>>35304000
  integer                                                      <<rwp31>>35306000
     outptr = decode'filename,   <<byteptr for output >>       <<rwp31>>35308000
     byteval, <<numeric value of current byte>>                <<rwp31>>35310000
     locptr;  <<to step through bbuffer for deblanking>>       <<rwp31>>35312000
                                                               <<rwp31>>35314000
                                                               <<rwp31>>35316000
  move bbuffer     := "        .        .        ";            <<rwp31>>35318000
  move bbuffer(0)  := binbuf(0),(8);                           <<rwp31>>35320000
  move bbuffer(9)  := binbuf(8),(8);                           <<rwp31>>35322000
  move bbuffer(18) := binbuf(16),(8);                          <<rwp31>>35324000
                                                               <<rwp31>>35326000
<<strip embedded blanks>>                                      <<rwp31>>35328000
  locptr := 0;                                                 <<rwp31>>35330000
  outptr := 0;                                                 <<rwp31>>35332000
  while locptr < maxnamelen  do                                <<rwp31>>35334000
  begin                                                        <<rwp31>>35336000
    byteval := integer(bbuffer(locptr));                       <<rwp31>>35338000
    if (byteval>=65 land byteval<=90)  lor  <<a-z>>            <<rwp31>>35340000
       (byteval>=97 land byteval<=122) lor  <<a-z>>            <<rwp31>>35342000
       (byteval>=48 land byteval<=57)  lor  <<0-9>>            <<rwp31>>35344000
       (byteval = 46)                       << . >>            <<rwp31>>35346000
    then                                                       <<rwp31>>35348000
    begin                                                      <<rwp31>>35350000
      boutbuf(outptr) := bbuffer(locptr);                      <<rwp31>>35352000
      outptr := outptr + 1; <<incr namelen>>                   <<rwp31>>35354000
    end;                                                       <<rwp31>>35356000
    locptr := locptr + 1;                                      <<rwp31>>35358000
  end;                                                         <<rwp31>>35360000
                                                               <<rwp31>>35362000
end;  <<decode'filename>>                                      <<rwp31>>35364000
$page  "DO'ATP'DITS : Format extra DIT's for ATP channels"     <<r8331>>35366000
$control segment=tablestg                                      <<r8331>>35368000
comment                                                        <<rwp31>>35370000
                                                               <<rwp31>>35372000
purpose:                                                       <<rwp31>>35374000
                    *** do'atp'dits ***                        <<rwp31>>35376000
                                                               <<rwp31>>35378000
   outputs the extra dit's contained in an atp terminal data   <<rwp31>>35380000
   segment (tds), for the ldev pointed to by "Locdit".         <<rwp31>>35382000
                                                               <<rwp31>>35384000
   so that the various extra dit pointers for an atp ldev will <<rwp31>>35386000
   be printed as part of printdit's header for this unit, this <<rwp31>>35388000
   routine also outputs the dit itself, rather than having     <<rwp31>>35390000
   printdit do it.                                             <<rwp31>>35392000
                                                               <<rwp31>>35394000
   to minimize the amount of knowledge printdit has to have    <<rwp31>>35396000
   about atp's, all printdit does is decide if a drt is an atp <<rwp31>>35398000
   or not, and then calls do'atp'dits to do everything else,   <<rwp31>>35400000
   for each unit (ldev).                                       <<rwp31>>35402000
                                                               <<rwp31>>35404000
   if this ldev also has a valid atp error dump present in its <<rwp31>>35406000
   tds, the dump will be formatted and output.                 <<rwp31>>35408000
                                                               <<rwp31>>35410000
input parameters:                                              <<rwp31>>35412000
   lociltx  double-word address of start of iltx for a         <<rwp31>>35414000
            drt which is known to be an atp drt.               <<rwp31>>35416000
            must be nonzero.                                   <<rwp31>>35418000
   locdit   double-word address of start of dit for a          <<rwp31>>35420000
            particular active unit in the same atp drt         <<rwp31>>35422000
            specified by lociltx. must be nonzero.             <<rwp31>>35424000
                                                               <<rwp31>>35426000
output parameters:                                             <<rwp31>>35428000
   none.                                                       <<rwp31>>35430000
                                                               <<rwp31>>35432000
globals referenced:                                            <<rwp31>>35434000
   none.                                                       <<rwp31>>35436000
                                                               <<rwp31>>35438000
globals altered:                                               <<rwp31>>35440000
   bbuf(*)  byte-oriented output print buffer.                 <<rwp31>>35442000
   pbuf  byte pointer into output print buffer.                <<rwp31>>35444000
                                                               <<rwp31>>35446000
procedures called:                                             <<rwp31>>35448000
   newpage                                                     <<rwp31>>35450000
   printline                                                   <<rwp31>>35452000
   ascii                                                       <<rwp31>>35454000
   skiplines                                                   <<rwp31>>35456000
   print'octal'dit                                             <<rwp31>>35458000
   decode'filename                                             <<rwp31>>35460000
   hascii                                                      <<rwp31>>35462000
   core                                                        <<rwp31>>35464000
   dcore                                                       <<r8331>>35466000
   putnump                                                     <<rwp31>>35468000
   blankbuf                                                    <<rwp31>>35470000
   putnum                                                      <<rwp31>>35472000
                                                               <<rwp31>>35474000
data structures:                                               <<rwp31>>35476000
   the atp system software contains a routine, lynx'error,     <<rwp31>>35478000
   which dumps all applicable atp/system tables into an area   <<rwp31>>35480000
   of the data segment. the first part of this area contains   <<rwp31>>35482000
   tables of fixed or known length, and the second part holds  <<rwp31>>35484000
   tables of variable length, each with an associated infor-   <<rwp31>>35486000
   mation block. the format of the dump area has changed       <<rwp31>>35488000
   as the format of the terminal data segment has evolved,     <<rwp31>>35490000
   so to adjust for the format, we have the following two      <<rwp31>>35492000
   data structures:                                            <<rwp31>>35494000
                                                               <<rwp31>>35496000
     dumplengths(*)  length, in words, of each table in dump   <<rwp31>>35498000
        area. if value is not positive, area does not exist.   <<rwp31>>35500000
     dumpoffsets(*)  offset, in words, from start of dump area <<rwp31>>35502000
        to first word of table which was dumped. if length of  <<rwp31>>35504000
        table (in dumplengths(*) ) is not positive, its        <<rwp31>>35506000
        corresponding offset here is undefined.                <<rwp31>>35508000
                                                               <<rwp31>>35510000
cautions:                                                      <<rwp31>>35512000
   future updates must include changes to: (1) load dump       <<rwp31>>35514000
   offsets and lengths, based on the new tds version, (2) find <<rwp31>>35516000
   pointers into the tds for any new areas, (3) provide print  <<rwp31>>35518000
   routines to print any new tables, (4) update documentation. <<rwp31>>35520000
   it is important to maintain backwards comaptibility, if at  <<rwp31>>35522000
   all possible.                                               <<rwp31>>35524000
                                                               <<rwp31>>35526000
algorithm:                                                     <<rwp31>>35528000
   if called from the secondary entry point, then look up in   <<rwp31>>35530000
   the passed iltx the tds data segment addresses and segment  <<rwp31>>35532000
   numbers for each tds on that atp drt. then format all the   <<rwp31>>35534000
   appropriate pointers from each tds header into an output    <<rwp31>>35536000
   header for the drt, and print it. this is done so printdit  <<rwp31>>35538000
   can display extra atp information once for each atp drt,    <<rwp31>>35540000
   without having to do it for every unit on that drt.         <<rwp31>>35542000
                                                               <<rwp31>>35544000
                                                               <<rwp31>>35546000
   if called from the main entrypoint, we are printing the     <<rwp31>>35548000
   dit's (and perhaps the dump area) for a given ldev. thus    <<rwp31>>35550000
   we need to find, by looking in the iltx, the right tds for  <<rwp31>>35552000
   that ldev. if the tds is not split, the tds is defined in   <<rwp31>>35554000
   words 0-2 of the iltx. if it is split, then the tds is      <<rwp31>>35556000
   defined in words 0-2 if the ldev's unit number is 0-47,     <<rwp31>>35558000
   and it's in words 6-8 if the unit number is 48-95.          <<rwp31>>35560000
                                                               <<rwp31>>35562000
   if the tds data segment number or address is zero, that     <<rwp31>>35564000
   tds is not defined enough to find it, so we print an        <<rwp31>>35566000
   error message, the dit, and exit.                           <<rwp31>>35568000
                                                               <<rwp31>>35570000
   next we call the subroutine load'dump'info to load the      <<rwp31>>35572000
   lengths of all the tables in the tds dump area. this        <<rwp31>>35574000
   subroutine will also tell us wheter we know the tds format  <<rwp31>>35576000
   of not. if we don't, we don't want to risk printing invalid <<rwp31>>35578000
   data. instead we print an appropriate error message, and    <<rwp31>>35580000
   print the dit (which we do know the location of).           <<rwp31>>35582000
                                                               <<rwp31>>35584000
   if it turns out we do know the tds format (we should), we   <<rwp31>>35586000
   can load pointers to each table and area in the tds that we <<rwp31>>35588000
   will want to print. this section of the code is set up to   <<rwp31>>35590000
   assign a zero address to any table which does not exist in  <<rwp31>>35592000
   the current tds, and a nonzero double-word address other-   <<rwp31>>35594000
   wise.                                                       <<rwp31>>35596000
                                                               <<rwp31>>35598000
   next, we format the active pointers into a header, print it,<<rwp31>>35600000
   then step through the various pointers and print the tables <<rwp31>>35602000
   if their addresses are nonzero.                             <<rwp31>>35604000
                                                               <<rwp31>>35606000
   last, we look at the dump area, and see if it contains a    <<rwp31>>35608000
   dump from the ldev we just formatted tables for. we can find<<rwp31>>35610000
   this out by looking first at word 0 of the area, which is   <<rwp31>>35612000
   a positive count of the number of times the area has been   <<rwp31>>35614000
   accessed since dumped. a nonzero value indicates there is   <<rwp31>>35616000
   one (and only one) dump present. then we can, using the     <<rwp31>>35618000
   offsets we loaded earlier, look into the monitor dit that   <<rwp31>>35620000
   was dumped into the area, and extract the ldev number from  <<rwp31>>35622000
   that dit. if the ldev number is the same ldev as the one    <<rwp31>>35624000
   we just formatted, then we do a page-eject and format the   <<rwp31>>35626000
   dump area before exiting the procedure. note that since     <<rwp31>>35628000
   ldev numbers and unit numbers are unique, we will only      <<rwp31>>35630000
   print this dump area once per drt--only when we format      <<rwp31>>35632000
   that ldev's dit in printdit.                                <<rwp31>>35634000
                                                               <<rwp31>>35636000
   printing the dump area is done much like it is done in      <<rwp31>>35638000
   atpdsm, basically printing each area if its length was found<<rwp31>>35640000
   to be nonzero. to find the variable-length areas, we need   <<rwp31>>35642000
   to set up pointers to them beforehand--this is done on entry<<rwp31>>35644000
   into the subroutine--using offsets stored in the information<<rwp31>>35646000
   blocks, lengths of these variable areas, and the offset to  <<rwp31>>35648000
   the variable area, to calculate the pointers.               <<rwp31>>35650000
                                                               <<rwp31>>35652000
   the format of the tds and its dump area is determined solely<<rwp31>>35654000
   by the tds version number, given by word 0 of the tds.      <<rwp31>>35656000
     version (-1) : first-release tds.                         <<rwp31>>35658000
             ( 0) : not used, so this would be unknown.        <<rwp31>>35660000
             (+1) : initial-release lynx2 tds.                 <<rwp31>>35662000
                                                               <<rwp31>>35664000
modification history:                                          <<rwp31>>35666000
  31jan83 - randy pawell, ind                                  <<rwp31>>35668000
    new procedure, contains bulk of code that used to be in    <<rwp31>>35670000
    printdit. also now handles either version -1 or version 1  <<rwp31>>35672000
    of the tds, for lynx2 and r-mit.                           <<rwp31>>35674000
                                                               <<rwp31>>35676000
  07jun83 - winson lau, ind     adcc ehancement                << adcc>>35678000
    added a subroutine to identify the channel type of         << adcc>>35680000
    the drt and its terminal data segment.  added codes        << adcc>>35682000
    to handle adcc tds version.  more detail comparision       << adcc>>35684000
    between atp and adcc dump area format can be found in      << adcc>>35686000
    termdsm and lynxerror source listing.                      << adcc>>35688000
    added logic to skip printing channel program if the        << adcc>>35690000
    drt is adcc.                                               << adcc>>35692000
                                                               << adcc>>35694000
09may83 - mimi pang, ind                                       <<mpev >>35696000
    changes for mpe v :                                        <<mpev >>35698000
    a.  changes of data structures have been made to the       <<mpev >>35700000
        following tables in their mpe v format :               <<mpev >>35702000
        1).  dit -- length of the dit has been increased from  <<mpev >>35704000
                    20 to 21.                                  <<mpev >>35706000
        2).  ioq -- length of the ioq has been increased from  <<mpev >>35708000
                    11 to 12.                                  <<mpev >>35710000
        3).  pcb -- length of the pcb has been increased from  <<mpev >>35712000
                    16 to 21.                                  <<mpev >>35714000
        4).  ldt -- length of the ldt has been increased from  <<mpev >>35716000
                    5 to 7.                                    <<mpev >>35718000
        5).  lpdt -- length of the lpdt has been increased from<<mpev >>35720000
                     2 to 4.                                   <<mpev >>35722000
        6).  fix dit -- length of the fix dit has been         <<mpev >>35724000
                        increased from 11 to 13.               <<mpev >>35726000
        7).  variable dit -- length of the variable dit has    <<mpev >>35728000
                             been increased from 26 to 27.     <<mpev >>35730000
        8).  trl -- timer request list index has increase from <<mpev >>35732000
                    8 bits to 16 bits.                         <<mpev >>35734000
                                                               <<mpev >>35736000
    b.  changes have been made to the following tables to allow<<mpev >>35738000
        themselves to be move outside of bank 0 :              <<mpev >>35740000
        1).  ioq \                                             <<mpev >>35742000
        2).  sbuf --- access methods has changed to data       <<mpev >>35744000
        3).  pcb /    segment relative offset from sysdb offset<<mpev >>35746000
        4).  lpdt -- ldev # is now 16 bits.                    <<mpev >>35748000
                                                               << adcc>>35750000
 13jul83 - wwl                                                 << adcc>>35752000
   added codes to print out the adcc header area in            << adcc>>35754000
   print'atp'dump.                                             << adcc>>35756000
                                                               <<r8331>>35758000
  12jan84 - randy pawell, ind                                  <<r8331>>35760000
    1) replace most of code in load'dump'info, to include all  <<r8331>>35762000
       tds versions. this means this code can be moved back    <<r8331>>35764000
       to mpeiv (p2) with minimum changes. objective is to     <<r8331>>35766000
       have only one copy of this module for dpan4 & dpan5.    <<r8331>>35768000
    2) revise sortware-version printing to handle both the     <<r8331>>35770000
       older 1-word and newer 2-word version numbers. this     <<r8331>>35772000
       code will format the software versions for any tds.     <<r8331>>35774000
    3) update get'channel'type for mighty-mouse tic controller.<<r8331>>35776000
    4) update decode'version for 1- or 2-word version numbers. <<r8331>>35778000
    5) add documentation to subroutines.                       <<r8331>>35780000
    6) test "offset" instead of "length" to see if tbuf table  <<r8331>>35782000
       and ppdit should be formatted in atp dump (no changes   <<r8331>>35784000
       for vfc, however).                                      <<r8331>>35786000
                                                               <<r8331>>35788000
                                                               << adcc>>35790000
;                                                              <<rwp31>>35792000
                                                               <<rwp31>>35794000
procedure do'atp'dits(lociltx, locdit);                        <<rwp31>>35796000
value lociltx, locdit;                                         <<rwp31>>35798000
double lociltx;                                                <<rwp31>>35800000
double locdit;                                                 <<rwp31>>35802000
                                                               <<rwp31>>35804000
                                                               <<rwp31>>35806000
begin                                                          <<rwp31>>35808000
                                                               <<rwp31>>35810000
entry                                                          <<rwp31>>35812000
  do'atp'drt'hdr;                                              <<rwp31>>35814000
                                                               <<rwp31>>35816000
double                                                         <<rwp31>>35818000
  loctds,                                                      <<rwp31>>35820000
  lociltxl,                                                    <<rwp31>>35822000
  lociltxu,                                                    <<rwp31>>35824000
  locpdfdit,                                                   <<rwp31>>35826000
  locpdpdit,                                                   <<rwp31>>35828000
  locpdvdit,                                                   <<rwp31>>35830000
  locppp,                                                      <<rwp31>>35832000
  lochwdit,                                                    <<rwp31>>35834000
  locctlpgm,                                                   <<rwp31>>35836000
  locvfc,                                                      <<rwp31>>35838000
  locheadtbuf,                                                 <<rwp31>>35840000
  loctailtbuf,                                                 <<rwp31>>35842000
  locdump,                                                     <<rwp31>>35844000
  loctable,                                                    <<rwp31>>35846000
  versiond,           <<2-word version number>>                <<r8331>>35848000
  loc'versions,         <<addr of tds secondary>>              <<r8331>>35850000
  scratchd;                                                    <<rwp31>>35852000
                                                               <<rwp31>>35854000
integer                                                        <<rwp31>>35856000
  ldev,                                                        <<rwp31>>35858000
  unit,                                                        <<rwp31>>35860000
  dumped'ldev,                                                 <<rwp31>>35862000
  num'of'dumps,                                                <<rwp31>>35864000
  tdsnum,                                                      <<rwp31>>35866000
  tds'ver,                                                     <<rwp31>>35868000
  indx1,                                                       <<rwp31>>35870000
  bbuf'ptr,                                                    << adcc>>35872000
  scratchi;                                                    <<rwp31>>35874000
                                                               <<rwp31>>35876000
logical                                                        <<rwp31>>35878000
  split'tds,                                                   <<rwp31>>35880000
  known'tds'format,                                            <<rwp31>>35882000
  only'doing'drt'header,                                       <<rwp31>>35884000
  type1,      <<chan type for 1st atp tds>>                    << adcc>>35886000
  type2,      <<chan type for 2nd atp tds>>                    << adcc>>35888000
  channel'type,     <<adcc, atp, or neither>>                  << adcc>>35890000
  file'name'valid,  <<true if current term file in use>>       << adcc>>35892000
  ver,               <<software version letter code>>          <<r8331>>35894000
  upd,               <<software update level number>>          <<r8331>>35896000
  fix,               <<software fix level number>>             <<r8331>>35898000
  versions'printed,  <<true when printed once>>                <<r8331>>35900000
  versionl,          <<1-word version number>>                 <<r8331>>35902000
  scratchl;                                                    <<rwp31>>35904000
                                                               <<rwp31>>35906000
logical array                                                  <<rwp31>>35908000
  scrd0(*) = scratchd,                                         <<rwp31>>35910000
  scrd1(*) = scrd0(1);                                         <<rwp31>>35912000
                                                               <<rwp31>>35914000
equate                                                         <<rwp31>>35916000
  mpe4 = false,                                                <<r8331>>35918000
  left'byte'start = false,                                     <<rwp31>>35920000
  right'byte'start = true,                                     <<rwp31>>35922000
  adcc'id = %(16)8001,                                         << adcc>>35924000
  adcc'extend'id = %(16)8011,                                  << adcc>>35926000
  atp'id = %(16)500f,                                          << adcc>>35928000
  tic'id = %(16)5004,        <<channel id of mighty-mouse atp>><<r8331>>35930000
  neither'type = 0,                                            << adcc>>35932000
  adcc'type = 2,                                               << adcc>>35934000
  atp'type = 4,                                                << adcc>>35936000
  atp'old'id = 0,                                              << adcc>>35938000
  iltx'chan'type = 4,                                          << adcc>>35940000
  blanks = %020040,                                            << adcc>>35942000
  assumed'iltx'size = 6,                                       <<rwp31>>35944000
  iltx'tdsdseg = 0,                                            <<rwp31>>35946000
  iltx'tdsbank = 1,                                            <<rwp31>>35948000
  iltx'tdsaddr = 2,                                            <<rwp31>>35950000
  iltx'iplab = 5;                                              <<rwp31>>35952000
                                                               <<rwp31>>35954000
equate                                                         <<rwp31>>35956000
  dl'ldevunit = 3,                                             <<mpev >>35958000
  dl'dltp = 4,                                                 <<mpev >>35960000
  dl'pd'ditp = 9,                                              <<mpev >>35962000
  dl'cnfgunit = 10,                                            <<mpev >>35964000
  dl'ldevunit4 = 3,                                            <<mpev >>35966000
  dl'dltp4 = 4,                                                <<mpev >>35968000
  dl'pd'ditp4 = 9;                                             <<mpev >>35970000
                                                               <<rwp31>>35972000
define                                                         <<rwp31>>35974000
  mpe5 = not mpe4#,                                            <<r8331>>35976000
  channel'tds'split = split'tds#,                              <<r8331>>35978000
  md'cnfgunit4 = (0:8)#,                                       <<mpev >>35980000
  md'ldev4 = (8:8)#,                                           <<mpev >>35982000
  md'cnfgunit = (8:8)#;                                        <<mpev >>35984000
                                                               <<rwp31>>35986000
equate                                                         <<rwp31>>35988000
  dlt'dtype = 5,                                               <<rwp31>>35990000
  tds'tbuftbl'p = 2,                                           <<rwp31>>35992000
  tds'portdump'p = 13,                                         <<rwp31>>35994000
  pd'hwditp = 0,                                               <<rwp31>>35996000
  pd'old'ppp = 6,                                              <<rwp31>>35998000
  pd'headtbuf = 2,                                             <<rwp31>>36000000
  pd'tailtbuf = 3,                                             <<rwp31>>36002000
  pd'term'type = 11,                                           << adcc>>36004000
  hw'cp'p = 2,                                                 <<rwp31>>36006000
  pp'fname'wrd = 0,                                            <<rwp31>>36008000
  pp'name'valid = 15,                                          << adcc>>36010000
  pp'vfc = 12,                                                 <<rwp31>>36012000
  vfc'fname'wrd = 0,                                           <<rwp31>>36014000
  vfc'init'ptr = 13;                                           <<rwp31>>36016000
                                                               <<rwp31>>36018000
define                                                         <<rwp31>>36020000
  name'valid = (0:1) #,                                        << adcc>>36022000
  termtype'loc = (8:8) #,                                      << adcc>>36024000
  dlt'ditsize = (0:8)#;                                        <<rwp31>>36026000
                                                               <<rwp31>>36028000
equate                                                         <<rwp31>>36030000
  pp'fname'len = 12,                                           <<rwp31>>36032000
  vfc'fname'len = 12,                                          <<rwp31>>36034000
  max'vfc'initbufs = 1,                                        <<rwp31>>36036000
  max'vfc'databufs = 2,                                        <<rwp31>>36038000
  max'vfc'bufs =                                               <<rwp31>>36040000
     max'vfc'initbufs + max'vfc'databufs,                      <<rwp31>>36042000
  ppp'length = 5;                                              <<rwp31>>36044000
                                                               <<rwp31>>36046000
                                                               <<rwp31>>36048000
<<ioq/tbuf information-block structure>>                       <<rwp31>>36050000
equate                                                         <<rwp31>>36052000
  ioq'total          = 0,                                      <<rwp31>>36054000
  ioq'info'bufoffset = 1,                                      <<rwp31>>36056000
  ioq'info'flags     = 2,                                      <<rwp31>>36058000
                                                               <<rwp31>>36060000
<<vfc information-block structure>>                            <<rwp31>>36062000
  vfc'info           = 0,                                      <<rwp31>>36064000
  vfc'info'nextp     = 1;                                      <<rwp31>>36066000
                                                               <<rwp31>>36068000
                                                               <<rwp31>>36070000
define                                                         <<rwp31>>36072000
  tbufs'dumped = (0:2) = 1#,                                   <<rwp31>>36074000
  num'sbufs'tbufs = (2:14)#,                                   <<rwp31>>36076000
  vfc'dumped = (0:1)#,                                         <<rwp31>>36078000
  num'initbufs = (8:4)#,                                       <<rwp31>>36080000
  num'databufs = (12:4)#;                                      <<rwp31>>36082000
                                                               <<rwp31>>36084000
                                                               <<rwp31>>36086000
<< these are misc equates for the atp dump format routine : >> <<rwp31>>36088000
                                                               <<rwp31>>36090000
equate                                                         <<rwp31>>36092000
  max'tbufs'ever = 12,                                         <<rwp31>>36094000
  max'ioqs'ever = 255,                                         <<rwp31>>36096000
  tbuf'size = 69,  << # words in an atp tbuf >>                <<rwp31>>36098000
  sbuf'size = 128, << # words in an sbuf >>                    <<rwp31>>36100000
  ioq'size = 11;   << # words in an ioq >>                     <<rwp31>>36102000
                                                               <<rwp31>>36104000
integer                                                        <<rwp31>>36106000
  initbufs,                                                    <<rwp31>>36108000
  databufs;                                                    <<rwp31>>36110000
                                                               <<rwp31>>36112000
<<declarations for pcc memory-dump formatting>>                <<rwp31>>36114000
                                                               <<rwp31>>36116000
equate                                                         <<rwp31>>36118000
                                                               <<rwp31>>36120000
<<number of bytes dumped by the pcc for : >>                   <<rwp31>>36122000
  stackptr'len    = 2,                                         <<rwp31>>36124000
  lowmem'len      = 21,                                        <<rwp31>>36126000
  highmem'len     = 128,                                       <<rwp31>>36128000
                                                               <<rwp31>>36130000
<<byte offsets into the dump buffer for : >>                   <<rwp31>>36132000
  stackptr'offset = 0,                                         <<rwp31>>36134000
  lowmem'offset   = stackptr'offset + stackptr'len,            <<rwp31>>36136000
  highmem'offset  = lowmem'offset + lowmem'len,                <<rwp31>>36138000
                                                               <<rwp31>>36140000
<<byte offsets to print along with the memory dump>>           <<rwp31>>36142000
  low'start'addr  = %(16)0000,                                 <<rwp31>>36144000
  high'start'addr = %(16)0080,                                 <<rwp31>>36146000
                                                               <<rwp31>>36148000
<<total length of the dump>>                                   <<rwp31>>36150000
  numbytes        = stackptr'len + lowmem'len + highmem'len,   <<rwp31>>36152000
  numwords        = numbytes/2 + 1,   <<equivalent # words>>   <<rwp31>>36154000
                                                               <<rwp31>>36156000
                                                               <<rwp31>>36158000
<<miscellaneous>>                                              <<rwp31>>36160000
  one'word        = 1,                                         <<r8331>>36162000
  two'word        = 2,                                         <<r8331>>36164000
  use'ascii       = true,      <<include ascii in dump>>       <<rwp31>>36166000
  base'is'hex     = 16;        <<do dump in hexadecimal>>      <<rwp31>>36168000
                                                               <<rwp31>>36170000
integer                                                        <<rwp31>>36172000
  wordcount;                   <<loop counter>>                <<rwp31>>36174000
                                                               <<rwp31>>36176000
logical array                                                  <<rwp31>>36178000
  tempbuf(0:numwords),      <<pcc memory to be printed>>       <<rwp31>>36180000
  pcc'mem(0:127);           <<local copy of pcc memory>>       <<rwp31>>36182000
                                                               <<rwp31>>36184000
byte array                                                     <<rwp31>>36186000
  tempbbuf(*) = tempbuf,    <<byte-oriented scratch buffer>>   <<rwp31>>36188000
  bpcc'mem (*) = pcc'mem;   <<pcc memory in a byte format>>    <<rwp31>>36190000
                                                               << adcc>>36192000
logical array                                                  <<rwp31>>36194000
  filename(0:11);                                              <<rwp31>>36196000
                                                               <<rwp31>>36198000
                                                               <<rwp31>>36200000
                                                               <<rwp31>>36202000
<<past and present lynx'error data structures>>                <<rwp31>>36204000
define                                                         <<rwp31>>36206000
  dump'control'length   = dumplengths(0)#,                     <<rwp31>>36208000
  tds'pri'length        = dumplengths(1)#,                     <<rwp31>>36210000
  tds'sec'length        = dumplengths(2)#,                     <<rwp31>>36212000
  mon'dit'length        = dumplengths(3)#,                     <<rwp31>>36214000
  pd'fdit'length        = dumplengths(4)#,                     <<rwp31>>36216000
  pd'ppdit'length       = dumplengths(5)#,                     <<rwp31>>36218000
  pd'vdit'length        = dumplengths(6)#,                     <<rwp31>>36220000
  hw'dit'length         = dumplengths(7)#,                     <<rwp31>>36222000
  tbuf'tbl'length       = dumplengths(8)#,                     <<rwp31>>36224000
  cntrl'prog'length     = dumplengths(9)#,                     <<rwp31>>36226000
  lpdt'length           = dumplengths(10)#,                    <<rwp31>>36228000
  dlt'length            = dumplengths(11)#,                    <<rwp31>>36230000
  drt'length            = dumplengths(12)#,                    <<rwp31>>36232000
  ldt'length            = dumplengths(13)#,                    <<rwp31>>36234000
  pcb'length            = dumplengths(14)#,                    <<rwp31>>36236000
  ldtpcb'length         = dumplengths(15)#,                    <<rwp31>>36238000
  pcc'memory'length     = dumplengths(16)#,                    <<rwp31>>36240000
  atp'regs'length       = dumplengths(17)#,                    <<rwp31>>36242000
  stack'length          = dumplengths(18)#,                    <<rwp31>>36244000
  ilt'size              = dumplengths(19)#,                    <<rwp31>>36246000
  iltx'fullsize         = dumplengths(20)#,                    <<rwp31>>36248000
  iltx'size             = dumplengths(21)#,                    <<rwp31>>36250000
  vfc'sir'length        = dumplengths(22)#,                    <<rwp31>>36252000
  vfc'info'length       = dumplengths(23)#,                    <<rwp31>>36254000
  vfc'entry'length      = dumplengths(24)#,                    <<rwp31>>36256000
  vfc'buf'length        = dumplengths(25)#,                    <<rwp31>>36258000
  ioq'tbuf'info'len     = dumplengths(26)#,                    <<rwp31>>36260000
  ioq'length           = dumplengths(27)#,                     << adcc>>36262000
  <<adcc special variables>>                                   << adcc>>36264000
  tds'header'length    = dumplengths(28)#,                     << adcc>>36266000
  chan'prog'length     = dumplengths(29)#;                     << adcc>>36268000
                                                               <<rwp31>>36270000
equate                                                         <<rwp31>>36272000
  highlength =        <<highest index in dumplengths>>         <<rwp31>>36274000
  29;                                                          << adcc>>36276000
                                                               <<rwp31>>36278000
                                                               <<rwp31>>36280000
<<dump area containing known-length data-structures>>          <<rwp31>>36282000
define                                                         <<rwp31>>36284000
  dump'control'offset   = dumpoffsets(0)#,                     <<rwp31>>36286000
  tds'pri'offset        = dumpoffsets(1)#,                     <<rwp31>>36288000
  tds'sec'offset        = dumpoffsets(2)#,                     <<rwp31>>36290000
  mon'dit'offset        = dumpoffsets(3)#,                     <<rwp31>>36292000
  pd'fdit'offset        = dumpoffsets(4)#,                     <<rwp31>>36294000
  pd'ppdit'offset       = dumpoffsets(5)#,                     <<rwp31>>36296000
  pd'vdit'offset        = dumpoffsets(6)#,                     <<rwp31>>36298000
  hw'dit'offset         = dumpoffsets(7)#,                     <<rwp31>>36300000
  tbuf'tbl'offset       = dumpoffsets(8)#,                     <<rwp31>>36302000
  cntrl'prog'offset     = dumpoffsets(9)#,                     <<rwp31>>36304000
  lpdt'offset           = dumpoffsets(10)#,                    <<rwp31>>36306000
  dlt'offset            = dumpoffsets(11)#,                    <<rwp31>>36308000
  drt'offset            = dumpoffsets(12)#,                    <<rwp31>>36310000
  ldt'offset            = dumpoffsets(13)#,                    <<rwp31>>36312000
  pcb'offset            = dumpoffsets(14)#,                    <<rwp31>>36314000
  ldtpcb'offset         = dumpoffsets(15)#,                    <<rwp31>>36316000
  pcc'memory'offset     = dumpoffsets(16)#,                    <<rwp31>>36318000
  atp'regs'offset       = dumpoffsets(17)#,                    <<rwp31>>36320000
  stack'offset          = dumpoffsets(18)#,                    <<rwp31>>36322000
  ilt'offset            = dumpoffsets(19)#,                    <<rwp31>>36324000
  variable'area'offset  = dumpoffsets(20)#;                    <<rwp31>>36326000
                                                               <<rwp31>>36328000
<<vfc variable-length dump area>>                              <<rwp31>>36330000
define                                                         <<rwp31>>36332000
  vfc'sir'offset        = dumpoffsets(21)#,                    <<rwp31>>36334000
  vfc'info'offset       = dumpoffsets(22)#,                    <<rwp31>>36336000
  vfc'entry'offset      = dumpoffsets(23)#,                    <<rwp31>>36338000
  vfc'buf'offset        = dumpoffsets(24)#;                    <<rwp31>>36340000
                                                               <<rwp31>>36342000
<<ioq/tbuf variable-length dump area>>                         <<rwp31>>36344000
define                                                         <<rwp31>>36346000
  ioq'tbuf'info         = dumpoffsets(25)#,                    <<rwp31>>36348000
  ioq'tbuf'offset       = dumpoffsets(26)#;                    <<r8331>>36350000
                                                               << adcc>>36352000
<<adcc offsets in dump area>>                                  << adcc>>36354000
define                                                         << adcc>>36356000
  tds'header'offset    = dumpoffsets(27)#,                     << adcc>>36358000
  chan'prog'offset     = dumpoffsets(28)#;                     << adcc>>36360000
                                                               <<rwp31>>36362000
<<pointers to special items in dump area>>                     <<r8331>>36364000
define                                                         <<r8331>>36366000
  tds'vuuff'ptr         = dumpoffsets(29)#,                    <<r8331>>36368000
  tds'versions'ptr      = dumpoffsets(30)#;                    <<r8331>>36370000
                                                               <<r8331>>36372000
                                                               <<r8331>>36374000
equate                                                         <<rwp31>>36376000
  highoffset =          <<highest index in dumpoffsets>>       <<rwp31>>36378000
  30;                                                          <<r8331>>36380000
                                                               <<rwp31>>36382000
                                                               <<rwp31>>36384000
                                                               <<rwp31>>36386000
integer array                                                  <<rwp31>>36388000
  dumplengths(0:highlength),                                   <<rwp31>>36390000
  dumpoffsets(0:highoffset);                                   <<rwp31>>36392000
                                                               <<rwp31>>36394000
integer                                                        <<rwp31>>36396000
  vfc'ptr,                                                     <<rwp31>>36398000
  ioq'ptr;                                                     <<rwp31>>36400000
$page                                                          <<rwp31>>36402000
subroutine get'channel'type;                                   <<r8331>>36404000
                                                               <<r8331>>36406000
comment *******************************************************<<r8331>>36408000
*                                                              <<r8331>>36410000
* get'channel'type --                                          <<r8331>>36412000
*                                                              <<r8331>>36414000
* determines the channel type from the iltx, where the actual  <<r8331>>36416000
* channel i.d. has been stored.                                <<r8331>>36418000
*                                                              <<r8331>>36420000
* three possible channel types are possible: atp/tic, adcc,    <<r8331>>36422000
* or neither. the earliest versions of atp did not store the   <<r8331>>36424000
* channel type, so that word is zero.                          <<r8331>>36426000
*                                                              <<r8331>>36428000
***************************************************************<<r8331>>36430000
;                                                              <<r8331>>36432000
                                                               <<r8331>>36434000
begin                                                          << adcc>>36436000
                                                               << adcc>>36438000
  type1:= core(lociltxl+double(iltx'chan'type)); <<1st tds>>   << adcc>>36440000
  type2:= core(lociltxu+double(iltx'chan'type)); <<2nd tds>>   << adcc>>36442000
                                                               << adcc>>36444000
  if type1 = adcc'id or type1 = adcc'extend'id then            << adcc>>36446000
     channel'type:= adcc'type                                  << adcc>>36448000
  else                                                         << adcc>>36450000
    if type1 = atp'id or type1 = tic'id then                   <<r8331>>36452000
       channel'type:= atp'type                                 << adcc>>36454000
    else  <<error, old atp, or 1st tds not built>>             << adcc>>36456000
      if type1 <> atp'old'id then                              << adcc>>36458000
         channel'type:= neither'type  <<**error**>>            << adcc>>36460000
      else                                                     << adcc>>36462000
        if not split'tds then                                  << adcc>>36464000
           channel'type:= atp'type <<earlier version>>         << adcc>>36466000
        else   <<split tds>>                                   << adcc>>36468000
        if type2 = adcc'id or type2 = adcc'extend'id then      << adcc>>36470000
           channel'type:= adcc'type                            << adcc>>36472000
        else                                                   << adcc>>36474000
        if type2 = atp'id or type2 = tic'id                    <<r8331>>36476000
             or type2 = atp'old'id then                        <<r8331>>36478000
           channel'type:= atp'type                             << adcc>>36480000
        else                                                   << adcc>>36482000
           channel'type:= neither'type;  <<**error**>>         << adcc>>36484000
                                                               << adcc>>36486000
  <<note: the above coding ignored the possibility of not  >>  << adcc>>36488000
 <<   atp type but has zero in both iltx channel type.     >>  << adcc>>36490000
                                                               << adcc>>36492000
end;                                                           << adcc>>36494000
$page                                                          <<r8331>>36496000
subroutine decode'version ( mode, addr );                      <<r8331>>36498000
  value    mode, addr;                                         <<r8331>>36500000
  integer  mode;                                               <<r8331>>36502000
  double   addr;                                               <<r8331>>36504000
                                                               <<r8331>>36506000
comment *******************************************************<<r8331>>36508000
*                                                              <<r8331>>36510000
* decode'version --                                            <<r8331>>36512000
*                                                              <<r8331>>36514000
* translates a 2-word version number stored in "versiond"      <<r8331>>36516000
* into an ascii version number of the form "A.12.34", and      <<r8331>>36518000
* stores it in the output buffer starting at the address of    <<r8331>>36520000
* "pbuf".                                                      <<r8331>>36522000
*                                                              <<r8331>>36524000
* the input value must have been encoded in the form:          <<r8331>>36526000
*      versiond := 10000 * vers + 100 * update + fix.          <<r8331>>36528000
*                                                              <<r8331>>36530000
***************************************************************<<r8331>>36532000
;                                                              <<r8331>>36534000
                                                               <<r8331>>36536000
begin                                                          <<r8331>>36538000
                                                               <<r8331>>36540000
if mode = two'word then                                        <<r8331>>36542000
  begin                                                        <<r8331>>36544000
  versiond := dcore ( addr );                                  <<r8331>>36546000
  ver      := logical ( versiond / 10000d ) mod 27;            <<r8331>>36548000
  versiond := versiond - ( double ( ver ) * 10000d );          <<r8331>>36550000
  upd      := logical ( versiond / 100d ) mod 100;             <<r8331>>36552000
  fix      := logical ( versiond - ( double ( upd ) * 100d ))  <<r8331>>36554000
                           mod 100;                            <<r8331>>36556000
  end                                                          <<r8331>>36558000
else                                                           <<r8331>>36560000
  begin                                                        <<r8331>>36562000
  versionl := core ( addr );                                   <<r8331>>36564000
  ver      := ( versionl / 10000 ) mod 27;                     <<r8331>>36566000
  versionl := versionl - ( ver * 10000 );                      <<r8331>>36568000
  upd      := ( versionl / 100 ) mod 100;                      <<r8331>>36570000
  fix      := ( versionl - ( upd * 100 )) mod 100;             <<r8331>>36572000
  end;                                                         <<r8331>>36574000
                                                               <<r8331>>36576000
                                                               <<r8331>>36578000
<< now load up the output buffer, byte by byte. it has to    >><<r8331>>36580000
<< end up in the form "A.00.00". force older versions to "A".>><<r8331>>36582000
                                                               <<r8331>>36584000
if ver = 0 then                                                <<r8331>>36586000
  pbuf ( 0 ) := byte ( 65 )                <<force to "A">>    <<r8331>>36588000
else                                                           <<r8331>>36590000
  pbuf ( 0 ) := byte ( ver + 64 );                             <<r8331>>36592000
pbuf ( 1 ) := ".";                                             <<r8331>>36594000
pbuf ( 2 ) := byte (( upd / 10 ) + 48 );                       <<r8331>>36596000
pbuf ( 3 ) := byte (( upd mod 10 ) + 48 );                     <<r8331>>36598000
pbuf ( 4 ) := ".";                                             <<r8331>>36600000
pbuf ( 5 ) := byte (( fix / 10 ) + 48 );                       <<r8331>>36602000
pbuf ( 6 ) := byte (( fix mod 10 ) + 48 );                     <<r8331>>36604000
                                                               <<r8331>>36606000
end;                                                           << adcc>>36608000
                                                               << adcc>>36610000
$page                                                          << adcc>>36612000
logical subroutine load'dump'info ( tds'ver, chan'type );      <<r8331>>36614000
  value     tds'ver, chan'type;                                <<r8331>>36616000
  integer   tds'ver;                                           <<r8331>>36618000
  integer chan'type;                                           <<r8331>>36620000
                                                               <<rwp31>>36622000
comment *******************************************************<<r8331>>36624000
*                                                              <<r8331>>36626000
* load'dump'info --                                            <<r8331>>36628000
*                                                              <<r8331>>36630000
* loads the global values for all the dump area lengths and    <<r8331>>36632000
* offsets into the dump area, based on the tds version id.     <<r8331>>36634000
*                                                              <<r8331>>36636000
* if a certain data structure does not exist in the dump area  <<r8331>>36638000
* of a tds of the requested version id, then zero is returned  <<r8331>>36640000
* for the length of that data structure (and the offset will be<<r8331>>36642000
* zero also).                                                  <<r8331>>36644000
*                                                              <<r8331>>36646000
* true is returned unless the tds version is unknown.          <<r8331>>36648000
*                                                              <<r8331>>36650000
***************************************************************<<r8331>>36652000
;                                                              <<r8331>>36654000
                                                               <<rwp31>>36656000
begin                                                          <<rwp31>>36658000
                                                               <<rwp31>>36660000
<<initialize both buffers to zero>>                            <<rwp31>>36662000
move dumplengths := 0;                                         <<rwp31>>36664000
move dumplengths(1) := dumplengths,(highlength);               <<rwp31>>36666000
move dumpoffsets := 0;                                         <<rwp31>>36668000
move dumpoffsets(1) := dumpoffsets,(highoffset);               <<rwp31>>36670000
                                                               <<rwp31>>36672000
load'dump'info := false;      <<set bad until done>>           <<rwp31>>36674000
                                                               <<rwp31>>36676000
                                                               <<rwp31>>36678000
$page                                                          <<r8331>>36680000
<< m p e - i v    original tds, pre-table-driven-termtypes   >><<r8331>>36682000
<<    a t p       this is c.01.01 and before, including      >><<r8331>>36684000
<<                impact, q, q-delta 1, q-delta 2, and       >><<r8331>>36686000
<<                the mpe-v "P1" cache-i opsys software.     >><<r8331>>36688000
                                                               <<r8331>>36690000
if ( tds'ver = -1 ) and ( chan'type = atp'type ) and mpe4      <<r8331>>36692000
then                                                           <<r8331>>36694000
begin                                                          <<r8331>>36696000
                                                               <<r8331>>36698000
<<lengths of tables in dump area>>                             <<r8331>>36700000
  dump'control'length := 1;                                    <<r8331>>36702000
  tds'pri'length := 14;                                        <<r8331>>36704000
                                                               <<r8331>>36706000
<<special for split-tds development tds! >>                    <<r8331>>36708000
  if channel'tds'split then tds'pri'length := 16;              <<r8331>>36710000
                                                               <<r8331>>36712000
  tds'sec'length := 10;                                        <<r8331>>36714000
  mon'dit'length := 20;                                        <<r8331>>36716000
  pd'fdit'length := 11;                                        <<r8331>>36718000
  pd'vdit'length := 26;                                        <<r8331>>36720000
  hw'dit'length := 50;                                         <<r8331>>36722000
  tbuf'tbl'length := 10;    <<not dumped, but does exist.>>    <<r8331>>36724000
  cntrl'prog'length := 16;                                     <<r8331>>36726000
  lpdt'length := 2;                                            <<r8331>>36728000
  dlt'length := 8;                                             <<r8331>>36730000
  drt'length := 4;                                             <<r8331>>36732000
  ldt'length := 10;                                            <<r8331>>36734000
  pcb'length := 16;                                            <<r8331>>36736000
  ldtpcb'length := 16;                                         <<r8331>>36738000
  pcc'memory'length := 128;                                    <<r8331>>36740000
  atp'regs'length := 16;                                       <<r8331>>36742000
  stack'length := 128;                                         <<r8331>>36744000
  ioq'tbuf'info'len := 3;                                      <<r8331>>36746000
  ioq'length := 11;                                            <<r8331>>36748000
  ilt'size := 14;                                              <<r8331>>36750000
  iltx'size := 6;                                              <<r8331>>36752000
  iltx'fullsize := 6;                                          <<r8331>>36754000
                                                               <<r8331>>36756000
<<special for split-tds development tds! >>                    <<r8331>>36758000
  if channel'tds'split then iltx'fullsize := 12;               <<r8331>>36760000
                                                               <<r8331>>36762000
                                                               <<r8331>>36764000
<<format of dump area>>                                        <<r8331>>36766000
  dump'control'offset := 0;                                    <<r8331>>36768000
  tds'pri'offset := dump'control'offset + dump'control'length; <<r8331>>36770000
  tds'sec'offset := tds'pri'offset + tds'pri'length;           <<r8331>>36772000
  mon'dit'offset := tds'sec'offset + tds'sec'length;           <<r8331>>36774000
  pd'fdit'offset := mon'dit'offset + mon'dit'length;           <<r8331>>36776000
  pd'vdit'offset := pd'fdit'offset + pd'fdit'length;           <<r8331>>36778000
  hw'dit'offset := pd'vdit'offset + pd'vdit'length;            <<r8331>>36780000
  cntrl'prog'offset := hw'dit'offset + hw'dit'length;          <<r8331>>36782000
  lpdt'offset := cntrl'prog'offset + cntrl'prog'length;        <<r8331>>36784000
  dlt'offset := lpdt'offset + lpdt'length;                     <<r8331>>36786000
  drt'offset := dlt'offset + dlt'length;                       <<r8331>>36788000
  ldt'offset := drt'offset + drt'length;                       <<r8331>>36790000
  pcb'offset := ldt'offset + ldt'length;                       <<r8331>>36792000
  ldtpcb'offset := pcb'offset + pcb'length;                    <<r8331>>36794000
  pcc'memory'offset := ldtpcb'offset + ldtpcb'length;          <<r8331>>36796000
  atp'regs'offset := pcc'memory'offset + pcc'memory'length;    <<r8331>>36798000
  stack'offset := atp'regs'offset + atp'regs'length;           <<r8331>>36800000
  ilt'offset := stack'offset + stack'length;                   <<r8331>>36802000
  variable'area'offset := ilt'offset + ilt'size +              <<r8331>>36804000
                          iltx'fullsize;                       <<r8331>>36806000
                                                               <<r8331>>36808000
  ioq'tbuf'info := 0;                                          <<r8331>>36810000
  ioq'tbuf'offset := ioq'tbuf'info + ioq'tbuf'info'len;        <<r8331>>36812000
                                                               <<r8331>>36814000
                                                               <<r8331>>36816000
<< table-relative pointers to important elements >>            <<r8331>>36818000
  tds'versions'ptr := 17;      <<1-word versions>>             <<r8331>>36820000
                                                               <<r8331>>36822000
<< special for split-tds development tds! >>                   <<r8331>>36824000
  if channel'tds'split then tds'versions'ptr := 19;            <<r8331>>36826000
                                                               <<r8331>>36828000
end                                                            <<r8331>>36830000
$page                                                          <<r8331>>36832000
<< m p e - i v    tds, atp enhcmt for table-driven termtypes >><<r8331>>36834000
<<    a t p       this is the experimental workstation i     >><<r8331>>36836000
<<                opsys software under the old r-mit and ws. >><<r8331>>36838000
                                                               <<r8331>>36840000
else                                                           <<r8331>>36842000
if ( tds'ver = 1 ) and ( chan'type = atp'type ) and mpe4       <<r8331>>36844000
then                                                           <<r8331>>36846000
begin                                                          <<r8331>>36848000
                                                               <<r8331>>36850000
<<lengths of tables in dump area>>                             <<r8331>>36852000
  dump'control'length := 1;                                    <<r8331>>36854000
  tds'pri'length := 16;  <<split'tds>>                         <<r8331>>36856000
  tds'sec'length := 10;                                        <<r8331>>36858000
  mon'dit'length := 20;                                        <<r8331>>36860000
  pd'fdit'length := 11;                                        <<r8331>>36862000
  pd'ppdit'length := 76;       <<lynx2>>                       <<r8331>>36864000
  pd'vdit'length := 26;                                        <<r8331>>36866000
  hw'dit'length := 50;                                         <<r8331>>36868000
  tbuf'tbl'length := 10;       <<lynx2>>                       <<r8331>>36870000
  cntrl'prog'length := 16;                                     <<r8331>>36872000
  vfc'sir'length := 2;         <<lynx2>>                       <<r8331>>36874000
  vfc'info'length := 2;        <<lynx2>>                       <<r8331>>36876000
  vfc'entry'length := 16;      <<lynx2>>                       <<r8331>>36878000
  vfc'buf'length := 69;        <<lynx2>>                       <<r8331>>36880000
  lpdt'length := 2;                                            <<r8331>>36882000
  dlt'length := 8;                                             <<r8331>>36884000
  drt'length := 4;                                             <<r8331>>36886000
  ldt'length := 10;                                            <<r8331>>36888000
  pcb'length := 16;                                            <<r8331>>36890000
  ldtpcb'length := 16;                                         <<r8331>>36892000
  pcc'memory'length := 128;                                    <<r8331>>36894000
  atp'regs'length := 16;                                       <<r8331>>36896000
  stack'length := 128;                                         <<r8331>>36898000
  ioq'tbuf'info'len := 3;                                      <<r8331>>36900000
  ioq'length := 11;                                            <<r8331>>36902000
  ilt'size := 14;                                              <<r8331>>36904000
  iltx'size := 6;                                              <<r8331>>36906000
  iltx'fullsize := 12;         <<lynx2>>                       <<r8331>>36908000
                                                               <<r8331>>36910000
<<format of dump area>>                                        <<r8331>>36912000
  dump'control'offset := 0;                                    <<r8331>>36914000
  tds'pri'offset := dump'control'offset + dump'control'length; <<r8331>>36916000
  tds'sec'offset := tds'pri'offset + tds'pri'length;           <<r8331>>36918000
  mon'dit'offset := tds'sec'offset + tds'sec'length;           <<r8331>>36920000
  pd'fdit'offset := mon'dit'offset + mon'dit'length;           <<r8331>>36922000
  pd'ppdit'offset := pd'fdit'offset + pd'fdit'length;          <<r8331>>36924000
  pd'vdit'offset := pd'ppdit'offset + pd'ppdit'length;         <<r8331>>36926000
  hw'dit'offset := pd'vdit'offset + pd'vdit'length;            <<r8331>>36928000
  tbuf'tbl'offset := hw'dit'offset + hw'dit'length;            <<r8331>>36930000
  cntrl'prog'offset := tbuf'tbl'offset + tbuf'tbl'length;      <<r8331>>36932000
  lpdt'offset := cntrl'prog'offset + cntrl'prog'length;        <<r8331>>36934000
  dlt'offset := lpdt'offset + lpdt'length;                     <<r8331>>36936000
  drt'offset := dlt'offset + dlt'length;                       <<r8331>>36938000
  ldt'offset := drt'offset + drt'length;                       <<r8331>>36940000
  pcb'offset := ldt'offset + ldt'length;                       <<r8331>>36942000
  ldtpcb'offset := pcb'offset + pcb'length;                    <<r8331>>36944000
  pcc'memory'offset := ldtpcb'offset + ldtpcb'length;          <<r8331>>36946000
  atp'regs'offset := pcc'memory'offset + pcc'memory'length;    <<r8331>>36948000
  stack'offset := atp'regs'offset + atp'regs'length;           <<r8331>>36950000
  ilt'offset := stack'offset + stack'length;                   <<r8331>>36952000
  variable'area'offset := ilt'offset + ilt'size +              <<r8331>>36954000
                          iltx'fullsize;                       <<r8331>>36956000
                                                               <<r8331>>36958000
  vfc'sir'offset := 0;                                         <<r8331>>36960000
  vfc'info'offset := vfc'sir'offset + vfc'sir'length;          <<r8331>>36962000
  vfc'entry'offset := vfc'info'offset + vfc'info'length;       <<r8331>>36964000
  vfc'buf'offset := vfc'entry'offset + vfc'entry'length;       <<r8331>>36966000
                                                               <<r8331>>36968000
  ioq'tbuf'info := 0;                                          <<r8331>>36970000
  ioq'tbuf'offset := ioq'tbuf'info + ioq'tbuf'info'len;        <<r8331>>36972000
                                                               <<r8331>>36974000
<< table-relative pointer to important elements >>             <<r8331>>36976000
  tds'versions'ptr := 19;        <<1-word versions>>           <<r8331>>36978000
                                                               <<r8331>>36980000
end                                                            <<r8331>>36982000
$page                                                          <<r8331>>36984000
<< m p e - i v    tds for atp hardware on atp/adcc driver >>   <<r8331>>36986000
<<    a t p       this is the mpe-v "P2" opsys software.  >>   <<r8331>>36988000
                                                               <<r8331>>36990000
else                                                           <<r8331>>36992000
if ( tds'ver = 2 ) and ( chan'type = atp'type ) and mpe4       <<r8331>>36994000
then                                                           <<r8331>>36996000
begin                                                          <<r8331>>36998000
                                                               <<r8331>>37000000
<<lengths of tables in dump area>>                             <<r8331>>37002000
  dump'control'length := 1;                                    <<r8331>>37004000
  tds'pri'length := 16;                                        <<r8331>>37006000
  tds'sec'length := 19;                                        <<r8331>>37008000
  mon'dit'length := 21;                                        <<r8331>>37010000
  pd'fdit'length := 13;                                        <<r8331>>37012000
  pd'ppdit'length := 76;                                       <<r8331>>37014000
  pd'vdit'length := 27;                                        <<r8331>>37016000
  hw'dit'length := 52;                                         <<r8331>>37018000
  tbuf'tbl'length := 10;                                       <<r8331>>37020000
  cntrl'prog'length := 16;                                     <<r8331>>37022000
  vfc'sir'length := 4;                                         <<r8331>>37024000
  vfc'info'length := 2;                                        <<r8331>>37026000
  vfc'entry'length := 16;                                      <<r8331>>37028000
  vfc'buf'length := 69;                                        <<r8331>>37030000
  lpdt'length := 2;          <<mpe-iv>>                        <<r8331>>37032000
  dlt'length := 8;                                             <<r8331>>37034000
  drt'length := 4;                                             <<r8331>>37036000
  ldt'length := 10;          <<mpe-iv>>                        <<r8331>>37038000
  pcb'length := 16;          <<mpe-iv>>                        <<r8331>>37040000
  ldtpcb'length := 16;       <<mpe-iv>>                        <<r8331>>37042000
  pcc'memory'length := 128;                                    <<r8331>>37044000
  atp'regs'length := 16;                                       <<r8331>>37046000
  stack'length := 128;                                         <<r8331>>37048000
  ioq'tbuf'info'len := 3;                                      <<r8331>>37050000
  ioq'length := 11;          <<mpe-iv>>                        <<r8331>>37052000
  ilt'size := 14;                                              <<r8331>>37054000
  iltx'size := 6;                                              <<r8331>>37056000
  iltx'fullsize := 12;                                         <<r8331>>37058000
                                                               <<r8331>>37060000
<<format of dump area>>                                        <<r8331>>37062000
  dump'control'offset := 0;                                    <<r8331>>37064000
  tds'pri'offset := dump'control'offset + dump'control'length; <<r8331>>37066000
  tds'sec'offset := tds'pri'offset + tds'pri'length;           <<r8331>>37068000
  mon'dit'offset := tds'sec'offset + tds'sec'length;           <<r8331>>37070000
  pd'fdit'offset := mon'dit'offset + mon'dit'length;           <<r8331>>37072000
  pd'ppdit'offset := pd'fdit'offset + pd'fdit'length;          <<r8331>>37074000
  pd'vdit'offset := pd'ppdit'offset + pd'ppdit'length;         <<r8331>>37076000
  hw'dit'offset := pd'vdit'offset + pd'vdit'length;            <<r8331>>37078000
  tbuf'tbl'offset := hw'dit'offset + hw'dit'length;            <<r8331>>37080000
  cntrl'prog'offset := tbuf'tbl'offset + tbuf'tbl'length;      <<r8331>>37082000
  lpdt'offset := cntrl'prog'offset + cntrl'prog'length;        <<r8331>>37084000
  dlt'offset := lpdt'offset + lpdt'length;                     <<r8331>>37086000
  drt'offset := dlt'offset + dlt'length;                       <<r8331>>37088000
  ldt'offset := drt'offset + drt'length;                       <<r8331>>37090000
  pcb'offset := ldt'offset + ldt'length;                       <<r8331>>37092000
  ldtpcb'offset := pcb'offset + pcb'length;                    <<r8331>>37094000
  pcc'memory'offset := ldtpcb'offset + ldtpcb'length;          <<r8331>>37096000
  atp'regs'offset := pcc'memory'offset + pcc'memory'length;    <<r8331>>37098000
  stack'offset := atp'regs'offset + atp'regs'length;           <<r8331>>37100000
  ilt'offset := stack'offset + stack'length;                   <<r8331>>37102000
  variable'area'offset := ilt'offset + ilt'size +              <<r8331>>37104000
                          iltx'fullsize;                       <<r8331>>37106000
                                                               <<r8331>>37108000
  vfc'sir'offset := 0;                                         <<r8331>>37110000
  vfc'info'offset := vfc'sir'offset + vfc'sir'length;          <<r8331>>37112000
  vfc'entry'offset := vfc'info'offset + vfc'info'length;       <<r8331>>37114000
  vfc'buf'offset := vfc'entry'offset + vfc'entry'length;       <<r8331>>37116000
                                                               <<r8331>>37118000
  ioq'tbuf'info := 0;                                          <<r8331>>37120000
  ioq'tbuf'offset := ioq'tbuf'info + ioq'tbuf'info'len;        <<r8331>>37122000
                                                               <<r8331>>37124000
<< table-relative pointers to important elements >>            <<r8331>>37126000
  tds'versions'ptr := 19;                                      <<r8331>>37128000
  tds'vuuff'ptr := 33;                                         <<r8331>>37130000
                                                               <<r8331>>37132000
end                                                            <<r8331>>37134000
$page                                                          <<r8331>>37136000
<< m p e - i v   tds for adcc hardware on atp/adcc driver >>   <<r8331>>37138000
<<   a d c c     this is the mpe-v "P2" opsys software.   >>   <<r8331>>37140000
                                                               <<r8331>>37142000
else                                                           <<r8331>>37144000
if ( tds'ver = 2 ) and ( chan'type = adcc'type ) and mpe4      <<r8331>>37146000
then                                                           <<r8331>>37148000
begin                                                          <<r8331>>37150000
                                                               <<r8331>>37152000
<<lengths of adcc tables in dump area>>                        <<r8331>>37154000
  dump'control'length := 1;                                    <<r8331>>37156000
  tds'header'length := 35;                                     <<r8331>>37158000
  mon'dit'length := 21;                                        <<r8331>>37160000
  pd'fdit'length := 13;                                        <<r8331>>37162000
  pd'ppdit'length := 76;                                       <<r8331>>37164000
  pd'vdit'length := 27;                                        <<r8331>>37166000
  hw'dit'length := 94;                                         <<r8331>>37168000
  tbuf'tbl'length := 10;                                       <<r8331>>37170000
  chan'prog'length := 200;                                     <<r8331>>37172000
  vfc'sir'length := 4;                                         <<r8331>>37174000
  vfc'info'length := 2;                                        <<r8331>>37176000
  vfc'entry'length := 16;                                      <<r8331>>37178000
  vfc'buf'length := 69;                                        <<r8331>>37180000
  lpdt'length := 2;                <<mpe-iv>>                  <<r8331>>37182000
  dlt'length := 8;                                             <<r8331>>37184000
  drt'length := 4;                                             <<r8331>>37186000
  ldt'length := 10;                <<mpe-iv>>                  <<r8331>>37188000
  pcb'length := 16;                <<mpe-iv>>                  <<r8331>>37190000
  ldtpcb'length := 16;             <<mpe-iv>>                  <<r8331>>37192000
  stack'length := 128;                                         <<r8331>>37194000
  ioq'tbuf'info'len := 3;                                      <<r8331>>37196000
  ioq'length := 11;                <<mpe-iv>>                  <<r8331>>37198000
  ilt'size := 14;                                              <<r8331>>37200000
  iltx'size := 6;                                              <<r8331>>37202000
  iltx'fullsize := 6;                                          <<r8331>>37204000
                                                               <<r8331>>37206000
<<format of dump area>>                                        <<r8331>>37208000
  dump'control'offset := 0;                                    <<r8331>>37210000
  tds'header'offset :=dump'control'offset+dump'control'length; <<r8331>>37212000
  mon'dit'offset := tds'header'offset + tds'header'length;     <<r8331>>37214000
  pd'fdit'offset := mon'dit'offset + mon'dit'length;           <<r8331>>37216000
  pd'ppdit'offset := pd'fdit'offset + pd'fdit'length;          <<r8331>>37218000
  pd'vdit'offset := pd'ppdit'offset + pd'ppdit'length;         <<r8331>>37220000
  hw'dit'offset := pd'vdit'offset + pd'vdit'length;            <<r8331>>37222000
  tbuf'tbl'offset := hw'dit'offset + hw'dit'length;            <<r8331>>37224000
  chan'prog'offset := tbuf'tbl'offset + tbuf'tbl'length;       <<r8331>>37226000
  lpdt'offset := chan'prog'offset + chan'prog'length;          <<r8331>>37228000
  dlt'offset := lpdt'offset + lpdt'length;                     <<r8331>>37230000
  drt'offset := dlt'offset + dlt'length;                       <<r8331>>37232000
  ldt'offset := drt'offset + drt'length;                       <<r8331>>37234000
  pcb'offset := ldt'offset + ldt'length;                       <<r8331>>37236000
  ldtpcb'offset := pcb'offset + pcb'length;                    <<r8331>>37238000
  stack'offset := ldtpcb'offset + ldtpcb'length;               <<r8331>>37240000
  ilt'offset := stack'offset + stack'length;                   <<r8331>>37242000
  variable'area'offset := ilt'offset + ilt'size +              <<r8331>>37244000
                          iltx'size;                           <<r8331>>37246000
                                                               <<r8331>>37248000
  vfc'sir'offset := 0;                                         <<r8331>>37250000
  vfc'info'offset := vfc'sir'offset + vfc'sir'length;          <<r8331>>37252000
  vfc'entry'offset := vfc'info'offset + vfc'info'length;       <<r8331>>37254000
  vfc'buf'offset := vfc'entry'offset + vfc'entry'length;       <<r8331>>37256000
                                                               <<r8331>>37258000
  ioq'tbuf'info := 0;                                          <<r8331>>37260000
  ioq'tbuf'offset := ioq'tbuf'info + ioq'tbuf'info'len;        <<r8331>>37262000
                                                               <<r8331>>37264000
<< table-relative pointers to important elements >>            <<r8331>>37266000
  tds'versions'ptr := 19;                                      <<r8331>>37268000
  tds'vuuff'ptr := 33;                                         <<r8331>>37270000
                                                               <<r8331>>37272000
end                                                            <<r8331>>37274000
$page                                                          <<r8331>>37276000
<< m p e - v    tds for atp hardware on atp/adcc driver >>     <<r8331>>37278000
<<   a t p      this is the mpe-v "E" opsys software.   >>     <<r8331>>37280000
                                                               <<r8331>>37282000
else                                                           <<r8331>>37284000
if ( tds'ver = 2 ) and ( chan'type = atp'type ) and mpe5       <<r8331>>37286000
then                                                           <<r8331>>37288000
begin                                                          <<r8331>>37290000
                                                               <<r8331>>37292000
<<lengths of tables in dump area>>                             <<r8331>>37294000
  dump'control'length := 1;                                    <<r8331>>37296000
  tds'pri'length := 16;                                        <<r8331>>37298000
  tds'sec'length := 19;                                        <<r8331>>37300000
  mon'dit'length := 21;          <<mpe-v>>                     <<r8331>>37302000
  pd'fdit'length := 13;                                        <<r8331>>37304000
  pd'ppdit'length := 76;                                       <<r8331>>37306000
  pd'vdit'length := 27;                                        <<r8331>>37308000
  hw'dit'length := 52;                                         <<r8331>>37310000
  tbuf'tbl'length := 10;                                       <<r8331>>37312000
  cntrl'prog'length := 16;                                     <<r8331>>37314000
  vfc'sir'length := 4;                                         <<r8331>>37316000
  vfc'info'length := 2;                                        <<r8331>>37318000
  vfc'entry'length := 16;                                      <<r8331>>37320000
  vfc'buf'length := 69;                                        <<r8331>>37322000
  lpdt'length := 4;                                            <<r8331>>37324000
  dlt'length := 8;                                             <<r8331>>37326000
  drt'length := 4;                                             <<r8331>>37328000
  ldt'length := 12;                                            <<r8331>>37330000
  pcb'length := 21;                                            <<r8331>>37332000
  ldtpcb'length := 21;                                         <<r8331>>37334000
  pcc'memory'length := 128;                                    <<r8331>>37336000
  atp'regs'length := 16;                                       <<r8331>>37338000
  stack'length := 128;                                         <<r8331>>37340000
  ioq'tbuf'info'len := 3;                                      <<r8331>>37342000
  ioq'length := 12;           <<mpe-v>>                        <<r8331>>37344000
  ilt'size := 14;                                              <<r8331>>37346000
  iltx'size := 6;                                              <<r8331>>37348000
  iltx'fullsize := 12;                                         <<r8331>>37350000
                                                               <<r8331>>37352000
<<format of dump area>>                                        <<r8331>>37354000
  dump'control'offset := 0;                                    <<r8331>>37356000
  tds'pri'offset := dump'control'offset + dump'control'length; <<r8331>>37358000
  tds'sec'offset := tds'pri'offset + tds'pri'length;           <<r8331>>37360000
  mon'dit'offset := tds'sec'offset + tds'sec'length;           <<r8331>>37362000
  pd'fdit'offset := mon'dit'offset + mon'dit'length;           <<r8331>>37364000
  pd'ppdit'offset := pd'fdit'offset + pd'fdit'length;          <<r8331>>37366000
  pd'vdit'offset := pd'ppdit'offset + pd'ppdit'length;         <<r8331>>37368000
  hw'dit'offset := pd'vdit'offset + pd'vdit'length;            <<r8331>>37370000
  tbuf'tbl'offset := hw'dit'offset + hw'dit'length;            <<r8331>>37372000
  cntrl'prog'offset := tbuf'tbl'offset + tbuf'tbl'length;      <<r8331>>37374000
  lpdt'offset := cntrl'prog'offset + cntrl'prog'length;        <<r8331>>37376000
  dlt'offset := lpdt'offset + lpdt'length;                     <<r8331>>37378000
  drt'offset := dlt'offset + dlt'length;                       <<r8331>>37380000
  ldt'offset := drt'offset + drt'length;                       <<r8331>>37382000
  pcb'offset := ldt'offset + ldt'length;                       <<r8331>>37384000
  ldtpcb'offset := pcb'offset + pcb'length;                    <<r8331>>37386000
  pcc'memory'offset := ldtpcb'offset + ldtpcb'length;          <<r8331>>37388000
  atp'regs'offset := pcc'memory'offset + pcc'memory'length;    <<r8331>>37390000
  stack'offset := atp'regs'offset + atp'regs'length;           <<r8331>>37392000
  ilt'offset := stack'offset + stack'length;                   <<r8331>>37394000
  variable'area'offset := ilt'offset + ilt'size +              <<r8331>>37396000
                          iltx'fullsize;                       <<r8331>>37398000
                                                               <<r8331>>37400000
  vfc'sir'offset := 0;                                         <<r8331>>37402000
  vfc'info'offset := vfc'sir'offset + vfc'sir'length;          <<r8331>>37404000
  vfc'entry'offset := vfc'info'offset + vfc'info'length;       <<r8331>>37406000
  vfc'buf'offset := vfc'entry'offset + vfc'entry'length;       <<r8331>>37408000
                                                               <<r8331>>37410000
  ioq'tbuf'info := 0;                                          <<r8331>>37412000
  ioq'tbuf'offset := ioq'tbuf'info + ioq'tbuf'info'len;        <<r8331>>37414000
                                                               <<r8331>>37416000
<< table-relative pointers to important elements >>            <<r8331>>37418000
  tds'versions'ptr := 19;                                      <<r8331>>37420000
  tds'vuuff'ptr := 33;                                         <<r8331>>37422000
                                                               <<r8331>>37424000
end                                                            <<r8331>>37426000
$page                                                          <<r8331>>37428000
<< m p e - v    tds for adcc hardware on atp/adcc driver >>    <<r8331>>37430000
<<  a d c c     this is the mpe-v "E" opsys software.    >>    <<r8331>>37432000
                                                               <<r8331>>37434000
else                                                           <<r8331>>37436000
                                                               <<r8331>>37438000
if ( tds'ver = 2 ) and ( chan'type = adcc'type ) and mpe5      <<r8331>>37440000
then                                                           <<r8331>>37442000
begin                                                          <<r8331>>37444000
                                                               <<r8331>>37446000
<<lengths of adcc tables in dump area>>                        <<r8331>>37448000
  dump'control'length := 1;                                    <<r8331>>37450000
  tds'header'length := 35;                                     <<r8331>>37452000
  mon'dit'length := 21;                                        <<r8331>>37454000
  pd'fdit'length := 13;                                        <<r8331>>37456000
  pd'ppdit'length := 76;                                       <<r8331>>37458000
  pd'vdit'length := 27;                                        <<r8331>>37460000
  hw'dit'length := 94;                                         <<r8331>>37462000
  tbuf'tbl'length := 10;                                       <<r8331>>37464000
  chan'prog'length := 200;                                     <<r8331>>37466000
  vfc'sir'length := 4;                                         <<r8331>>37468000
  vfc'info'length := 2;                                        <<r8331>>37470000
  vfc'entry'length := 16;                                      <<r8331>>37472000
  vfc'buf'length := 69;                                        <<r8331>>37474000
  lpdt'length := 4;                                            <<r8331>>37476000
  dlt'length := 8;                                             <<r8331>>37478000
  drt'length := 4;                                             <<r8331>>37480000
  ldt'length := 12;                                            <<r8331>>37482000
  pcb'length := 21;                                            <<r8331>>37484000
  ldtpcb'length := 21;                                         <<r8331>>37486000
  stack'length := 128;                                         <<r8331>>37488000
  ioq'tbuf'info'len := 3;                                      <<r8331>>37490000
  ioq'length := 12;                                            <<r8331>>37492000
  ilt'size := 14;                                              <<r8331>>37494000
  iltx'size := 6;                                              <<r8331>>37496000
  iltx'fullsize := 6;                                          <<r8331>>37498000
                                                               <<r8331>>37500000
<<format of dump area>>                                        <<r8331>>37502000
  dump'control'offset := 0;                                    <<r8331>>37504000
  tds'header'offset :=dump'control'offset+dump'control'length; <<r8331>>37506000
  mon'dit'offset := tds'header'offset + tds'header'length;     <<r8331>>37508000
  pd'fdit'offset := mon'dit'offset + mon'dit'length;           <<r8331>>37510000
  pd'ppdit'offset := pd'fdit'offset + pd'fdit'length;          <<r8331>>37512000
  pd'vdit'offset := pd'ppdit'offset + pd'ppdit'length;         <<r8331>>37514000
  hw'dit'offset := pd'vdit'offset + pd'vdit'length;            <<r8331>>37516000
  tbuf'tbl'offset := hw'dit'offset + hw'dit'length;            <<r8331>>37518000
  chan'prog'offset := tbuf'tbl'offset + tbuf'tbl'length;       <<r8331>>37520000
  lpdt'offset := chan'prog'offset + chan'prog'length;          <<r8331>>37522000
  dlt'offset := lpdt'offset + lpdt'length;                     <<r8331>>37524000
  drt'offset := dlt'offset + dlt'length;                       <<r8331>>37526000
  ldt'offset := drt'offset + drt'length;                       <<r8331>>37528000
  pcb'offset := ldt'offset + ldt'length;                       <<r8331>>37530000
  ldtpcb'offset := pcb'offset + pcb'length;                    <<r8331>>37532000
  stack'offset := ldtpcb'offset + ldtpcb'length;               <<r8331>>37534000
  ilt'offset := stack'offset + stack'length;                   <<r8331>>37536000
  variable'area'offset := ilt'offset + ilt'size +              <<r8331>>37538000
                          iltx'size;                           <<r8331>>37540000
                                                               <<r8331>>37542000
  vfc'sir'offset := 0;                                         <<r8331>>37544000
  vfc'info'offset := vfc'sir'offset + vfc'sir'length;          <<r8331>>37546000
  vfc'entry'offset := vfc'info'offset + vfc'info'length;       <<r8331>>37548000
  vfc'buf'offset := vfc'entry'offset + vfc'entry'length;       <<r8331>>37550000
                                                               <<r8331>>37552000
  ioq'tbuf'info := 0;                                          <<r8331>>37554000
  ioq'tbuf'offset := ioq'tbuf'info + ioq'tbuf'info'len;        <<r8331>>37556000
                                                               <<r8331>>37558000
<< table-relative pointers to important elements >>            <<r8331>>37560000
  tds'versions'ptr := 19;                                      <<r8331>>37562000
  tds'vuuff'ptr := 33;                                         <<r8331>>37564000
                                                               <<r8331>>37566000
end                                                            <<r8331>>37568000
$page                                                          <<r8331>>37570000
                                                               <<r8331>>37572000
                                                               <<r8331>>37574000
                                                               <<r8331>>37576000
                                                               <<r8331>>37578000
                                                               <<r8331>>37580000
                                                               <<r8331>>37582000
                                                               <<r8331>>37584000
                                                               <<r8331>>37586000
                                                               <<r8331>>37588000
                                                               <<r8331>>37590000
                                                               <<r8331>>37592000
                                                               <<r8331>>37594000
                                                               <<r8331>>37596000
                                                               <<r8331>>37598000
                                                               <<r8331>>37600000
                                                               <<r8331>>37602000
                                                               <<r8331>>37604000
                                                               <<r8331>>37606000
                                                               <<r8331>>37608000
                                                               <<r8331>>37610000
                                                               <<r8331>>37612000
                                                               <<r8331>>37614000
                                                               <<r8331>>37616000
                                                               <<r8331>>37618000
                                                               <<r8331>>37620000
                                                               <<r8331>>37622000
                                                               <<r8331>>37624000
                                                               <<r8331>>37626000
                                                               <<r8331>>37628000
                                                               <<r8331>>37630000
                                                               <<r8331>>37632000
                                                               <<r8331>>37634000
                                                               <<r8331>>37636000
                                                               <<r8331>>37638000
$page                                                          <<r8331>>37640000
<< ( the previous empty lines were reserved for expansion. ) >><<r8331>>37642000
                                                               <<r8331>>37644000
                                                               <<r8331>>37646000
                                                               <<rwp31>>37648000
else                                                           <<rwp31>>37650000
return;     <<unknown tds format--return false value>>         <<rwp31>>37652000
                                                               <<rwp31>>37654000
  load'dump'info := true;    <<return good status>>            <<rwp31>>37656000
                                                               <<rwp31>>37658000
end;    <<subroutine load'dump'info>>                          <<rwp31>>37660000
$page                                                          <<rwp31>>37662000
comment *******************************************************<<r8331>>37664000
*                                                              <<r8331>>37666000
*  print'atp'dump --                                           <<r8331>>37668000
*                                                              <<r8331>>37670000
*  this subroutine is called if the ldev number being          <<r8331>>37672000
*  processed has a dump in the tds, at the completion of the   <<r8331>>37674000
*  dit printing for that ldev. it will format the port-dump    <<r8331>>37676000
*  area of the terminal data segment according to the order    <<r8331>>37678000
*  in which tables were dumped into that area.                 <<r8331>>37680000
*                                                              <<r8331>>37682000
***************************************************************<<r8331>>37684000
;                                                              <<r8331>>37686000
                                                               <<rwp31>>37688000
subroutine print'atp'dump;                                     <<rwp31>>37690000
                                                               <<rwp31>>37692000
begin                                                          <<rwp31>>37694000
                                                               <<rwp31>>37696000
                                                               <<rwp31>>37698000
<<set pointers into variable-length dump area>>                <<rwp31>>37700000
if vfc'sir'length > 0 then                                     <<rwp31>>37702000
begin                                                          <<rwp31>>37704000
  vfc'ptr := variable'area'offset;                             <<rwp31>>37706000
  ioq'ptr := integer(core(locdump + double(vfc'ptr +           <<rwp31>>37708000
                    vfc'info'offset + vfc'info'nextp)));       <<rwp31>>37710000
                                                               <<rwp31>>37712000
<< adjust tds-relative offset for our dump-relative ptr >>     <<rwp31>>37714000
  ioq'ptr := ioq'ptr - integer(locdump - loctds);              <<rwp31>>37716000
                                                               <<rwp31>>37718000
end                                                            <<rwp31>>37720000
else                                                           <<rwp31>>37722000
begin                                                          <<rwp31>>37724000
  vfc'ptr := 0;   <<no vfc>>                                   <<rwp31>>37726000
  ioq'ptr := variable'area'offset;                             <<rwp31>>37728000
end;                                                           <<rwp31>>37730000
                                                               <<rwp31>>37732000
                                                               <<rwp31>>37734000
                                                               <<rwp31>>37736000
newpage;                                                       <<rwp31>>37738000
if channel'type = atp'type  then                               << adcc>>37740000
   move bbuf(40) := "****** ATP ERROR-DUMP AREA ******"        << adcc>>37742000
else                                                           << adcc>>37744000
   move bbuf(40) := "****** ADCC ERROR-DUMP AREA ******";      << adcc>>37746000
printline;                                                     <<rwp31>>37748000
skiplines (1);                                                 <<rwp31>>37750000
                                                               <<rwp31>>37752000
move bbuf(12) := "NUMBER OF ERROR CALLS  =";                   <<rwp31>>37754000
@pbuf := @bbuf + 38;                                           <<rwp31>>37756000
ascii(num'of'dumps, 10, pbuf );                                <<rwp31>>37758000
printline;                                                     <<rwp31>>37760000
                                                               <<rwp31>>37762000
move bbuf(12) := "LOGICAL DEVICE NUMBER  =";                   <<rwp31>>37764000
@pbuf := @bbuf + 38;                                           <<rwp31>>37766000
ascii(dumped'ldev, 10, pbuf );                                 <<rwp31>>37768000
printline;                                                     <<rwp31>>37770000
skiplines (2);                                                 <<rwp31>>37772000
                                                               <<rwp31>>37774000
                                                               <<rwp31>>37776000
if tds'pri'length > 0 then                                     <<rwp31>>37778000
begin                                                          <<rwp31>>37780000
  move bbuf ( 12 ) := "TERMINAL DATA SEGMENT HEADER AREA :";   <<r8331>>37782000
  printline;                                                   <<rwp31>>37784000
  loctable := locdump + double(tds'pri'offset);                <<rwp31>>37786000
  print'octal'dit(loctable, 0, tds'pri'length);                <<rwp31>>37788000
  skiplines(1);                                                <<rwp31>>37790000
                                                               <<rwp31>>37792000
  if tds'sec'length > 0 then                                   <<rwp31>>37794000
  begin                                                        <<rwp31>>37796000
    loctable := locdump + double(tds'sec'offset);              <<rwp31>>37798000
    print'octal'dit(loctable, logical(tds'pri'length),         <<rwp31>>37800000
                                tds'sec'length);               <<rwp31>>37802000
    skiplines(1);                                              <<rwp31>>37804000
  end;                                                         <<rwp31>>37806000
end;                                                           <<rwp31>>37808000
                                                               <<rwp31>>37810000
if tds'header'length > 0 then                                  << adcc>>37812000
begin  <<print adcc header>>                                   << adcc>>37814000
  move bbuf ( 12 ) := "TERMINAL DATA SEGMENT HEADER AREA :";   <<r8331>>37816000
  printline;                                                   << adcc>>37818000
  loctable := locdump + double(tds'header'offset);             << adcc>>37820000
  print'octal'dit(loctable, 0, tds'header'length);             << adcc>>37822000
  skiplines(1);                                                << adcc>>37824000
end;   <<print adcc header>>                                   << adcc>>37826000
                                                               << adcc>>37828000
if mon'dit'length > 0 then                                     <<rwp31>>37830000
begin                                                          <<rwp31>>37832000
  move bbuf(12) := "MONITOR DIT:";                             <<rwp31>>37834000
  printline;                                                   <<rwp31>>37836000
  loctable := locdump + double(mon'dit'offset);                <<rwp31>>37838000
  print'octal'dit(loctable, 0, mon'dit'length);                <<rwp31>>37840000
  skiplines(1);                                                <<rwp31>>37842000
end;                                                           <<rwp31>>37844000
                                                               <<rwp31>>37846000
if pd'ppdit'offset > 0 then                                    <<r8331>>37848000
begin                                                          <<rwp31>>37850000
  move bbuf(12) := "PORT PROTOCOL DIT :";                      <<rwp31>>37852000
  printline;                                                   <<rwp31>>37854000
  loctable := locdump + double(pd'ppdit'offset);               <<rwp31>>37856000
                                                               <<rwp31>>37858000
<<output the termtype filename>>                               <<rwp31>>37860000
  scratchd := double(pp'fname'wrd);                            <<rwp31>>37862000
  indx1 := 0;                                                  <<rwp31>>37864000
  while indx1 < pp'fname'len  do                               <<rwp31>>37866000
  begin                                                        <<rwp31>>37868000
    filename(indx1) := core(loctable + scratchd);              <<rwp31>>37870000
    scratchd := scratchd + 1d;                                 <<rwp31>>37872000
    indx1 := indx1 + 1;                                        <<rwp31>>37874000
  end;                                                         <<rwp31>>37876000
  move bbuf(12):= "(Termtype filename : ";                     <<rwp31>>37878000
  scratchi := decode'filename(filename, bbuf(33));             <<rwp31>>37880000
  move bbuf(33 + scratchi) := ")";                             <<rwp31>>37882000
  printline;                                                   <<rwp31>>37884000
                                                               <<rwp31>>37886000
  print'octal'dit(loctable, 0,                                 <<rwp31>>37888000
                               pd'ppdit'length);               <<rwp31>>37890000
  skiplines(1);                                                <<rwp31>>37892000
end;                                                           <<rwp31>>37894000
                                                               <<rwp31>>37896000
if vfc'sir'length > 0 then                                     <<rwp31>>37898000
begin   <<vfc exists>>                                         <<rwp31>>37900000
                                                               <<rwp31>>37902000
  move bbuf(12) := "VFC SIR TABLE :";                          <<rwp31>>37904000
  printline;                                                   <<rwp31>>37906000
  loctable := locdump + double(vfc'ptr + vfc'sir'offset);      <<rwp31>>37908000
  print'octal'dit(loctable, 0, vfc'sir'length);                <<rwp31>>37910000
  skiplines(1);                                                <<rwp31>>37912000
                                                               <<rwp31>>37914000
<<format vfc entry if it was dumped>>                          <<rwp31>>37916000
  scratchl := core(locdump +                                   <<rwp31>>37918000
              double(vfc'ptr + vfc'info'offset + vfc'info));   <<rwp31>>37920000
                                                               <<rwp31>>37922000
  if scratchl.vfc'dumped then                                  <<rwp31>>37924000
  begin  <<vfc entry dumped>>                                  <<rwp31>>37926000
                                                               <<rwp31>>37928000
    move bbuf(12) := "VFC ENTRY :";                            <<rwp31>>37930000
    printline;                                                 <<rwp31>>37932000
    loctable := locdump + double(vfc'ptr + vfc'entry'offset);  <<rwp31>>37934000
                                                               <<rwp31>>37936000
<<output the vfc filename>>                                    <<rwp31>>37938000
    scratchd := double(vfc'fname'wrd);                         <<rwp31>>37940000
    indx1 := 0;                                                <<rwp31>>37942000
    while indx1 < vfc'fname'len  do                            <<rwp31>>37944000
    begin                                                      <<rwp31>>37946000
      filename(indx1) := core(loctable + scratchd);            <<rwp31>>37948000
      scratchd := scratchd + 1d;                               <<rwp31>>37950000
      indx1 := indx1 + 1;                                      <<rwp31>>37952000
    end;                                                       <<rwp31>>37954000
    move bbuf(12):= "(VFC filename : ";                        <<rwp31>>37956000
    scratchi := decode'filename(filename, bbuf(28));           <<rwp31>>37958000
    move bbuf(28 + scratchi) := ")";                           <<rwp31>>37960000
    printline;                                                 <<rwp31>>37962000
                                                               <<rwp31>>37964000
    print'octal'dit(loctable, 0, vfc'entry'length);            <<rwp31>>37966000
    skiplines(1);                                              <<rwp31>>37968000
                                                               <<rwp31>>37970000
<<print vfc buffers, if dumped>>                               <<rwp31>>37972000
    indx1 := 0;                                                <<rwp31>>37974000
    initbufs := integer(scratchl.num'initbufs);                <<rwp31>>37976000
    databufs := integer(scratchl.num'databufs);                <<rwp31>>37978000
                                                               <<rwp31>>37980000
    while (initbufs > 0) or (databufs > 0) do                  <<rwp31>>37982000
    begin                                                      <<rwp31>>37984000
      if initbufs > 0 then                                     <<rwp31>>37986000
        move bbuf(12) := "VFC INITIALIZATION BUFFER :"         <<rwp31>>37988000
      else                                                     <<rwp31>>37990000
        move bbuf(12) := "VFC DATA BUFFER :";                  <<rwp31>>37992000
      printline;                                               <<rwp31>>37994000
                                                               <<rwp31>>37996000
<<load start, end address for dump, set global flag to>>       <<rwp31>>37998000
<<include ascii, and set global relative-address value>>       <<rwp31>>38000000
      loctable := locdump + double(indx1 * vfc'buf'length      <<rwp31>>38002000
                     + vfc'ptr + vfc'buf'offset);              <<rwp31>>38004000
                                                               <<rwp31>>38006000
      print'octal'dit(loctable, 0, vfc'buf'length,             <<rwp31>>38008000
                           use'ascii);                         <<rwp31>>38010000
                                                               <<rwp31>>38012000
      skiplines(1);                                            <<rwp31>>38014000
                                                               <<rwp31>>38016000
      indx1 := indx1 + 1;                                      <<rwp31>>38018000
      if initbufs > 0 then initbufs := initbufs - 1            <<rwp31>>38020000
      else databufs := databufs - 1;                           <<rwp31>>38022000
    end;                                                       <<rwp31>>38024000
                                                               <<rwp31>>38026000
  end;  <<vfc entry dumped>>                                   <<rwp31>>38028000
                                                               <<rwp31>>38030000
end;  <<vfc exists>>                                           <<rwp31>>38032000
                                                               <<rwp31>>38034000
if pd'fdit'length > 0 then                                     <<rwp31>>38036000
begin                                                          <<rwp31>>38038000
  move bbuf(12) := "PROTOCOL AND DATA-MANAGEMENT DIT :";       <<rwp31>>38040000
  printline;                                                   <<rwp31>>38042000
  loctable := locdump + double(pd'fdit'offset);                <<rwp31>>38044000
  print'octal'dit(loctable, 0, pd'fdit'length);                <<rwp31>>38046000
  skiplines(1);                                                <<rwp31>>38048000
                                                               <<rwp31>>38050000
  loctable := locdump + double(pd'vdit'offset);                <<rwp31>>38052000
  print'octal'dit(loctable, 0, pd'vdit'length);                <<rwp31>>38054000
  skiplines (1);                                               <<rwp31>>38056000
end;                                                           <<rwp31>>38058000
                                                               <<rwp31>>38060000
if hw'dit'length > 0 then                                      <<rwp31>>38062000
begin                                                          <<rwp31>>38064000
  move bbuf(12) := "HARDWARE DIT :";                           <<rwp31>>38066000
  printline;                                                   <<rwp31>>38068000
  loctable := locdump + double(hw'dit'offset);                 <<rwp31>>38070000
  print'octal'dit(loctable, 0, hw'dit'length);                 <<rwp31>>38072000
  skiplines(1);                                                <<rwp31>>38074000
end;                                                           <<rwp31>>38076000
                                                               <<rwp31>>38078000
if channel'type = atp'type and cntrl'prog'length > 0 then      << adcc>>38080000
begin                                                          <<rwp31>>38082000
  move bbuf(12) := "CONTROL PROGRAM :";                        <<rwp31>>38084000
  printline;                                                   <<rwp31>>38086000
  loctable := locdump + double(cntrl'prog'offset);             <<rwp31>>38088000
  print'octal'dit(loctable, 0, cntrl'prog'length);             <<rwp31>>38090000
  skiplines(1);                                                <<rwp31>>38092000
end;                                                           <<rwp31>>38094000
                                                               << adcc>>38096000
if channel'type = adcc'type and chan'prog'length > 0 then      << adcc>>38098000
begin                                                          << adcc>>38100000
  move bbuf(12) := "CHANNEL PROGRAM :";                        << adcc>>38102000
  printline;                                                   << adcc>>38104000
  loctable := locdump + double(chan'prog'offset);              << adcc>>38106000
  print'octal'dit(loctable, 0, chan'prog'length);              << adcc>>38108000
  skiplines(1);                                                << adcc>>38110000
end;                                                           << adcc>>38112000
                                                               <<rwp31>>38114000
if stack'length > 0 then                                       <<rwp31>>38116000
begin                                                          <<rwp31>>38118000
  move bbuf(12) := "STACK DUMP :";                             <<rwp31>>38120000
  printline;                                                   <<rwp31>>38122000
  loctable := locdump + double(stack'offset);                  <<rwp31>>38124000
  print'octal'dit(loctable, 0, stack'length);                  <<rwp31>>38126000
  skiplines(1);                                                <<rwp31>>38128000
end;                                                           <<rwp31>>38130000
                                                               <<rwp31>>38132000
<<print ioq's if dumped>>                                      <<rwp31>>38134000
if ioq'tbuf'info'len > 0 then                                  <<rwp31>>38136000
begin                                                          <<rwp31>>38138000
  scratchi := integer(core(locdump + double(ioq'ptr +          <<rwp31>>38140000
                    ioq'tbuf'info + ioq'total)));              <<rwp31>>38142000
                                                               <<rwp31>>38144000
  if scratchi > 0 then       << ioq's were dumped >>           <<rwp31>>38146000
  begin                                                        <<rwp31>>38148000
    move bbuf(12) := "IOQS DUMPED :";                          <<rwp31>>38150000
    printline;                                                 <<rwp31>>38152000
    skiplines (1);                                             <<rwp31>>38154000
                                                               <<rwp31>>38156000
    indx1 := 0;   <<zero loop counter>>                        <<rwp31>>38158000
    while (indx1 < scratchi) and (indx1 < max'ioqs'ever)  do   <<rwp31>>38160000
    begin                                                      <<rwp31>>38162000
                                                               <<rwp31>>38164000
      move bbuf (12) := "IOQ #";                               <<rwp31>>38166000
      @pbuf := @bbuf + 18;                                     <<rwp31>>38168000
      ascii(indx1, 10, pbuf);                                  <<rwp31>>38170000
      printline;                                               <<rwp31>>38172000
      loctable := locdump +                                    <<rwp31>>38174000
                    double(indx1 * ioq'size + ioq'ptr);        <<rwp31>>38176000
      print'octal'dit(loctable, 0, ioq'size);                  <<rwp31>>38178000
      skiplines(1);                                            <<rwp31>>38180000
      indx1 := indx1 + 1;                                      <<rwp31>>38182000
                                                               <<rwp31>>38184000
    end; << print all ioqs >>                                  <<rwp31>>38186000
                                                               <<rwp31>>38188000
  end; << ioqs were dumped >>                                  <<rwp31>>38190000
                                                               <<rwp31>>38192000
end;   <<ioq's may exist>>                                     <<rwp31>>38194000
                                                               <<rwp31>>38196000
if lpdt'length > 0 then                                        <<rwp31>>38198000
begin                                                          <<rwp31>>38200000
  move bbuf(12) := "LOGICAL-TO-PHYSICAL DEVICE TABLE ENTRY :"; <<rwp31>>38202000
  printline;                                                   <<rwp31>>38204000
  loctable := locdump + double(lpdt'offset);                   <<rwp31>>38206000
  print'octal'dit(loctable, 0, lpdt'length);                   <<rwp31>>38208000
  skiplines(1);                                                <<rwp31>>38210000
end;                                                           <<rwp31>>38212000
                                                               <<rwp31>>38214000
if ldt'length > 0 then                                         <<rwp31>>38216000
begin                                                          <<rwp31>>38218000
  move bbuf(12) := "LOGICAL DEVICE TABLE ENTRY :";             <<rwp31>>38220000
  printline;                                                   <<rwp31>>38222000
  loctable := locdump + double(ldt'offset);                    <<rwp31>>38224000
  print'octal'dit(loctable, 0, ldt'length);                    <<rwp31>>38226000
  skiplines(1);                                                <<rwp31>>38228000
end;                                                           <<rwp31>>38230000
                                                               <<rwp31>>38232000
if drt'length > 0 then                                         <<rwp31>>38234000
begin                                                          <<rwp31>>38236000
  move bbuf(12) := "DEVICE REFERENCE TABLE ENTRY :";           <<rwp31>>38238000
  printline;                                                   <<rwp31>>38240000
  loctable := locdump + double(drt'offset);                    <<rwp31>>38242000
  print'octal'dit(loctable, 0, drt'length);                    <<rwp31>>38244000
  skiplines(1);                                                <<rwp31>>38246000
end;                                                           <<rwp31>>38248000
                                                               <<rwp31>>38250000
if dlt'length > 0 then                                         <<rwp31>>38252000
begin                                                          <<rwp31>>38254000
  move bbuf(12) := "DRIVER LINKAGE TABLE :";                   <<rwp31>>38256000
  printline;                                                   <<rwp31>>38258000
  loctable := locdump + double(dlt'offset);                    <<rwp31>>38260000
  print'octal'dit(loctable, 0, dlt'length);                    <<rwp31>>38262000
  skiplines(1);                                                <<rwp31>>38264000
end;                                                           <<rwp31>>38266000
                                                               <<rwp31>>38268000
if ilt'size > 0 then                                           <<rwp31>>38270000
begin                                                          <<rwp31>>38272000
  move bbuf(12) := "INTERRUPT LINKAGE TABLE :";                <<rwp31>>38274000
  printline;                                                   <<rwp31>>38276000
  loctable := locdump + double(ilt'offset);                    <<rwp31>>38278000
  print'octal'dit(loctable, 0, ilt'size);                      <<rwp31>>38280000
  skiplines(1);                                                <<rwp31>>38282000
                                                               <<rwp31>>38284000
  if iltx'size > 0 then                                        <<rwp31>>38286000
  begin                                                        <<rwp31>>38288000
    loctable := locdump + double(ilt'offset + ilt'size);       <<rwp31>>38290000
    print'octal'dit(loctable, 0, iltx'fullsize);               <<rwp31>>38292000
    skiplines(1);                                              <<rwp31>>38294000
  end;                                                         <<rwp31>>38296000
end;                                                           <<rwp31>>38298000
                                                               <<rwp31>>38300000
if tbuf'tbl'offset > 0 then                                    <<r8331>>38302000
begin                                                          <<rwp31>>38304000
  move bbuf(12) := "TERMINAL BUFFER TABLE :";                  <<rwp31>>38306000
  printline;                                                   <<rwp31>>38308000
  loctable := locdump + double(tbuf'tbl'offset);               <<rwp31>>38310000
  print'octal'dit(loctable, 0, tbuf'tbl'length);               <<rwp31>>38312000
  skiplines(1);                                                <<rwp31>>38314000
end;                                                           <<rwp31>>38316000
                                                               <<rwp31>>38318000
<<print tbuf's if dumped>>                                     <<rwp31>>38320000
if ioq'tbuf'info'len > 0 then                                  <<rwp31>>38322000
begin  <<tbufs may exist>>                                     <<rwp31>>38324000
                                                               <<rwp31>>38326000
<< get # of tbufs or sbufs dumped from information word >>     <<rwp31>>38328000
                                                               <<rwp31>>38330000
  scratchl := core(locdump + double(ioq'ptr +                  <<rwp31>>38332000
                     ioq'tbuf'info + ioq'info'flags));         <<rwp31>>38334000
  scratchi := integer(scratchl.num'sbufs'tbufs);               <<rwp31>>38336000
                                                               <<rwp31>>38338000
  if scratchi > 0 then                                         <<rwp31>>38340000
  begin   <<tbufs do exist>>                                   <<rwp31>>38342000
                                                               <<rwp31>>38344000
    if scratchl.tbufs'dumped then                              <<rwp31>>38346000
    move bbuf(12) := "TERMINAL BUFFERS DUMPED :"               <<rwp31>>38348000
    else                                                       <<rwp31>>38350000
    move bbuf(12) :="SYSTEM BUFFERS DUMPED :";                 <<rwp31>>38352000
                                                               <<rwp31>>38354000
    printline;   <<output header>>                             <<rwp31>>38356000
    skiplines(1);                                              <<rwp31>>38358000
                                                               <<rwp31>>38360000
                                                               <<rwp31>>38362000
<< load starting address for dump from tds-rel ptr in info>>   <<rwp31>>38364000
                                                               <<rwp31>>38366000
    loctable := loctds + double(core(locdump +                 <<rwp31>>38368000
             double(ioq'ptr + ioq'info'bufoffset)));           <<rwp31>>38370000
                                                               <<rwp31>>38372000
    indx1 := 0;                                                <<rwp31>>38374000
    while (indx1 < scratchi) and (indx1 <= max'tbufs'ever) do  <<rwp31>>38376000
    begin      <<print all tbuf's>>                            <<rwp31>>38378000
                                                               <<rwp31>>38380000
  << load start address for this buffer >>                     <<rwp31>>38382000
      loctable := loctable + double(indx1 *                    <<rwp31>>38384000
              (if scratchl.tbufs'dumped then                   <<rwp31>>38386000
                    tbuf'size  else  sbuf'size));              <<rwp31>>38388000
                                                               <<rwp31>>38390000
  << now print the buffer >>                                   <<rwp31>>38392000
                                                               <<rwp31>>38394000
      print'octal'dit(loctable, 0,                             <<rwp31>>38396000
            integer(if scratchl.tbufs'dumped then              <<rwp31>>38398000
                  tbuf'size  else  sbuf'size),                 <<rwp31>>38400000
                     use'ascii);                               <<rwp31>>38402000
                                                               <<rwp31>>38404000
      skiplines(1);                                            <<rwp31>>38406000
      indx1 := indx1 + 1;                                      <<rwp31>>38408000
                                                               <<rwp31>>38410000
    end;  <<print all tbuf's>>                                 <<rwp31>>38412000
                                                               <<rwp31>>38414000
  end;   <<tbufs do exist>>                                    <<rwp31>>38416000
end;  <<tbuf's may exist>>                                     <<rwp31>>38418000
                                                               <<rwp31>>38420000
if pcb'length > 0 then                                         <<rwp31>>38422000
begin                                                          <<rwp31>>38424000
  move bbuf(12) := "PROCESS CONTROL BLOCK ENTRY :";            <<rwp31>>38426000
  printline;                                                   <<rwp31>>38428000
  loctable := locdump + double(pcb'offset);                    <<rwp31>>38430000
  print'octal'dit(loctable, 0, pcb'length);                    <<rwp31>>38432000
  skiplines(1);                                                <<rwp31>>38434000
end;                                                           <<rwp31>>38436000
                                                               <<rwp31>>38438000
if ldtpcb'length > 0 then                                      <<rwp31>>38440000
begin                                                          <<rwp31>>38442000
  move bbuf(12) := "LDT PROCESS CONTROL BLOCK :";              <<rwp31>>38444000
  printline;                                                   <<rwp31>>38446000
  loctable := locdump + double(ldtpcb'offset);                 <<rwp31>>38448000
  print'octal'dit(loctable, 0, ldtpcb'length);                 <<rwp31>>38450000
  skiplines(1);                                                <<rwp31>>38452000
end;                                                           <<rwp31>>38454000
                                                               <<rwp31>>38456000
if channel'type = atp'type and atp'regs'length > 0 then        << adcc>>38458000
begin                                                          <<rwp31>>38460000
  move bbuf(12) := "SIB REGISTERS :";                          <<rwp31>>38462000
  printline;                                                   <<rwp31>>38464000
  loctable := locdump + double(atp'regs'offset);               <<rwp31>>38466000
  print'octal'dit(loctable, 0, atp'regs'length);               <<rwp31>>38468000
  skiplines(1);                                                <<rwp31>>38470000
end;                                                           <<rwp31>>38472000
                                                               <<rwp31>>38474000
if channel'type = atp'type and pcc'memory'length > 0 then      << adcc>>38476000
begin                                                          <<rwp31>>38478000
                                                               <<rwp31>>38480000
<<first copy the pcc memory to a local buffer>>                <<rwp31>>38482000
<<so we can reference the stack pointer by byte offset>>       <<rwp31>>38484000
  loctable := locdump + double(pcc'memory'offset);             <<rwp31>>38486000
  wordcount := 0;                                              <<rwp31>>38488000
  while wordcount < numwords do                                <<rwp31>>38490000
  begin                                                        <<rwp31>>38492000
    pcc'mem(wordcount) := core(loctable +                      <<rwp31>>38494000
                               double(wordcount));             <<rwp31>>38496000
    wordcount := wordcount + 1;                                <<rwp31>>38498000
  end;                                                         <<rwp31>>38500000
                                                               <<rwp31>>38502000
<<now print the pcc memory>>                                   <<rwp31>>38504000
  move bbuf(12) := "PORT-CONTROLLER MEMORY :";                 <<rwp31>>38506000
  printline;                                                   <<rwp31>>38508000
                                                               <<rwp31>>38510000
  move bbuf(12) := "Stack pointer:              ?????";        <<rwp31>>38512000
  hascii(pcc'mem(stackptr'offset), base'is'hex, bbuf(40));     <<rwp31>>38514000
  bbuf(44) := bbuf(43);  <<split into two bytes>>              <<rwp31>>38516000
  bbuf(43) := bbuf(42);                                        <<rwp31>>38518000
  bbuf(42) := " ";                                             <<rwp31>>38520000
  printline;                                                   <<rwp31>>38522000
  skiplines(1);                                                <<rwp31>>38524000
                                                               <<rwp31>>38526000
  move bbuf(12) := "Low memory:";                              <<rwp31>>38528000
  printline;                                                   <<rwp31>>38530000
                                                               <<rwp31>>38532000
  print'octal'dit(loctable + double(lowmem'offset/2),          <<rwp31>>38534000
                  low'start'addr, -lowmem'len, use'ascii,      <<rwp31>>38536000
                  base'is'hex, left'byte'start);               <<rwp31>>38538000
  skiplines(1);                                                <<rwp31>>38540000
                                                               <<rwp31>>38542000
  move bbuf(12) := "High memory:";                             <<rwp31>>38544000
  printline;                                                   <<rwp31>>38546000
                                                               <<rwp31>>38548000
  print'octal'dit(loctable + double(highmem'offset/2),         <<rwp31>>38550000
                  high'start'addr, -highmem'len, use'ascii,    <<rwp31>>38552000
                  base'is'hex, right'byte'start);              <<rwp31>>38554000
  skiplines(1);                                                <<rwp31>>38556000
end;                                                           <<rwp31>>38558000
                                                               <<rwp31>>38560000
                                                               <<rwp31>>38562000
newpage;                                                       <<rwp31>>38564000
                                                               <<rwp31>>38566000
quit'atp'dump:   << exit or error >>                           <<rwp31>>38568000
                                                               <<rwp31>>38570000
end; <<subroutine print'atp'dump>>                             <<rwp31>>38572000
$page                                                          <<rwp31>>38574000
<< *** m a i n *** >>                                          <<rwp31>>38576000
                                                               <<rwp31>>38578000
only'doing'drt'header := false;                                <<rwp31>>38580000
goto start;                                                    <<rwp31>>38582000
                                                               <<rwp31>>38584000
do'atp'drt'hdr:                                                <<rwp31>>38586000
only'doing'drt'header := true;                                 <<rwp31>>38588000
                                                               <<rwp31>>38590000
                                                               <<rwp31>>38592000
start:                                                         <<rwp31>>38594000
if (lociltx <> 0d) and (locdit <> 0d) then                     <<rwp31>>38596000
  begin <<valid addresses>>                                    <<r8331>>38598000
                                                               <<rwp31>>38600000
                                                               <<rwp31>>38602000
<<see if the tds is split. if so, there are two tds's>>        <<rwp31>>38604000
  lociltxl := lociltx;                                         <<rwp31>>38606000
  lociltxu := lociltx + double(assumed'iltx'size);             <<rwp31>>38608000
  split'tds := if core(lociltxl + double(iltx'iplab)) =        <<rwp31>>38610000
              core(lociltxu + double(iltx'iplab)) then         <<rwp31>>38612000
              true else false;                                 <<rwp31>>38614000
                                                               <<rwp31>>38616000
                                                               <<rwp31>>38618000
  get'channel'type;     <<determine if adcc or atp>>           <<r8331>>38620000
$page "DO'ATP'DITS : Print DRT header, with software versions" <<r8331>>38622000
  if only'doing'drt'header then                                <<rwp31>>38624000
    begin <<load drt header>>                                  <<r8331>>38626000
                                                               <<rwp31>>38628000
    versions'printed := false;                                 <<r8331>>38630000
    indx1 := 0;                                                <<rwp31>>38632000
    while indx1 < integer(if split'tds then 2 else 1)  do      <<rwp31>>38634000
      begin <<hdr for each tds>>                               <<r8331>>38636000
                                                               <<rwp31>>38638000
      blankbuf;                                                <<rwp31>>38640000
      move bbuf(12) := "TDS SEG NO";                           <<rwp31>>38642000
      @pbuf := @bbuf + 23;                                     <<rwp31>>38644000
      scratchl := core(lociltx +                               <<rwp31>>38646000
          double(indx1 * assumed'iltx'size + iltx'tdsdseg));   <<rwp31>>38648000
      putnump (scratchl);                                      <<rwp31>>38650000
                                                               <<rwp31>>38652000
      scratchl := core(lociltx +                               <<rwp31>>38654000
          double(indx1 * assumed'iltx'size + iltx'tdsbank));   <<rwp31>>38656000
      scrd0 := scratchl;                                       <<rwp31>>38658000
      move bbuf(32) := "BANK";                                 <<rwp31>>38660000
      @pbuf := @bbuf + 37;                                     <<rwp31>>38662000
      putnump(scratchl);                                       <<rwp31>>38664000
                                                               <<rwp31>>38666000
      scratchl := core(lociltx +                               <<rwp31>>38668000
          double(indx1 * assumed'iltx'size + iltx'tdsaddr));   <<rwp31>>38670000
      scrd1 := scratchl;                                       <<rwp31>>38672000
      move bbuf(46) := "OFFSET";                               <<rwp31>>38674000
      @pbuf := @bbuf + 53;                                     <<rwp31>>38676000
      putnum(scratchl);                                        <<rwp31>>38678000
                                                               <<rwp31>>38680000
   <<scratchd is now address of a tds>>                        <<rwp31>>38682000
      move bbuf(62) := "TDS'VER  =";                           <<r8331>>38684000
      @pbuf := @bbuf + 73;                                     <<r8331>>38686000
      tds'ver := integer ( core ( scratchd ));                 <<r8331>>38688000
      putnum ( tds'ver );                                      <<r8331>>38690000
                                                               <<r8331>>38692000
      move bbuf(82) := "TBUFTBLP =";                           <<r8331>>38694000
      @pbuf := @bbuf + 93;                                     <<r8331>>38696000
      scratchl := core(scratchd + double(tds'tbuftbl'p));      <<rwp31>>38698000
      putnum(scratchl);                                        <<rwp31>>38700000
                                                               <<rwp31>>38702000
      if channel'type = atp'type then                          <<r8331>>38704000
      begin                                                    <<r8331>>38706000
        move bbuf(102) := "PORTDUMPP =";                       <<r8331>>38708000
        @pbuf := @bbuf + 114;                                  <<r8331>>38710000
        scratchl := core(scratchd + double(tds'portdump'p));   <<r8331>>38712000
        putnum(scratchl);                                      <<r8331>>38714000
      end;                                                     <<r8331>>38716000
                                                               <<rwp31>>38718000
      printline;                                               <<rwp31>>38720000
      skiplines(1);                                            <<rwp31>>38722000
                                                               <<rwp31>>38724000
comment -------------------------------------------------------<<r8331>>38726000
                                                               <<r8331>>38728000
  now print the software versions. the layout of these has     <<r8331>>38730000
  changed through the years ( * = name chgs for atp/adcc ) :   <<r8331>>38732000
                                                               <<r8331>>38734000
tds'ver -1              1              2                       <<r8331>>38736000
     ---------      ---------      ---------                   <<r8331>>38738000
  3  lpmon       3  lpmon       3  lpmon                       <<r8331>>38740000
  4  termmon     4  termmon     5  termmon                     <<r8331>>38742000
  5  atpdrivr    5  atpdrivr    7  drvr *                      <<r8331>>38744000
  6  pdmanagr    6  pdmanagr    9  ihandler                    <<r8331>>38746000
  7  atpinit     7  atpinit    11  init *                      <<r8331>>38748000
                 8  imanager   13  imanager                    <<r8331>>38750000
                               15  termutil                    <<r8331>>38752000
                               17  vuuff                       <<r8331>>38754000
                                                               <<r8331>>38756000
---------------------------------------------------------------<<r8331>>38758000
;                                                              <<r8331>>38760000
                                                               <<r8331>>38762000
      known'tds'format :=                                      <<r8331>>38764000
        load'dump'info ( tds'ver, channel'type );              <<r8331>>38766000
                                                               <<r8331>>38768000
      if known'tds'format then                                 <<r8331>>38770000
        begin  <<found known tds>>                             <<r8331>>38772000
                                                               <<r8331>>38774000
        if not versions'printed then                           <<r8331>>38776000
          begin   <<print versions>>                           <<r8331>>38778000
                                                               <<r8331>>38780000
          versions'printed := true;                            <<r8331>>38782000
          loc'versions :=                                      <<r8331>>38784000
            scratchd + double ( tds'versions'ptr );            <<r8331>>38786000
                                                               <<r8331>>38788000
          @pbuf := @bbuf + 24;                                 <<r8331>>38790000
          move bbuf ( 12 ) :=    "LPMON     = ?       ";       <<r8331>>38792000
          if tds'ver = -1 or tds'ver = 1 then                  <<r8331>>38794000
            decode'version ( one'word, loc'versions + 0d )     <<r8331>>38796000
          else                                                 <<r8331>>38798000
            decode'version ( two'word, loc'versions + 0d );    <<r8331>>38800000
                                                               <<r8331>>38802000
          @pbuf := @bbuf + 48;                                 <<r8331>>38804000
          move bbuf ( 36 ) :=    "TERMMON   = ?       ";       <<r8331>>38806000
          if tds'ver = -1 or tds'ver = 1 then                  <<r8331>>38808000
            decode'version ( one'word, loc'versions + 1d )     <<r8331>>38810000
          else                                                 <<r8331>>38812000
            decode'version ( two'word, loc'versions + 2d );    <<r8331>>38814000
                                                               <<r8331>>38816000
                                                               <<r8331>>38818000
          @pbuf := @bbuf + 72;                                 <<r8331>>38820000
          if channel'type = atp'type then                      <<r8331>>38822000
            move bbuf ( 60 ) :=  "ATPDRIVR  = ?       "        <<r8331>>38824000
          else                                                 <<r8331>>38826000
            move bbuf ( 60 ) :=  "ADCCDRVR  = ?       ";       <<r8331>>38828000
          if tds'ver = -1 or tds'ver = 1 then                  <<r8331>>38830000
            decode'version ( one'word, loc'versions + 2d )     <<r8331>>38832000
          else                                                 <<r8331>>38834000
            decode'version ( two'word, loc'versions + 4d );    <<r8331>>38836000
                                                               <<r8331>>38838000
          @pbuf := @bbuf + 96;                                 <<r8331>>38840000
          if tds'ver = -1 or tds'ver = 1 then                  <<r8331>>38842000
            begin                                              <<r8331>>38844000
            move bbuf ( 84 )  := "PDMANAGR  = ?       ";       <<r8331>>38846000
            decode'version ( one'word, loc'versions + 3d );    <<r8331>>38848000
            end                                                <<r8331>>38850000
          else                                                 <<r8331>>38852000
            begin                                              <<r8331>>38854000
            move bbuf ( 84 )  := "IHANDLER  = ?       ";       <<r8331>>38856000
            decode'version ( two'word, loc'versions + 6d );    <<r8331>>38858000
            end;                                               <<r8331>>38860000
                                                               <<r8331>>38862000
          printline;                                           <<r8331>>38864000
                                                               <<r8331>>38866000
          @pbuf := @bbuf + 24;                                 <<r8331>>38868000
          if channel'type = atp'type then                      <<r8331>>38870000
            move bbuf ( 12 )  := "ATPINIT   = ?       "        <<r8331>>38872000
          else                                                 <<r8331>>38874000
            move bbuf ( 12 )  := "ADCCINIT  = ?       ";       <<r8331>>38876000
          if tds'ver = -1 or tds'ver = 1 then                  <<r8331>>38878000
            decode'version ( one'word, loc'versions + 4d )     <<r8331>>38880000
          else                                                 <<r8331>>38882000
            decode'version ( two'word, loc'versions + 8d );    <<r8331>>38884000
                                                               <<r8331>>38886000
          @pbuf := @bbuf + 48;                                 <<r8331>>38888000
          if tds'ver = -1 then                                 <<r8331>>38890000
            begin                                              <<r8331>>38892000
         <<not used until version 1>>                          <<r8331>>38894000
            end                                                <<r8331>>38896000
          else                                                 <<r8331>>38898000
            begin <<used>>                                     <<r8331>>38900000
            move bbuf ( 36 ) :=    "IMANAGER  = ?       ";     <<r8331>>38902000
            if tds'ver = 1 then                                <<r8331>>38904000
              decode'version ( one'word, loc'versions + 5d )   <<r8331>>38906000
            else                                               <<r8331>>38908000
              decode'version ( two'word, loc'versions + 10d ); <<r8331>>38910000
            end;  <<used>>                                     <<r8331>>38912000
                                                               <<r8331>>38914000
          @pbuf := @bbuf + 72;                                 <<r8331>>38916000
          if tds'ver = -1 or tds'ver = 1 then                  <<r8331>>38918000
            begin                                              <<r8331>>38920000
         <<not used until version 2>>                          <<r8331>>38922000
            end                                                <<r8331>>38924000
          else                                                 <<r8331>>38926000
            begin <<used>>                                     <<r8331>>38928000
            move bbuf ( 60 )  :=   "TERMUTIL  = ?       ";     <<r8331>>38930000
            decode'version ( two'word, loc'versions + 12d );   <<r8331>>38932000
            end;  <<used>>                                     <<r8331>>38934000
                                                               <<r8331>>38936000
          @pbuf := @bbuf + 96;                                 <<r8331>>38938000
          if tds'ver = -1 or tds'ver = 1 then                  <<r8331>>38940000
            begin                                              <<r8331>>38942000
         <<not used until version 2>>                          <<r8331>>38944000
            end                                                <<r8331>>38946000
          else                                                 <<r8331>>38948000
            begin <<used>>                                     <<r8331>>38950000
            move bbuf ( 84 )  :=   "SOFTWARE  = ?       ";     <<r8331>>38952000
            decode'version ( two'word, loc'versions + 14d );   <<r8331>>38954000
            end;  <<used>>                                     <<r8331>>38956000
                                                               <<r8331>>38958000
          printline;                                           <<r8331>>38960000
          skiplines(1);                                        <<r8331>>38962000
                                                               <<r8331>>38964000
          end;  <<print versions>>                             <<r8331>>38966000
                                                               <<r8331>>38968000
        end;  <<found known tds>>                              <<r8331>>38970000
                                                               <<rwp31>>38972000
      indx1 := indx1 + 1;                                      <<r8331>>38974000
                                                               <<r8331>>38976000
      end;  <<hdr for each tds>>                               <<r8331>>38978000
                                                               <<r8331>>38980000
    return;    <<exit now>>                                    <<rwp31>>38982000
                                                               <<r8331>>38984000
    end;  <<load drt header>>                                  <<r8331>>38986000
                                                               <<rwp31>>38988000
$page  "DO'ATP'DITS : Find Terminal Data Segment for ldev"     <<r8331>>38990000
<<get ldev number and configured unit# (0-95) from dit>>       <<rwp31>>38992000
                                                               <<rwp31>>38994000
if mpe5 then                                                   <<r8331>>38996000
  begin                                                        <<r8331>>38998000
  ldev := integer(core(locdit +                                <<rwp31>>39000000
               double (dl'ldevunit)));                         <<mpev >>39002000
  unit := integer(core(locdit +                                <<rwp31>>39004000
               double(dl'ldevunit)).md'cnfgunit);              <<rwp31>>39006000
  end                                                          <<r8331>>39008000
else                                                           <<r8331>>39010000
  begin                                                        <<r8331>>39012000
  ldev := integer (core (locdit +                              <<mpev >>39014000
               double (dl'ldevunit4)).md'ldev4);               <<mpev >>39016000
  unit := integer (core (locdit +                              <<mpev >>39018000
               double (dl'ldevunit4)).md'cnfgunit4);           <<mpev >>39020000
  end;                                                         <<r8331>>39022000
                                                               <<rwp31>>39024000
                                                               <<rwp31>>39026000
<<find the right tds for this ldev>>                           <<rwp31>>39028000
                                                               <<rwp31>>39030000
  if split'tds and (unit >= 48) then                           <<rwp31>>39032000
  begin                                                        <<r8331>>39034000
    tos := core(lociltxu + double(iltx'tdsbank));              <<rwp31>>39036000
    tos := core(lociltxu + double(iltx'tdsaddr));              <<rwp31>>39038000
    loctds := tos;                                             <<rwp31>>39040000
    tdsnum := integer(core(lociltxu + double(iltx'tdsdseg)));  <<rwp31>>39042000
  end                                                          <<r8331>>39044000
  else                                                         <<rwp31>>39046000
  begin                                                        <<r8331>>39048000
    tos := core(lociltxl + double(iltx'tdsbank));              <<rwp31>>39050000
    tos := core(lociltxl + double(iltx'tdsaddr));              <<rwp31>>39052000
    loctds := tos;                                             <<rwp31>>39054000
    tdsnum := integer(core(lociltxl + double(iltx'tdsdseg)));  <<rwp31>>39056000
  end;                                                         <<r8331>>39058000
                                                               <<rwp31>>39060000
$page "DO'ATP'DITS : Load offsets into TDS tables"             <<r8331>>39062000
  if tdsnum <> 0 then                                          <<rwp31>>39064000
    begin <<tds exists>>                                       <<r8331>>39066000
                                                               <<rwp31>>39068000
                                                               <<rwp31>>39070000
<<load up all the dit sizes and lengths, based on tds version>><<rwp31>>39072000
<<in word 0 of the tds>>                                       <<rwp31>>39074000
    tds'ver := integer(core(loctds));                          <<rwp31>>39076000
    known'tds'format :=                                        <<r8331>>39078000
      load'dump'info ( tds'ver, channel'type );                <<r8331>>39080000
                                                               <<rwp31>>39082000
                                                               <<rwp31>>39084000
<<find pointers to everything>>                                <<rwp31>>39086000
    if known'tds'format then                                   <<rwp31>>39088000
      begin <<known tds>>                                      <<r8331>>39090000
                                                               <<rwp31>>39092000
      locdump := loctds +                                      <<rwp31>>39094000
           double(core(loctds + double(tds'portdump'p)));      <<rwp31>>39096000
                                                               <<rwp31>>39098000
      locpdfdit := loctds +                                    <<rwp31>>39100000
           double(core(locdit + double(dl'pd'ditp)));          <<rwp31>>39102000
                                                               <<rwp31>>39104000
      locpdvdit := locpdfdit + double(pd'fdit'length +         <<rwp31>>39106000
           (if pd'ppdit'length > 0 then                        <<rwp31>>39108000
           pd'ppdit'length                                     <<rwp31>>39110000
           else 0));                                           <<rwp31>>39112000
                                                               <<rwp31>>39114000
      locppp := if tds'ver = -1 then                           <<rwp31>>39116000
           loctds +                                            <<rwp31>>39118000
           double(core(locpdfdit + double(pd'old'ppp)))        <<rwp31>>39120000
           else 0d;                                            <<rwp31>>39122000
                                                               <<rwp31>>39124000
      locpdpdit := if pd'ppdit'length > 0 then                 <<rwp31>>39126000
           locpdfdit + double(pd'fdit'length)                  <<rwp31>>39128000
           else 0d;                                            <<rwp31>>39130000
                                                               <<rwp31>>39132000
      locvfc := 0d;                                            <<rwp31>>39134000
      if vfc'sir'length > 0 then                               <<rwp31>>39136000
      begin                                                    <<rwp31>>39138000
        scratchl := core(locpdpdit + double(pp'vfc));          <<rwp31>>39140000
        if scratchl <> 0 then                                  <<rwp31>>39142000
        locvfc := loctds + double(scratchl);                   <<rwp31>>39144000
      end;                                                     <<rwp31>>39146000
                                                               <<rwp31>>39148000
      lochwdit := loctds +                                     <<rwp31>>39150000
             double(core(locpdfdit + double(pd'hwditp)));      <<rwp31>>39152000
                                                               <<rwp31>>39154000
      locctlpgm := loctds +                                    <<rwp31>>39156000
             double(core(lochwdit + double(hw'cp'p)));         <<rwp31>>39158000
                                                               <<rwp31>>39160000
      locheadtbuf := loctds +                                  <<rwp31>>39162000
             double(core(locpdvdit + double(pd'headtbuf)));    <<rwp31>>39164000
                                                               <<rwp31>>39166000
      loctailtbuf := loctds +                                  <<rwp31>>39168000
             double(core(locpdvdit + double(pd'tailtbuf)));    <<rwp31>>39170000
                                                               <<rwp31>>39172000
      end;  <<known tds>>                                      <<r8331>>39174000
                                                               <<rwp31>>39176000
    end;  <<tds exists>>                                       <<r8331>>39178000
$page "DO'ATP'DITS : Load header for ldev information"         <<r8331>>39180000
  if known'tds'format then                                     <<rwp31>>39182000
  begin  <<load header>>                                       <<rwp31>>39184000
                                                               <<rwp31>>39186000
                                                               <<r8331>>39188000
  if channel'type = atp'type then                              << adcc>>39190000
     move bbuf(12) := "ATP  DSEG ="                            << adcc>>39192000
  else                                                         << adcc>>39194000
     move bbuf(12) := "ADCC DSEG =";                           << adcc>>39196000
    @pbuf := @bbuf + 24;                                       <<rwp31>>39198000
    putnump(tdsnum);                                           <<rwp31>>39200000
                                                               <<rwp31>>39202000
    move bbuf(32) := "TBUFHEADP =";                            <<rwp31>>39204000
    @pbuf := @bbuf + 44;                                       <<rwp31>>39206000
    putnum(logical(locheadtbuf - loctds));                     <<rwp31>>39208000
                                                               <<rwp31>>39210000
    move bbuf(52) := "TBUFTAILP =";                            <<rwp31>>39212000
    @pbuf := @bbuf + 64;                                       <<rwp31>>39214000
    putnum(logical(loctailtbuf - loctds));                     <<rwp31>>39216000
                                                               <<rwp31>>39218000
    printline;                                                 <<rwp31>>39220000
    skiplines(1);                                              <<rwp31>>39222000
                                                               <<rwp31>>39224000
end;  <<load header>>                                          <<rwp31>>39226000
$page "DO'ATP'DITS : Print DIT for ATP ldev"                   <<r8331>>39228000
<<print the dit itself now, whether we found the tds or not>>  <<rwp31>>39230000
                                                               <<rwp31>>39232000
  move bbuf(12) := "DIT :";                                    <<rwp31>>39234000
  printline;                                                   <<rwp31>>39236000
  <<get dit size from dlt entry>>                              <<rwp31>>39238000
  scratchi := integer(core(double(%1000 +                      <<rwp31>>39240000
    core(locdit + double(dl'dltp)) + dlt'dtype)).dlt'ditsize); <<rwp31>>39242000
  print'octal'dit(locdit, logical(locdit-%1000d), scratchi);   <<rwp31>>39244000
  skiplines(1);                                                <<rwp31>>39246000
                                                               <<rwp31>>39248000
$page "DO'ATP'DITS : Print TDS tables for ldev"                <<r8331>>39250000
<<make sure we've got a terminal data segment>>                <<rwp31>>39252000
  if tdsnum = 0 then                                           <<rwp31>>39254000
    begin <<dstnum zero>>                                      <<r8331>>39256000
    move bbuf(12) := "(NO TERMINAL DATA SEGMENT IS ACTIVE)";   <<rwp31>>39258000
    printline;                                                 <<rwp31>>39260000
    skiplines(1);                                              <<rwp31>>39262000
    end   <<dstnum zero>>                                      <<r8331>>39264000
                                                               <<rwp31>>39266000
else                                                           <<r8331>>39268000
  if core ( locdit + double ( dl'pd'ditp )) = 0 then           <<r8331>>39270000
    begin <<pdditp zero>>                                      <<r8331>>39272000
    move bbuf ( 12 ) := ( "(INDEX INTO TERMINAL DATA ",        <<r8331>>39274000
                          "SEGMENT FROM DIT IS ZERO)" );       <<r8331>>39276000
    printline;                                                 <<r8331>>39278000
    skiplines ( 1 );                                           <<r8331>>39280000
    end  <<pdditp zero>>                                       <<r8331>>39282000
                                                               <<r8331>>39284000
  else                                                         <<rwp31>>39286000
  if not known'tds'format then                                 <<rwp31>>39288000
    begin <<unknown tds>>                                      <<r8331>>39290000
    move bbuf(12) := "(UNKNOWN TERMINAL DATA SEGMENT FORMAT)"; <<rwp31>>39292000
    printline;                                                 <<rwp31>>39294000
    skiplines(1);                                              <<rwp31>>39296000
    end   <<unknown tds>>                                      <<r8331>>39298000
                                                               <<rwp31>>39300000
  else                                                         <<rwp31>>39302000
    begin <<format existing tds>>                              <<r8331>>39304000
                                                               <<rwp31>>39306000
                                                               <<rwp31>>39308000
    move bbuf(12) := "PROTOCOL AND DATA-MANAGEMENT DIT :";     <<rwp31>>39310000
    printline;                                                 <<rwp31>>39312000
    print'octal'dit(locpdfdit, logical(locpdfdit - loctds),    <<rwp31>>39314000
                      pd'fdit'length);                         <<rwp31>>39316000
    skiplines (1);                                             <<rwp31>>39318000
    print'octal'dit(locpdvdit, logical(locpdvdit - loctds),    <<rwp31>>39320000
                      pd'vdit'length);                         <<rwp31>>39322000
    skiplines (1);                                             <<rwp31>>39324000
                                                               <<rwp31>>39326000
                                                               <<rwp31>>39328000
    move bbuf(12) := "HARDWARE DIT :";                         <<rwp31>>39330000
    printline;                                                 <<rwp31>>39332000
    print'octal'dit(lochwdit, logical(lochwdit - loctds),      <<rwp31>>39334000
                                  hw'dit'length);              <<rwp31>>39336000
    skiplines (1);                                             <<rwp31>>39338000
                                                               <<rwp31>>39340000
                                                               <<rwp31>>39342000
    move bbuf(12) := "PORT PROTOCOL DIT :";                    <<rwp31>>39344000
    printline;                                                 <<rwp31>>39346000
    if locppp <> 0d then                                       <<rwp31>>39348000
    begin                                                      <<rwp31>>39350000
      print'octal'dit (locppp, logical(locppp - loctds),       <<rwp31>>39352000
                       ppp'length);                            <<rwp31>>39354000
    end                                                        <<rwp31>>39356000
                                                               <<rwp31>>39358000
    else                                                       <<rwp31>>39360000
    if locpdpdit <> 0d then                                    <<rwp31>>39362000
    begin                                                      <<rwp31>>39364000
                                                               <<rwp31>>39366000
      file'name'valid := core(locpdpdit +                      << adcc>>39368000
                         double(pp'name'valid)).name'valid;    << adcc>>39370000
<<output the termtype filename>>                               <<rwp31>>39372000
      scratchd := double(pp'fname'wrd);                        <<rwp31>>39374000
      indx1 := 0;                                              <<rwp31>>39376000
      while indx1 < pp'fname'len  do                           <<rwp31>>39378000
      begin                                                    <<rwp31>>39380000
        filename(indx1) := core(locpdpdit + scratchd);         <<rwp31>>39382000
        scratchd := scratchd + 1d;                             <<rwp31>>39384000
        indx1 := indx1 + 1;                                    <<rwp31>>39386000
      end;                                                     <<rwp31>>39388000
      if file'name'valid  then                                 << adcc>>39390000
        begin                                                  << adcc>>39392000
          move bbuf(14) := "Termtype filename     : ";         << adcc>>39394000
          scratchi := decode'filename(filename, bbuf(38));     << adcc>>39396000
        end                                                    << adcc>>39398000
      else                                                     << adcc>>39400000
        begin                                                  << adcc>>39402000
          move bbuf(14) := "Last termtype file name : ";       << adcc>>39404000
          if filename = blanks  then                           << adcc>>39406000
             move bbuf(40) := "none"                           << adcc>>39408000
          else                                                 << adcc>>39410000
             scratchi := decode'filename(filename, bbuf(26));  << adcc>>39412000
          printline;                                           << adcc>>39414000
          move bbuf(14) := "Current term type : ";             << adcc>>39416000
          scratchi := core(locpdfdit + double(pd'term'type)).  << adcc>>39418000
                      termtype'loc;                            << adcc>>39420000
          ascii (scratchi, 10, bbuf(34));                      << adcc>>39422000
        end;                                                   << adcc>>39424000
        printline;                                             << adcc>>39426000
                                                               <<rwp31>>39428000
      print'octal'dit(locpdpdit, logical(locpdpdit - loctds),  <<rwp31>>39430000
                      pd'ppdit'length);                        <<rwp31>>39432000
    end;                                                       <<rwp31>>39434000
    skiplines(1);                                              <<rwp31>>39436000
                                                               <<rwp31>>39438000
                                                               <<rwp31>>39440000
    if locvfc <> 0d then                                       <<rwp31>>39442000
    begin   <<vfc in use>>                                     <<rwp31>>39444000
                                                               <<rwp31>>39446000
      move bbuf(12) := "VFC ENTRY :";                          <<rwp31>>39448000
      printline;                                               <<rwp31>>39450000
                                                               <<rwp31>>39452000
<<output the vfc filename>>                                    <<rwp31>>39454000
      scratchd := double(vfc'fname'wrd);                       <<rwp31>>39456000
      indx1 := 0;                                              <<rwp31>>39458000
      while indx1 < vfc'fname'len  do                          <<rwp31>>39460000
      begin                                                    <<rwp31>>39462000
        filename(indx1) := core(locvfc + scratchd);            <<rwp31>>39464000
        scratchd := scratchd + 1d;                             <<rwp31>>39466000
        indx1 := indx1 + 1;                                    <<rwp31>>39468000
      end;                                                     <<rwp31>>39470000
      move bbuf(12):= "(VFC filename : ";                      <<rwp31>>39472000
      scratchi := decode'filename(filename, bbuf(28));         <<rwp31>>39474000
      move bbuf(28 + scratchi) := ")";                         <<rwp31>>39476000
      printline;                                               <<rwp31>>39478000
                                                               <<rwp31>>39480000
      print'octal'dit(locvfc, logical(locvfc - loctds),        <<rwp31>>39482000
                      vfc'entry'length);                       <<rwp31>>39484000
      skiplines(1);                                            <<rwp31>>39486000
                                                               <<rwp31>>39488000
      <<now do the vfc buffers if they're in use>>             <<rwp31>>39490000
                                                               <<rwp31>>39492000
      indx1 := 0;                                              <<rwp31>>39494000
      while indx1 < max'vfc'bufs  do                           <<rwp31>>39496000
      begin   <<each buffer>>                                  <<rwp31>>39498000
                                                               <<rwp31>>39500000
        scratchl := core(locvfc +                              <<rwp31>>39502000
                      double(vfc'init'ptr + indx1));           <<rwp31>>39504000
        if scratchl <> 0 then                                  <<rwp31>>39506000
        begin  <<buffer in use>>                               <<rwp31>>39508000
                                                               <<rwp31>>39510000
          if indx1 < max'vfc'initbufs then                     <<rwp31>>39512000
            move bbuf(12) := "VFC INITIALIZATION BUFFER :"     <<rwp31>>39514000
          else                                                 <<rwp31>>39516000
            move bbuf(12) := "VFC DATA BUFFER :";              <<rwp31>>39518000
          printline;                                           <<rwp31>>39520000
                                                               <<rwp31>>39522000
      <<load start, end address for dump, set global flag to>> <<rwp31>>39524000
      <<include ascii, and set global relative-address value>> <<rwp31>>39526000
                                                               <<rwp31>>39528000
          loctable := loctds + double(scratchl);               <<rwp31>>39530000
                                                               <<rwp31>>39532000
          print'octal'dit(loctable, scratchl,                  <<rwp31>>39534000
                           vfc'buf'length, use'ascii);         <<rwp31>>39536000
          skiplines(1);                                        <<rwp31>>39538000
                                                               <<rwp31>>39540000
        end;  <<buffer in use>>                                <<rwp31>>39542000
                                                               <<rwp31>>39544000
        indx1 := indx1 + 1;                                    <<rwp31>>39546000
      end;   <<each buffer>>                                   <<rwp31>>39548000
                                                               <<rwp31>>39550000
    end;   <<vfc in use>>                                      <<rwp31>>39552000
                                                               <<rwp31>>39554000
                                                               <<rwp31>>39556000
    if channel'type = atp'type then                            << adcc>>39558000
    begin                                                      << adcc>>39560000
    move bbuf(12) := "CONTROL PROGRAM :";                      <<rwp31>>39562000
    printline;                                                 <<rwp31>>39564000
    print'octal'dit (locctlpgm, logical(locctlpgm - loctds),   <<rwp31>>39566000
                      cntrl'prog'length);                      <<rwp31>>39568000
    skiplines (1);                                             <<rwp31>>39570000
    end;                                                       << adcc>>39572000
                                                               <<rwp31>>39574000
$page "DO'ATP'DITS : Print ATP dump for ldev, if dump exists"  <<r8331>>39576000
<<now do atp dump if it's for this ldev>>                      <<rwp31>>39578000
    num'of'dumps := integer(core(locdump +                     <<rwp31>>39580000
                   double(dump'control'offset)));              <<rwp31>>39582000
    if num'of'dumps <> 0 then                                  <<rwp31>>39584000
      begin <<dump exists>>                                    <<r8331>>39586000
                                                               <<rwp31>>39588000
      if mpe5 then                                             <<r8331>>39590000
        dumped'ldev :=                                         <<r8331>>39592000
          integer ( core ( locdump +                           <<r8331>>39594000
            double ( mon'dit'offset + dl'ldevunit )))          <<r8331>>39596000
      else                                                     <<r8331>>39598000
      dumped'ldev := integer(core(locdump +                    <<rwp31>>39600000
        double ( mon'dit'offset + dl'ldevunit4 )).md'ldev4 );  <<r8331>>39602000
                                                               <<r8331>>39604000
      if dumped'ldev = ldev then                               <<rwp31>>39606000
      begin                                                    <<rwp31>>39608000
        skiplines(2);                                          <<rwp31>>39610000
        print'atp'dump;                                        <<rwp31>>39612000
      end;                                                     <<rwp31>>39614000
                                                               <<rwp31>>39616000
      end;  <<dump exists>>                                    <<r8331>>39618000
                                                               <<r8331>>39620000
    end;  <<format existing tds>>                              <<r8331>>39622000
                                                               <<rwp31>>39624000
  skiplines(1);                                                <<rwp31>>39626000
  end;  <<valid addresses>>                                    <<r8331>>39628000
                                                               <<rwp31>>39630000
end; <<procedure do'atp'dits>>                                 <<rwp31>>39632000
