<< LINES .001/.009 ARE RESERVED FOR SYSTEMS INTEGRATION>>               00000001
$PAGE "PRINTTBUF : Format the termial buffers"                          55000000
$CONTROL SEGMENT=TABLESTG                                               55002000
PROCEDURE PRINTTBUF;                                           <<03752>>55004000
begin                                                          <<03752>>55006000
COMMENT                                                                 55008000
                                                                        55010000
Purpose:                                                                55012000
     This procedure formats and prints the terminal buffers.            55014000
   The table is printed from tail to head, free list first,             55016000
   then the in-use list. Terminal buffers are printed in                55018000
   ASCII, less the link word. Any non-printable bytes are               55020000
   replaced by '.' . ADCC (or ATC) TBUFs are printed first,             55022000
   followed by the TBUFs for each ATP Subsystem present.                55024000
                                                                        55026000
      For the ADCC (or ATC), the TBUF table contains all the            55028000
   relevant pointers, etc, and this table always resides at             55030000
   the address specified in system DST entry %14. For the               55032000
   ATP, there is one TBUF table in each ATP subsystem's                 55034000
   Terminal Data Segment, pointed to by word 2 of that seg-             55036000
   ment. For the ATP, the DRT is used to get to the ILT, and            55038000
   the ILT is used to get to the TDS.                                   55040000
                                                                        55042000
Input parameters:                                                       55044000
   None.                                                                55046000
                                                                        55048000
Output parameters:                                                      55050000
   None.                                                                55052000
                                                                        55054000
Globals Referenced:                                                     55056000
                                                                        55058000
Globals Altered:                                                        55060000
                                                                        55062000
Data Structures:                                                        55064000
                                                                        55066000
Algorithm:                                                              55068000
                                                                        55070000
;                                                                       55072000
                                                               <<03752>>55074000
logical                                                        <<03752>>55076000
       scratchl,    << Type LOGICAL scratch variable.      >>  <<03752>>55078000
       taptr,       << Link word from last TBUF read.      >>  <<03752>>55080000
       hdptr,       << TBUF Head Pointer, from table.      >>  <<03752>>55082000
       valid'drts,  << Flag returned from TEST'DRT'INFO.   >>  <<03752>>55084000
       atp,         << Flag for table structure, 0=non-ATP.>>  <<03752>>55086000
       tds'seg'num, << Data-sgmt # of TDS for current DRT. >>  <<03752>>55088000
       offset'to'1st'tbuf;  << Displacement from LOCTBUF to>>  <<03752>>55090000
                            << Word 0 of 1st TBUF.         >>  <<03752>>55092000
                                                               <<03752>>55094000
double                                                         <<03752>>55096000
       loctbuf,     << Abs addr of start of TBUF table for >>  <<03752>>55098000
                    << ADCC, ATC, and ATP. Is chg'd to abs >>  <<03752>>55100000
                    << addr of TDS for printing ATP TBUFs. >>  <<03752>>55102000
       scratchd,    << Type DOUBLE scratch variable.       >>  <<03752>>55104000
       locilt,      << Abs addr of ILT, from DRT.          >>  <<03752>>55106000
       lociltx,     << Abs addr of ILTX, calc. from ILT.   >>  <<03752>>55108000
       loctds;      << Abs addr of TDS, from ILTX.         >>  <<03752>>55110000
                                                               <<03752>>55112000
logical array                                                  <<03752>>55114000
       loctbuf0(*) = loctbuf,    << Access to MSW of LOCTBUF>> <<03752>>55116000
       loctbuf1(*) = loctbuf0(1),<< Access to LSW of LOCTBUF>> <<03752>>55118000
       scrd0  (*) = scratchd,     << Access to MSW of TOTREQ>> <<03752>>55120000
       scrd1  (*) = scrd0 (1),    << Access to LSW of TOTREQ>> <<03752>>55122000
       loctds0(*) = loctds,       << Access to MSW of LOCTDS>> <<03752>>55124000
       loctds1(*) = loctds0 (1);  << Access to LSW of LOCTDS>> <<03752>>55126000
                                                               <<03752>>55128000
integer                                                        <<03752>>55130000
       esize,       << Size (in words) of each TBUF.       >>  <<03752>>55132000
       cinuse,      << Number of currently-in-use TBUFs.   >>  <<03752>>55134000
       totale,      << Total# TBUFentries in table.        >>  <<03752>>55136000
       indx,        << Loop counter for free list chaining.>>  <<03752>>55138000
       ix,          << Loop ctr for byte-load, link scan.  >>  <<03752>>55140000
       scratchi,    << Type INTEGER scratch variable.      >>  <<03752>>55142000
       drtno,       << DRT# for loop counter in ATP scan.  >>  <<03752>>55144000
       highdrt,     << Highest DRT#, from fixed low memory.>>  <<03752>>55146000
       lowdrt,      << Lowest DRT#, according to CPU type. >>  <<03752>>55148000
       pi'offset,   << Offset within DRT entry for PI word.>>  <<03752>>55150000
       dbi'offset,  << Offset within DRT entry for DBI wd. >>  <<03752>>55152000
       bytecount;   << Counter for printing TBUF contents. >>  <<03752>>55154000
                                                               <<03752>>55156000
equate                                                         <<03752>>55158000
                                                               <<03752>>55160000
<< The following equates define the order of words in the >>   <<03752>>55162000
<< TBUF table for the ADCC (or ATC):  >>                       <<03752>>55164000
                                                               <<03752>>55166000
       tnum'adcc      = 0,                                     <<03752>>55168000
       tsize'adcc     = 1,                                     <<03752>>55170000
       thead'adcc     = 2,                                     <<03752>>55172000
       ttail'adcc     = 3,                                     <<03752>>55174000
       tuse'adcc      = 4,                                     <<03752>>55176000
       tovflw'adcc    = 5,                                     <<03752>>55178000
       trqsts'adcc    = 6,    << double word >>                <<03752>>55180000
       table'len'adcc = 8,                                     <<03752>>55182000
                                                               <<03752>>55184000
       tbuf'dst'num'adcc = %14, << DST number of TBUF table >> <<03752>>55186000
                                << for ADCC (or ATC). >>       <<03752>>55188000
                                                               <<03752>>55190000
<< The following equates define the TBUF table for the ATP: >> <<03752>>55192000
                                                               <<03752>>55194000
       tnum'atp      = 0,                                      <<03752>>55196000
       tsize'atp     = 1,                                      <<03752>>55198000
       thead'atp     = 2,                                      <<03752>>55200000
       ttail'atp     = 3,                                      <<03752>>55202000
       tmaxuse'atp   = 4,                                      <<03752>>55204000
       tinuse'atp    = 5,                                      <<03752>>55206000
       trqsts'atp    = 6,      << double word >>               <<03752>>55208000
       tdenied'atp   = 8,                                      <<03752>>55210000
       table'len'atp = 10,                                     <<03752>>55212000
                                                               <<03752>>55214000
                                                               <<03752>>55216000
<< The following equates define the ILTX for the ATP: >>       <<03752>>55218000
                                                               <<03752>>55220000
       iltx'dseg      = 0,                                     <<03752>>55222000
       iltx'tdsbank   = 1,                                     <<03752>>55224000
       iltx'tdsoffset = 2,                                     <<03752>>55226000
       iltx'pi        = 5,                                     <<03752>>55228000
                                                               <<03752>>55230000
<< The following equates define words in other tables: >>      <<03752>>55232000
                                                               <<03752>>55234000
       tds'tbuf'table  = 2, <<Offset to TBUF table ptr in TDS>><<03752>>55236000
                                                               <<03752>>55238000
       ilt'drt         = 7, <<Offset to ICNTRL word in ILT.  >><<03752>>55240000
       ilt'isiop       = 8, <<Offset to ISIOP word in ILT.   >><<03752>>55242000
                                                               <<03752>>55244000
       drt'dbi'hpib    = 1, <<Offset to DRT's DBI wd for HPIB>><<03752>>55246000
       drt'pi'hpib     = 2, <<Offset to PI wd in DRT for HPIB>><<03752>>55248000
       drt'dbi'nonhpib = 2, <<Offset to DRT's DBI wd for SIII>><<03752>>55250000
       drt'pi'nonhpib  = 1; <<Offset to PI wd in DRT for SIII>><<03752>>55252000
                                                               <<03752>>55254000
                                                               <<03752>>55256000
SUBROUTINE FMT'TBUFS;                                          <<03752>>55258000
begin                                                          <<03752>>55260000
                                                               <<03752>>55262000
NEWPAGE;              <<for normal TBUFs and each ATP system>> <<03752>>55264000
                                                               <<03752>>55266000
                                                               <<03752>>55268000
<< Build and output Title Header >>                            <<03752>>55270000
if atp then                                                    <<03752>>55272000
  move dbuffer(23) :=                                          <<03752>>55274000
    "******  ATP TERMINAL BUFFERS  ******"                     <<03752>>55276000
  else                                                         <<03752>>55278000
  begin  << store global page number >>                        <<03752>>55280000
    indxaray ( tbuf'dst'num'adcc * 2 ) := pageno;              <<03752>>55282000
    move dbuffer(23) :=                                        <<03752>>55284000
      "******    TERMINAL BUFFERS    ******";                  <<03752>>55286000
  end;                                                         <<03752>>55288000
PRINTLINE;   << output title header>>                          <<03752>>55290000
SKIPLINES(3);                                                  <<03752>>55292000
                                                               <<03752>>55294000
                                                               <<03752>>55296000
                                                               <<03752>>55298000
<< Load #entries in table and #in use from TBUF Table >>       <<03752>>55300000
<< The #entries is saved for later use. >>                     <<03752>>55302000
                                                               <<03752>>55304000
move bbuf := "NUMBER OF ELEMENTS IN TABLE";                    <<03752>>55306000
scratchl := CORE( loctbuf + double(( if atp then               <<03752>>55308000
                     tnum'atp else tnum'adcc )));              <<03752>>55310000
if atp then totale := integer( scratchl )                      <<03752>>55312000
  else totale := integer( scratchl.(0:8));                     <<03752>>55314000
@pbuf := @bbuf + 40;                                           <<03752>>55316000
ASCII( totale, 10, pbuf );                                     <<03752>>55318000
                                                               <<03752>>55320000
move bbuf(52) := "MAXIMUM NUMBER OF ELEMENTS IN USE";          <<03752>>55322000
scratchl := CORE( loctbuf + double(( if atp then               <<03752>>55324000
                     tmaxuse'atp else tuse'adcc )));           <<03752>>55326000
if atp then scratchi:= integer( scratchl )                     <<03752>>55328000
  else scratchi := integer( scratchl.(0:8));                   <<03752>>55330000
@pbuf := @bbuf + 92;                                           <<03752>>55332000
ASCII( scratchi, 10, pbuf );                                   <<03752>>55334000
PRINTLINE;                                                     <<03752>>55336000
                                                               <<03752>>55338000
                                                               <<03752>>55340000
                                                               <<03752>>55342000
<< Load # TBUFs in primary area and # in use from TBUF table >><<03752>>55344000
<< The # in-use is saved for later use. >>                     <<03752>>55346000
                                                               <<03752>>55348000
move bbuf := "ELEMENTS IN PRIMARY AREA";                       <<03752>>55350000
scratchl := CORE( loctbuf + double( tnum'adcc ));              <<03752>>55352000
if atp then scratchi := totale                                 <<03752>>55354000
  else scratchi := integer( scratchl.(8:8));                   <<03752>>55356000
@pbuf := @bbuf + 40;                                           <<03752>>55358000
ASCII( scratchi, 10, pbuf );                                   <<03752>>55360000
                                                               <<03752>>55362000
move bbuf(52) := "CURRENT NUMBER OF ELEMENTS IN USE";          <<03752>>55364000
scratchl := CORE( loctbuf + double(( if atp then               <<03752>>55366000
                     tinuse'atp else tuse'adcc )));            <<03752>>55368000
if atp then cinuse := integer( scratchl )                      <<03752>>55370000
  else cinuse := integer( scratchl.(8:8));                     <<03752>>55372000
@pbuf := @bbuf + 92;                                           <<03752>>55374000
ASCII( cinuse, 10, pbuf );                                     <<03752>>55376000
PRINTLINE;                                                     <<03752>>55378000
                                                               <<03752>>55380000
                                                               <<03752>>55382000
                                                               <<03752>>55384000
<< Load TBUF size and overflows/#denied from TBUF table. >>    <<03752>>55386000
<< The entry-size is saved for later use. >>                   <<03752>>55388000
                                                               <<03752>>55390000
move bbuf := "SIZE OF EACH ELEMENT (WORDS)";                   <<03752>>55392000
scratchl := CORE( loctbuf + double(( if atp then               <<03752>>55394000
                     tsize'atp else tsize'adcc )));            <<03752>>55396000
esize := integer( scratchl.(8:8));                             <<03752>>55398000
@pbuf := @bbuf + 40;                                           <<03752>>55400000
ASCII( esize, 10, pbuf );                                      <<03752>>55402000
                                                               <<03752>>55404000
scratchl := CORE( loctbuf + double((if atp then                <<03752>>55406000
                     tdenied'atp else tovflw'adcc )));         <<03752>>55408000
if atp then                                                    <<03752>>55410000
    move bbuf(52) :=                                           <<03752>>55412000
      "NUMBER OF TBUF REQUESTS DENIED"                         <<03752>>55414000
  else                                                         <<03752>>55416000
    move bbuf(52) := "OVERFLOWS";                              <<03752>>55418000
@pbuf := @bbuf + 92;                                           <<03752>>55420000
ASCII( scratchl, 10, pbuf );                                   <<03752>>55422000
PRINTLINE;                                                     <<03752>>55424000
                                                               <<03752>>55426000
                                                               <<03752>>55428000
                                                               <<03752>>55430000
<< Load head pointer and total #requests from TBUF table. >>   <<03752>>55432000
<< The head pointer is saved for later use. >>                 <<03752>>55434000
                                                               <<03752>>55436000
move bbuf := "INDEX OF FIRST FREE ELEMENT";                    <<03752>>55438000
hdptr := CORE( loctbuf + double(( if atp then                  <<03752>>55440000
                  thead'atp else thead'adcc )));               <<03752>>55442000
@pbuf := @bbuf + 36;                                           <<03752>>55444000
PUTNUMP( hdptr );                                              <<03752>>55446000
                                                               <<03752>>55448000
move bbuf(52) := "TOTAL NUMBER OF REQUESTS";                   <<03752>>55450000
scratchl := (if atp then trqsts'atp else trqsts'adcc );        <<03752>>55452000
scrd0 := CORE( loctbuf + double( scratchl ));                  <<03752>>55454000
scrd1 := CORE( loctbuf + double( scratchl + 1 ));              <<03752>>55456000
@pbuf := @bbuf + 92;                                           <<03752>>55458000
DASCII ( scratchd, 10, pbuf );                                 <<03752>>55460000
PRINTLINE;                                                     <<03752>>55462000
                                                               <<03752>>55464000
                                                               <<03752>>55466000
                                                               <<03752>>55468000
<< Load Tail pointer (and TDS bank# if ATP) from TBUF  >>      <<03752>>55470000
<< table. The Tail pointer is saved as a starting point for >> <<03752>>55472000
<< the free-list chained printout later. >>                    <<03752>>55474000
                                                               <<03752>>55476000
move bbuf := "INDEX TO LAST FREE ELEMENT";                     <<03752>>55478000
taptr := CORE( loctbuf + double(( if atp then                  <<03752>>55480000
                  ttail'atp else ttail'adcc )));               <<03752>>55482000
@pbuf := @bbuf + 36;                                           <<03752>>55484000
PUTNUMP( taptr );                                              <<03752>>55486000
                                                               <<03752>>55488000
if atp then                                                    <<03752>>55490000
begin                                                          <<03752>>55492000
  move bbuf(52) := "TBUF TABLE BANK NUMBER";                   <<03752>>55494000
  @pbuf := @bbuf+ 89;                                          <<03752>>55496000
  PUTNUMP( loctbuf0 );   << Bank# of TBUF table >>             <<03752>>55498000
end;                                                           <<03752>>55500000
PRINTLINE;                                                     <<03752>>55502000
                                                               <<03752>>55504000
                                                               <<03752>>55506000
                                                               <<03752>>55508000
<< If ATP, then also load and output data-segment# of the >>   <<03752>>55510000
<< TDS and the offset to the start of the TBUF table. >>       <<03752>>55512000
                                                               <<03752>>55514000
if atp then                                                    <<03752>>55516000
begin                                                          <<03752>>55518000
  move bbuf := "DATA SEGMENT NUMBER (OCTAL)";                  <<03752>>55520000
  @pbuf := @bbuf + 36;                                         <<03752>>55522000
  PUTNUMP( tds'seg'num );     << Data-sgmt # of TDS >>         <<03752>>55524000
                                                               <<03752>>55526000
  move bbuf(52) := "TBUF TABLE OFFSET";                        <<03752>>55528000
  @pbuf := @bbuf + 89;                                         <<03752>>55530000
  PUTNUMP( loctbuf1 );        << Offset to TBUF table >>       <<03752>>55532000
  PRINTLINE;                                                   <<03752>>55534000
end;                                                           <<03752>>55536000
                                                               <<03752>>55538000
SKIPLINES (1);                                                 <<03752>>55540000
                                                               <<03752>>55542000
                                                               <<03752>>55544000
                                                               <<03752>>55546000
<< Check entry size. If too large then assume bad data  >>     <<03752>>55548000
<< and don't print these TBUFs. >>                             <<03752>>55550000
                                                               <<03752>>55552000
if not ( 0 <= esize <= 80 ) then                               <<03752>>55554000
begin                                                          <<03752>>55556000
  move bbuf := "ERROR: INVALID ENTRY SIZE";                    <<03752>>55558000
  PRINTLINE;                                                   <<03752>>55560000
  go bailout;                                                  <<03752>>55562000
end;                                                           <<03752>>55564000
                                                               <<03752>>55566000
                                                               <<03752>>55568000
<< Output headers for free list >>                             <<03752>>55570000
                                                               <<03752>>55572000
move bbuf(46) := "FREE LIST";                                  <<03752>>55574000
PRINTLINE;                                                     <<03752>>55576000
SKIPLINES (1);                                                 <<03752>>55578000
                                                               <<03752>>55580000
move bbuf := "TABLE";                                          <<03752>>55582000
if atp then move bbuf(20) := "TABLE";                          <<03752>>55584000
PRINTLINE;                                                     <<03752>>55586000
                                                               <<03752>>55588000
move bbuf := "INDEX    LINK";                                  <<03752>>55590000
if atp then move bbuf(20) := "ADDRESS";                        <<03752>>55592000
move bbuf(44) := "TERMINAL BUFFER";                            <<03752>>55594000
PRINTLINE;                                                     <<03752>>55596000
SKIPLINES (1);                                                 <<03752>>55598000
                                                               <<03752>>55600000
                                                               <<03752>>55602000
                                                               <<03752>>55604000
<<   Any TBUF with a nonzero link to another TBUF is con-  >>  <<03752>>55606000
<< sidered to be part of the 'free list', and the index in >>  <<03752>>55608000
<< array IOQIX corresponding to the TBUF#  (0-255) is      >>  <<03752>>55610000
<< appropriately flagged. Later, any element of this array >>  <<03752>>55612000
<< which is still 0 is assumed to indicate an in-use TBUF. >>  <<03752>>55614000
                                                               <<03752>>55616000
                                                               <<03752>>55618000
ioqix := 0;      << Load global index-array with zeroes >>     <<03752>>55620000
move ioqix(1) := ioqix,(255);                                  <<03752>>55622000
                                                               <<03752>>55624000
                                                               <<03752>>55626000
<< Since ATP TBUF pointers are TDS-relative, we now >>         <<03752>>55628000
<< redefine LOCTBUF as the start of the TDS. We also >>        <<03752>>55630000
<< calculate the offset from LOCTBUF to the 1st TBUF. >>       <<03752>>55632000
                                                               <<03752>>55634000
if atp then   <<Adjust pointers to find ATP TBUFs >>           <<03752>>55636000
  begin                                                        <<03752>>55638000
    offset'to'1st'tbuf :=           << Length of ATP TDS >>    <<03752>>55640000
      logical( loctbuf - loctds) +   << up to and including >> <<03752>>55642000
                  table'len'atp;      << the TBUF table. >>    <<03752>>55644000
    loctbuf := loctds;       << Pointers are TDS-relative >>   <<03752>>55646000
  end                                                          <<03752>>55648000
  else  offset'to'1st'tbuf :=     <<TBUF table header length>> <<03752>>55650000
              table'len'adcc;     <<for ADCC and ATC. >>       <<03752>>55652000
                                                               <<03752>>55654000
<< Chain through free TBUF list, starting with the first >>    <<03752>>55656000
<< physical TBUF. Print all TBUFs in the free list. >>         <<03752>>55658000
                                                               <<03752>>55660000
indx := 1;                                                     <<03752>>55662000
while indx <= ( totale - cinuse )  do                          <<03752>>55664000
begin                                                          <<03752>>55666000
                                                               <<03752>>55668000
<< Load index /link ptrs for next TBUF into the output line. >><<03752>>55670000
<< For the ATP we also load the absolute address. This is not>><<03752>>55672000
<< needed for the ATC or ADCC, which are always Sysdb-rel.   >><<03752>>55674000
                                                               <<03752>>55676000
  @pbuf := @bbuf;                                              <<03752>>55678000
  PUTNUMP( taptr );                        <<load index>>      <<03752>>55680000
  scratchd := double( taptr );  <<use index to get link word>> <<03752>>55682000
  scratchl := CORE( loctbuf + scratchd );                      <<03752>>55684000
  @pbuf := @bbuf + 8;                                          <<03752>>55686000
  PUTNUMP( scratchl );                     <<load link>>       <<03752>>55688000
  if atp then        <<calculate and load absolute address>>   <<03752>>55690000
    begin                                                      <<03752>>55692000
      @pbuf := @bbuf + 20;                                     <<03752>>55694000
      PUTNUM( loctds1 + taptr );           <<load address>>    <<03752>>55696000
    end;  <<address load>>                                     <<03752>>55698000
                                                               <<03752>>55700000
                                                               <<03752>>55702000
<< Load this TBUF, word-by-word, and print it out. >>          <<03752>>55704000
<< Dump words 1 through last. Last should be zero. >>          <<03752>>55706000
                                                               <<03752>>55708000
  @pbuf := @bbuf + 36;  <<set pointer for byte dump>>          <<03752>>55710000
  bytecount := 0;                                              <<03752>>55712000
  for ix := 1 until ( esize - 1 ) do                           <<03752>>55714000
  begin                                                        <<03752>>55716000
    scratchl := CORE( loctbuf + scratchd + double( ix ));      <<03752>>55718000
    PUTCHAR( scratchl );  <<load next 2 bytes>>                <<03752>>55720000
    bytecount := bytecount + 2;                                <<03752>>55722000
    if bytecount > 66 then  <<this line is full>>              <<03752>>55724000
      begin                                                    <<03752>>55726000
        PRINTLINE;                                             <<03752>>55728000
        SKIPLINES (1);                                         <<03752>>55730000
        bytecount := 0;                                        <<03752>>55732000
        @pbuf := @bbuf + 36;                                   <<03752>>55734000
      end;  << if line full >>                                 <<03752>>55736000
    end;  <<for>>                                              <<03752>>55738000
    if bytecount > 0 then  <<flush partial line>>              <<03752>>55740000
      begin                                                    <<03752>>55742000
        PRINTLINE;                                             <<03752>>55744000
        SKIPLINES (1);                                         <<03752>>55746000
      end;  <<flush>>                                          <<03752>>55748000
                                                               <<03752>>55750000
                                                               <<03752>>55752000
<< Mark this TBUF as 'free' by storing its link in the >>      <<03752>>55754000
<< index array. >>                                             <<03752>>55756000
                                                               <<03752>>55758000
  ioqix( integer( taptr -  offset'to'1st'tbuf )                <<03752>>55760000
                          / esize ) := taptr;                  <<03752>>55762000
                                                               <<03752>>55764000
                                                               <<03752>>55766000
<< Scan list to look for a link to match this index >>         <<03752>>55768000
<< unless we've found the head entry. >>                       <<03752>>55770000
                                                               <<03752>>55772000
  if taptr = hdptr then go do'inuse'list;                      <<03752>>55774000
                                                               <<03752>>55776000
  ix := integer( offset'to'1st'tbuf );                         <<03752>>55778000
  while ix < ( totale * esize                                  <<03752>>55780000
                 + integer( offset'to'1st'tbuf ))   do         <<03752>>55782000
  begin                                                        <<03752>>55784000
    scratchl := CORE( loctbuf + double( ix ));                 <<03752>>55786000
    if scratchl = taptr then go see'if'link'broken             <<03752>>55788000
      else ix := ix + esize;                                   <<03752>>55790000
  end;                                                         <<03752>>55792000
                                                               <<03752>>55794000
  see'if'link'broken:                                          <<03752>>55796000
  if scratchl = taptr then taptr := logical( ix )              <<03752>>55798000
    else                                                       <<03752>>55800000
    begin                                                      <<03752>>55802000
      move bbuf := "ERROR: BROKEN TERMINAL BUFFER LINK";       <<03752>>55804000
      PRINTLINE;                                               <<03752>>55806000
      go bailout;                                              <<03752>>55808000
    end;                                                       <<03752>>55810000
                                                               <<03752>>55812000
  indx := indx + 1;                                            <<03752>>55814000
end;  << while >>                                              <<03752>>55816000
                                                               <<03752>>55818000
                                                               <<03752>>55820000
<< Print headers for in-use list. >>                           <<03752>>55822000
                                                               <<03752>>55824000
do'inuse'list:                                                 <<03752>>55826000
if linecount > ( lnsperpg - 18 ) then NEWPAGE;                 <<03752>>55828000
SKIPLINES (3);                                                 <<03752>>55830000
                                                               <<03752>>55832000
if atp then                                                    <<03752>>55834000
  move dbuffer(23) :=                                          <<03752>>55836000
    "******  ATP TERMINAL BUFFERS  ******"                     <<03752>>55838000
  else                                                         <<03752>>55840000
  move dbuffer(23) :=                                          <<03752>>55842000
    "******    TERMINAL BUFFERS    ******";                    <<03752>>55844000
PRINTLINE;                                                     <<03752>>55846000
SKIPLINES (3);                                                 <<03752>>55848000
                                                               <<03752>>55850000
move bbuf(46) := "IN-USE LIST";                                <<03752>>55852000
PRINTLINE;                                                     <<03752>>55854000
SKIPLINES (1);                                                 <<03752>>55856000
                                                               <<03752>>55858000
move bbuf := "TABLE";                                          <<03752>>55860000
if atp then move bbuf(20) := "TABLE";                          <<03752>>55862000
PRINTLINE;                                                     <<03752>>55864000
                                                               <<03752>>55866000
move bbuf := "INDEX    LINK";                                  <<03752>>55868000
if atp then move bbuf(20) := "ADDRESS";                        <<03752>>55870000
move bbuf(44) := "TERMINAL BUFFER";                            <<03752>>55872000
PRINTLINE;                                                     <<03752>>55874000
SKIPLINES (1);                                                 <<03752>>55876000
                                                               <<03752>>55878000
                                                               <<03752>>55880000
<< Step through index array and print the TBUFs which >>       <<03752>>55882000
<< correspond to elements which were left zero by the >>       <<03752>>55884000
<< free-list routine. >>                                       <<03752>>55886000
                                                               <<03752>>55888000
indx := 0;                                                     <<03752>>55890000
while indx <= ( totale - 1 )   do                              <<03752>>55892000
begin                                                          <<03752>>55894000
  if ioqix( indx ) = 0 then   <<this is not a free TBUF>>      <<03752>>55896000
    begin                                                      <<03752>>55898000
                                                               <<03752>>55900000
<< Set the pointer to the link word of this in-use TBUF. >>    <<03752>>55902000
                                                               <<03752>>55904000
      taptr := logical( indx * esize )                         <<03752>>55906000
                            + offset'to'1st'tbuf;              <<03752>>55908000
                                                               <<03752>>55910000
<< Load index pointers for this in-use TBUF. >>                <<03752>>55912000
                                                               <<03752>>55914000
      @pbuf := @bbuf;                                          <<03752>>55916000
      PUTNUMP( taptr  + ( if atp then 0    << load index >>    <<03752>>55918000
                      else ( loctbuf1 - %1000 )));             <<03752>>55920000
      scratchd := double( taptr );                             <<03752>>55922000
      scratchl := CORE( loctbuf + scratchd );                  <<03752>>55924000
      @pbuf := @bbuf + 8;                                      <<03752>>55926000
      PUTNUMP( scratchl );               <<load link>>         <<03752>>55928000
      if atp then                                              <<03752>>55930000
        begin                                                  <<03752>>55932000
          @pbuf := @bbuf + 20;                                 <<03752>>55934000
          PUTNUM( loctds1 + taptr );     <<load address>>      <<03752>>55936000
        end;  <<if atp>>                                       <<03752>>55938000
                                                               <<03752>>55940000
                                                               <<03752>>55942000
<< Load and print in-use TBUF, word-by-word. >>                <<03752>>55944000
                                                               <<03752>>55946000
      @pbuf := @bbuf + 36;                                     <<03752>>55948000
      bytecount := 0;                                          <<03752>>55950000
      for ix := 1 until ( esize - 1 )  do                      <<03752>>55952000
      begin                                                    <<03752>>55954000
        scratchl := CORE( loctbuf + scratchd + double( ix ));  <<03752>>55956000
        PUTCHAR( scratchl );  <<load next 2 bytes>>            <<03752>>55958000
        bytecount := bytecount + 2;                            <<03752>>55960000
        if bytecount > 66 then   <<this line is full>>         <<03752>>55962000
          begin                                                <<03752>>55964000
            PRINTLINE;                                         <<03752>>55966000
            SKIPLINES (1);                                     <<03752>>55968000
            bytecount := 0;                                    <<03752>>55970000
            @pbuf := @bbuf + 36;                               <<03752>>55972000
          end;  <<if full line>>                               <<03752>>55974000
      end;  <<for>>                                            <<03752>>55976000
      if bytecount > 0 then  <<flush partial line>>            <<03752>>55978000
        begin                                                  <<03752>>55980000
          PRINTLINE;                                           <<03752>>55982000
          SKIPLINES (1);                                       <<03752>>55984000
        end;  <<flush>>                                        <<03752>>55986000
      end;  <<if ioqix(ix) = 0>>                               <<03752>>55988000
                                                               <<03752>>55990000
  indx := indx + 1;                                            <<03752>>55992000
end;   << while >>                                             <<03752>>55994000
                                                               <<03752>>55996000
bailout:                                                       <<03752>>55998000
end;  <<subroutine fmt'tbufs>>                                 <<03752>>56000000
                 << ****** MAIN ****** >>                      <<03752>>56002000
                                                               <<03752>>56004000
                                                               <<03752>>56006000
<< Verify System DB and DST pointers agree, >>                 <<03752>>56008000
<< obtain absolute address of DST %14 >>                       <<03752>>56010000
                                                               <<03752>>56012000
loctbuf := VERIFYP( tbuf'dst'num'adcc, %1016D );               <<03752>>56014000
if <> then                                                     <<03752>>56016000
  if loctbuf <> 0D then WARNING else                           <<03752>>56018000
  begin                                                        <<03752>>56020000
    NOFORMT';                                                  <<03752>>56022000
    go do'atp'tbufs;                                           <<03752>>56024000
  end;                                                         <<03752>>56026000
                                                               <<03752>>56028000
atp := false;                                                  <<03752>>56030000
FMT'TBUFS;   << Do non-ATP TBUFs >>                            <<03752>>56032000
                                                               <<03752>>56034000
                                                               <<03752>>56036000
<< Obtain lowest DRT# according to CPU type and >>             <<03752>>56038000
<< highest DRT# from fixed low memory. Quit if bad data.>>     <<03752>>56040000
                                                               <<03752>>56042000
do'atp'tbufs:                                                  <<03752>>56044000
TEST'DRT'INFO( lowdrt, highdrt, valid'drts, 0 );               <<03752>>56046000
if not valid'drts then go bailout1;                            <<03752>>56048000
                                                               <<03752>>56050000
                                                               <<03752>>56052000
                                                               <<03752>>56054000
<< Get correct orientation of PI and DBI words in DRT entry.>> <<03752>>56056000
                                                               <<03752>>56058000
dbi'offset := (if series'33'thru'55 then                       <<03752>>56060000
                drt'dbi'hpib  else  drt'dbi'nonhpib );         <<03752>>56062000
pi'offset := (if series'33'thru'55 then                        <<03752>>56064000
                drt'pi'hpib  else  drt'pi'nonhpib );           <<03752>>56066000
                                                               <<03752>>56068000
                                                               <<03752>>56070000
                                                               <<03752>>56072000
<< Scan through DRT table, looking for ATP subsystems >>       <<03752>>56074000
                                                               <<03752>>56076000
for drtno := lowdrt until highdrt  do                          <<03752>>56078000
begin                                                          <<03752>>56080000
  if integer( GETDRT( drtno, 0 )) = -1 then go next'drt;       <<03752>>56082000
                                                               <<03752>>56084000
                                                               <<03752>>56086000
                                                               <<03752>>56088000
<< Load ILT abs addr from DBI word of DRT entry >>             <<03752>>56090000
                                                               <<03752>>56092000
  locilt := double( GETDRT( drtno, dbi'offset ));              <<03752>>56094000
                                                               <<03752>>56096000
                                                               <<03752>>56098000
                                                               <<03752>>56100000
<< ATP software does not run on Series III and uses only >>    <<03752>>56102000
<< the 'new' ILT format. Quit if conditions not met. >>        <<03752>>56104000
                                                               <<03752>>56106000
  if not (series'33'thru'55) or not (new'ilt'format)           <<03752>>56108000
           then go bailout1;                                   <<03752>>56110000
                                                               <<03752>>56112000
                                                               <<03752>>56114000
                                                               <<03752>>56116000
<< Check DRT word in ILT for the expected value. Skip if >>    <<03752>>56118000
<< the values do not match. >>                                 <<03752>>56120000
                                                               <<03752>>56122000
  scratchl := CORE( locilt + double( ilt'drt ));               <<03752>>56124000
  if integer (scratchl.(7:9)) <> drtno then go next'drt;       <<03752>>56126000
                                                               <<03752>>56128000
                                                               <<03752>>56130000
                                                               <<03752>>56132000
<< Use ISIOP pointer word in ILT as pointer to ILTX. >>        <<03752>>56134000
                                                               <<03752>>56136000
  tos := 0;                                                    <<03752>>56138000
  tos := CORE( locilt + double( ilt'isiop ));                  <<03752>>56140000
  lociltx := tos;                                              <<03752>>56142000
  lociltx := lociltx + %1000D; << ISIOP is sysdb-rel. ptr >>   <<03752>>56144000
                                                               <<03752>>56146000
                                                               <<03752>>56148000
                                                               <<03752>>56150000
<< Attempt to load PI pointer from last word of ILTX. If >>    <<03752>>56152000
<< software is for ATP, then this matches the PI word >>       <<03752>>56154000
<< in the current DRT entry. Else not an ATP.         >>       <<03752>>56156000
                                                               <<03752>>56158000
  scratchl := CORE( lociltx + double( iltx'pi ));              <<03752>>56160000
  atp := (if GETDRT( drtno, pi'offset ) = scratchl             <<03752>>56162000
               then true else false);                          <<03752>>56164000
                                                               <<03752>>56166000
                                                               <<03752>>56168000
                                                               <<03752>>56170000
<< Load pointers and print TBUFs if ATP, else fall through >>  <<03752>>56172000
<< to next DRT entry. >>                                       <<03752>>56174000
                                                               <<03752>>56176000
  if atp then                                                  <<03752>>56178000
  begin                                                        <<03752>>56180000
    tds'seg'num := CORE( lociltx + double( iltx'dseg ));       <<03752>>56182000
    tos := CORE( lociltx + double( iltx'tdsbank ));            <<03752>>56184000
    tos := CORE( lociltx + double( iltx'tdsoffset ));          <<03752>>56186000
    loctds := tos;                                             <<03752>>56188000
                                                               <<03752>>56190000
                                                               <<03752>>56192000
                                                               <<03752>>56194000
<< Skip if TDS was not built yet when dump was done. >>        <<03752>>56196000
                                                               <<03752>>56198000
    if loctds <= 0D then go next'drt;                          <<03752>>56200000
                                                               <<03752>>56202000
                                                               <<03752>>56204000
<< Load location of TBUF table from TDS. This is a TDS-rel. >> <<03752>>56206000
<< pointer which is changed before printing the actual TBUF. >><<03752>>56208000
                                                               <<03752>>56210000
    loctbuf := loctds +    << TBUF-table ptr word from TDS >>  <<03752>>56212000
            double( CORE( loctds + double( tds'tbuf'table ))); <<03752>>56214000
                                                               <<03752>>56216000
    FMT'TBUFS;   << Do ATP TBUFs >>                            <<03752>>56218000
  end;  << if ATP >>                                           <<03752>>56220000
                                                               <<03752>>56222000
next'drt:  << done or not ATP, try next DRT entry >>           <<03752>>56224000
end;  << for >>                                                <<03752>>56226000
                                                               <<03752>>56228000
bailout1:                                                      <<03752>>56230000
end;  << procedure printtbuf >>                                <<03752>>56232000
                                                                        56234000
$PAGE "PRINTDIT: Format DIT"                                            56236000
$CONTROL SEGMENT=TABLESTG                                               56238000
COMMENT                                                                 56240000
                                                                        56242000
Purpose:                                                                56244000
                    PRINT DIT                                  <<03752>>56246000
   This procedure will print the Device Information Table.     <<03752>>56248000
   The DRT is used to get to the ILT and the ILT is used to    <<03752>>56250000
   get to the DIT. The DLT is used to determine DIT size       <<03752>>56252000
   and device type. The LPDT is used to determine subtype.     <<03752>>56254000
                                                               <<03752>>56256000
   For the ATP, the ILTX is used to get to the TDS, and the    <<03752>>56258000
   DIT is used to get to the PDDIT in the TDS. The PDDIT is    <<03752>>56260000
   used to get to the HWDIT, PPDIT, and TBUFs, and the HWDIT   <<03752>>56262000
   is used to get to the CONTROL PROGRAM, all of which         <<03752>>56264000
   reside in the TDS.                                          <<03752>>56266000
                                                               <<03752>>56268000
   This routine obtains the lowest and highest DRT numbers     <<03752>>56270000
   in the system, then steps through the entire DRT. For       <<03752>>56272000
   each active DRT entry, the routine obtains the DIT poin-    <<03752>>56274000
   ter and ILT pointer, then calculates the number of units    <<03752>>56276000
   on the active entry by subtracting addresses of pointers    <<03752>>56278000
   in the ILT from the address of its first DIT pointer.       <<03752>>56280000
                                                               <<03752>>56282000
   For each active unit a header containing pertinent info.    <<03752>>56284000
   is output, followed by the main DIT and any additional      <<03752>>56286000
   device-dependent DITs. PRINT'DIT uses the procedure         <<03752>>56288000
   PRINT'OCTAL'DIT to output the DIT if the device is not      <<03752>>56290000
   a DS device, or calls DODSDIT to do output if it is.        <<03752>>56292000
                                                               <<03752>>56294000
   If any ATP devices have been dumped to the TDS dump area,   <<03752>>56296000
   this dump area will also be formatted.                      <<03752>>56298000
                                                               <<03752>>56300000
   After the entire DRT has been stepped through, any MRJE     <<03752>>56302000
   DITs which may exist are printed by DO'MRJE'DITS.           <<03752>>56304000
                                                                        56306000
Input parameters:                                                       56308000
                                                                        56310000
Output parameters:                                                      56312000
                                                                        56314000
Globals Referenced:                                                     56316000
                                                                        56318000
Globals Altered:                                                        56320000
                                                                        56322000
Data Structures:                                                        56324000
                                                                        56326000
Algorithm:                                                              56328000
                                                                        56330000
;                                                                       56332000
                                                               <<03752>>56334000
PROCEDURE PRINTDIT;                                            <<03752>>56336000
begin                                                          <<03752>>56338000
                                                               <<03752>>56340000
  double                                                       <<03752>>56342000
                                                               <<03752>>56344000
<< Absolute addresses of word 0 of the specified tables: >>    <<03752>>56346000
                                                               <<03752>>56348000
         locilt,      << Interrupt Linkage Table from DRT   >> <<03752>>56350000
         lociltx,     << Interrupt Linkage Table Extension  >> <<03752>>56352000
         locdit,      << Device Information Table from ILT  >> <<03752>>56354000
         locdlt,      << Driver Linkage Table from DIT      >> <<03752>>56356000
         loctds,      << Terminal Data Segment from ILTX    >> <<03752>>56358000
         locpddit,    << Protocol/Data Manager DIT from DIT >> <<03752>>56360000
         locppdit,    << Port Protocol DIT from PDDIT       >> <<03752>>56362000
         lochwdit,    << Hardware DIT from PDDIT            >> <<03752>>56364000
         locctlpgm,   << Control Program from HWDIT         >> <<03752>>56366000
                                                               <<03752>>56368000
<< Miscellaneous: >>                                           <<03752>>56370000
         nunits,      << Number of units for DRT from addr's>> <<03752>>56372000
         scratchd;    << type DOUBLE scratch variable       >> <<03752>>56374000
                                                               <<03752>>56376000
integer                                                        <<03752>>56378000
         highdrt,     << Highest DRT# from fixed low memory >> <<03752>>56380000
         lowdrt,      << Lowest DRT# according to CPU type  >> <<03752>>56382000
         drtno,       << DRT# for loop counter              >> <<03752>>56384000
         pi'offset,   << Offset within DRT entry for PI wd  >> <<03752>>56386000
         dbi'offset,  << Offset within DRT entry for DBI wd >> <<03752>>56388000
         ditsize,     << # words in DIT, from DLT           >> <<03752>>56390000
         devtype,     << Device Type, from DLT              >> <<03752>>56392000
         devsubtype,  << Device Subtype, from LPDT          >> <<03752>>56394000
         devunit,     << Device unit#, for loop counter     >> <<03752>>56396000
         ldev,        << Logical Device# from DIT           >> <<03752>>56398000
         syscon,      << LDEV# of Sys Console from fixed mem>> <<03752>>56400000
         ix,          << loop cntr for active-DIT lookahead >> <<03752>>56402000
         scratchi;    << type INTEGER scratch variable      >> <<03752>>56404000
                                                               <<03752>>56406000
logical                                                        <<03752>>56408000
         icf,         << flag for CPU type: 0=SIII, 1=HPIB  >> <<03752>>56410000
         atp,         << flag for table structure, 0=non-ATP>> <<03752>>56412000
         valid'drts,  << flag returned from TEST'DRT'INFO   >> <<03752>>56414000
         ditnotfound, << flag for first-active-DIT lookahead>> <<03752>>56416000
         scratchl;    << type LOGICAL scratch variable      >> <<03752>>56418000
                                                               <<03752>>56420000
logical array                                                  <<03752>>56422000
         scrd0(*) = scratchd,  << access to MSW of SCRATCHD >> <<03752>>56424000
         scrd1(*) = scrd0(1);  << access to LSW of SCRATCHD >> <<03752>>56426000
                                                               <<03752>>56428000
                                                               <<03752>>56430000
equate                                                         <<03752>>56432000
                                                               <<03752>>56434000
<< These equates define the order of words in the DRT entry >> <<03752>>56436000
<< for HPIB systems (S30, 33, 40, 44, 64, STARFISH) and non->> <<03752>>56438000
<< HPIB systems (SII, SIII): >>                                <<03752>>56440000
                                                               <<03752>>56442000
       drt'dbi'hpib     = 1,  <<Disp to DRT's DBI wd for HPIB>><<03752>>56444000
       drt'pi'hpib      = 2,  <<Disp to DRT's PI wd for HPIB >><<03752>>56446000
                                                               <<03752>>56448000
       drt'dbi'nonhpib  = 2,  <<Disp to DRT's DBI wd for SIII>><<03752>>56450000
       drt'pi'nonhpib   = 1,  <<Disp to DRT's PI wd for SIII >><<03752>>56452000
                                                               <<03752>>56454000
<< The following equates define the order of words in the >>   <<03752>>56456000
<< 'old' ILT format: >>                                        <<03752>>56458000
                                                               <<03752>>56460000
       ilt'icntrl'old   = 0,                                   <<03752>>56462000
       ilt'isiop'old    = 1,                                   <<03752>>56464000
       ilt'iditp0'old   = 4,                                   <<03752>>56466000
                                                               <<03752>>56468000
<< These equates define the order of words in the 'new' ILT >> <<03752>>56470000
<< format: >>                                                  <<03752>>56472000
                                                               <<03752>>56474000
       ilt'icntrl'new   = 7,                                   <<03752>>56476000
       ilt'isiop'new    = 8,                                   <<03752>>56478000
       ilt'istap'new    = 9,                                   <<03752>>56480000
       ilt'iditp0'new   = 14,                                  <<03752>>56482000
                                                               <<03752>>56484000
<< These equates define the order of words in the >>           <<03752>>56486000
<< ILT Extension (ILTX) as used with the ATP: >>               <<03752>>56488000
                                                               <<03752>>56490000
       iltx'dseg        = 0,                                   <<03752>>56492000
       iltx'tdsbank     = 1,                                   <<03752>>56494000
       iltx'tdsoffset   = 2,                                   <<03752>>56496000
       iltx'pi          = 5,                                   <<03752>>56498000
                                                               <<03752>>56500000
<< These equates define the order of words in the DIT header,>><<03752>>56502000
<< according to the semi-standard format: >>                   <<03752>>56504000
                                                               <<03752>>56506000
       dit'dflags       = 0,                                   <<03752>>56508000
       dit'dlink        = 1,                                   <<03752>>56510000
       dit'dioqp        = 2,                                   <<03752>>56512000
       dit'dldev        = 3,                                   <<03752>>56514000
       dit'ddltp        = 4,                                   <<03752>>56516000
       dit'diltp        = 5,                                   <<03752>>56518000
       dit'dstat        = 6,                                   <<03752>>56520000
       dit'dserr        = 7,                                   <<03752>>56522000
                                                               <<03752>>56524000
<< The following equates define the order of words in >>       <<03752>>56526000
<< other applicable tables: >>                                 <<03752>>56528000
                                                               <<03752>>56530000
       dlt'dtype      = 5,   <<Offset to DTYPE word in DLT>>   <<03752>>56532000
                                                               <<03752>>56534000
       dit'pdditp'atp = 9,   <<Offset to PDDITP wd in ATP DIT>><<03752>>56536000
                                                               <<03752>>56538000
       pdfdit'hwditp'atp = 0, <<Offset to HWDITP wd in PDDIT>> <<03752>>56540000
       pdfdit'ppditp'atp = 6, <<Offset to PPP word in PDDIT>>  <<03752>>56542000
       pdfdit'length'atp = 11, << # wds in PDDIT fixed area >> <<03752>>56544000
                                                               <<03752>>56546000
       pdvdit'theadp'atp = 2, <<Ofst to TBUF Headptr in PDDIT>><<03752>>56548000
       pdvdit'ttailp'atp = 3, <<Ofst to TBUF tailptr in PDDIT>><<03752>>56550000
       pdvdit'length'atp = 26, <<# wds in PDDIT variable area>><<03752>>56552000
                                                               <<03752>>56554000
       hwdit'ctlpgmp'atp = 2,  <<Ofst to Ctrlpgm ptr in HWDIT>><<03752>>56556000
       hwdit'length'atp  = 50, <<# wds in ATP Hardware DIT >>  <<03752>>56558000
                                                               <<03752>>56560000
       ppdit'length'atp  = 5,  <<ATP Port Protocol DIT length>><<03752>>56562000
       ctlpgm'length'atp = 16, <<ATP Control Program length  >><<03752>>56564000
       tds'tbuftblp'atp  = 2,  <<Ptr to TBUF table in TDS    >><<03752>>56566000
       tds'portdumpp'atp = 13, <<Pointer to dump area in TDS >><<03752>>56568000
                                                               <<03752>>56570000
       maxunits'atp     = 96,  <<Max #units in ATP subsystem >><<03752>>56572000
       maxunits'nonatp  = 16,  <<Max #units, other subsystems>><<03752>>56574000
                                                               <<03752>>56576000
       lpdt'addr'wd    = %1010, <<Fixed low mem LPDT address >><<03752>>56578000
       sysconsole'wd   = %1074; <<Fixed low mem console LDEV#>><<03752>>56580000
                                                               <<03752>>56582000
                                                               <<03752>>56584000
                                                               <<03752>>56586000
<< PRINT'ATP'DUMP declarations : >>                            <<03752>>56588000
                                                               <<03752>>56590000
double                                                         <<03752>>56592000
        locdump,       << abs addr of start of ATP dump area.>><<03752>>56594000
        loctable;      << addr of currently-dumping table.   >><<03752>>56596000
                                                               <<03752>>56598000
integer                                                        <<03752>>56600000
        indx1;         << loop counter for IOQ printing.     >><<03752>>56602000
                                                               <<03752>>56604000
                                                               <<03752>>56606000
<< The following equates define the number of words in each >> <<03752>>56608000
<< table dumped to the ATP dump area : >>                      <<03752>>56610000
                                                               <<03752>>56612000
equate                                                         <<03752>>56614000
        dump'control'length   = 1,                             <<03752>>56616000
        tds'pri'length        = 14,   <<Terminal Data segment>><<03752>>56618000
        tds'sec'length        = 10,                            <<03752>>56620000
                                                               <<03752>>56622000
        mon'dit'length        = 20,   <<Device Info. Table>>   <<03752>>56624000
                                                               <<03752>>56626000
        pd'fdit'length        = pdfdit'length'atp,             <<03752>>56628000
        pd'vdit'length        = pdvdit'length'atp,             <<03752>>56630000
        hw'dit'length         = hwdit'length'atp,              <<03752>>56632000
        cntrl'prog'length     = ctlpgm'length'atp,             <<03752>>56634000
                                                               <<03752>>56636000
        lpdt'length           = 2,    <<Logical/Phys Dev Tbl >><<03752>>56638000
                                                               <<03752>>56640000
        dlt'length            = 8,    <<Driver Linkage Table >><<03752>>56642000
                                                               <<03752>>56644000
        drt'length            = 4,    <<Device Reference Tbl >><<03752>>56646000
                                                               <<03752>>56648000
        ldt'length            = 10,   <<Logical Device Table >><<03752>>56650000
        ldt'size              = 5,                             <<03752>>56652000
        ldtx'size             = 5,                             <<03752>>56654000
                                                               <<03752>>56656000
        pcb'length            = 16,   <<Process Control Block>><<03752>>56658000
                                                               <<03752>>56660000
        ldtpcb'length         = 16,   <<LDT Process Ctl Block>><<03752>>56662000
                                                               <<03752>>56664000
        pcc'memory'length     = 128,  <<Port-Ctlr Chip memory>><<03752>>56666000
        atp'regs'length       = 16,   <<Channel Registers    >><<03752>>56668000
                                                               <<03752>>56670000
        stack'length          = 128,  <<when error occurred  >><<03752>>56672000
                                                               <<03752>>56674000
        ioq'tbuf'info'len     = 3,    <<Info block in dump   >><<03752>>56676000
                                                               <<03752>>56678000
        ilt'size              = 14,   <<Interrupt Linkage Tbl>><<03752>>56680000
        iltx'size             = 6,                             <<03752>>56682000
                                                               <<03752>>56684000
                                                               <<03752>>56686000
<< These equates define the order of words dumped to the >>    <<03752>>56688000
<< ATP dump area : >>                                          <<03752>>56690000
                                                               <<03752>>56692000
        dump'control'offset = 0,                               <<03752>>56694000
        tds'pri'offset      = dump'control'offset +            <<03752>>56696000
                                 dump'control'length,          <<03752>>56698000
        tds'sec'offset      = tds'pri'offset + tds'pri'length, <<03752>>56700000
        mon'dit'offset      = tds'sec'offset + tds'sec'length, <<03752>>56702000
        pd'fdit'offset      = mon'dit'offset + mon'dit'length, <<03752>>56704000
        pd'vdit'offset      = pd'fdit'offset + pd'fdit'length, <<03752>>56706000
        hw'dit'offset       = pd'vdit'offset + pd'vdit'length, <<03752>>56708000
        cntrl'prog'offset   = hw'dit'offset + hw'dit'length,   <<03752>>56710000
        lpdt'offset         = cntrl'prog'offset +              <<03752>>56712000
                                 cntrl'prog'length,            <<03752>>56714000
        dlt'offset          = lpdt'offset + lpdt'length,       <<03752>>56716000
        drt'offset          = dlt'offset + dlt'length,         <<03752>>56718000
        ldt'offset          = drt'offset + drt'length,         <<03752>>56720000
        pcb'offset          = ldt'offset + ldt'length,         <<03752>>56722000
        ldtpcb'offset       = pcb'offset + pcb'length,         <<03752>>56724000
        pcc'memory'offset   = ldtpcb'offset + ldtpcb'length,   <<03752>>56726000
        atp'regs'offset     = pcc'memory'offset +              <<03752>>56728000
                                  pcc'memory'length,           <<03752>>56730000
        stack'offset        = atp'regs'offset +                <<03752>>56732000
                                  atp'regs'length,             <<03752>>56734000
        ilt'offset          = stack'offset + stack'length,     <<03752>>56736000
        info'offset         = ilt'offset + ilt'size +          <<03752>>56738000
                                  iltx'size,                   <<03752>>56740000
        ioq'offset          = info'offset + ioq'tbuf'info'len, <<03752>>56742000
                                                               <<03752>>56744000
<< These equates define the order of words in the >>           <<03752>>56746000
<< TBUF / SBUF information block of the ATP dump area : >>     <<03752>>56748000
                                                               <<03752>>56750000
        num'of'ioqs'word    = 0,                               <<03752>>56752000
        buf'offset'word     = 1,                               <<03752>>56754000
        num'of'bufs'word    = 2,                               <<03752>>56756000
                                                               <<03752>>56758000
                                                               <<03752>>56760000
<< These are misc equates for the ATP dump format routine : >> <<03752>>56762000
                                                               <<03752>>56764000
        tbuf'size      = 69,  << # words in an ATP TBUF.  >>   <<03752>>56766000
        sbuf'size      = 128, << # words in an SBUF.      >>   <<03752>>56768000
        ioq'size       = 11,  << # words in an IOQ.       >>   <<03752>>56770000
                                                               <<03752>>56772000
        tbuf           = 1,   << 'TBUFs dumped' type-code.>>   <<03752>>56774000
        sbuf           = 2;   << 'SBUFs dumped' type-code.>>   <<03752>>56776000
                                                               <<03752>>56778000
                                                               <<03752>>56780000
                                                               <<03752>>56782000
                                                               <<03752>>56784000
<<     PRINT'ATP'DUMP                                      >>  <<03752>>56786000
                                                               <<03752>>56788000
<< This subroutine is called if the DRT entry being        >>  <<03752>>56790000
<< processed is an ATP subsystem, at the completion of the >>  <<03752>>56792000
<< DIT printing for that DRT. It will format the port-dump >>  <<03752>>56794000
<< area of the Terminal Data Segment according to the fixed>>  <<03752>>56796000
<< order in which tables were dumped into that area.       >>  <<03752>>56798000
                                                               <<03752>>56800000
                                                               <<03752>>56802000
SUBROUTINE PRINT'ATP'DUMP;                                     <<03752>>56804000
                                                               <<03752>>56806000
begin                                                          <<03752>>56808000
locdump := loctds + double( CORE( loctds +                     <<03752>>56810000
                    double( tds'portdumpp'atp )));             <<03752>>56812000
scratchl := CORE( locdump + double( dump'control'offset ));    <<03752>>56814000
                                                               <<03752>>56816000
if integer( scratchl ) < 1 then go quit'atp'dump;              <<03752>>56818000
                                                               <<03752>>56820000
                                                               <<03752>>56822000
NEWPAGE;                                                       <<03752>>56824000
move bbuf(40) := "****** ATP ERROR-DUMP AREA ******";          <<03752>>56826000
PRINTLINE;                                                     <<03752>>56828000
SKIPLINES (1);                                                 <<03752>>56830000
                                                               <<03752>>56832000
move bbuf(12) := "NUMBER OF ERROR CALLS  =";                   <<03752>>56834000
@pbuf := @bbuf + 38;                                           <<03752>>56836000
ASCII( scratchl, 10, pbuf );                                   <<03752>>56838000
PRINTLINE;                                                     <<03752>>56840000
                                                               <<03752>>56842000
move bbuf(12) := "LOGICAL DEVICE NUMBER  =";                   <<03752>>56844000
@pbuf := @bbuf + 38;                                           <<03752>>56846000
scratchl := CORE( locdump + double( mon'dit'offset +           <<03752>>56848000
                                               dit'dldev ));   <<03752>>56850000
ASCII( scratchl.(8:8), 10, pbuf );                             <<03752>>56852000
PRINTLINE;                                                     <<03752>>56854000
SKIPLINES (2);                                                 <<03752>>56856000
                                                               <<03752>>56858000
                                                               <<03752>>56860000
move bbuf(12) := "TERMINAL DATA SEGMENT PRIMARY AREA :";       <<03752>>56862000
PRINTLINE;                                                     <<03752>>56864000
loctable := locdump + double( tds'pri'offset );                <<03752>>56866000
PRINT'OCTAL'DIT( loctable, 0, tds'pri'length );                <<03752>>56868000
SKIPLINES (1);                                                 <<03752>>56870000
                                                               <<03752>>56872000
move bbuf(12) := "TERMINAL DATA SEGMENT SECONDARY AREA :";     <<03752>>56874000
PRINTLINE;                                                     <<03752>>56876000
loctable := locdump + double( tds'sec'offset );                <<03752>>56878000
PRINT'OCTAL'DIT( loctable, 0, tds'sec'length );                <<03752>>56880000
SKIPLINES (1);                                                 <<03752>>56882000
                                                               <<03752>>56884000
move bbuf(12) := "DIT:";                                       <<03752>>56886000
PRINTLINE;                                                     <<03752>>56888000
loctable := locdump + double( mon'dit'offset );                <<03752>>56890000
PRINT'OCTAL'DIT( loctable, 0, mon'dit'length );                <<03752>>56892000
SKIPLINES (1);                                                 <<03752>>56894000
                                                               <<03752>>56896000
move bbuf(12) := "PROTOCOL AND DATA-MANAGEMENT DIT :";         <<03752>>56898000
PRINTLINE;                                                     <<03752>>56900000
loctable := locdump + double( pd'fdit'offset );                <<03752>>56902000
PRINT'OCTAL'DIT( loctable, 0, pd'fdit'length );                <<03752>>56904000
SKIPLINES (1);                                                 <<03752>>56906000
loctable := locdump + double( pd'vdit'offset );                <<03752>>56908000
PRINT'OCTAL'DIT( loctable, 0, pd'vdit'length );                <<03752>>56910000
SKIPLINES (1);                                                 <<03752>>56912000
                                                               <<03752>>56914000
move bbuf(12) := "HARDWARE DIT :";                             <<03752>>56916000
PRINTLINE;                                                     <<03752>>56918000
loctable := locdump + double( hw'dit'offset );                 <<03752>>56920000
PRINT'OCTAL'DIT( loctable, 0, hw'dit'length );                 <<03752>>56922000
SKIPLINES (1);                                                 <<03752>>56924000
                                                               <<03752>>56926000
move bbuf(12) := "CONTROL PROGRAM :";                          <<03752>>56928000
PRINTLINE;                                                     <<03752>>56930000
loctable := locdump + double( cntrl'prog'offset );             <<03752>>56932000
PRINT'OCTAL'DIT( loctable, 0, cntrl'prog'length );             <<03752>>56934000
SKIPLINES (1);                                                 <<03752>>56936000
                                                               <<03752>>56938000
move bbuf(12) := "LOGICAL-TO-PHYSICAL DEVICE TABLE ENTRY :";   <<03752>>56940000
PRINTLINE;                                                     <<03752>>56942000
loctable := locdump + double( lpdt'offset );                   <<03752>>56944000
PRINT'OCTAL'DIT( loctable, 0, lpdt'length );                   <<03752>>56946000
SKIPLINES (1);                                                 <<03752>>56948000
                                                               <<03752>>56950000
move bbuf(12) := "DRIVER LINKAGE TABLE :";                     <<03752>>56952000
PRINTLINE;                                                     <<03752>>56954000
loctable := locdump + double( dlt'offset );                    <<03752>>56956000
PRINT'OCTAL'DIT( loctable, 0, dlt'length );                    <<03752>>56958000
SKIPLINES (1);                                                 <<03752>>56960000
                                                               <<03752>>56962000
move bbuf(12) := "LOGICAL DEVICE TABLE ENTRY :";               <<03752>>56964000
PRINTLINE;                                                     <<03752>>56966000
loctable := locdump + double( ldt'offset );                    <<03752>>56968000
PRINT'OCTAL'DIT( loctable, 0, ldt'length );                    <<03752>>56970000
SKIPLINES (1);                                                 <<03752>>56972000
                                                               <<03752>>56974000
move bbuf(12) := "DEVICE REFERENCE TABLE ENTRY :";             <<03752>>56976000
PRINTLINE;                                                     <<03752>>56978000
loctable := locdump + double( drt'offset );                    <<03752>>56980000
PRINT'OCTAL'DIT( loctable, 0, drt'length );                    <<03752>>56982000
SKIPLINES (1);                                                 <<03752>>56984000
                                                               <<03752>>56986000
                                                               <<03752>>56988000
move bbuf(12) := "PROCESS CONTROL BLOCK ENTRY :";              <<03752>>56990000
PRINTLINE;                                                     <<03752>>56992000
loctable := locdump + double( pcb'offset );                    <<03752>>56994000
PRINT'OCTAL'DIT( loctable, 0, pcb'length );                    <<03752>>56996000
SKIPLINES (1);                                                 <<03752>>56998000
                                                               <<03752>>57000000
move bbuf(12) := "LDT PROCESS CONTROL BLOCK :";                <<03752>>57002000
PRINTLINE;                                                     <<03752>>57004000
loctable := locdump + double( ldtpcb'offset );                 <<03752>>57006000
PRINT'OCTAL'DIT( loctable, 0, ldtpcb'length );                 <<03752>>57008000
SKIPLINES (1);                                                 <<03752>>57010000
                                                               <<03752>>57012000
move bbuf(12) := "PORT-CONTROLLER MEMORY :";                   <<03752>>57014000
PRINTLINE;                                                     <<03752>>57016000
loctable := locdump + double( pcc'memory'offset );             <<03752>>57018000
PRINT'OCTAL'DIT( loctable, 0, pcc'memory'length );             <<03752>>57020000
SKIPLINES (1);                                                 <<03752>>57022000
                                                               <<03752>>57024000
move bbuf(12) := "ATP REGISTERS :";                            <<03752>>57026000
PRINTLINE;                                                     <<03752>>57028000
loctable := locdump + double( atp'regs'offset );               <<03752>>57030000
PRINT'OCTAL'DIT( loctable, 0, atp'regs'length );               <<03752>>57032000
SKIPLINES (1);                                                 <<03752>>57034000
                                                               <<03752>>57036000
move bbuf(12) := "STACK DUMP :";                               <<03752>>57038000
PRINTLINE;                                                     <<03752>>57040000
loctable := locdump + double( stack'offset );                  <<03752>>57042000
PRINT'OCTAL'DIT( loctable, 0, stack'length );                  <<03752>>57044000
SKIPLINES (1);                                                 <<03752>>57046000
                                                               <<03752>>57048000
move bbuf(12) := "INTERRUPT LINKAGE TABLE AND EXTENSION :";    <<03752>>57050000
PRINTLINE;                                                     <<03752>>57052000
loctable := locdump + double( ilt'offset );                    <<03752>>57054000
PRINT'OCTAL'DIT( loctable, 0, ilt'size + iltx'size );          <<03752>>57056000
SKIPLINES (1);                                                 <<03752>>57058000
loctable := locdump + double( ilt'offset + ilt'size );         <<03752>>57060000
PRINT'OCTAL'DIT( loctable, 0, iltx'size );                     <<03752>>57062000
SKIPLINES (1);                                                 <<03752>>57064000
                                                               <<03752>>57066000
scratchi := integer( CORE( locdump +                           <<03752>>57068000
                    double( info'offset + num'of'ioqs'word )));<<03752>>57070000
                                                               <<03752>>57072000
if scratchi > 0 then     << IOQs were dumped >>                <<03752>>57074000
begin                                                          <<03752>>57076000
  move bbuf(12) := "IOQS DUMPED :";                            <<03752>>57078000
  PRINTLINE;                                                   <<03752>>57080000
  SKIPLINES (1);                                               <<03752>>57082000
                                                               <<03752>>57084000
  indx1 := 0;   <<zero loop counter>>                          <<03752>>57086000
  while indx1 < scratchi do     << print all IOQs >>           <<03752>>57088000
  begin                                                        <<03752>>57090000
                                                               <<03752>>57092000
    move bbuf (12) := "IOQ #";                                 <<03752>>57094000
    @pbuf := @bbuf + 18;                                       <<03752>>57096000
    ASCII( indx1, 10, pbuf );                                  <<03752>>57098000
    PRINTLINE;                                                 <<03752>>57100000
    loctable := locdump +                                      <<03752>>57102000
                    double( indx1 * ioq'size + ioq'offset );   <<03752>>57104000
    PRINT'OCTAL'DIT( loctable, 0, ioq'size );                  <<03752>>57106000
    SKIPLINES (1);                                             <<03752>>57108000
    indx1 := indx1 + 1;                                        <<03752>>57110000
                                                               <<03752>>57112000
  end; << print all IOQs >>                                    <<03752>>57114000
                                                               <<03752>>57116000
end; << IOQs were dumped >>                                    <<03752>>57118000
                                                               <<03752>>57120000
                                                               <<03752>>57122000
<< Get # of TBUFs or SBUFs dumped from information word >>     <<03752>>57124000
                                                               <<03752>>57126000
scratchl := CORE( locdump +                                    <<03752>>57128000
              double( info'offset + num'of'bufs'word ));       <<03752>>57130000
scratchi := integer( scratchl.(2:14));                         <<03752>>57132000
                                                               <<03752>>57134000
if scratchi > 0 then   << buffers were dumped >>               <<03752>>57136000
begin                                                          <<03752>>57138000
                                                               <<03752>>57140000
  if integer( scratchl.(0:2)) = tbuf then                      <<03752>>57142000
    move bbuf(12) := "TERMINAL BUFFERS DUMPED :"               <<03752>>57144000
      else  <<SBUF or bad>>                                    <<03752>>57146000
      begin                                                    <<03752>>57148000
                                                               <<03752>>57150000
      if integer( scratchl.(0:2)) = sbuf then                  <<03752>>57152000
        move bbuf(12) :="SYSTEM BUFFERS DUMPED :"              <<03752>>57154000
                                                               <<03752>>57156000
          else  <<invalid code>>                               <<03752>>57158000
          begin                                                <<03752>>57160000
            move bbuf(12) :=                                   <<03752>>57162000
              "*** INVALID BUFFER-TYPE CODE ***";              <<03752>>57164000
              PRINTLINE;     <<output error message>>          <<03752>>57166000
              SKIPLINES (2);                                   <<03752>>57168000
              go quit'atp'dump;                                <<03752>>57170000
          end;  <<invalid code>>                               <<03752>>57172000
                                                               <<03752>>57174000
    end; <<SBUF or bad>>                                       <<03752>>57176000
                                                               <<03752>>57178000
  PRINTLINE;   <<output header>>                               <<03752>>57180000
  SKIPLINES (1);                                               <<03752>>57182000
                                                               <<03752>>57184000
                                                               <<03752>>57186000
<< Load starting address for dump >>                           <<03752>>57188000
                                                               <<03752>>57190000
  loctable := loctds + double( CORE( locdump +                 <<03752>>57192000
             double( info'offset + buf'offset'word )));        <<03752>>57194000
                                                               <<03752>>57196000
<< Load ending address for dump >>                             <<03752>>57198000
                                                               <<03752>>57200000
  scratchd := loctable + double( scratchi *                    <<03752>>57202000
            ( if integer( scratchl.(0:2)) = tbuf then          <<03752>>57204000
                  tbuf'size  else  sbuf'size ) - 1 );          <<03752>>57206000
                                                               <<03752>>57208000
<< Set 'print-in-ASCII-also' flag for printing buffers >>      <<03752>>57210000
                                                               <<03752>>57212000
  charflag := true;  << set global flag >>                     <<03752>>57214000
                                                               <<03752>>57216000
<< Since relative address is also printed when charflag >>     <<03752>>57218000
<< is true, need to set this value so values are TDS- rel. >>  <<03752>>57220000
                                                               <<03752>>57222000
  dbadr := loctds;    << Set global db-rel. index >>           <<03752>>57224000
                                                               <<03752>>57226000
  OCTALDUMP( loctable, scratchd );                             <<03752>>57228000
                                                               <<03752>>57230000
  end;   << TBUFs or SBUFs were dumped >>                      <<03752>>57232000
                                                               <<03752>>57234000
NEWPAGE;                                                       <<03752>>57236000
                                                               <<03752>>57238000
quit'atp'dump:   << exit or error >>                           <<03752>>57240000
                                                               <<03752>>57242000
end; <<subroutine print'atp'dump>>                             <<03752>>57244000
                                                               <<03752>>57246000
                     <<******* MAIN *******>>                  <<03752>>57248000
                                                               <<03752>>57250000
                                                               <<03752>>57252000
NEWPAGE;                                                       <<03752>>57254000
ditfpg := pageno;  <<store global page# for index >>           <<03752>>57256000
                                                               <<03752>>57258000
                                                               <<03752>>57260000
move dbuffer(23) :=                                            <<03752>>57262000
  "******    DEVICE INFORMATION TABLES    ******";             <<03752>>57264000
PRINTLINE;                                                     <<03752>>57266000
SKIPLINES (3);                                                 <<03752>>57268000
                                                               <<03752>>57270000
                                                               <<03752>>57272000
TEST'DRT'INFO(lowdrt,highdrt,valid'drts,0);                    <<03752>>57274000
                                                               <<03752>>57276000
if not valid'drts                                              <<03752>>57278000
then go bailout;                                               <<03752>>57280000
                                                               <<03752>>57282000
for drtno := lowdrt until highdrt <<step 1>> do                <<03752>>57284000
 begin                                                         <<03752>>57286000
   icf := ( series'33'thru'55 );                               <<03752>>57288000
   if integer (GETDRT(drtno,0)) = -1  <<get DRT word 0 >>      <<03752>>57290000
   then go bump;                                               <<03752>>57292000
                                                               <<03752>>57294000
                                                               <<03752>>57296000
                                                               <<03752>>57298000
                                                               <<03752>>57300000
  << DBI and PI words are reversed for SIII, HPIB systems,>>   <<03752>>57302000
  << so get correct offsets here. >>                           <<03752>>57304000
                                                               <<03752>>57306000
   dbi'offset := ( if series'33'thru'55 then                   <<03752>>57308000
                    drt'dbi'hpib  else  drt'dbi'nonhpib );     <<03752>>57310000
   pi'offset  := ( if series'33'thru'55 then                   <<03752>>57312000
                    drt'pi'hpib  else  drt'pi'nonhpib );       <<03752>>57314000
                                                               <<03752>>57316000
                                                               <<03752>>57318000
                                                               <<03752>>57320000
  << Load address of word 0 of ILT for this DRT >>             <<03752>>57322000
  << from DBI word in DRT entry                 >>             <<03752>>57324000
                                                               <<03752>>57326000
   locilt := double(GETDRT(drtno,dbi'offset));                 <<03752>>57328000
                                                               <<03752>>57330000
                                                               <<03752>>57332000
                                                               <<03752>>57334000
<< Check for old ILT format or Series III. Set     >>          <<03752>>57336000
<< ICF false if these conditions exist, else true. >>          <<03752>>57338000
<< New ILT format is determined by a global define.>>          <<03752>>57340000
                                                               <<03752>>57342000
icf := if (series'33'thru'55) or new'ilt'format                <<03752>>57344000
          then true else false;                                <<03752>>57346000
                                                               <<03752>>57348000
                                                               <<03752>>57350000
                                                               <<03752>>57352000
<< Load channel/device (DRT number) from correct kind >>       <<03752>>57354000
<< of ILT table. >>                                            <<03752>>57356000
<< Compare loop's actve DRT# with DRT# stored in the ILT.  >>  <<03752>>57358000
<< If not the same, assume bad data and skip this DRT. >>      <<03752>>57360000
                                                               <<03752>>57362000
scratchl := CORE(locilt + double(( if icf then                 <<03752>>57364000
             ilt'icntrl'new  else  ilt'icntrl'old )));         <<03752>>57366000
                                                               <<03752>>57368000
                                                               <<03752>>57370000
if integer(scratchl).(7:9) <> drtno then go bump;              <<03752>>57372000
                                                               <<03752>>57374000
                                                               <<03752>>57376000
                                                               <<03752>>57378000
<< Load double DIT pointer for unit 0 from ILT >>              <<03752>>57380000
                                                               <<03752>>57382000
tos := 0;                                                      <<03752>>57384000
tos := CORE(  locilt + double(( if icf then                    <<03752>>57386000
               ilt'iditp0'new  else  ilt'iditp0'old )))        <<03752>>57388000
         + %1000;    << later calc's use sysdb addresses  >>   <<03752>>57390000
locdit := tos;                                                 <<03752>>57392000
                                                               <<03752>>57394000
                                                               <<03752>>57396000
                                                               <<03752>>57398000
<< Load ISIOP word from ILT. will be used to find the >>       <<03752>>57400000
<< number of units and for the ATP check.             >>       <<03752>>57402000
<< Note that ISIOP is a sysdb-rel. address.           >>       <<03752>>57404000
                                                               <<03752>>57406000
tos := 0;                                                      <<03752>>57408000
tos := CORE( locilt + double(( if icf then                     <<03752>>57410000
              ilt'isiop'new  else  ilt'isiop'old )));          <<03752>>57412000
nunits := tos;       << save for #units calculation.     >>    <<03752>>57414000
                                                               <<03752>>57416000
lociltx := nunits + %1000D; << save abs addr of ILTX wd 0>>    <<03752>>57418000
                                                               <<03752>>57420000
                                                               <<03752>>57422000
                                                               <<03752>>57424000
<< Calculate number of units in this ILT                 >>    <<03752>>57426000
<< by subtracting address of ILTX from 1st DITP          >>    <<03752>>57428000
                                                               <<03752>>57430000
   if icf then << new ILT format >>                            <<03752>>57432000
   begin                                                       <<03752>>57434000
   nunits := nunits - (locilt + double( ilt'iditp0'new )       <<03752>>57436000
              - %1000D);   << since nunits was sysdb-rel.  >>  <<03752>>57438000
                                                               <<03752>>57440000
<< Subtract length of ISTAP area if exists >>                  <<03752>>57442000
   if CORE( locilt + double( ilt'istap'new )) <> 0             <<03752>>57444000
     then nunits := nunits                                     <<03752>>57446000
    - double(CORE( locilt + double( ilt'isiop'new )))          <<03752>>57448000
    + double(CORE( locilt + double( ilt'istap'new )));         <<03752>>57450000
   end                                                         <<03752>>57452000
                                                               <<03752>>57454000
   else  << old ILT format >>                                  <<03752>>57456000
     nunits := nunits - ( locilt + double( ilt'iditp0'old )    <<03752>>57458000
                      -%1000D); << DIT ptrs are sysdb-rel. >>  <<03752>>57460000
                                                               <<03752>>57462000
                                                               <<03752>>57464000
                                                               <<03752>>57466000
<< ATP-software devices all duplicate the PI word in the >>    <<03752>>57468000
<< DRT entry in word 5 of the ILTX. Check for this here  >>    <<03752>>57470000
<< and set flag if ATP. >>                                     <<03752>>57472000
                                                               <<03752>>57474000
scratchl := CORE( lociltx + double( iltx'pi ));                <<03752>>57476000
                                                               <<03752>>57478000
atp := (if GETDRT(drtno, pi'offset) = scratchl                 <<03752>>57480000
        then true else false);                                 <<03752>>57482000
                                                               <<03752>>57484000
                                                               <<03752>>57486000
                                                               <<03752>>57488000
<< Scan through unit DITP's for first configured unit# >>      <<03752>>57490000
                                                               <<03752>>57492000
ix := 1;                                                       <<03752>>57494000
ditnotfound := true;                                           <<03752>>57496000
                                                               <<03752>>57498000
while ix <= integer(nunits)     << exit if no units cnfg'd >>  <<03752>>57500000
            and ditnotfound do  << exit if find cnfg'd unit>>  <<03752>>57502000
                                                               <<03752>>57504000
   if (locdit - %1000D) > %377D    << true if locdit less  >>  <<03752>>57506000
     then ditnotfound := false     << than or = to %1000D  >>  <<03752>>57508000
                                                               <<03752>>57510000
   else                                                        <<03752>>57512000
   begin                                                       <<03752>>57514000
   << Load next double DITP in case it is active >>            <<03752>>57516000
     tos := 0;                                                 <<03752>>57518000
     tos := CORE( locilt + double(( if icf then                <<03752>>57520000
               ilt'iditp0'new  else  ilt'iditp0'old )          <<03752>>57522000
                    + ix )) << offset into unit list in ILT>>  <<03752>>57524000
                   + %1000; << since sysdb-relative        >>  <<03752>>57526000
     locdit := tos;                                            <<03752>>57528000
     ix := ix + 1;   << next unit's dit pointer >>             <<03752>>57530000
  end;                                                         <<03752>>57532000
                                                               <<03752>>57534000
                                                               <<03752>>57536000
                                                               <<03752>>57538000
<< At this point we hopefully have the DITP to a configured>>  <<03752>>57540000
<< unit. Now we wish to find out the device type to see if >>  <<03752>>57542000
<< controller information should be printed along with the >>  <<03752>>57544000
<< DRT-number header. Device Type comes from the DLT...    >>  <<03752>>57546000
                                                               <<03752>>57548000
tos := 0;                                                      <<03752>>57550000
tos := CORE( locdit + double( dit'ddltp ))                     <<03752>>57552000
                 +%1000;  << since dlt addr is sysdb-rel.  >>  <<03752>>57554000
locdlt := tos;                                                 <<03752>>57556000
scratchl := CORE( locdlt + double( dlt'dtype ));               <<03752>>57558000
devtype :=                                                     <<03752>>57560000
  integer (scratchl.(8:8));  << get device type from dlt   >>  <<03752>>57562000
                                                               <<03752>>57564000
                                                               <<03752>>57566000
                                                               <<03752>>57568000
<< Device types 17 through 19 have only one unit   >> <<*?*>>  <<03752>>57570000
<< configured.  The above algorithm, in these      >>          <<03752>>57572000
<< cases, would return garbage to 'nunits'.        >>          <<03752>>57574000
                                                               <<03752>>57576000
if 17 <= devtype <= 19 then nunits := 1D;                      <<03752>>57578000
                                                               <<03752>>57580000
                                                               <<03752>>57582000
                                                               <<03752>>57584000
<< If nunits calculated out to more than maximum number >>     <<03752>>57586000
<< expected, then assume bad data and skip this DRT. >>        <<03752>>57588000
                                                               <<03752>>57590000
if nunits > double( if atp then maxunits'atp                   <<03752>>57592000
                      else maxunits'nonatp )  then go bump;    <<03752>>57594000
                                                               <<03752>>57596000
                                                               <<03752>>57598000
                                                               <<03752>>57600000
<< Load active DRT# into output buffer >>                      <<03752>>57602000
                                                               <<03752>>57604000
BLANKBUF;                                                      <<03752>>57606000
move bbuf := "DRT NO";         << stuff header >>              <<03752>>57608000
@pbuf := @bbuf + 8;                                            <<03752>>57610000
ASCII ( drtno, 10, pbuf );     << stuff value >>               <<03752>>57612000
                                                               <<03752>>57614000
                                                               <<03752>>57616000
                                                               <<03752>>57618000
<< If ATP, also get absolute location of Terminal Data  >>     <<03752>>57620000
<< Segment (TDS) from the ILT extension (ILTX). This address>> <<03752>>57622000
<< is printed now and used later to find the PDDIT, etc. >>    <<03752>>57624000
<< Note 'Controller Status' is not printed for ATP.      >>    <<03752>>57626000
                                                               <<03752>>57628000
if atp then   << get TDS addr and load header with TDS info. >><<03752>>57630000
begin                                                          <<03752>>57632000
    tos := CORE( lociltx + double( iltx'tdsbank ));            <<03752>>57634000
    tos := CORE( lociltx + double( iltx'tdsoffset ));          <<03752>>57636000
    loctds := tos;                                             <<03752>>57638000
                                                               <<03752>>57640000
move bbuf(12) := "TDS SEG NO";                                 <<03752>>57642000
@pbuf := @bbuf + 23;                                           <<03752>>57644000
scratchl := CORE( lociltx + double( iltx'dseg ));              <<03752>>57646000
PUTNUMP (scratchl);                      << load segment # >>  <<03752>>57648000
scratchd := loctds;         << use SCRATCHD to split LOCTDS >> <<03752>>57650000
move bbuf(32) := "BANK";                                       <<03752>>57652000
@pbuf := @bbuf + 37;                                           <<03752>>57654000
PUTNUMP (scrd0);                         << load bank # >>     <<03752>>57656000
move bbuf(46) := "OFFSET";                                     <<03752>>57658000
@pbuf := @bbuf + 53;                                           <<03752>>57660000
PUTNUM (scrd1);                     << load absolute offset >> <<03752>>57662000
move bbuf(62) := "TBUFTBLP =";                                 <<03752>>57664000
@pbuf := @bbuf + 73;                                           <<03752>>57666000
scratchl := CORE( loctds + double( tds'tbuftblp'atp ));        <<03752>>57668000
PUTNUM (scratchl);         <<load TBUF table pointer>>         <<03752>>57670000
move bbuf(82) := "PORTDUMPP =";                                <<03752>>57672000
@pbuf := @bbuf + 94;                                           <<03752>>57674000
scratchl := CORE( loctds + double( tds'portdumpp'atp ));       <<03752>>57676000
PUTNUM (scratchl);         <<load error-dump area pointer>>    <<03752>>57678000
end;  << if atp >>                                             <<03752>>57680000
                                                               <<03752>>57682000
                                                               <<03752>>57684000
                                                               <<03752>>57686000
<< Load DFLAGS word from DIT. If not a terminal, SSLC, or>>    <<03752>>57688000
<< HSI then also print controller status if there are    >>    <<03752>>57690000
<< multiple units on this DRT entry.                     >>    <<03752>>57692000
                                                               <<03752>>57694000
scratchl := CORE( locdit + double( dit'dflags ));              <<03752>>57696000
if scratchl.(0:1) = 0         << bit 0 = 1 for terminals >>    <<03752>>57698000
  then if (not(18<=devtype<=19))  << skip if SSLC or HSI >>    <<03752>>57700000
        and ix < integer(nunits) then                          <<03752>>57702000
  begin                                                        <<03752>>57704000
    if not icf then                                            <<03752>>57706000
    begin                                                      <<03752>>57708000
      move bbuf(40) := "CONTROLLER STATUS =";                  <<03752>>57710000
      @pbuf := @bbuf + 60;                                     <<03752>>57712000
      scratchl := CORE( locdit + double( dit'dstat ));         <<03752>>57714000
      PUTNUM (scratchl);     << load device status >>          <<03752>>57716000
    end;                                                       <<03752>>57718000
    move bbuf(70) := "CONTROLLER ERROR STATUS =";              <<03752>>57720000
    @pbuf := @bbuf + 96;                                       <<03752>>57722000
    scratchl := CORE(locdit + double( dit'dserr ));            <<03752>>57724000
    PUTNUM (scratchl);       << load error status >>           <<03752>>57726000
  end;                                                         <<03752>>57728000
                                                               <<03752>>57730000
PRINTLINE;    <<output the DRT / Controller header>>           <<03752>>57732000
SKIPLINES (1);                                                 <<03752>>57734000
                                                               <<03752>>57736000
                                                               <<03752>>57738000
                                                               <<03752>>57740000
<< Obtain the Ldev# of the System Console from fixed low >>    <<03752>>57742000
<< memory, for use later during the Unit loop.           >>    <<03752>>57744000
                                                               <<03752>>57746000
scratchd := double( sysconsole'wd );                           <<03752>>57748000
syscon := integer(CORE(scratchd));                             <<03752>>57750000
                                                               <<03752>>57752000
                <<*******************>>                        <<03752>>57754000
                                                               <<03752>>57756000
                                                               <<03752>>57758000
                                                               <<03752>>57760000
<< Print all DIT's for all configured Units in this ILT >>     <<03752>>57762000
                                                               <<03752>>57764000
for devunit := ix until integer (nunits) do                    <<03752>>57766000
begin                                                          <<03752>>57768000
                                                               <<03752>>57770000
<< Skip any absent DIT's encountered along the way >>          <<03752>>57772000
                                                               <<03752>>57774000
  if (locdit-%1000D) < 1D  then go bumpa;                      <<03752>>57776000
                                                               <<03752>>57778000
                                                               <<03752>>57780000
<<Get the Ldev# from the DLDEV word of the DIT >>              <<03752>>57782000
                                                               <<03752>>57784000
ldev := integer (CORE(locdit + double( dit'dldev )).(8:8));    <<03752>>57786000
                                                               <<03752>>57788000
<< Use the Ldev# as an index into the LPDT to >>               <<03752>>57790000
<< get the Subtype.                           >>               <<03752>>57792000
                                                               <<03752>>57794000
scratchd := double( lpdt'addr'wd );  << from fixed low mem >>  <<03752>>57796000
scratchl := CORE( scratchd);                                   <<03752>>57798000
scrd0 := 0;                                                    <<03752>>57800000
scrd1 := ( logical( ldev.(8:8) ) * 2 +                         <<03752>>57802000
                                %1001 + scratchl );            <<03752>>57804000
devsubtype := integer ( CORE(scratchd).(12:4));                <<03752>>57806000
                                                               <<03752>>57808000
<< Get the DLT address from the DDLTP word of the DIT. Then >> <<03752>>57810000
<< use the DTYPE word from the DLT to get the device Type >>   <<03752>>57812000
<< and the length of the DIT (for the octal dump).        >>   <<03752>>57814000
                                                               <<03752>>57816000
tos := 0;                                                      <<03752>>57818000
tos := CORE( locdit + double( dit'ddltp ))                     <<03752>>57820000
                 +%1000;  << since dlt addr is sysdb-rel.  >>  <<03752>>57822000
locdlt := tos;                                                 <<03752>>57824000
scratchl := CORE(locdlt + double( dlt'dtype ));                <<03752>>57826000
devtype :=                                                     <<03752>>57828000
  integer (scratchl.(8:8));  << get device type from dlt   >>  <<03752>>57830000
ditsize := integer(scratchl.(0:8));                            <<03752>>57832000
                                                               <<03752>>57834000
                                                               <<03752>>57836000
                                                               <<03752>>57838000
<< Decode each unit's device Type into a readable name. >>     <<03752>>57840000
                                                               <<03752>>57842000
if devtype = 0 then                                            <<03752>>57844000
begin                                                          <<03752>>57846000
  if 0 <= devsubtype <= 2 then                                 <<03752>>57848000
    move bbuf(12) := "(CARTRIDGE DISC DRIVE)"                  <<03752>>57850000
  else                                                         <<03752>>57852000
  if devsubtype = 3 then                                       <<03752>>57854000
    move bbuf(12) := "(DISC FILE)"                             <<03752>>57856000
  else                                                         <<03752>>57858000
  if 4 <= devsubtype <= 12 then                                <<03752>>57860000
    move bbuf(12) := "(DISC DRIVE)"                            <<03752>>57862000
  else   <<unknown subtype>>                                   <<03752>>57864000
    move bbuf(12) := "(NON-STANDARD DISC)";                    <<03752>>57866000
end;   <<if devtype=0>>                                        <<03752>>57868000
                                                               <<03752>>57870000
if devtype = 1                                                 <<03752>>57872000
   then move bbuf(12) :=                                       <<03752>>57874000
           "(FIXED-HEAD DISC)";                                <<03752>>57876000
if devtype = 2                                                 <<03752>>57878000
   then move bbuf(12) :=                                       <<03752>>57880000
           "(FLEXIBLE DISC DRIVE)";                            <<03752>>57882000
if devtype = 8                                                 <<03752>>57884000
   then move bbuf(12) :=                                       <<03752>>57886000
           "(CARD READER)";                                    <<03752>>57888000
if devtype = 9                                                 <<03752>>57890000
   then move bbuf(12) :=                                       <<03752>>57892000
           "(PAPER-TAPE READER)";                              <<03752>>57894000
if devtype = 16                                                <<03752>>57896000
   then move bbuf(12) :=                                       <<03752>>57898000
           "(TERMINAL)";                                       <<03752>>57900000
if devtype = 17                                                <<03752>>57902000
   then move bbuf(12) :=                                       <<03752>>57904000
           "(INTELLIGENT NETWK PROCESSOR)";                    <<03752>>57906000
if devtype = 18                                                <<03752>>57908000
   then move bbuf(12) :=                                       <<03752>>57910000
           "(SYNC. SINGLE-LINE CNTRL)";                        <<03752>>57912000
if devtype = 19                                                <<03752>>57914000
   then move bbuf(12) :=                                       <<03752>>57916000
           "(HARDWIRED SERIAL INTERFACE)";                     <<03752>>57918000
if devtype = 20                                                <<03752>>57920000
   then move bbuf(12) :=                                       <<03752>>57922000
           "(PRINTING READER/PUNCH)";                          <<03752>>57924000
if devtype = 23                                                <<03752>>57926000
   then move bbuf(12) :=                                       <<03752>>57928000
           "(PROGRAMMABLE CONTROLLER)";                        <<03752>>57930000
if devtype = 24                                                <<03752>>57932000
   then move bbuf(12) :=                                       <<03752>>57934000
           "(MAGNETIC TAPE UNIT)";                             <<03752>>57936000
if devtype = 32                                                <<03752>>57938000
   then move bbuf(12) :=                                       <<03752>>57940000
           "(LINE PRINTER)";                                   <<03752>>57942000
if devtype = 33                                                <<03752>>57944000
   then move bbuf(12) :=                                       <<03752>>57946000
           "(CARD PUNCH)";                                     <<03752>>57948000
if devtype = 34                                                <<03752>>57950000
   then move bbuf(12) :=                                       <<03752>>57952000
           "(PAPER TAPE PUNCH)";                               <<03752>>57954000
if 35 <= devtype <= 37                                         <<03752>>57956000
   then move bbuf(12) :=                                       <<03752>>57958000
           "(PLOTTER)";                                        <<03752>>57960000
                                                               <<03752>>57962000
                                                               <<03752>>57964000
if bbuf(12) = "  "       <<unknown Type>>                      <<03752>>57966000
    then move bbuf(12) :=                                      <<03752>>57968000
                   "(NON-STANDARD DEVICE)";                    <<03752>>57970000
                                                               <<03752>>57972000
                                                               <<03752>>57974000
<< Whether the device type has been recognized or not, we   >> <<03752>>57976000
<< print device as 'System Disc' if Ldev is 1, or as 'System>> <<03752>>57978000
<< Console' if the Ldev is the same as that in low memory.  >> <<03752>>57980000
                                                               <<03752>>57982000
if ldev = 1                                                    <<03752>>57984000
   then move bbuf(12) :=                                       <<03752>>57986000
           "(SYSTEM DISC)               ";                     <<03752>>57988000
if ldev = syscon                                               <<03752>>57990000
   then move bbuf(12) :=                                       <<03752>>57992000
           "(SYSTEM CONSOLE/TERMINAL)   ";                     <<03752>>57994000
                                                               <<03752>>57996000
                                                               <<03752>>57998000
                                                               <<03752>>58000000
<< Now add the Type and Subtype to the unit header. >>         <<03752>>58002000
                                                               <<03752>>58004000
move bbuf(45) := "TYPE";                                       <<03752>>58006000
@pbuf := @bbuf + 50;                                           <<03752>>58008000
ASCII ( devtype, 10, pbuf );                                   <<03752>>58010000
                                                               <<03752>>58012000
move bbuf(57) := "SUBTYPE";                                    <<03752>>58014000
@pbuf := @bbuf + 65;                                           <<03752>>58016000
ASCII ( devsubtype, 10, pbuf );                                <<03752>>58018000
                                                               <<03752>>58020000
PRINTLINE;    <<output the device-type header>>                <<03752>>58022000
SKIPLINES (1);                                                 <<03752>>58024000
                                                               <<03752>>58026000
                                                               <<03752>>58028000
                                                               <<03752>>58030000
<< Get unit# from the DLDEV word of the DIT. >>                <<03752>>58032000
                                                               <<03752>>58034000
  move bbuf (12) := "UNIT";                                    <<03752>>58036000
  scratchl :=                                                  <<03752>>58038000
    CORE( locdit + double( dit'dldev ));                       <<03752>>58040000
  if atp then                                                  <<03752>>58042000
    scratchi := integer(scratchl.(0:8))                        <<03752>>58044000
      else scratchi := integer(scratchl.(3:5));                <<03752>>58046000
  @pbuf := @bbuf + 17;                                         <<03752>>58048000
  ASCII ( scratchi, 10, pbuf );                                <<03752>>58050000
                                                               <<03752>>58052000
<< Output the Ldev# obtained earlier from the DIT. >>          <<03752>>58054000
  move bbuf (20) := "LOGICAL DEV";                             <<03752>>58056000
  @pbuf := @bbuf + 32;                                         <<03752>>58058000
  ASCII ( ldev, 10, pbuf );                                    <<03752>>58060000
                                                               <<03752>>58062000
<< Output the DFLAGS word from the DIT in octal. >>            <<03752>>58064000
  move bbuf (37) := "FLAGS =";                                 <<03752>>58066000
  scratchl := CORE( locdit + double( dit'dflags ));            <<03752>>58068000
  @pbuf := @bbuf + 45;                                         <<03752>>58070000
  PUTNUM (scratchl);                                           <<03752>>58072000
                                                               <<03752>>58074000
<< Output the next DITP in octal, unless HSI or >> <<*?*>>     <<03752>>58076000
<< SSLC, which have only one unit. >>                          <<03752>>58078000
  if not (17 <= devtype <= 19) then                            <<03752>>58080000
  begin                                                        <<03752>>58082000
    move bbuf (55) := "NEXT DIT =";                            <<03752>>58084000
    scratchl := CORE( locdit + double( dit'dlink ));           <<03752>>58086000
    @pbuf := @bbuf + 66;                                       <<03752>>58088000
    PUTNUM (scratchl);                                         <<03752>>58090000
  end;                                                         <<03752>>58092000
                                                               <<03752>>58094000
<< Output pointer to DLT from DIT in octal. >>                 <<03752>>58096000
  move bbuf (74) := "DLTP =";                                  <<03752>>58098000
  scratchl := CORE( locdit + double( dit'ddltp ));             <<03752>>58100000
  @pbuf := @bbuf + 81;                                         <<03752>>58102000
  PUTNUM (scratchl);                                           <<03752>>58104000
                                                               <<03752>>58106000
<< Output ILT entry pointer from DIT in octal. >>              <<03752>>58108000
  move bbuf (89) := "ILTP =";                                  <<03752>>58110000
  scratchl := CORE( locdit + double( dit'diltp ));             <<03752>>58112000
  @pbuf := @bbuf + 96;                                         <<03752>>58114000
  PUTNUM (scratchl);                                           <<03752>>58116000
                                                               <<03752>>58118000
<< Output IOQ head pointer from DIT in octal. >>               <<03752>>58120000
  move bbuf (104) := "IOQP =";                                 <<03752>>58122000
  scratchl := CORE( locdit + double( dit'dioqp ));             <<03752>>58124000
  @pbuf := @bbuf + 111;                                        <<03752>>58126000
  PUTNUM (scratchl);                                           <<03752>>58128000
                                                               <<03752>>58130000
  PRINTLINE;  << Output the line of standard pointers >>       <<03752>>58132000
  SKIPLINES (1);                                               <<03752>>58134000
                                                               <<03752>>58136000
                                                               <<03752>>58138000
                                                               <<03752>>58140000
<< Load additional pointers for ATP >>                         <<03752>>58142000
  if atp then                                                  <<03752>>58144000
  begin                                                        <<03752>>58146000
                                                               <<03752>>58148000
<< Output PDDITP for ATP protocol and data-manager table >>    <<03752>>58150000
<< (PDDIT) from TDS-relative pointer in DIT. >>                <<03752>>58152000
    move bbuf (12) := "PDDITP =";                              <<03752>>58154000
    scratchl := CORE( locdit + double( dit'pdditp'atp ));      <<03752>>58156000
    locpddit :=                                                <<03752>>58158000
      loctds + double(scratchl);     <<save PDDIT abs loc>>    <<03752>>58160000
    @pbuf := @bbuf + 21;                                       <<03752>>58162000
    PUTNUM (scratchl);                                         <<03752>>58164000
                                                               <<03752>>58166000
                                                               <<03752>>58168000
<< Load HWDITP for ATP hardware table (HWDIT) from >>          <<03752>>58170000
<< TDS-relative pointer in PDDIT table. >>                     <<03752>>58172000
    move bbuf (29) := "HWDITP =";                              <<03752>>58174000
    scratchl := CORE( locpddit + double( pdfdit'hwditp'atp )); <<03752>>58176000
    lochwdit :=                                                <<03752>>58178000
      loctds + double(scratchl);     <<save HWDIT abs loc>>    <<03752>>58180000
    @pbuf := @bbuf + 38;                                       <<03752>>58182000
    putnum (scratchl);                                         <<03752>>58184000
                                                               <<03752>>58186000
<< Load ATP port-protocol table pointer from PDDIT >>          <<03752>>58188000
    move bbuf (46) := "PPP =";                                 <<03752>>58190000
    scratchl := CORE( locpddit + double( pdfdit'ppditp'atp )); <<03752>>58192000
    locppdit :=                                                <<03752>>58194000
      loctds + double(scratchl);     <<save PPDIT abs loc>>    <<03752>>58196000
    @pbuf := @bbuf + 52;                                       <<03752>>58198000
    PUTNUM (scratchl);  << load PPP in octal >>                <<03752>>58200000
                                                               <<03752>>58202000
<< Output control-program pointer from HWDIT in octal. >>      <<03752>>58204000
    move bbuf (60) := "CPP =";                                 <<03752>>58206000
    scratchl := CORE( lochwdit + double( hwdit'ctlpgmp'atp )); <<03752>>58208000
    locctlpgm :=                                               <<03752>>58210000
      loctds + double(scratchl);     << CTLPGM abs loc >>      <<03752>>58212000
    @pbuf := @bbuf + 66;                                       <<03752>>58214000
    PUTNUM (scratchl);                                         <<03752>>58216000
                                                               <<03752>>58218000
<< Output TBUF head pointer from PDDIT in octal. >>            <<03752>>58220000
    move bbuf (74) := "TBUFHEADP =";                           <<03752>>58222000
    scratchl :=                                                <<03752>>58224000
             CORE( locpddit + double( pdfdit'length'atp        <<03752>>58226000
                           + pdvdit'theadp'atp ));             <<03752>>58228000
    @pbuf := @bbuf + 86;                                       <<03752>>58230000
    PUTNUM (scratchl);                                         <<03752>>58232000
                                                               <<03752>>58234000
<< Output TBUF tail pointer from PDDIT in octal. >>            <<03752>>58236000
    move bbuf (94) := "TBUFTAILP =";                           <<03752>>58238000
    scratchl :=                                                <<03752>>58240000
             CORE( locpddit + double( pdfdit'length'atp        <<03752>>58242000
                           + pdvdit'ttailp'atp ));             <<03752>>58244000
    @pbuf := @bbuf + 106;                                      <<03752>>58246000
    PUTNUM (scratchl);                                         <<03752>>58248000
                                                               <<03752>>58250000
    PRINTLINE;   << Output the line of additional pointers >>  <<03752>>58252000
    SKIPLINES (1);                                             <<03752>>58254000
  end;                                                         <<03752>>58256000
                                                               <<03752>>58258000
                                                               <<03752>>58260000
                                                               <<03752>>58262000
                                                               <<03752>>58264000
<< Now do octal dump of DIT's >>                               <<03752>>58266000
                                                               <<03752>>58268000
move bbuf(12) := "DIT :";                                      <<03752>>58270000
PRINTLINE;                                                     <<03752>>58272000
PRINT'OCTAL'DIT ( locdit, logical(locdit-%1000D), ditsize );   <<03752>>58274000
                                                               <<03752>>58276000
if atp then                                                    <<03752>>58278000
begin                                                          <<03752>>58280000
                                                               <<03752>>58282000
  SKIPLINES (1);                                               <<03752>>58284000
  move bbuf(12) := "PROTOCOL AND DATA-MANAGEMENT DIT :";       <<03752>>58286000
  PRINTLINE;                                                   <<03752>>58288000
                                                               <<03752>>58290000
<< Get relative address from pointer in DIT >>                 <<03752>>58292000
  scratchl := CORE( locdit + double( dit'pdditp'atp ));        <<03752>>58294000
                                                               <<03752>>58296000
<< Output the Fixed area >>                                    <<03752>>58298000
  PRINT'OCTAL'DIT ( locpddit, scratchl, pdfdit'length'atp );   <<03752>>58300000
                                                               <<03752>>58302000
  SKIPLINES (1);                                               <<03752>>58304000
                                                               <<03752>>58306000
<< Output the Variable area >>                                 <<03752>>58308000
  PRINT'OCTAL'DIT ( locpddit + double( pdfdit'length'atp ),    <<03752>>58310000
                     scratchl + logical( pdfdit'length'atp ),  <<03752>>58312000
                       pdvdit'length'atp );                    <<03752>>58314000
  SKIPLINES (1);                                               <<03752>>58316000
                                                               <<03752>>58318000
  move bbuf(12) := "HARDWARE DIT :";                           <<03752>>58320000
  PRINTLINE;                                                   <<03752>>58322000
  PRINT'OCTAL'DIT ( lochwdit, CORE( locpddit ),                <<03752>>58324000
                                  hwdit'length'atp );          <<03752>>58326000
  SKIPLINES (1);                                               <<03752>>58328000
                                                               <<03752>>58330000
  move bbuf(12) := "PORT PROTOCOL DIT :";                      <<03752>>58332000
  PRINTLINE;                                                   <<03752>>58334000
  PRINT'OCTAL'DIT ( locppdit, CORE( locpddit                   <<03752>>58336000
                     + double( pdfdit'ppditp'atp )),           <<03752>>58338000
                      ppdit'length'atp );                      <<03752>>58340000
  SKIPLINES (1);                                               <<03752>>58342000
                                                               <<03752>>58344000
  move bbuf(12) := "CONTROL PROGRAM :";                        <<03752>>58346000
  PRINTLINE;                                                   <<03752>>58348000
  PRINT'OCTAL'DIT ( locctlpgm, CORE( lochwdit                  <<03752>>58350000
                     + double( hwdit'ctlpgmp'atp )),           <<03752>>58352000
                      ctlpgm'length'atp );                     <<03752>>58354000
  SKIPLINES (1);                                               <<03752>>58356000
                                                               <<03752>>58358000
end; <<extra ATP DIT's>>                                       <<03752>>58360000
                                                               <<03752>>58362000
move bbuf(20) := "           ";                                <<03752>>58364000
if 17 <= devtype <= 19 then                                    <<03752>>58366000
begin                                                          <<03752>>58368000
  SKIPLINES (2);                                               <<03752>>58370000
  DODSDIT (ldev, devtype );                                    <<03752>>58372000
end;                                                           <<03752>>58374000
                                                               <<03752>>58376000
                                                               <<03752>>58378000
                                                               <<03752>>58380000
  SKIPLINES (2);   << We are done with this unit >>            <<03752>>58382000
                                                               <<03752>>58384000
                                                               <<03752>>58386000
BUMPA:                                                         <<03752>>58388000
                                                               <<03752>>58390000
<< Get next DITP from ILT >>                                   <<03752>>58392000
                                                               <<03752>>58394000
  tos := 0;                                                    <<03752>>58396000
  tos := CORE(  locilt + double(( if icf then                  <<03752>>58398000
                  ilt'iditp0'new  else  ilt'iditp0'old )       <<03752>>58400000
                       + devunit)) + %1000;                    <<03752>>58402000
                                                               <<03752>>58404000
  locdit := tos;     <<assign new dit address>>                <<03752>>58406000
                                                               <<03752>>58408000
end; <<for devunit>>                                           <<03752>>58410000
                                                               <<03752>>58412000
                                                               <<03752>>58414000
<< Also print the dump area for this DRT if it is an ATP. >>   <<03752>>58416000
<< The dump area is only formatted if it has been used. >>     <<03752>>58418000
                                                               <<03752>>58420000
if atp then PRINT'ATP'DUMP;                                    <<03752>>58422000
                                                               <<03752>>58424000
BUMP:  << Go get next DRT entry in DRT table >>                <<03752>>58426000
                                                               <<03752>>58428000
end;  << while DRT >>                                          <<03752>>58430000
                                                               <<03752>>58432000
                                                               <<03752>>58434000
BAILOUT:  << Quit because done or fatal error >>               <<03752>>58436000
                                                               <<03752>>58438000
DO'MRJE'DITS;                                                  <<03752>>58440000
                                                               <<03752>>58442000
end;  <<procedure printdit>>                                   <<03752>>58444000
                                                                        58446000
$PAGE "PRINT'OCTAL'DIT: Format DIT"                                     58448000
$CONTROL SEGMENT = TABLES                                               58450000
COMMENT                                                                 58452000
                                                                        58454000
Purpose:                                                                58456000
                   PRINT'OCTAL'DIT                             <<03752>>58458000
   This procedure prints octal values from the 'core' in       <<03752>>58460000
   columns of eight, with the absolute bank and offset and     <<03752>>58462000
   a relative address printed at the left for indexing. The    <<03752>>58464000
   relative address is printed to the left, enclosed in        <<03752>>58466000
   parentheses, followed by the bank, offset, and data.        <<03752>>58468000
                                                               <<03752>>58470000
   DIT'START'ADDR is the absolute address of the first         <<03752>>58472000
   word in the block to be printed.                            <<03752>>58474000
                                                               <<03752>>58476000
   DIT'LENGTH specifies the number of words in the block.      <<03752>>58478000
                                                               <<03752>>58480000
   RELATIVE'INDEX is a word counter for printing purposes      <<03752>>58482000
   only. It is used for block-relative indexing (pass a        <<03752>>58484000
   value of 0) or db-relative addressing (pass the lower       <<03752>>58486000
   word of a db-relative address).                             <<03752>>58488000
                                                                        58490000
Input parameters:                                                       58492000
                                                                        58494000
Output parameters:                                                      58496000
                                                                        58498000
Globals Referenced:                                                     58500000
                                                                        58502000
Globals Altered:                                                        58504000
                                                                        58506000
Data Structures:                                                        58508000
                                                                        58510000
Algorithm:                                                              58512000
                                                                        58514000
;                                                                       58516000
                                                               <<03752>>58518000
                                                               <<03752>>58520000
                                                               <<03752>>58522000
PROCEDURE PRINT'OCTAL'DIT                                      <<03752>>58524000
              (dit'start'addr, relative'index, dit'length);    <<03752>>58526000
                                                               <<03752>>58528000
value dit'start'addr, relative'index, dit'length;              <<03752>>58530000
                                                               <<03752>>58532000
double dit'start'addr;                                         <<03752>>58534000
logical relative'index;                                        <<03752>>58536000
integer dit'length;                                            <<03752>>58538000
                                                               <<03752>>58540000
begin  <<procedure print'octal'dit>>                           <<03752>>58542000
                                                               <<03752>>58544000
                                                               <<03752>>58546000
                                                               <<03752>>58548000
logical                                                        <<03752>>58550000
        core'data,       << word read from 'core'.         >>  <<03752>>58552000
        core'addr;       << address to print.              >>  <<03752>>58554000
                                                               <<03752>>58556000
integer                                                        <<03752>>58558000
        scratchi,        << type integer scratch variable. >>  <<03752>>58560000
        indx;            << word counter.                  >>  <<03752>>58562000
                                                               <<03752>>58564000
byte array                                                     <<03752>>58566000
        tempbbuf (0:6);  << for octal conversions.         >>  <<03752>>58568000
                                                               <<03752>>58570000
double                                                         <<03752>>58572000
        abs'addr;        << type double scratch variable.  >>  <<03752>>58574000
                                                               <<03752>>58576000
logical array                                                  <<03752>>58578000
        addr0 (*) = abs'addr, << access to MSW of abs'addr.>>  <<03752>>58580000
        addr1 (*) = addr0(1); << access to LSW of abs'addr.>>  <<03752>>58582000
                                                               <<03752>>58584000
                                                               <<03752>>58586000
if dit'length = 0 then return;   <<do nothing>>                <<03752>>58588000
                                                               <<03752>>58590000
abs'addr := dit'start'addr;                                    <<03752>>58592000
core'addr := relative'index;                                   <<03752>>58594000
                                                               <<03752>>58596000
bbuf(14) := "(";   << load the index pointers >>               <<03752>>58598000
@pbuf := @bbuf + 15;  << db-relative index >>                  <<03752>>58600000
PUTNUM (core'addr);                                            <<03752>>58602000
@pbuf := @pbuf - 1;                                            <<03752>>58604000
pbuf := ")";                                                   <<03752>>58606000
@pbuf := @bbuf + 25;   << absolute bank >>                     <<03752>>58608000
scratchi := ASCII (addr0, 8, tempbbuf(0));                     <<03752>>58610000
move pbuf := tempbbuf(6-scratchi),(scratchi);                  <<03752>>58612000
@pbuf := @bbuf + 29;    << absolute offset >>                  <<03752>>58614000
PUTNUM (addr1);                                                <<03752>>58616000
@pbuf := @bbuf + 40;   << set starting column of octal dump >> <<03752>>58618000
                                                               <<03752>>58620000
for indx := 0 until (dit'length -1) do                         <<03752>>58622000
begin                                                          <<03752>>58624000
  core'data := CORE(dit'start'addr + double(indx));            <<03752>>58626000
  PUTNUM (core'data);        << load # and increment pbuf >>   <<03752>>58628000
  if @pbuf > (@bbuf + 90) then  << done loading 8 values >>    <<03752>>58630000
  begin                                                        <<03752>>58632000
    PRINTLINE;                  <<output fully-loaded line >>  <<03752>>58634000
    core'addr :=                                               <<03752>>58636000
        core'addr + 8;   <<incr sysdb-rel addr by integer 8>>  <<03752>>58638000
    abs'addr :=                                                <<03752>>58640000
        abs'addr + 8D;  <<increment abs addr by double 8>>     <<03752>>58642000
                                                               <<03752>>58644000
    if indx < dit'length-1 then                                <<03752>>58646000
       begin      << load index pointers for next line >>      <<03752>>58648000
         bbuf(14) := "(";                                      <<03752>>58650000
         @pbuf := @bbuf + 15;                                  <<03752>>58652000
         PUTNUM (core'addr);                                   <<03752>>58654000
         @pbuf := @pbuf - 1;                                   <<03752>>58656000
         pbuf := ")";                                          <<03752>>58658000
         @pbuf := @bbuf + 25;                                  <<03752>>58660000
         scratchi := ASCII (addr0, 8, tempbbuf(0));            <<03752>>58662000
         move pbuf :=                                          <<03752>>58664000
         tempbbuf(6-scratchi),(scratchi); <<no leading 0>>     <<03752>>58666000
         @pbuf := @bbuf + 29;                                  <<03752>>58668000
         PUTNUM (addr1);                                       <<03752>>58670000
         @pbuf := @bbuf + 40;                                  <<03752>>58672000
       end;  << if >>                                          <<03752>>58674000
  end;     << if end of line >>                                <<03752>>58676000
<<else not end of line, so increment indx>>                    <<03752>>58678000
end;      <<for>>                                              <<03752>>58680000
if bbuf(40) <> "  " then PRINTLINE; << print unfilled line >>  <<03752>>58682000
                                                               <<03752>>58684000
end; <<procedure print'octal'dit>>                             <<03752>>58686000
