<< LINES .001/.009 ARE RESERVED FOR SYSTEMS INTEGRATION>>               30260000
                                                                        30262000
$page "DODSDIT(LDEV, TYPECHECK): Format DS DIT"                         30264000
$control segment=tablesds                                               30266000
comment                                                                 30268000
                                                                        30270000
purpose:                                                                30272000
<< in order to process the ds dits associated with the     >>  <<01199>>30274000
<< logical device "LDEV", all devices must be examined in  >>  <<01199>>30276000
<< order to determine that that particular device is       >>  <<01199>>30278000
<< controlled by ldev.  every entry in the lpdt is scanned >>  <<01199>>30280000
<< and if a device is a ds device and it backreferences    >>  <<01199>>30282000
<< ldev, its ds dit is formatted.                          >>  <<01199>>30284000
                                                                        30286000
input parameters:                                                       30288000
                                                                        30290000
output parameters:                                                      30292000
                                                                        30294000
globals referenced:                                                     30296000
                                                                        30298000
globals altered:                                                        30300000
                                                                        30302000
data structures:                                                        30304000
                                                                        30306000
algorithm:                                                              30308000
                                                                        30310000
;                                                                       30312000
procedure dodsdit( ldev, typecheck );                          <<01199>>30314000
value ldev, typecheck;                                         <<01199>>30316000
integer ldev, typecheck;                                       <<01199>>30318000
begin                                                         <<<01.02>>30320000
                                                              <<<01.02>>30322000
double scratch,ditptr,lpdt;                       <<<01.02>>            30324000
                                                               <<01199>>30326000
logical                                                        <<01199>>30328000
   dlt,                     << table addresses.            >>  <<01199>>30330000
   dit;                     << dit address.                >>  <<01199>>30332000
                                                               <<01199>>30334000
integer                                                        <<01199>>30336000
   ldindx,                  << logical device loop index.  >>  <<01199>>30338000
   numentries,              << number of entries in lpdt.  >>  <<01199>>30340000
   subtype,                 << device subtype.             >>  <<01199>>30342000
   backref;                 << back reference ldev number. >>  <<01199>>30344000
                                                               <<01199>>30346000
logical array scr0(*)=scratch;                                 <<01.02>>30348000
logical array scr1(*)=scr0(1);                                 <<01.02>>30350000
logical work1,size,dtype,ld;                                  <<<01.02>>30352000
logical multipt := false;                                      <<01199>>30354000
integer indx;                                                 <<<01.02>>30356000
                                                              <<<01.02>>30358000
                                                              <<<01.02>>30360000
subroutine printdsdit;                                         <<01199>>30362000
                                                               <<01199>>30364000
<< prints the dit of ds device with logical device number, >>  <<01199>>30366000
<< "LD".  this subroutine assumes that most error checks   >>  <<01199>>30368000
<< were already done.                                      >>  <<01199>>30370000
                                                               <<01199>>30372000
                                                               <<01199>>30374000
                                                               <<01199>>30376000
begin                                                          <<01199>>30378000
   ditptr:=scratch;                                           <<<01.02>>30380000
   scr1:=core(ditptr+4d);<<get dlt ptr>>                      <<<01.02>>30382000
   scr1:=scr1+%1000;<<make it absolute>>                      <<<01.02>>30384000
   work1:=core(scratch+5d);<<dlt word 5/ditsize/devtype>>     <<<01.02>>30386000
   size:=work1.(0:8);                                         <<<01.02>>30388000
   dtype:=work1.(8:8);                                        <<<01.02>>30390000
   if multipt then go headone;                                 <<01199>>30392000
   if dtype=41 then                                           <<<01.02>>30394000
      move bbuf(12) := "(IODS0 CONTROLLER)";                   <<01199>>30396000
   if dtype=16 then                                            <<01.02>>30398000
      move bbuf(12) := "(IODS0 TERMINAL DEVICE)";              <<01199>>30400000
   if bbuf(12)="  " then go getout;<<not ds dev..all over>>   <<<01.02>>30402000
                                                               <<01199>>30404000
headone:                                                       <<01199>>30406000
                                                               <<01199>>30408000
   printline;                                                 <<<01.02>>30410000
   skiplines(1);                                              <<<01.02>>30412000
   if typecheck <> 17 then                                     <<01199>>30414000
   begin                                                       <<01199>>30416000
      move bbuf(12) := "UNIT";                                 <<01199>>30418000
      @pbuf := @bbuf + 17;                                     <<01199>>30420000
      work1 := core( ditptr+10d);                              <<01199>>30422000
      work1 := work1.(8:8);                                    <<01199>>30424000
      ascii( work1, 10, pbuf );                                <<01199>>30426000
   end;                                                        <<01199>>30428000
   @pbuf:=@bbuf+32;                                           <<<01.02>>30430000
                                                               <<01199>>30432000
   move bbuf(20):="LOGICAL DEV";                              <<<01.02>>30434000
   ascii(ld,10,pbuf);                                         <<<01.02>>30436000
   move bbuf(37):="FLAGS =";                                  <<<01.02>>30438000
   @pbuf:=@bbuf+45;                                           <<<01.02>>30440000
   work1:=core(ditptr);                                       <<<01.02>>30442000
   putnum(work1);<<flags>>                                    <<<01.02>>30444000
   move bbuf(55):="NEXT DIT =";                               <<<01.02>>30446000
   work1:=core(ditptr+1d);                                    <<<01.02>>30448000
   @pbuf:=@bbuf+66;                                           <<<01.02>>30450000
   putnum(work1);<<next dit>>                                 <<<01.02>>30452000
   move bbuf(74):="DLTP =";                                   <<<01.02>>30454000
   work1:=core(ditptr+4d);                                    <<<01.02>>30456000
   @pbuf:=@bbuf+81;                                           <<<01.02>>30458000
   putnum(work1);<<dltp>>                                     <<<01.02>>30460000
   move bbuf(104):="IOQP =";                                  <<<01.02>>30462000
   work1:=core(ditptr+2d);                                    <<<01.02>>30464000
   @pbuf:=@bbuf+111;                                          <<<01.02>>30466000
   putnum(work1);<<ioqp>>                                     <<<01.02>>30468000
   printline;                                                 <<<01.02>>30470000
   skiplines(1);                                              <<<01.02>>30472000
   if size=0 then return;                                     <<<01.02>>30474000
   scratch:=ditptr-%1000d;                                    <<<01.02>>30476000
                                                               <<03752>>30478000
<< now print the actual dit >>                                 <<03752>>30480000
   print'octal'dit( ditptr, scr1, integer( size ));            <<03752>>30482000
                                                               <<03752>>30484000
   skiplines(2);                                              <<<01.02>>30486000
   getout:                                                     <<01199>>30488000
                                                               <<01199>>30490000
end;  << printdsdit >>                                         <<01199>>30492000
                                                               <<01199>>30494000
<< m a i n   b o d y                                       >>  <<01199>>30496000
                                                               <<01199>>30498000
                                                               <<01199>>30500000
<< check the parameter.                                    >>  <<01199>>30502000
   if ldev = 0 then return;                                    <<01199>>30504000
                                                               <<01199>>30506000
<< determine the number of entries in the lpdt.            >>  <<01199>>30508000
   lpdt := dsttoaddr(%15);                                     <<01199>>30510000
   numentries := core(lpdt);                                   <<01199>>30512000
                                                               <<01199>>30514000
<< process every entry in the lpdt.                        >>  <<01199>>30516000
                                                               <<01199>>30518000
for ldindx := 1 until numentries do                            <<01199>>30520000
begin                                                          <<01199>>30522000
                                                               <<01199>>30524000
<< for every device in the system, get the device type,    >>  <<01199>>30526000
<< subtype, dit pointer, and backreference.                >>  <<01199>>30528000
   ld := logical( ldindx );                                    <<01199>>30530000
   scratch:=lpdt+double(ld*4);                                          30532000
    if integer(core(scratch))<0 then go nextdev;               << mcw >>30534000
   dit:=core(scratch+2d)+%1000;                                         30536000
   scratch:=double(dit);                                                30538000
                                                               <<01199>>30540000
<< get dit size and device type from dlt entry.            >>  <<01199>>30542000
   dlt := core( scratch + 4d ) + %1000;                        <<01199>>30544000
   scr0 := 0;                                                  <<01199>>30546000
   scr1 := dlt;                                                <<01199>>30548000
   work1 := core( scratch + 5d );                              <<01199>>30550000
   dtype := work1.(8:8);                                       <<01199>>30552000
   size := work1.(0:8);                                        <<01199>>30554000
                                                               <<01199>>30556000
<< check for ds type devices (device types 16 and 41).     >>  <<01199>>30558000
   if dtype <> 41 and dtype <> 16 then go nextdev;             <<01199>>30560000
   scr0 := 0;                                                  <<01199>>30562000
   scr1 := dit;                                                <<01199>>30564000
   if dtype = 16 then   << multipoint device check.        >>  <<01199>>30566000
   begin                                                       <<01199>>30568000
                                                               <<01199>>30570000
      work1 := core( scratch );   << check terminal bit    >>  <<01199>>30572000
      if work1.(0:1) = 1  then go nextdev;                     <<01199>>30574000
      work1 := core( scratch + 11d );  << back reference   >>  <<01199>>30576000
      if integer( work1) <> ldev  then go nextdev;             <<01199>>30578000
      multipt := true;       << good multipoint device     >>  <<01199>>30580000
      work1 := core( scratch +  9d );  << supervisor check >>  <<01199>>30582000
      if work1.(7:1) = 1                                       <<01199>>30584000
         then move bbuf(12) := "(MULTIPOINT SUPERVISOR)"       <<01199>>30586000
         else move bbuf(12) := "(MULTIPOINT TERMINAL)  ";      <<01199>>30588000
                                                               <<01199>>30590000
   end                                                         <<01199>>30592000
                                                               <<01199>>30594000
   else   << possible iods0 controller                     >>  <<01199>>30596000
   begin                                                       <<01199>>30598000
      backref := integer( core( scratch + 7d ) ).(0:8);        <<01199>>30600000
      if backref <> ldev        << wrong backref           >>  <<01199>>30602000
         then go nextdev;                                      <<01199>>30604000
      multipt := false;                                        <<01199>>30606000
   end;                                                        <<01199>>30608000
                                                               <<01199>>30610000
   scr0 := 0;                                                  <<01199>>30612000
   scr1 := dit;                                                <<01199>>30614000
   printdsdit;                                                 <<01199>>30616000
   scr0 := 0;                                                  <<01199>>30618000
   scr1 := dit;                                                <<01199>>30620000
   ld := core( scratch + 11d);                           <<01199>>      30622000
   while ld <> 0 do                                            <<01199>>30624000
   begin                                                       <<01199>>30626000
      scr0 := 0;                                               <<01199>>30628000
      scratch := double(ld * 4) + lpdt;                                 30630000
      dit := scr1 := core( scratch +2d) + %1000;                        30632000
      printdsdit;                                              <<01199>>30634000
      scr0 := 0;                                               <<01199>>30636000
      scr1 := dit;                                             <<01199>>30638000
      ld := core( scratch + 11d);                              <<01199>>30640000
   end;                                                        <<01199>>30642000
   nextdev:                                                    <<01199>>30644000
                                                               <<01199>>30646000
end;                                                           <<01199>>30648000
                                                               <<01199>>30650000
   bbuf:=" ";                                                 <<<01.02>>30652000
   move bbuf(1):=bbuf,(40);                                   <<<01.02>>30654000
end<<dodsdit>>;                                               <<<01.02>>30656000
