DataMuseum.dk

Presents historical artifacts from the history of:

RC4000/8000/9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC4000/8000/9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦10418516c⟧ TextFile

    Length: 102912 (0x19200)
    Types: TextFile
    Names: »hjlaplst«

Derivation

└─⟦a41ae585a⟧ Bits:30001842 SW-save af projekt 1000, Alarm-system
    └─⟦72244f0ef⟧ 
        └─⟦this⟧ »hjlaplst« 

TextFile

\f

hjlaplst    81.05.04.   08.25.                                                    page     1

   10    1           
\f

hjlaplst    81.05.04.   08.25.                                                    page     2

 1010    2        PROCESS lam(
 1020    3          opsem: sempointer;
 1030    4          pu: integer;
 1040    5          level:integer;
 1050    6          VAR mainsem: !ts_pointer
 1060    7          );
 1070    8          
 1080    9            (*********************************************************
 1090   10            *                                                        *
 1100   11            *   lam-driver                                           *
 1110   12            *   programmed by oer                                    *
 1120   13            **********************************************************)
 1130   14          
 1140   15            (*-------------------------------------------------------
 1150   16            . terms
 1160   17            .
 1170   18            . port     refers to a port on the physical lam
 1180   19            . channel  refers to a channel in the lamdriver
 1190   20            .          where there are two channels for each port
 1200   21            .          i e one for output and one for input
 1210   22            .
 1220   23            .--------------------------------------------------------*)
 1230   24          
 1240   25        CONST
 1250   26          
 1260   27          version = "vers  4.00 /";
 1270   28          
 1280   29          max_port_no=15;
 1290   30          max_channel_no= 2*max_port_no+1;
 1300   31          
 1310   32            (*---  values used when creating high level lam-driver ---*)
 1320   33          mask = 0;
 1330   34          prio  = 2;
 1340   35          store = 200;
 1350   36            (*--- number of lambuffers, one is used as channelmessage ---*)
 1360   37          no_of_lambufs = 32;
 1370   38          
 1380   39          
 1390   40          long_time = 10;
 1400   41          normal_time = 7;
 1410   42          short_time = 4;
 1420   43          no_time = 1;
 1430   44          
 1440   45          forever = false;
 1450   46          
 1460   47          
\f

hjlaplst    81.05.04.   08.25.                                                    page     3

 1470   48            (*       controlebits to lam *)
 1480   49          requesttosend = 7*32;
 1490   50          readytoread = 5*32;
 1500   51          
 1510   52            (*       statuswords from lam *)
 1520   53          write_read_ok = 40;
 1530   54          overrun=41;
 1540   55          parity=44;
 1550   56          overrun_and_parity=45;
 1560   57          readytosend = 24;
 1570   58          
 1580   59            (* alc-functions *)
 1590   60          
 1600   61          alc_write = write_it;
 1610   62          alc_read = read_it;
 1620   63          write_alc_read = write_read_it;
 1630   64          create_alc_ch = create_it_ch;
 1640   65          op_codes = (. 5, 19, 20, 21, 28, 29 .);
 1650   66           
\f

hjlaplst    81.05.04.   08.25.                                                    page     4

 2010   67            (*---  channelkinds  ---*)
 2020   68          
 2030   69          not_created = 0;
 2040   70          at_write_channel = 1;
 2050   71          at_write_wait = 2;
 2060   72          at_read_channel = 3;
 2070   73          at_read_wait = 4;
 2080   74          alc_write_channel = 5;
 2090   75          alc_read_channel = 6;
 2100   76          tty_write_channel = 7;
 2110   77          tty_read_channel = 8;
 2120   78          echo_nl_on_channel = 9;
 2130   79          tty_wait_cr = 10;
 2140   80          tty_wait_nl = 11;
 2150   81          tty_wait_input = 12;
 2160   82          
 2170   83          
 2180   84            (*---  delays used on at-channels  ---*)
 2190   85          
 2200   86          rts_delay_u3 = 10;
 2210   87          rts_delay_u4 = 5;
 2220   88          
 2230   89          rtr_delay_u3 = 13;
 2240   90          rtr_delay_u4 = 5;
 2250   91          
 2260   92          
 2270   93            (*---  byte-compatible values for special characters  ---*)
 2280   94          
 2290   95          stx = 2;
 2300   96          etx = 3;
 2310   97          bs = 8;
 2320   98          nl = 10;
 2330   99          cr = 13;
 2340  100          cs = 19;       (*  crtl + small s   *)
 2350  101          esc = 27;
 2360  102          sp = 32;
 2370  103          del = 127;
 2380  104          
 2390  105          command = 28;
 2400  106           
\f

hjlaplst    81.05.04.   08.25.                                                    page     5

 3010  107          
 3020  108            (*  result codes  *)
 3030  109            (*  specified in u2 overwriting portno *)
 3040  110            (*  other resultcodes are given in alarmenv *)
 3050  111          
 3060  112          transient_error = transi_err;
 3070  113          persistent_error = persi_err;
 3080  114          illegal_function = ill_func;
 3090  115          write_error = 2*8 +  transient_error;
 3100  116          write_read_mixed = create_done;
 3110  117          buffer_too_small = illegal_function;
 3120  118          go_on_read = 6;
 3130  119            (*-------------------
 3140  120            results modified for
 3150  121            transient errors
 3160  122            
 3170  123            2*8 +2 = write-error
 3180  124            3*8 +2 = parity or overrun
 3190  125            4*8 +2 = checksum error
 3200  126            5*8 +2 = read bbl too big
 3210  127            6*8 +2 = etx missing
 3220  128            
 3230  129            ---------------------*)
 3240  130          
 3250  131            (****************************************
 3260  132            *
 3270  133            *  params that should be used in create channel
 3280  134            *
 3290  135            *  +0  odd parity
 3300  136            *      1 stop element
 3310  137            *      5 databits/char
 3320  138            *      110 bps
 3330  139            *  +1  no parity
 3340  140            *  +2  even parity
 3350  141            *  +3  no parity
 3360  142            *  +4  2 stop elements
 3370  143            *  +8  6 databits
 3380  144            *  +16 7 databits
 3390  145            *  +24 8 databits
 3400  146            *  +32 300 bps
 3410  147            *  +64 600 bps
 3420  148            *  +96 1200 bps
 3430  149            *
 3440  150            ****************************************)
 3450  151           
\f

hjlaplst    81.05.04.   08.25.                                                    page     6

 4010  152        TYPE
 4020  153            (*      no of input+output devices on one lam-driver *)
 4030  154          channelset   = 0..max_channel_no;
 4040  155          
 4050  156          portset = 0..max_port_no;
 4060  157          
 4070  158            (*      format of a buffer send to/from a vcit *)
 4080  159          drvbuffer
 4090  160          = RECORD
 4100  161            !  first, last, next : integer;
 4110  162            END;
 4120  163          
 4130  164            (*      format of a buffer send to/from a vcat or at *)
 4140  165          atbuffer
 4150  166          = ARRAY(0..1)   OF byte;
 4160  167          
 4170  168          
 4180  169            (*      one word to write in writeword *)
 4190  170          
 4200  171          lamword
 4210  172          = PACKED RECORD
 4220  173                   !  data : byte;
 4230  174                   !  std : 0..7;
 4240  175                   !  port_and_bit15 : channelset;
 4250  176                   END;
 4260  177          
 4270  178            (*      one description for each device *)
 4280  179          
 4290  180          channelrecord
 4300  181          = RECORD
 4310  182            !  request:reference;           (*  current message     *)
 4320  183            !  channel_kind : 0..15;
 4330  184            !  old_result : byte;
 4340  185            !  interruptable : boolean;
 4350  186            !  reading_tty : boolean;
 4360  187            !  checksum: integer;
 4370  188            !  timeout,
 4380  189            !  next,
 4390  190            !  top: integer;
 4400  191            !  status : integer;
 4410  192            END;
 4420  193           
\f

hjlaplst    81.05.04.   08.25.                                                    page     7

 5010  194        VAR
 5020  195            (*        ref for channelmsg *)
 5030  196          channelmessage,ref:   reference;
 5040  197            (*        shadow for lam at high level *)
 5050  198          driver:    shadow;
 5060  199          
 5070  200          lamsem : semaphore;
 5080  201            (*---  pools  ---*)
 5090  202          
 5100  203          delaypool : pool 16;
 5110  204          timerpool: pool 1;
 5120  205            (*        buffers for handling interrupts *)
 5130  206          lampool:   pool no_of_lambufs;
 5140  207          
 5150  208            (*        devicenumber *)
 5160  209          channel_no:     integer;
 5170  210            (*        zone used by testopen and testout *)
 5180  211          z:    zone;
 5190  212            (*        all devicedescriptors in one array *)
 5200  213          
 5210  214          channel_descriptor:  ARRAY(channelset) OF channelrecord;
 5220  215          
 5230  216          queue : ARRAY(channelset) OF semaphore;
 5240  217          
 5250  218            (*        timeoutperiode and controlword for each device *)
 5260  219          time,controle_byte: ARRAY(portset)OF byte;
 5270  220          
 5280  221          i,j,k : integer;
 5290  222          test_b : boolean;
 5300  223          tst : integer := 0;
 5310  224           
\f

hjlaplst    81.05.04.   08.25.                                                    page     8

 6010  225            (***************   externals   ***********************************)
 6020  226          
 6030  227          FUNCTION  copychm(VAR x,y: reference): integer; EXTERNAL;
 6040  228            (* makes a copy of a channelmessage *)
 6050  229          
 6060  230          PROCEDURE testopen(VAR x:zone; y:alfa; z:^semaphore); EXTERNAL;
 6070  231            (* opens testmode *)
 6080  232          
 6090  233          PROCEDURE testout(VAR x:zone; y:alfa; z:integer); EXTERNAL;
 6100  234            (* writes text for test *)
 6110  235          
 6120  236          PROCEDURE control( x: integer; VAR y: reference); EXTERNAL;
 6130  237            (* writes one controlword *)
 6140  238          
 6150  239          PROCEDURE outword( x: lamword; VAR y: reference); EXTERNAL;
 6160  240            (* writes one word *)
 6170  241          
 6180  242          
 6190  243          PROCEDURE sense(VAR x:integer; y:integer; VAR z:reference); EXTERNAL;
 6200  244          
 6210  245          
 6220  246            (***************   procedures  ***********************************)
 6230  247          
 6240  248          PROCEDURE stop_actual_request
 6250  249            ( result: byte;  channel_no: channelset );
 6260  250          FORWARD;
 6270  251          
 6280  252          
 6290  253           
\f

hjlaplst    81.05.04.   08.25.                                                    page     9

 7010  254          PROCEDURE start_rts_delay(channel_no : integer);
 7020  255              (*********************************************
 7030  256              *   rts-delay                                *
 7040  257              **********************************************)
 7050  258            
 7060  259          VAR ref:reference;
 7070  260          BEGIN
 7080  261    1     ! alloc(ref, delaypool, mainsem.s^);
 7090  262    2     ! ref^.u3 := rts_delay_u3;
 7100  263    3     ! ref^.u4 := rts_delay_u4;
 7110  264    4     ! ref^.u1 := channel_no*2;
 7120  265    5     !   (*q if test_b then
 7130  266    6     !   testout( z, "rts-delay   ", ref^.u1); q*)
 7140  267    7     ! sendtimer(ref);
 7150  268    8     END;
 7160  269          
 7170  270          
 7180  271          
 7190  272          
 7200  273          
 7210  274          PROCEDURE start_rtr_delay(channel_no : integer);
 7220  275              (*********************************************
 7230  276              *   rtr-delay                                *
 7240  277              **********************************************)
 7250  278            
 7260  279          VAR ref:reference;
 7270  280          BEGIN
 7280  281    1     ! alloc(ref, delaypool, mainsem.s^);
 7290  282    2     ! ref^.u3:=rtr_delay_u3;
 7300  283    3     ! ref^.u4:=rtr_delay_u4;
 7310  284    4     ! ref^.u1 :=channel_no*2+1;
 7320  285    5     !   (*q if test_b then
 7330  286    6     !   testout( z, "rtr-delay   ", ref^.u1); q*)
 7340  287    7     ! sendtimer(ref);
 7350  288    8     END;
 7360  289          
 7370  290           
\f

hjlaplst    81.05.04.   08.25.                                                    page    10

 8010  291          PROCEDURE createchannel( w_kind, r_kind: 0..15 );
 8020  292              (***********************************************
 8030  293              *   createchannel                              *
 8040  294              ************************************************)
 8050  295            
 8060  296          VAR i: integer;
 8070  297          BEGIN
 8080  298    1     ! i:=ref^.u2;
 8090  299    2     ! channel_descriptor(i*2).channel_kind:=w_kind;
 8100  300    3     ! channel_descriptor(i*2+1).channel_kind:=r_kind;
 8110  301    4     ! 
 8120  302    5     ! channel_descriptor(i*2).status := write_read_ok;
 8130  303    6     ! channel_descriptor(i*2+1).status := write_read_ok;
 8140  304    7     ! 
 8150  305    8     ! LOCK ref AS buf:atbuffer DO
 8160  306    9     !   BEGIN
 8170  307   10     !   ! controle_byte(i):=buf(0) MOD 128;
 8180  308   11     !   ! time(i):=buf(1);
 8190  309   12     !   END;
 8200  310   13     ! 
 8210  311   14     ! ref^.u2:=ok_result;
 8220  312   15     ! return(ref);
 8230  313   16     ! 
 8240  314   17     !   (*q if test_b then
 8250  315   18     !   begin
 8260  316   19     !   testout( z, "chn created ", i);
 8270  317   20     !   testout( z, "controlebyte", controle_byte(i));
 8280  318   21     !   end; q*)
 8290  319   22     END;
 8300  320           
\f

hjlaplst    81.05.04.   08.25.                                                    page    11

 9010  321          
 9020  322            (*******************************************************
 9030  323            *   start_next_request                                        *
 9040  324            
 9050  325            *   initializes   next,  top,  and  timeout  in        *
 9060  326            *                 channeldescriptor(channel_no)             *
 9070  327            *           and   channel if it is used for output     *
 9080  328            *                                                      *
 9090  329            *   called when - not finished with write/read         *
 9100  330            *               - more requests after stop_actual_request
 9110  331            *               - timeout on write                     *
 9120  332            *               - no requests when a new userbuffer    *
 9130  333            *                 is comming                           *
 9140  334            ********************************************************)
 9150  335          
 9160  336          
 9170  337          PROCEDURE start_next_request( channel_no:channelset);
 9180  338          VAR c : integer;
 9190  339          BEGIN
 9200  340    1     ! WITH channel_descriptor(channel_no) DO
 9210  341    2     !   BEGIN
 9220  342    3     !   ! 
 9230  343    4     !   ! timeout:= time(channel_no DIV 2);
 9240  344    5     !   ! 
 9250  345    6     !   !   (*q if test_b then
 9260  346    7     !   !   begin
 9270  347    8     !   !   testout( z,"sta-nxt-req ", channel_no);
 9280  348    9     !   !   testout( z,"chn-kind    ",channel_kind);
 9290  349   10     !   !   end; q*)
 9300  350   11     !   ! 
 9310  351   12     !   ! IF channel_kind = at_write_channel THEN
 9320  352   13     !   !   BEGIN
 9330  353   14     !   !   !   (*                set up for output  *)
 9340  354   15     !   !   ! c:=controle_byte(channel_no DIV 2)*256+requesttosend+channel_no;
 9350  355   16     !   !   ! control(c,channelmessage);
 9360  356   17     !   !   !   (*q if test_b then
 9370  357   18     !   !   !   testout(z,"rts-init    ",c); q*)
 9380  358   19     !   !   ! start_rts_delay(channel_no);
 9390  359   20     !   !   ! channel_kind := at_write_wait;
 9400  360   21     !   !   END
 9410  361   22     !   !    
\f

hjlaplst    81.05.04.   08.25.                                                    page    12

10010  362   23     !   ! ELSE
10020  363   24     !   !   BEGIN
10030  364   25     !   !   ! IF channel_kind = tty_read_channel THEN
10040  365   26     !   !   !   channel_descriptor(channel_no-1).reading_tty:=true;
10050  366   27     !   !   ! interruptable:=true;
10060  367   28     !   !   END;
10070  368   29     !   ! 
10080  369   30     !   ! IF request^.u1 > write_alc_read THEN
10090  370   31     !   !   BEGIN
10100  371   32     !   !   ! LOCK request AS buf: drvbuffer DO
10110  372   33     !   !   !   BEGIN
10120  373   34     !   !   !   ! next:= buf.next;
10130  374   35     !   !   !   ! top:= buf.last+1;
10140  375   36     !   !   !   END;
10150  376   37     !   !   END
10160  377   38     !   !   
10170  378   39     !   ! ELSE
10180  379   40     !   !   IF request^.u1 <= write_read_at THEN
10190  380   41     !   !     BEGIN
10200  381   42     !   !     ! next := 0;
10210  382   43     !   !     ! top := 2;
10220  383   44     !   !     END
10230  384   45     !   !   ELSE
10240  385   46     !   !     BEGIN            (*  alc mode     *)
10250  386   47     !   !     ! IF request^.u3 >= command THEN
10260  387   48     !   !     !   LOCK request AS buf : drvbuffer DO
10270  388   49     !   !     !     BEGIN
10280  389   50     !   !     !     ! buf.next := buf.first;
10290  390   51     !   !     !     END;
10300  391   52     !   !     ! top := 1;
10310  392   53     !   !     ! IF channel_kind = alc_read_channel THEN
10320  393   54     !   !     !   timeout := timeout * 10;
10330  394   55     !   !     END;
10340  395   56     !   END;
10350  396   57     END;
10360  397           
\f

hjlaplst    81.05.04.   08.25.                                                    page    13

11010  398            (*******************************************************
11020  399            *   stop_actual_request
11030  400            *
11040  401            *   sends answer back to user
11050  402            *   if we shall go on read the request is send to      *
11060  403            *   queue at channel_no+1                                  *
11070  404            ********************************************************)
11080  405          
11090  406          PROCEDURE stop_actual_request
11100  407            ( result:byte; channel_no:channelset);
11110  408            
11120  409          VAR c : integer;
11130  410            
11140  411            
11150  412          BEGIN
11160  413    1     ! 
11170  414    2     ! WITH channel_descriptor(channel_no) DO
11180  415    3     !   
11190  416    4     !   CASE channel_kind OF
11200  417    5     !   ! 
11210  418    6     !   ! at_write_channel:
11220  419    7     !   !   BEGIN
11230  420    8     !   !   ! start_rtr_delay(channel_no);
11240  421    9     !   !   ! channel_kind := at_read_wait;
11250  422   10     !   !   ! old_result := result;
11260  423   11     !   !   END;
11270  424   12     !   ! 
11280  425   13     !   ! at_read_wait:
11290  426   14     !   !   BEGIN
11300  427   15     !   !   ! c:=controle_byte(channel_no DIV 2)*256+readytoread+channel_no;
11310  428   16     !   !   ! control(c,channelmessage);
11320  429   17     !   !   ! channel_kind := at_write_channel;
11330  430   18     !   !   ! result:= old_result;
11340  431   19     !   !   !   (*q if test_b then
11350  432   20     !   !   !   testout( z,"rtr-answer  ", c); q*)
11360  433   21     !   !   END
11370  434   22     !   !   OTHERWISE;
11380  435   23     !   END;
11390  436   24     !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    14

12010  437   25     ! IF channel_descriptor(channel_no).channel_kind <> at_read_wait THEN
12020  438   26     !   BEGIN
12030  439   27     !   ! 
12040  440   28     !   ! IF result = go_on_read THEN
12050  441   29     !   !   BEGIN
12060  442   30     !   !   ! 
12070  443   31     !   !   !   (*q if test_b then
12080  444   32     !   !   !   testout( z,"go on read  ", channel_no); q*)
12090  445   33     !   !   ! 
12100  446   34     !   !   ! WHILE NOT nil( channel_descriptor(channel_no+1).request) DO
12110  447   35     !   !   !   WITH channel_descriptor(channel_no+1) DO
12120  448   36     !   !   !     BEGIN
12130  449   37     !   !   !     ! request^.u2:=write_read_mixed;
12140  450   38     !   !   !     ! return(request);
12150  451   39     !   !   !     ! sensesem( request, queue(channel_no+1));
12160  452   40     !   !   !     END;
12170  453   41     !   !   ! channel_descriptor(channel_no+1).request:=:channel_descriptor(channel_no).request;
12180  454   42     !   !   ! start_next_request(channel_no+1);
12190  455   43     !   !   END
12200  456   44     !   ! ELSE
12210  457   45     !   !   BEGIN
12220  458   46     !   !   ! WITH channel_descriptor( channel_no) DO
12230  459   47     !   !   !   IF (( channel_kind=alc_read_channel) OR (channel_kind=alc_write_channel)) THEN
12240  460   48     !   !   !     BEGIN
12250  461   49     !   !   !     !   <*t
12260  462   50     !   !   !     !   IF result <> 0 THEN
12270  463   51     !   !   !     !   BEGIN
12280  464   52     !   !   !     !   IF channel_kind=alc_read_channel THEN
12290  465   53     !   !   !     !   testout(z,"ui-r        ", result)
12300  466   54     !   !   !     !   ELSE
12310  467   55     !   !   !     !   testout(z,"uo-r        ", result);
12320  468   56     !   !   !     !   testout(z,"opc         ", request^.u3);
12330  469   57     !   !   !     !   END;
12340  470   58     !   !   !     !   t*>
12350  471   59     !   !   !     ! 
12360  472   60     !   !   !     ! request^.u4 := status MOD 256;
12370  473   61     !   !   !     END;
12380  474   62     !   !   ! channel_descriptor(channel_no).request^.u2:=result;
12390  475   63     !   !   ! 
12400  476   64     !   !   !   (*q if test_b then
12410  477   65     !   !   !   testout( z, "returning   ", channel_no); q*)
12420  478   66     !   !   ! return(channel_descriptor(channel_no).request);
12430  479   67     !   !   END;
12440  480   68     !   !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    15

13010  481   69     !   ! WITH channel_descriptor(channel_no) DO
13020  482   70     !   !   BEGIN
13030  483   71     !   !   ! timeout:=0;
13040  484   72     !   !   ! sensesem(request,queue(channel_no));
13050  485   73     !   !   ! IF channel_kind = tty_read_channel THEN
13060  486   74     !   !   !   BEGIN
13070  487   75     !   !   !   ! IF nil(channel_descriptor(channel_no-1).request) THEN
13080  488   76     !   !   !   !   BEGIN      (*   no writes are waiting  *)
13090  489   77     !   !   !   !   ! IF nil(request) THEN
13100  490   78     !   !   !   !   !   channel_descriptor(channel_no-1).reading_tty := false
13110  491   79     !   !   !   !   ! ELSE
13120  492   80     !   !   !   !   !   start_next_request( channel_no)
13130  493   81     !   !   !   !   END
13140  494   82     !   !   !   ! ELSE
13150  495   83     !   !   !   !   BEGIN      (*   writes are waiting   *)
13160  496   84     !   !   !   !   ! channel_descriptor(channel_no-1).reading_tty:=false;
13170  497   85     !   !   !   !   ! start_next_request(channel_no-1);
13180  498   86     !   !   !   !   END
13190  499   87     !   !   !   END
13200  500   88     !   !   ! ELSE
13210  501   89     !   !   !   IF channel_kind = tty_write_channel THEN
13220  502   90     !   !   !     BEGIN
13230  503   91     !   !   !     ! IF nil( request) THEN
13240  504   92     !   !   !     !   BEGIN      (*   no more writes look for reads  *)
13250  505   93     !   !   !     !   ! IF NOT nil(channel_descriptor(channel_no+1).request) THEN
13260  506   94     !   !   !     !   !   start_next_request(channel_no+1)
13270  507   95     !   !   !     !   END
13280  508   96     !   !   !     ! ELSE
13290  509   97     !   !   !     !   start_next_request(channel_no);
13300  510   98     !   !   !     END
13310  511   99     !   !   !   ELSE
13320  512  100     !   !   !     IF nil(request) THEN interruptable:=false
13330  513  101     !   !   !     ELSE start_next_request(channel_no);
13340  514  102     !   !   END;
13350  515  103     !   END;
13360  516  104     END;
13370  517           
\f

hjlaplst    81.05.04.   08.25.                                                    page    16

14010  518          
14020  519          FUNCTION packed_word ( databits: byte; channel_no: channelset): lamword;
14030  520              (********************************************************
14040  521              *   makes a word ready for outword                      *
14050  522              *********************************************************)
14060  523          VAR   w: lamword;
14070  524          BEGIN
14080  525    1     ! w.data:= databits;
14090  526    2     ! w.std := 0;
14100  527    3     ! w.port_and_bit15:=channel_no;
14110  528    4     ! packed_word:= w
14120  529    5     END;
14130  530           
\f

hjlaplst    81.05.04.   08.25.                                                    page    17

15010  531          PROCEDURE set_lam_control( channel_no : channelset);
15020  532          VAR c : integer;
15030  533          BEGIN
15040  534    1     ! channel_no := channel_no - channel_no MOD 2;
15050  535    2     ! c := controle_byte( channel_no DIV 2) *256 + channel_no;
15060  536    3     ! IF channel_descriptor(channel_no).channel_kind = at_write_channel THEN
15070  537    4     !   c := c+readytoread
15080  538    5     ! ELSE
15090  539    6     !   c:= c+ requesttosend;
15100  540    7     ! 
15110  541    8     ! control( c, channelmessage);
15120  542    9     END;
15130  543           
\f

hjlaplst    81.05.04.   08.25.                                                    page    18

16010  544          PROCEDURE start_new_channel(channel_no: channelset);
16020  545              (********************************************************
16030  546              *   start_new_channel                                               *
16040  547              *   called when - channel is created                    *
16050  548              *               - persistent status error               *
16060  549              *               - timeout on write or write/read        *
16070  550              *********************************************************)
16080  551            
16090  552          BEGIN
16100  553    1     ! set_lam_control( channel_no);
16110  554    2     ! channel_descriptor(channel_no).status:= write_read_ok;
16120  555    3     ! 
16130  556    4     ! WITH channel_descriptor(channel_no) DO
16140  557    5     !   WHILE NOT nil(request) DO
16150  558    6     !     stop_actual_request
16160  559    7     !     (create_done, channel_no);
16170  560    8     ! 
16180  561    9     ! channel_no:= channel_no+1;
16190  562   10     ! WITH channel_descriptor(channel_no) DO
16200  563   11     !   WHILE NOT nil(request) DO
16210  564   12     !     stop_actual_request
16220  565   13     !     (create_done, channel_no);
16230  566   14     END;
16240  567           
\f

hjlaplst    81.05.04.   08.25.                                                    page    19

17010  568          FUNCTION ready_to_send( channel_no:channelset):boolean;
17020  569              (********************************************************
17030  570              *   ready-to-send                                         *
17040  571              *********************************************************)
17050  572            
17060  573          BEGIN
17070  574    1     ! WITH channel_descriptor(channel_no) DO
17080  575    2     !   BEGIN
17090  576    3     !   ! sense( status, channel_no, channelmessage);
17100  577    4     !   ! 
17110  578    5     !   ! IF status MOD 32 DIV 8 = 3 THEN
17120  579    6     !   !   ready_to_send := true
17130  580    7     !   ! ELSE
17140  581    8     !   !   ready_to_send:=false
17150  582    9     !   END;
17160  583   10     END;
17170  584           
\f

hjlaplst    81.05.04.   08.25.                                                    page    20

18010  585          PROCEDURE handle_ok_lam_int(data_byte: byte; channel_no: channelset);
18020  586              (********************************************************
18030  587              *   handle_ok_lam_int                                             *
18040  588              *   handles the buffer pointed to by request                *
18050  589              *                                                       *
18060  590              *   if it is a writebuffer the byte pointed to by next  *
18070  591              *   is output                                           *
18080  592              *                                                       *
18090  593              *   if it is a readbuffer the data_byte is put into       *
18100  594              *   the buffer at the byte pointed to by next           *
18110  595              *                                                       *
18120  596              *********************************************************)
18130  597            
18140  598            
18150  599          BEGIN
18160  600    1     !   (*q if test_b then
18170  601    2     !   testout(z, "hndl-o-l-int", channel_no); q*)
18180  602    3     ! 
18190  603    4     ! WITH channel_descriptor(channel_no) DO
18200  604    5     !   
18210  605    6     !   CASE channel_kind OF
18220  606    7     !   !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    21

19010  607    8     !   ! at_write_channel :
19020  608    9     !   !   
19030  609   10     !   !   IF next >= top THEN
19040  610   11     !   !     BEGIN
19050  611   12     !   !     !   (*q if test_b then
19060  612   13     !   !     !   testout( z, "next = top  ", 0); q*)
19070  613   14     !   !     ! IF request^.u1 = write_read_at THEN
19080  614   15     !   !     !   stop_actual_request
19090  615   16     !   !     !   ( go_on_read, channel_no)
19100  616   17     !   !     ! ELSE stop_actual_request
19110  617   18     !   !     !   ( ok_result, channel_no);
19120  618   19     !   !     END
19130  619   20     !   !   ELSE
19140  620   21     !   !     BEGIN
19150  621   22     !   !     !   <*rif ready_to_send(channel_no) THEN
19160  622   23     !   !     !   r*>
19170  623   24     !   !     ! LOCK request AS buf:atbuffer DO
19180  624   25     !   !     !   BEGIN
19190  625   26     !   !     !   ! 
19200  626   27     !   !     !   !   (*q if test_b then
19210  627   28     !   !     !   !   begin
19220  628   29     !   !     !   !   testout( z, "at-w-next   ", next);
19230  629   30     !   !     !   !   testout( z, "at-w-ch     ", buf(next));
19240  630   31     !   !     !   !   end; q*)
19250  631   32     !   !     !   ! 
19260  632   33     !   !     !   ! outword( packed_word( buf(next), channel_no), channelmessage);
19270  633   34     !   !     !   ! next:=next+1;
19280  634   35     !   !     !   END
19290  635   36     !   !     !     <*r
19300  636   37     !   !     !     ELSE
19310  637   38     !   !     !     stop_actual_request
19320  638   39     !   !     !     ( write_error, channel_no)
19330  639   40     !   !     !     r*>
19340  640   41     !   !     END;
19350  641   42     !   !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    22

20010  642   43     !   ! at_read_channel :
20020  643   44     !   !   
20030  644   45     !   !   BEGIN
20040  645   46     !   !   ! LOCK request AS buf:atbuffer DO
20050  646   47     !   !   !   buf(next):=data_byte;
20060  647   48     !   !   !   (*q if test_b then
20070  648   49     !   !   !   begin
20080  649   50     !   !   !   testout( z, "at-r-next   ", next);
20090  650   51     !   !   !   testout( z,"at-r-ch     ", data_byte);
20100  651   52     !   !   !   end; q*)
20110  652   53     !   !   ! next:=next+1;
20120  653   54     !   !   ! IF next >= top THEN
20130  654   55     !   !   !   stop_actual_request
20140  655   56     !   !   !   ( ok_result, channel_no);
20150  656   57     !   !   END;
20160  657   58     !   !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    23

21010  658   59     !   ! alc_read_channel :
21020  659   60     !   !   
21030  660   61     !   !   BEGIN
21040  661   62     !   !   !   (*  top controls position i format     *)
21050  662   63     !   !   ! CASE top OF
21060  663   64     !   !   ! ! 
21070  664   65     !   !   ! ! 1 : (* stx should be read *)
21080  665   66     !   !   ! !   
21090  666   67     !   !   ! !   IF data_byte = stx THEN top:= 2;
21100  667   68     !   !   ! ! 
21110  668   69     !   !   ! ! 2 : (* opcode should be read *)
21120  669   70     !   !   ! !   BEGIN
21130  670   71     !   !   ! !   ! old_result := data_byte;
21140  671   72     !   !   ! !   ! checksum := 0;
21150  672   73     !   !   ! !   ! IF  (data_byte IN op_codes) THEN
21160  673   74     !   !   ! !   !   IF data_byte < command THEN top:= 5  ELSE top:= 3
21170  674   75     !   !   ! !   !   ELSE top:= 1;  (*  illegal opk  *)
21180  675   76     !   !   ! !   END;
21190  676   77     !   !   ! ! 
21200  677   78     !   !   ! ! 3 : (* bbl  should be read *)
21210  678   79     !   !   ! !   BEGIN
21220  679   80     !   !   ! !   ! 
21230  680   81     !   !   ! !   ! next:= data_byte;      (*  points to etx   *)
21240  681   82     !   !   ! !   ! top:= 4;
21250  682   83     !   !   ! !   ! 
21260  683   84     !   !   ! !   !   (*qtestout(z,"reci-bbl    ", data_byte);q*)
21270  684   85     !   !   ! !   END;
21280  685   86     !   !   ! ! 
21290  686   87     !   !   ! ! 4:
21300  687   88     !   !   ! !   BEGIN  (* info is read *)
21310  688   89     !   !   ! !   ! 
21320  689   90     !   !   ! !   ! i := request^.size;
21330  690   91     !   !   ! !   ! LOCK request AS buf : RECORD
21340  691   92     !   !   ! !   !                         !  first, last, next : integer;
21350  692   93     !   !   ! !   !                         !  info : ARRAY (6..i-1+i) OF byte;
21360  693   94     !   !   ! !   !   END DO
21370  694   95     !   !   ! !   !   BEGIN
21380  695   96     !   !   ! !   !   ! buf.info(buf.next) := data_byte;
21390  696   97     !   !   ! !   !   ! buf.next := buf.next +1;
21400  697   98     !   !   ! !   !   ! next:= next-1;
21410  698   99     !   !   ! !   !   ! IF next < 0 THEN top:= 5  ELSE
21420  699  100     !   !   ! !   !   !   IF buf.next > buf.last THEN    (* buffer too small  *)
21430  700  101     !   !   ! !   !   !     top:= 1
21440  701  102     !   !   ! !   !   END;
21450  702  103     !   !   ! !   ! IF top = 1 THEN
21460  703  104     !   !   ! !   !   stop_actual_request ( 5*8+transient_error, channel_no);
\f

hjlaplst    81.05.04.   08.25.                                                    page    24

21470  704  105     !   !   ! !   END;
21480  705  106     !   !   ! !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    25

22010  706  107     !   !   ! ! 5:       (*---  etx should be read *)
22020  707  108     !   !   ! !   BEGIN
22030  708  109     !   !   ! !   ! 
22040  709  110     !   !   ! !   ! IF data_byte <> etx THEN
22050  710  111     !   !   ! !   !   BEGIN (* start again *)
22060  711  112     !   !   ! !   !   ! IF request^.u3 >= command THEN
22070  712  113     !   !   ! !   !   !   LOCK request AS buf : drvbuffer DO
22080  713  114     !   !   ! !   !   !     BEGIN
22090  714  115     !   !   ! !   !   !     ! buf.next := buf.first;
22100  715  116     !   !   ! !   !   !     END;
22110  716  117     !   !   ! !   !   ! top := 1;
22120  717  118     !   !   ! !   !   END  ELSE
22130  718  119     !   !   ! !   !   top:= 6;
22140  719  120     !   !   ! !   ! 
22150  720  121     !   !   ! !   END;
22160  721  122     !   !   ! ! 
22170  722  123     !   !   ! ! 6:
22180  723  124     !   !   ! !     (* chs should be read *)
22190  724  125     !   !   ! !   
22200  725  126     !   !   ! !   IF data_byte <> checksum THEN
22210  726  127     !   !   ! !     BEGIN
22220  727  128     !   !   ! !     ! stop_actual_request
22230  728  129     !   !   ! !     ! ( 4*8 + transient_error, channel_no);
22240  729  130     !   !   ! !     END  ELSE
22250  730  131     !   !   ! !     BEGIN
22260  731  132     !   !   ! !     ! 
22270  732  133     !   !   ! !     ! request^.u3 := old_result;
22280  733  134     !   !   ! !     ! 
22290  734  135     !   !   ! !     ! stop_actual_request
22300  735  136     !   !   ! !     ! ( ok_result, channel_no);
22310  736  137     !   !   ! !     ! 
22320  737  138     !   !   ! !     !   (*qtestout(z,"release-ui  ", 0);q*)
22330  738  139     !   !   ! !     END;
22340  739  140     !   !   ! END;  (* case  *)
22350  740  141     !   !   ! 
22360  741  142     !   !   ! checksum := (checksum + data_byte) MOD 256;
22370  742  143     !   !   ! 
22380  743  144     !   !   END;
22390  744  145     !   !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    26

23010  745  146     !   ! alc_write_channel :
23020  746  147     !   !   BEGIN
23030  747  148     !   !   !   <*r
23040  748  149     !   !   !   IF ready_to_send ( channel_no) THEN
23050  749  150     !   !   !   r*>
23060  750  151     !   !   ! BEGIN
23070  751  152     !   !   ! ! 
23080  752  153     !   !   ! ! CASE top OF
23090  753  154     !   !   ! ! ! 
23100  754  155     !   !   ! ! ! 1 : (* stx is send *)
23110  755  156     !   !   ! ! !   BEGIN
23120  756  157     !   !   ! ! !   ! 
23130  757  158     !   !   ! ! !   ! data_byte := stx;
23140  758  159     !   !   ! ! !   ! top:= 2;
23150  759  160     !   !   ! ! !   END;
23160  760  161     !   !   ! ! ! 
23170  761  162     !   !   ! ! ! 2 : (* opcode is send *)
23180  762  163     !   !   ! ! !   BEGIN
23190  763  164     !   !   ! ! !   ! data_byte := request^.u3;
23200  764  165     !   !   ! ! !   ! checksum:= 0;
23210  765  166     !   !   ! ! !   ! IF data_byte < command THEN top:= 5 ELSE top:= 3
23220  766  167     !   !   ! ! !   END;
23230  767  168     !   !   ! ! ! 
23240  768  169     !   !   ! ! ! 3 : (* bbl  is send *)
23250  769  170     !   !   ! ! !   LOCK request AS buf : drvbuffer DO
23260  770  171     !   !   ! ! !     BEGIN  (* bbl *)
23270  771  172     !   !   ! ! !     ! data_byte := buf.last - buf.first;
23280  772  173     !   !   ! ! !     ! top:= 4;
23290  773  174     !   !   ! ! !     !   (*qtestout(z,"send-bbl    ", data_byte);q*)
23300  774  175     !   !   ! ! !     END;
23310  775  176     !   !   ! ! ! 
23320  776  177     !   !   ! ! ! 4:   (*  send info   *)
23330  777  178     !   !   ! ! !   BEGIN
23340  778  179     !   !   ! ! !   ! i:= request^.size;
23350  779  180     !   !   ! ! !   ! LOCK request AS buf : RECORD
23360  780  181     !   !   ! ! !   !                         !  first, last, next : integer;
23370  781  182     !   !   ! ! !   !                         !  info : ARRAY (6..i-1+i) OF byte;
23380  782  183     !   !   ! ! !   !   END DO
23390  783  184     !   !   ! ! !   !   BEGIN
23400  784  185     !   !   ! ! !   !   ! data_byte := buf.info( buf.next);
23410  785  186     !   !   ! ! !   !   ! buf.next := buf.next +1;
23420  786  187     !   !   ! ! !   !   ! IF buf.next > buf.last THEN top:= 5;
23430  787  188     !   !   ! ! !   !   !   (*qtestout(z,"send-info   ", buf.info(buf.next));q*)
23440  788  189     !   !   ! ! !   !   END;
23450  789  190     !   !   ! ! !   END;
23460  790  191     !   !   ! ! !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    27

24010  791  192     !   !   ! ! ! 5:   (*  send etx   *)
24020  792  193     !   !   ! ! !   BEGIN
24030  793  194     !   !   ! ! !   ! data_byte := etx;
24040  794  195     !   !   ! ! !   ! top:= 6;
24050  795  196     !   !   ! ! !   !   (*qtestout(z,"send-etx    ", checksum);q*)
24060  796  197     !   !   ! ! !   END;
24070  797  198     !   !   ! ! ! 
24080  798  199     !   !   ! ! ! 
24090  799  200     !   !   ! ! ! 6:
24100  800  201     !   !   ! ! !     (* chs is send *)
24110  801  202     !   !   ! ! !   BEGIN
24120  802  203     !   !   ! ! !   ! data_byte := checksum;
24130  803  204     !   !   ! ! !   ! top:= 7;
24140  804  205     !   !   ! ! !   !   (*qtestout(z,"send-chs    ", etx);q*)
24150  805  206     !   !   ! ! !   ! 
24160  806  207     !   !   ! ! !   END;
24170  807  208     !   !   ! ! ! 
24180  808  209     !   !   ! ! ! 7:     (*  user buffer is released *)
24190  809  210     !   !   ! ! !   BEGIN
24200  810  211     !   !   ! ! !   ! stop_actual_request
24210  811  212     !   !   ! ! !   ! ( ok_result, channel_no);
24220  812  213     !   !   ! ! !   ! 
24230  813  214     !   !   ! ! !   !   (*qtestout(z,"release uo  ",next);q*)
24240  814  215     !   !   ! ! !   END;
24250  815  216     !   !   ! ! ! 
24260  816  217     !   !   ! ! END;   (*  case  *)
24270  817  218     !   !   ! !   <*r
24280  818  219     !   !   ! !   ELSE
24290  819  220     !   !   ! !   stop_actual_request
24300  820  221     !   !   ! !   (write_error, channel_no);
24310  821  222     !   !   ! !   r*>
24320  822  223     !   !   ! ! 
24330  823  224     !   !   ! ! outword( packed_word( data_byte, channel_no), channelmessage);
24340  824  225     !   !   ! ! checksum := (checksum + data_byte) MOD 256;
24350  825  226     !   !   ! ! 
24360  826  227     !   !   ! END;
24370  827  228     !   !   END;
24380  828  229     !   !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    28

25010  829  230     !   ! tty_read_channel :
25020  830  231     !   !   
25030  831  232     !   !   BEGIN
25040  832  233     !   !   ! 
25050  833  234     !   !   !   (*q if test_b then
25060  834  235     !   !   !   begin
25070  835  236     !   !   !   testout( z,"tty-r-next  ", next);
25080  836  237     !   !   !   testout( z,"tty-r-ch    ", data_byte);
25090  837  238     !   !   !   end; q*)
25100  838  239     !   !   ! 
25110  839  240     !   !   ! 
25120  840  241     !   !   ! CASE data_byte OF
25130  841  242     !   !   ! ! 
25140  842  243     !   !   ! ! esc :
25150  843  244     !   !   ! !   BEGIN
25160  844  245     !   !   ! !   ! WITH channel_descriptor( channel_no-1) DO
25170  845  246     !   !   ! !   !   IF NOT reading_tty THEN
25180  846  247     !   !   ! !   !     BEGIN
25190  847  248     !   !   ! !   !     ! timeout:=0;
25200  848  249     !   !   ! !   !     ! channel_kind:=tty_wait_cr;
25210  849  250     !   !   ! !   !     ! LOCK request AS buf:drvbuffer DO
25220  850  251     !   !   ! !   !     !   IF next > 1 THEN
25230  851  252     !   !   ! !   !     !     buf.next:=next-1
25240  852  253     !   !   ! !   !     !   ELSE
25250  853  254     !   !   ! !   !     !     buf.next:=next;
25260  854  255     !   !   ! !   !     END
25270  855  256     !   !   ! !   !   ELSE
25280  856  257     !   !   ! !   !     channel_kind := tty_wait_nl;
25290  857  258     !   !   ! !   ! outword( packed_word( cr, channel_no), channelmessage);
25300  858  259     !   !   ! !   ! start_next_request( channel_no);
25310  859  260     !   !   ! !   !   (*ttestout(z,"esc         ",timeout);t*)
25320  860  261     !   !   ! !   END;
25330  861  262     !   !   ! ! 
25340  862  263     !   !   ! ! cs :
25350  863  264     !   !   ! !   WITH channel_descriptor(channel_no-1) DO
25360  864  265     !   !   ! !     IF NOT reading_tty THEN
25370  865  266     !   !   ! !       BEGIN
25380  866  267     !   !   ! !       ! WHILE NOT nil(request) DO
25390  867  268     !   !   ! !       !   BEGIN
25400  868  269     !   !   ! !       !   ! request^.u2:=create_done;
25410  869  270     !   !   ! !       !   ! return(request);
25420  870  271     !   !   ! !       !   ! sensesem(request,queue(channel_no-1))
25430  871  272     !   !   ! !       !   END;
25440  872  273     !   !   ! !       ! timeout:=0;
25450  873  274     !   !   ! !       ! IF NOT nil(channel_descriptor(channel_no).request) THEN
25460  874  275     !   !   ! !       !   start_next_request(channel_no);
\f

hjlaplst    81.05.04.   08.25.                                                    page    29

25470  875  276     !   !   ! !       END
25480  876  277     !   !   ! !     ELSE  (*  reading tty  *)
25490  877  278     !   !   ! !       BEGIN
25500  878  279     !   !   ! !       ! WITH channel_descriptor( channel_no) DO
25510  879  280     !   !   ! !       !   BEGIN
25520  880  281     !   !   ! !       !   ! i:= request^.size;
25530  881  282     !   !   ! !       !   ! 
25540  882  283     !   !   ! !       !   ! LOCK request AS buf : RECORD
25550  883  284     !   !   ! !       !   !                         !  first, last, next : integer;
25560  884  285     !   !   ! !       !   !                         !  text : ARRAY (1..i-6+i) OF byte;
25570  885  286     !   !   ! !       !   !   END DO
25580  886  287     !   !   ! !       !   !   BEGIN
25590  887  288     !   !   ! !       !   !   ! IF next > (i-6+i) THEN next := (i-6+i);
25600  888  289     !   !   ! !       !   !   ! buf.text(next):=cs;
25610  889  290     !   !   ! !       !   !   ! next:=next+1;
25620  890  291     !   !   ! !       !   !   ! IF next>=top THEN
25630  891  292     !   !   ! !       !   !   !   buf.next:=next;
25640  892  293     !   !   ! !       !   !   END;
25650  893  294     !   !   ! !       !   ! IF next>=top THEN
25660  894  295     !   !   ! !       !   !   stop_actual_request
25670  895  296     !   !   ! !       !   !   ( ok_result, channel_no);
25680  896  297     !   !   ! !       !   END;
25690  897  298     !   !   ! !       ! outword(packed_word(cr,channel_no), channelmessage);
25700  898  299     !   !   ! !       !   (*ttestout(z,"cs          ",timeout);t*)
25710  899  300     !   !   ! !       ! channel_kind:=echo_nl_on_channel;
25720  900  301     !   !   ! !       END;
25730  901  302     !   !   ! ! 
25740  902  303     !   !   ! ! del,bs :
25750  903  304     !   !   ! !   IF channel_descriptor(channel_no-1).reading_tty THEN
25760  904  305     !   !   ! !     BEGIN
25770  905  306     !   !   ! !     ! LOCK request AS buf:drvbuffer DO
25780  906  307     !   !   ! !     !   IF next > buf.first THEN       (*  erase  *)
25790  907  308     !   !   ! !     !     next:=next-1;
25800  908  309     !   !   ! !     ! outword( packed_word( bs, channel_no), channelmessage);
25810  909  310     !   !   ! !     END;
25820  910  311     !   !   ! ! cr:          (*  return   works as line-end    *)
25830  911  312     !   !   ! !   IF channel_descriptor(channel_no-1).reading_tty THEN
25840  912  313     !   !   ! !     BEGIN
25850  913  314     !   !   ! !     ! i := request^.size;
25860  914  315     !   !   ! !     ! 
25870  915  316     !   !   ! !     ! LOCK request AS buf : RECORD
25880  916  317     !   !   ! !     !                         !  first, last, next : integer;
25890  917  318     !   !   ! !     !                         !  text : ARRAY (1..i-6+i) OF byte;
25900  918  319     !   !   ! !     !   END DO
25910  919  320     !   !   ! !     !   BEGIN
25920  920  321     !   !   ! !     !   ! channel_descriptor(channel_no-1).channel_kind:=echo_nl_on_channel;
\f

hjlaplst    81.05.04.   08.25.                                                    page    30

25930  921  322     !   !   ! !     !   ! buf.text(next):=data_byte;
25940  922  323     !   !   ! !     !   ! IF next<top-1 THEN
25950  923  324     !   !   ! !     !   !   BEGIN
25960  924  325     !   !   ! !     !   !   ! buf.text(next+1):=nl;
25970  925  326     !   !   ! !     !   !   ! buf.next:=next+2
25980  926  327     !   !   ! !     !   !   END
25990  927  328     !   !   ! !     !   ! ELSE
26000  928  329     !   !   ! !     !   !   buf.next:=next+1;
26010  929  330     !   !   ! !     !   ! outword( packed_word( cr, channel_no), channelmessage);
26020  930  331     !   !   ! !     !   !   (*ttestout(z,"cr          ",timeout);t*)
26030  931  332     !   !   ! !     !   END
26040  932  333     !   !   ! !     END
26050  933  334     !   !   ! !      
\f

hjlaplst    81.05.04.   08.25.                                                    page    31

27010  934  335     !   !   ! !     OTHERWISE      (*  packed_word character   *)
27020  935  336     !   !   ! !     
27030  936  337     !   !   ! !     IF channel_descriptor(channel_no-1).reading_tty THEN
27040  937  338     !   !   ! !       BEGIN
27050  938  339     !   !   ! !       ! i := request^.size;
27060  939  340     !   !   ! !       ! 
27070  940  341     !   !   ! !       ! LOCK request AS buf : RECORD
27080  941  342     !   !   ! !       !                         !  first, last, next : integer;
27090  942  343     !   !   ! !       !                         !  text : ARRAY (1..i-6+i) OF byte;
27100  943  344     !   !   ! !       !   END DO
27110  944  345     !   !   ! !       !   BEGIN
27120  945  346     !   !   ! !       !   !   (*  index error has been seen here,  next=81    *)
27130  946  347     !   !   ! !       !   ! IF next > (i-6+i) THEN next := (i-6+i);
27140  947  348     !   !   ! !       !   ! buf.text(next):=data_byte;
27150  948  349     !   !   ! !       !   ! next:=next+1;
27160  949  350     !   !   ! !       !   ! IF next >= top THEN
27170  950  351     !   !   ! !       !   !   buf.next:=next;
27180  951  352     !   !   ! !       !   END;
27190  952  353     !   !   ! !       ! IF next>=top THEN
27200  953  354     !   !   ! !       !   stop_actual_request
27210  954  355     !   !   ! !       !   ( ok_result, channel_no);
27220  955  356     !   !   ! !       ! outword( packed_word( data_byte, channel_no), channelmessage);
27230  956  357     !   !   ! !       END
27240  957  358     !   !   ! END;
27250  958  359     !   !   ! IF channel_descriptor(channel_no-1).reading_tty THEN
27260  959  360     !   !   !   IF timeout<normal_time THEN
27270  960  361     !   !   !     timeout:=normal_time;
27280  961  362     !   !   END;    (*  case read_tty  *)
27290  962  363     !   !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    32

28010  963  364     !   ! tty_write_channel :
28020  964  365     !   !   
28030  965  366     !   !   IF NOT reading_tty THEN
28040  966  367     !   !       <*r
28050  967  368     !   !       IF ready_to_send(channel_no) THEN
28060  968  369     !   !       r*>
28070  969  370     !   !     BEGIN
28080  970  371     !   !     ! i:= request^.size;
28090  971  372     !   !     ! 
28100  972  373     !   !     ! LOCK request AS buf : RECORD
28110  973  374     !   !     !                         !  first, last, next : integer;
28120  974  375     !   !     !                         !  text : ARRAY (1..i-6+i) OF byte;
28130  975  376     !   !     !   END DO
28140  976  377     !   !     !   BEGIN
28150  977  378     !   !     !   ! 
28160  978  379     !   !     !   !   (*q if test_b then
28170  979  380     !   !     !   !   begin
28180  980  381     !   !     !   !   testout( z, "tty-w-next  ", next);
28190  981  382     !   !     !   !   testout( z, "tty-w-ch    ", buf.text(next));
28200  982  383     !   !     !   !   end; q*)
28210  983  384     !   !     !   ! 
28220  984  385     !   !     !   ! outword ( packed_word( buf.text(next), channel_no), channelmessage);
28230  985  386     !   !     !   ! next:= next+1;
28240  986  387     !   !     !   ! IF next>= top THEN    (*  terminate  *)
28250  987  388     !   !     !   !   buf.next:= next;
28260  988  389     !   !     !   END;
28270  989  390     !   !     ! IF next>=top THEN
28280  990  391     !   !     !   stop_actual_request
28290  991  392     !   !     !   ( ok_result, channel_no)
28300  992  393     !   !     END;
28310  993  394     !   !   <*r
28320  994  395     !   !   ELSE
28330  995  396     !   !   stop_actual_request
28340  996  397     !   !   ( write_error, channel_no);
28350  997  398     !   !   r*>
28360  998  399     !   ! 
28370  999  400     !   !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    33

29010 1000  401     !   ! echo_nl_on_channel :
29020 1001  402     !   !   BEGIN
29030 1002  403     !   !   !   (*ttestout(z,"nl          ",timeout);t*)
29040 1003  404     !   !   ! outword( packed_word( nl, channel_no), channelmessage);
29050 1004  405     !   !   ! IF reading_tty THEN
29060 1005  406     !   !   !   stop_actual_request( ok_result, channel_no+1);
29070 1006  407     !   !   ! channel_kind:=tty_write_channel;
29080 1007  408     !   !   END;
29090 1008  409     !   ! 
29100 1009  410     !   ! tty_wait_cr :
29110 1010  411     !   !   BEGIN
29120 1011  412     !   !   ! outword(packed_word(cr,channel_no),channelmessage);
29130 1012  413     !   !   ! channel_kind:=tty_wait_nl;
29140 1013  414     !   !   !   (*ttestout(z,"esc cr      ",timeout);t*)
29150 1014  415     !   !   END;
29160 1015  416     !   ! 
29170 1016  417     !   ! tty_wait_nl :
29180 1017  418     !   !   BEGIN
29190 1018  419     !   !   ! outword(packed_word(nl,channel_no),channelmessage);
29200 1019  420     !   !   ! channel_kind:=tty_wait_input;
29210 1020  421     !   !   !   (*ttestout(z,"esc nl      ",timeout);t*)
29220 1021  422     !   !   END;
29230 1022  423     !   ! 
29240 1023  424     !   ! tty_wait_input :
29250 1024  425     !   !   BEGIN
29260 1025  426     !   !   END;
29270 1026  427     !   ! OTHERWISE
29280 1027  428     !   ! BEGIN
29290 1028  429     !   ! END
29300 1029  430     !   END;
29310 1030  431     END;
29320 1031           
\f

hjlaplst    81.05.04.   08.25.                                                    page    34

30010 1032            (***********************************************************
30020 1033            *                                                          *
30030 1034            *   high level lam-driver                                  *
30040 1035            *                                                          *
30050 1036            *  converts an interrupt to a signal to the level-0-driver *
30060 1037            *                                                          *
30070 1038            *   handles input only                                     *
30080 1039            ************************************************************)
30090 1040          
30100 1041        PROCESS highlevellamdriver( VAR lamsem: semaphore);
30110 1042          
30120 1043        CONST
30130 1044          readytosend= 24;
30140 1045          startscanner = -1;
30150 1046          interrupt_ok=40;
30160 1047          no_input=255;
30170 1048          
30180 1049        TYPE
30190 1050          dataword
30200 1051          = PACKED RECORD
30210 1052                   !  data:byte;
30220 1053                   !  unused:0..3;
30230 1054                   !  error:boolean;
30240 1055                   !  port_and_bit15: 0..31;
30250 1056                   END;
30260 1057          
30270 1058        VAR
30280 1059          channelmessage,ref:  reference;
30290 1060          indata:   dataword;
30300 1061          status:   integer;
30310 1062          
30320 1063          PROCEDURE controlclr(x:integer; VAR y:reference); EXTERNAL;
30330 1064            (*        writes controle and clears interrupt *)
30340 1065          
30350 1066          PROCEDURE inword( VAR x: dataword; VAR y: reference); EXTERNAL;
30360 1067            (*         reads one word *)
30370 1068          
30380 1069          PROCEDURE sense( VAR x:integer; y:integer; VAR z:reference); EXTERNAL;
30390 1070            (*         gets status *)
30400 1071           
\f

hjlaplst    81.05.04.   08.25.                                                    page    35

31010 1072        BEGIN
31020 1073    1   ! 
31030 1074    2   ! wait(channelmessage,lamsem);
31040 1075    3   !   (*            wait for a channelmessage to arrive *)
31050 1076    4   ! 
31060 1077    5   ! CHANNEL channelmessage DO
31070 1078    6   !   WHILE true DO
31080 1079    7   !     BEGIN
31090 1080    8   !     ! controlclr(startscanner,channelmessage);
31100 1081    9   !     !   (*            write control and clear interrupt *)
31110 1082   10   !     ! inword(indata,channelmessage);
31120 1083   11   !     !   (*            read one word of input *)
31130 1084   12   !     ! wait(ref,lamsem);
31140 1085   13   !     !   (*            wait for inputbuffer at lamsem *)
31150 1086   14   !     ! WITH indata,ref^ DO
31160 1087   15   !     !   BEGIN
31170 1088   16   !     !   ! u2:=interrupt_ok;
31180 1089   17   !     !   ! IF (port_and_bit15 MOD 2) = 0 THEN
31190 1090   18   !     !   !     (*          it is an outputinterrupt *)
31200 1091   19   !     !   !   u3:=no_input
31210 1092   20   !     !   ! ELSE
31220 1093   21   !     !   !   IF error THEN
31230 1094   22   !     !   !     BEGIN
31240 1095   23   !     !   !     ! sense(status, port_and_bit15, channelmessage);
31250 1096   24   !     !   !     ! u2 := status MOD 64;
31260 1097   25   !     !   !     END
31270 1098   26   !     !   !   ELSE
31280 1099   27   !     !   !     u3:=data;
31290 1100   28   !     !   ! u4:=port_and_bit15;
31300 1101   29   !     !   ! 
31310 1102   30   !     !   !   (*******************************
31320 1103   31   !     !   !   *                      +1 overrun
31330 1104   32   !     !   !   *                      +2 framing error
31340 1105   33   !     !   !   *  status = 0          +4 parity error
31350 1106   34   !     !   !   *                      +8 data set ready
31360 1107   35   !     !   !   *                     +16 ready for sending
31370 1108   36   !     !   !   *                     +32 data carrier detector
31380 1109   37   !     !   !   ********************************)
31390 1110   38   !     !   ! 
31400 1111   39   !     !   END;
31410 1112   40   !     ! return(ref);
31420 1113   41   !     END
31430 1114   42   END;
31440 1115         
\f

hjlaplst    81.05.04.   08.25.                                                    page    36

32010 1116          (********************************************************
32020 1117          *   initialization                                      *
32030 1118          *********************************************************)
32040 1119        
32050 1120        BEGIN
32060 1121    1   ! 
32070 1122    2   ! testopen(z, own.incname, opsem);
32080 1123    3   ! 
32090 1124    4   ! testout( z, version, al_env_version);
32100 1125    5   ! 
32110 1126    6   !   (*             create and start high level lamdriver *)
32120 1127    7   ! IF create( "highlevellam", highlevellamdriver(lamsem), driver, store ) = 0
32130 1128    8   !   THEN start(driver,prio)
32140 1129    9   !     (*q else
32150 1130   10   !     if test_b then
32160 1131   11   !     testout(z,"create error",0) q*) ;
32170 1132   12   ! 
32180 1133   13   !   (*             first buffer from lampool is used as a copy of channelmess *)
32190 1134   14   !   (*q if test_b then
32200 1135   15   !   testout(z, "lam-h start ", 0); q*)
32210 1136   16   ! 
32220 1137   17   ! alloc(ref,lampool,mainsem.s^);
32230 1138   18   ! 
32240 1139   19   ! IF (reservech(channelmessage, level,mask) + copychm(ref,channelmessage) <> 1) AND test_b THEN
32250 1140   20   !     (*q      testout(z,"res.ch error",reservech(channelmessage, level,mask)) q*) ;
32260 1141   21   !   (*             if reservation of channel went well, send copy of channelmess to lamdriver *)
32270 1142   22   ! signal(ref,lamsem);
32280 1143   23   ! 
32290 1144   24   !   (*             get one timeoutbuffer *)
32300 1145   25   ! alloc(ref,timerpool,mainsem.s^);
32310 1146   26   !   (*             delay is set to u3*2**u4 = 1 sec   *)
32320 1147   27   ! ref^.u1 := 6;
32330 1148   28   ! ref^.u3:=250; ref^.u4:=2;
32340 1149   29   !   (*             send to systemtimer *)
32350 1150   30   ! sendtimer(ref);
32360 1151   31   !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    37

33010 1152   32   !   (*             get rest of inputbuffers and send them to lamdriver *)
33020 1153   33   ! 
33030 1154   34   ! FOR channel_no:=2 TO no_of_lambufs DO
33040 1155   35   !   BEGIN
33050 1156   36   !   ! alloc(ref, lampool, mainsem.s^);
33060 1157   37   !   ! ref^.u1 := 6;
33070 1158   38   !   ! signal(ref,lamsem);
33080 1159   39   !   END;
33090 1160   40   ! 
33100 1161   41   !   (*             all devicedescriptors are initialized *)
33110 1162   42   ! 
33120 1163   43   ! FOR channel_no:=0 TO max_channel_no DO
33130 1164   44   !   WITH channel_descriptor( channel_no) DO
33140 1165   45   !     BEGIN
33150 1166   46   !     ! timeout := 0;
33160 1167   47   !     ! channel_kind := not_created;
33170 1168   48   !     ! interruptable := false;
33180 1169   49   !     ! reading_tty := false;
33190 1170   50   !     END;
33200 1171   51   !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    38

34010 1172   52   !   (********************************************************
34020 1173   53   !   *   level-0-lam                                         *
34030 1174   54   !   *                                                       *
34040 1175   55   !   *    sends output directly to the channel               *
34050 1176   56   !   *    handles inputbuffers from highlevel lamdriver      *
34060 1177   57   !   *                                                       *
34070 1178   58   !   *********************************************************)
34080 1179   59   ! 
34090 1180   60   ! REPEAT     (*  main loop  *)
34100 1181   61   ! !   (*                  wait for buffer on inputsemaphore *)
34110 1182   62   ! ! 
34120 1183   63   ! ! wait(ref,mainsem.w^);
34130 1184   64   ! !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    39

35010 1185   65   ! ! IF ownertest(lampool,ref) THEN
35020 1186   66   ! !   BEGIN
35030 1187   67   ! !   !   (*q if test_b then
35040 1188   68   ! !   !   testout( z, "interrupt on", ref^.u4); q*)
35050 1189   69   ! !   ! 
35060 1190   70   ! !   ! WITH channel_descriptor(ref^.u4) DO
35070 1191   71   ! !   !   
35080 1192   72   ! !   !   IF interruptable THEN
35090 1193   73   ! !   !     IF (NOT nil(request)) OR (channel_kind>=echo_nl_on_channel) THEN
35100 1194   74   ! !   !       BEGIN
35110 1195   75   ! !   !       ! status := ref^.u2;
35120 1196   76   ! !   !       ! IF status = write_read_ok THEN
35130 1197   77   ! !   !       !   handle_ok_lam_int(ref^.u3, ref^.u4)
35140 1198   78   ! !   !       ! ELSE
35150 1199   79   ! !   !       !   BEGIN
35160 1200   80   ! !   !       !   ! stop_actual_request
35170 1201   81   ! !   !       !   ! (3*8 + transient_error,ref^.u4);
35180 1202   82   ! !   !       !   ! set_lam_control( ref^.u4);
35190 1203   83   ! !   !       !   !   <*
35200 1204   84   ! !   !       !   !   END
35210 1205   85   ! !   !       !   !   OTHERWISE
35220 1206   86   ! !   !       !   !   BEGIN
35230 1207   87   ! !   !       !   !   stop_actual_request
35240 1208   88   ! !   !       !   !   (persistent_error, ref^.u4);
35250 1209   89   ! !   !       !   !   status := ref^.u2;
35260 1210   90   ! !   !       !   !   start_new_channel(ref^.u4);
35270 1211   91   ! !   !       !   !   (*q if test_b then
35280 1212   92   ! !   !       !   !   testout(z,"hwstatus= 8.",((ref^.u2 div 8)*10+(ref^.u2 mod 8))*100+ref^.u4); q*)
35290 1213   93   ! !   !       !   !   *>
35300 1214   94   ! !   !       !   END;
35310 1215   95   ! !   !       END;
35320 1216   96   ! !   ! 
35330 1217   97   ! !   ! signal(ref,lamsem);
35340 1218   98   ! !   END
35350 1219   99   ! !    
\f

hjlaplst    81.05.04.   08.25.                                                    page    40

36010 1220  100   ! ! ELSE
36020 1221  101   ! !     (*          it is a timeoutbuffer from systemtimer *)
36030 1222  102   ! !   IF ownertest(timerpool,ref) THEN
36040 1223  103   ! !     BEGIN
36050 1224  104   ! !     ! ref^.u3:=250; ref^.u4:=2;
36060 1225  105   ! !     ! sendtimer(ref);
36070 1226  106   ! !     ! FOR channel_no:=0 TO 31 DO WITH channel_descriptor(channel_no) DO
36080 1227  107   ! !     !     IF timeout>0 THEN
36090 1228  108   ! !     !       BEGIN
36100 1229  109   ! !     !       ! timeout:=timeout-1;
36110 1230  110   ! !     !       ! IF timeout=0 THEN
36120 1231  111   ! !     !       !   IF request^.u1=read_tty THEN
36130 1232  112   ! !     !       !     IF NOT nil(channel_descriptor(channel_no-1).request) THEN
36140 1233  113   ! !     !       !       BEGIN
36150 1234  114   ! !     !       !       ! channel_descriptor(channel_no-1).reading_tty := false;
36160 1235  115   ! !     !       !       ! start_next_request(channel_no-1);
36170 1236  116   ! !     !       !       ! 
36180 1237  117   ! !     !       !       ! LOCK request AS buf:drvbuffer DO
36190 1238  118   ! !     !       !       !   BEGIN
36200 1239  119   ! !     !       !       !   ! IF channel_descriptor(channel_no).next>buf.first THEN
36210 1240  120   ! !     !       !       !   !   outword( packed_word( 60, channel_no), channelmessage)
36220 1241  121   ! !     !       !       !   ! ELSE
36230 1242  122   ! !     !       !       !   !   outword( packed_word(del, channel_no), channelmessage);
36240 1243  123   ! !     !       !       !   END
36250 1244  124   ! !     !       !       END
36260 1245  125   ! !     !       !     ELSE
36270 1246  126   ! !     !       !       stop_actual_request
36280 1247  127   ! !     !       !       ( timeout_err, channel_no)
36290 1248  128   ! !     !       !     ELSE
36300 1249  129   ! !     !       !       BEGIN
36310 1250  130   ! !     !       !       ! stop_actual_request
36320 1251  131   ! !     !       !       ! ( timeout_err, channel_no);
36330 1252  132   ! !     !       !       ! IF channel_no MOD 2 = 0 THEN start_new_channel ( channel_no)
36340 1253  133   ! !     !       !       END;
36350 1254  134   ! !     !       END;
36360 1255  135   ! !     END
36370 1256  136   ! !      
\f

hjlaplst    81.05.04.   08.25.                                                    page    41

37010 1257  137   ! !   ELSE
37020 1258  138   ! !       (*                   it is a delaybuffer from systemtimer *)
37030 1259  139   ! !     IF ownertest( delaypool, ref) THEN
37040 1260  140   ! !       BEGIN
37050 1261  141   ! !       ! channel_no:=ref^.u1 DIV 2;
37060 1262  142   ! !       ! WITH channel_descriptor(channel_no) DO
37070 1263  143   ! !       !   BEGIN
37080 1264  144   ! !       !   ! 
37090 1265  145   ! !       !   ! CASE (ref^.u1 MOD 2) OF
37100 1266  146   ! !       !   ! ! 0:
37110 1267  147   ! !       !   ! !   BEGIN
37120 1268  148   ! !       !   ! !   !   (*q if test_b then
37130 1269  149   ! !       !   ! !   !   testout( z, "end-rts-dlay", channel_no); q*)
37140 1270  150   ! !       !   ! !   ! channel_kind:=at_write_channel;
37150 1271  151   ! !       !   ! !   ! interruptable := true;
37160 1272  152   ! !       !   ! !   ! handle_ok_lam_int( 0,channel_no);
37170 1273  153   ! !       !   ! !   END;
37180 1274  154   ! !       !   ! ! 1:
37190 1275  155   ! !       !   ! !   BEGIN
37200 1276  156   ! !       !   ! !   !   (*q if test_b then
37210 1277  157   ! !       !   ! !   !   testout( z, "end-rtr-dlay", channel_no); q*)
37220 1278  158   ! !       !   ! !   ! IF request^.u1 = write_at THEN stop_actual_request
37230 1279  159   ! !       !   ! !   !   ( ok_result, channel_no)
37240 1280  160   ! !       !   ! !   ! ELSE stop_actual_request
37250 1281  161   ! !       !   ! !   !   ( go_on_read, channel_no);
37260 1282  162   ! !       !   ! !   END;
37270 1283  163   ! !       !   ! ! OTHERWISE (*q testout( z, "timer fault ", channel_no) q*);
37280 1284  164   ! !       !   ! END;
37290 1285  165   ! !       !   ! 
37300 1286  166   ! !       !   ! release(ref);
37310 1287  167   ! !       !   END
37320 1288  168   ! !       END
37330 1289  169   ! !       
37340 1290  170   ! !     ELSE
37350 1291  171   ! !       IF ref^.u3 = dummy_route THEN  return ( ref)
37360 1292  172   ! !          
\f

hjlaplst    81.05.04.   08.25.                                                    page    42

38010 1293  173   ! !       ELSE
38020 1294  174   ! !           (*       it is a userbuffer *)
38030 1295  175   ! !         
38040 1296  176   ! !         BEGIN
38050 1297  177   ! !         !   (*       devicenumber is equal to portno *2  *)
38060 1298  178   ! !         ! channel_no:=ref^.u2 * 2;
38070 1299  179   ! !         ! 
38080 1300  180   ! !         !   (*       if command is pure read the devicenumber is uneven *)
38090 1301  181   ! !         ! IF ref^.u1 MOD 4 = 1 THEN channel_no:=channel_no+1;
38100 1302  182   ! !         ! 
38110 1303  183   ! !         ! CASE ref^.u1 OF
38120 1304  184   ! !         ! ! 
38130 1305  185   ! !         ! ! create_at_ch:
38140 1306  186   ! !         ! !   BEGIN
38150 1307  187   ! !         ! !   ! createchannel(at_write_channel, at_read_channel);
38160 1308  188   ! !         ! !   ! start_new_channel(channel_no);
38170 1309  189   ! !         ! !   END;
38180 1310  190   ! !         ! ! 
38190 1311  191   ! !         ! ! create_alc_ch:
38200 1312  192   ! !         ! !   BEGIN
38210 1313  193   ! !         ! !   ! createchannel(alc_write_channel, alc_read_channel);
38220 1314  194   ! !         ! !   ! start_new_channel(channel_no);
38230 1315  195   ! !         ! !   END;
38240 1316  196   ! !         ! ! 
38250 1317  197   ! !         ! ! create_tty_ch:
38260 1318  198   ! !         ! !   BEGIN
38270 1319  199   ! !         ! !   ! createchannel(tty_write_channel, tty_read_channel);
38280 1320  200   ! !         ! !   ! channel_descriptor(channel_no).interruptable:=true;
38290 1321  201   ! !         ! !   ! channel_descriptor(channel_no+1).interruptable:=true;
38300 1322  202   ! !         ! !   ! start_new_channel(channel_no);
38310 1323  203   ! !         ! !   END;
38320 1324  204   ! !         ! ! 
38330 1325  205   ! !         ! ! 
38340 1326  206   ! !         ! !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    43

39010 1327  207   ! !         ! ! read_at, write_at, write_read_at :
39020 1328  208   ! !         ! !   
39030 1329  209   ! !         ! !   WITH channel_descriptor(channel_no) DO
39040 1330  210   ! !         ! !     IF (channel_kind<at_write_channel) OR (channel_kind > at_read_wait) THEN
39050 1331  211   ! !         ! !       BEGIN
39060 1332  212   ! !         ! !       ! ref^.u2 := illegal_function;
39070 1333  213   ! !         ! !       ! return( ref)
39080 1334  214   ! !         ! !       END
39090 1335  215   ! !         ! !     ELSE
39100 1336  216   ! !         ! !       IF NOT nil(request) THEN signal(ref,queue(channel_no))
39110 1337  217   ! !         ! !       ELSE
39120 1338  218   ! !         ! !         BEGIN
39130 1339  219   ! !         ! !         ! request:=:ref;
39140 1340  220   ! !         ! !         ! start_next_request(channel_no);
39150 1341  221   ! !         ! !         END;
39160 1342  222   ! !         ! !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    44

40010 1343  223   ! !         ! ! alc_read, alc_write, write_alc_read :
40020 1344  224   ! !         ! !   
40030 1345  225   ! !         ! !   BEGIN
40040 1346  226   ! !         ! !   ! IF ref^.u3 >= command THEN
40050 1347  227   ! !         ! !   !   BEGIN
40060 1348  228   ! !         ! !   !   ! LOCK ref AS buf : drvbuffer DO
40070 1349  229   ! !         ! !   !   !   BEGIN
40080 1350  230   ! !         ! !   !   !   ! i := buf.first;
40090 1351  231   ! !         ! !   !   !   ! j := buf.last;
40100 1352  232   ! !         ! !   !   !   END;
40110 1353  233   ! !         ! !   !   ! k:= ref^.size;
40120 1354  234   ! !         ! !   !   ! 
40130 1355  235   ! !         ! !   !   ! IF (i<6) OR (j<i) OR (j > (k-1+k)) THEN
40140 1356  236   ! !         ! !   !   !   BEGIN
40150 1357  237   ! !         ! !   !   !   !   (*q if test_b then
40160 1358  238   ! !         ! !   !   !   !   testout( z,"buffer small", ref^.size); q*)
40170 1359  239   ! !         ! !   !   !   ! ref^.u2:=buffer_too_small;
40180 1360  240   ! !         ! !   !   !   ! return( ref);
40190 1361  241   ! !         ! !   !   !   END;
40200 1362  242   ! !         ! !   !   END;
40210 1363  243   ! !         ! !   ! 
40220 1364  244   ! !         ! !   ! 
40230 1365  245   ! !         ! !   ! IF NOT nil( ref) THEN
40240 1366  246   ! !         ! !   !   WITH channel_descriptor(channel_no) DO
40250 1367  247   ! !         ! !   !     IF (channel_kind<alc_write_channel) OR (channel_kind>alc_read_channel) THEN
40260 1368  248   ! !         ! !   !       BEGIN
40270 1369  249   ! !         ! !   !       ! ref^.u2:=illegal_function;
40280 1370  250   ! !         ! !   !       ! return( ref);
40290 1371  251   ! !         ! !   !       END
40300 1372  252   ! !         ! !   !     ELSE
40310 1373  253   ! !         ! !   !       BEGIN
40320 1374  254   ! !         ! !   !       ! 
40330 1375  255   ! !         ! !   !       ! IF NOT nil(request) THEN signal( ref, queue(channel_no))
40340 1376  256   ! !         ! !   !       ! ELSE
40350 1377  257   ! !         ! !   !       !   BEGIN
40360 1378  258   ! !         ! !   !       !   ! request :=: ref;
40370 1379  259   ! !         ! !   !       !   ! start_next_request(channel_no);
40380 1380  260   ! !         ! !   !       !   ! IF channel_kind=alc_write_channel THEN handle_ok_lam_int(0,channel_no);
40390 1381  261   ! !         ! !   !       !   END;
40400 1382  262   ! !         ! !   !       END
40410 1383  263   ! !         ! !   END;
40420 1384  264   ! !         ! !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    45

41010 1385  265   ! !         ! ! read_tty:
41020 1386  266   ! !         ! !   
41030 1387  267   ! !         ! !   WITH channel_descriptor(channel_no) DO
41040 1388  268   ! !         ! !     IF channel_kind < tty_write_channel THEN
41050 1389  269   ! !         ! !       BEGIN
41060 1390  270   ! !         ! !       ! ref^.u2:=illegal_function;
41070 1391  271   ! !         ! !       ! return(ref);
41080 1392  272   ! !         ! !       END
41090 1393  273   ! !         ! !     ELSE
41100 1394  274   ! !         ! !       BEGIN
41110 1395  275   ! !         ! !       ! LOCK ref AS buf : drvbuffer DO
41120 1396  276   ! !         ! !       !   BEGIN
41130 1397  277   ! !         ! !       !   ! i:= buf.first;
41140 1398  278   ! !         ! !       !   ! j:= buf.last;
41150 1399  279   ! !         ! !       !   END;
41160 1400  280   ! !         ! !       ! IF (j<i)
41170 1401  281   ! !         ! !       !   OR (i<1)
41180 1402  282   ! !         ! !       !   OR (j-i >= 2*ref^.size-6) THEN
41190 1403  283   ! !         ! !       !   BEGIN
41200 1404  284   ! !         ! !       !   ! ref^.u2 := illegal_function;
41210 1405  285   ! !         ! !       !   ! return( ref);
41220 1406  286   ! !         ! !       !   END;
41230 1407  287   ! !         ! !       ! 
41240 1408  288   ! !         ! !       ! IF NOT nil( ref) THEN
41250 1409  289   ! !         ! !       !   IF NOT nil ( request) THEN signal ( ref, queue(channel_no))
41260 1410  290   ! !         ! !       !   ELSE
41270 1411  291   ! !         ! !       !     BEGIN   (*  start now  *)
41280 1412  292   ! !         ! !       !     ! request :=: ref;
41290 1413  293   ! !         ! !       !     !   (*   look if write_tty is going on  *)
41300 1414  294   ! !         ! !       !     ! IF nil(channel_descriptor(channel_no-1).request) THEN
41310 1415  295   ! !         ! !       !     !   start_next_request(channel_no)
41320 1416  296   ! !         ! !       !     END;
41330 1417  297   ! !         ! !       END;
41340 1418  298   ! !         ! !  
\f

hjlaplst    81.05.04.   08.25.                                                    page    46

42010 1419  299   ! !         ! ! write_tty:
42020 1420  300   ! !         ! !   
42030 1421  301   ! !         ! !   WITH channel_descriptor(channel_no) DO
42040 1422  302   ! !         ! !     IF channel_kind<tty_write_channel THEN
42050 1423  303   ! !         ! !       BEGIN
42060 1424  304   ! !         ! !       ! ref^.u2:=illegal_function;
42070 1425  305   ! !         ! !       ! return(ref);
42080 1426  306   ! !         ! !       END
42090 1427  307   ! !         ! !     ELSE
42100 1428  308   ! !         ! !       BEGIN
42110 1429  309   ! !         ! !       ! LOCK ref AS buf : drvbuffer DO
42120 1430  310   ! !         ! !       !   BEGIN
42130 1431  311   ! !         ! !       !   ! i := buf.first;
42140 1432  312   ! !         ! !       !   ! j := buf.last;
42150 1433  313   ! !         ! !       !   ! buf.next:=buf.first;
42160 1434  314   ! !         ! !       !   END;
42170 1435  315   ! !         ! !       ! IF (j<i)
42180 1436  316   ! !         ! !       !   OR (i<1)
42190 1437  317   ! !         ! !       !   OR (j-i >= 2*ref^.size-6) THEN
42200 1438  318   ! !         ! !       !   BEGIN
42210 1439  319   ! !         ! !       !   ! ref^.u2 := illegal_function;
42220 1440  320   ! !         ! !       !   ! return( ref);
42230 1441  321   ! !         ! !       !   END;
42240 1442  322   ! !         ! !       ! IF NOT nil( ref) THEN
42250 1443  323   ! !         ! !       !   IF NOT nil (request) THEN
42260 1444  324   ! !         ! !       !     signal ( ref, queue(channel_no))
42270 1445  325   ! !         ! !       !   ELSE
42280 1446  326   ! !         ! !       !     BEGIN
42290 1447  327   ! !         ! !       !     ! request :=: ref;
42300 1448  328   ! !         ! !       !     !   (*   look if read_tty is going on   *)
42310 1449  329   ! !         ! !       !     ! 
42320 1450  330   ! !         ! !       !     ! IF channel_kind <> tty_wait_input THEN
42330 1451  331   ! !         ! !       !     !   IF reading_tty THEN
42340 1452  332   ! !         ! !       !     !     WITH channel_descriptor(channel_no+1) DO
42350 1453  333   ! !         ! !       !     !       LOCK request AS buf:drvbuffer DO
42360 1454  334   ! !         ! !       !     !         BEGIN
42370 1455  335   ! !         ! !       !     !         ! IF next>buf.first THEN
42380 1456  336   ! !         ! !       !     !         !   timeout:=normal_time
42390 1457  337   ! !         ! !       !     !         ! ELSE
42400 1458  338   ! !         ! !       !     !         !   timeout:=no_time
42410 1459  339   ! !         ! !       !     !         END
42420 1460  340   ! !         ! !       !     !       ELSE
42430 1461  341   ! !         ! !       !     !         BEGIN
42440 1462  342   ! !         ! !       !     !         ! start_next_request(channel_no);
42450 1463  343   ! !         ! !       !     !         ! IF NOT nil( request) THEN
42460 1464  344   ! !         ! !       !     !         !   handle_ok_lam_int ( 0, channel_no);
\f

hjlaplst    81.05.04.   08.25.                                                    page    47

42470 1465  345   ! !         ! !       !     !         END;
42480 1466  346   ! !         ! !       !     END;
42490 1467  347   ! !         ! !       END
42500 1468  348   ! !         ! !        
\f

hjlaplst    81.05.04.   08.25.                                                    page    48

43010 1469  349   ! !         ! !       OTHERWISE
43020 1470  350   ! !         ! !       BEGIN
43030 1471  351   ! !         ! !       !   (*q if test_b then
43040 1472  352   ! !         ! !       !   testout ( z, "unknown     ", ref^.u1); q*)
43050 1473  353   ! !         ! !       ! ref^.u2:=illegal_function;
43060 1474  354   ! !         ! !       ! return(ref);
43070 1475  355   ! !         ! !       END
43080 1476  356   ! !         ! END;
43090 1477  357   ! !         ! 
43100 1478  358   ! !         END   (*  user request  *)
43110 1479  359   ! !         
43120 1480  360   ! UNTIL  forever
43130 1481  361   ! 
43140 1482  362   END.     (*  lam driver   *)
43150 1483      
\f

hjlaplst    81.05.04.   08.25.                                                    page    49

           0   33*   69*  154*  156*  166*  174*  183*  223*  291*  307   381   483   526   671   698 
              764   847   872  1053* 1055* 1089  1127  1163  1166  1226  1227  1230  1252  1266: 1272 
             1380  1464 
           1   30*   43*   70*  166*  204*  284   300   303   308   365   374   391   446   447   451 
              453   454   487   490   496   497   505   506   561   633   652   664:  674   692   696 
              697   700   702   716   754:  781   785   844   850   851   863   870   884   889   903 
              907   911   917   920   922   924   928   936   942   948   958   974   985  1005  1045*
             1139  1229  1232  1234  1235  1274: 1301  1301  1321  1355  1401  1414  1436  1452 
           2   30*   34*   71*   95*  115*  264   284   299   300   302   303   343   354   382   427 
              534   535   666   668:  758   761:  925  1089  1148  1154  1224  1252  1261  1265  1298 
             1402  1437 
           3   72*   96*  578   673   677:  765   768: 1053* 1201 
           4   42*   73*  681   686:  728   772   776: 1301 
           5   50*   65*   74*   87*   90*  673   698   703   706:  765   786   791:
           6   75*  118*  692   718   722:  781   794   799:  884   887   887   917   942   946   946 
              974  1147  1157  1355  1402  1437 
           7   41*   49*   76*  174*  803   808:
           8   77*   97*  115*  578   703   728  1201 
           9   78*
          10   40*   79*   86*   98*  393 
          11   80*
          12   81*
          13   89*   99*
          15   29*  183*  291*
          16  203*
          19   65*  100*
          20   65*
          21   65*
          24   57* 1044*
          27  101*
          28   65*  105*
          29   65*
          31 1055* 1226 
          32   37*   49*   50*  102*  578 
          40   53* 1046*
          41   54*
          44   55*
          45   56*
          60 1240 
          64 1096 
         127  103*
         128  307 
         200   35*
         250 1148  1224 
\f

hjlaplst    81.05.04.   08.25.                                                    page    50

         255 1047*
         256  354   427   472   535   741   824 
alc_read       62* 1343:
alc_read_channel                                                 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               75*  392   459   658: 1313  1367 
alc_write      61* 1343:
alc_write_channel                                                <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               74*  459   745: 1313  1367  1380 
alfa          230*  233*
alloc         261   281  1137  1145  1156 
al_env_version                                                   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
             1124 
as            305:  371:  387:  623:  645:  690:  712:  769:  779:  849:  882:  905:  915:  940:  972:
             1237: 1348: 1395: 1429: 1453:
atbuffer      165*  305   623   645 
at_read_channel                                                  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               72*  642: 1307 
at_read_wait   73*  421   425:  437  1330 
at_write_channel                                                 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               70*  351   418:  429   536   607: 1270  1307  1330 
at_write_wait                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               71*  359 
boolean       185*  186*  222*  568* 1054*
bs             97*  902:  908 
buf           305:  307   308   371:  373   374   387:  389   389   623:  632   645:  646=  690:  695 
              695   696   696   699   699   712:  714   714   769:  771   771   779:  784   784   785 
              785   786   786   849:  851   853   882:  888   891   905:  906   915:  921   924   925 
              928   940:  947   950   972:  984   987  1237: 1239  1348: 1350  1351  1395: 1397  1398 
             1429: 1431  1432  1433  1433  1453: 1455 
buffer_too_small                                                 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              117* 1359 
byte          166*  173*  184*  219*  249*  407*  519*  585*  692   781   884   917   942   974  1052*
c             338*  354=  355   409*  427=  428   532*  535=  537=  537   539=  539   541 
channel      1077 
channelmessage                                                   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              196*  355   428   541   576   632   823   857   897   908   929   955   984  1003  1011 
             1018  1059* 1074  1077  1080  1082  1095  1139  1139  1240  1242 
channelrecord                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              180*  214*
channelset    154*  175*  214*  216*  249*  337*  407*  519*  531*  544*  568*  585*
channel_descriptor                                               <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              214*  299   300   302   303   340   365   414   437   446   447   453   453   458   474 
              478   481   487   490   496   505   536   554   556   562   574   603   844   863   873 
              878   903   911   920   936   958  1164  1190  1226  1232  1234  1239  1262  1320  1321 
             1329  1366  1387  1414  1421  1452 
\f

hjlaplst    81.05.04.   08.25.                                                    page    51

channel_kind  183*  299=  300=  351   359=  364   392   416   421=  429=  437   459   459   485   501 
              536   605   848=  856=  899=  920= 1006= 1012= 1019= 1167= 1193  1270= 1330  1330  1367 
             1367  1380  1388  1422  1450 
channel_no    209*  249*  254*  264   274*  284   337*  340   343   354   354   358   365   407*  414 
              420   427   427   437   446   447   451   453   453   454   458   474   478   481   484 
              487   490   492   496   497   505   506   509   513   519*  527   531*  534=  534   534 
              535   535   536   544*  553   554   556   559   561=  561   562   565   568*  574   576 
              585*  603   615   617   632   655   703   728   735   811   823   844   857   858   863 
              870   873   874   878   895   897   903   908   911   920   929   936   954   955   958 
              984   991  1003  1005  1011  1018  1154= 1163= 1164  1226= 1226  1232  1234  1235  1239 
             1240  1242  1247  1251  1252  1252  1261= 1262  1272  1279  1281  1298= 1301= 1301  1308 
             1314  1320  1321  1322  1329  1336  1340  1366  1375  1379  1380  1387  1409  1414  1415 
             1421  1444  1452  1462  1464 
checksum      187*  671=  725   741=  741   764=  802   824=  824 
command       105*  386   673   711   765  1346 
control       236*  355   428   541 
controlclr   1063* 1080 
controle_byte                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              219*  307=  354   427   535 
copychm       227* 1139 
cr             99*  857   897   910:  929  1011 
create       1127 
createchannel                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              291* 1307  1313  1319 
create_alc_ch                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               64* 1311:
create_at_ch 1305:
create_done   116*  559   565   868 
create_it_ch   64*
create_tty_ch                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
             1317:
cs            100*  862:  888 
data          173*  525= 1052* 1099 
databits      519*  525 
dataword     1050* 1060* 1066*
data_byte     585*  646   666   670   672   673   680   695   709   725   741   757=  763=  765   771=
              784=  793=  802=  823   824   840   921   947   955 
del           103*  902: 1242 
delaypool     203*  261   281  1259 
driver        198* 1127  1128 
drvbuffer     159*  371   387   712   769   849   905  1237  1348  1395  1429  1453 
dummy_route  1291 
echo_nl_on_channel                                               <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               78*  899   920  1000: 1193 
\f

hjlaplst    81.05.04.   08.25.                                                    page    52

error        1054* 1093 
esc           101*  842:
etx            96*  709   793 
external      227*  230*  233*  236*  239*  243* 1063* 1066* 1069*
false          45*  490   496   512   581  1168  1169  1234 
first         161*  389   691:  714   771   780:  883:  906   916:  941:  973: 1239  1350  1397  1431 
             1433  1455 
forever        45* 1480 
go_on_read    118*  440   615  1281 
handle_ok_lam_int                                                <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              585* 1197  1272  1380  1464 
highlevellamdriver                                               <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
             1041* 1127 
i             221*  296*  298=  299   300   302   303   307   308   689=  692   692   778=  781   781 
              880=  884   884   887   887   887   887   913=  917   917   938=  942   942   946   946 
              946   946   970=  974   974  1350= 1355  1355  1397= 1400  1401  1402  1431= 1435  1436 
             1437 
illegal_function                                                 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              114*  117* 1332  1369  1390  1404  1424  1439  1473 
ill_func      114*
incname      1122 
indata       1060* 1082  1086 
info          692:  695=  781:  784 
integer         4*    5*  161*  187*  190*  191*  209*  221*  223*  227*  233*  236*  243*  243*  254*
              274*  296*  338*  409*  532*  691   780   883   916   941   973  1061* 1063* 1069* 1069*
interruptable                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              185*  366=  512= 1168= 1192  1271= 1320= 1321=
interrupt_ok 1046* 1088 
inword       1066* 1082 
j             221* 1351= 1355  1355  1398= 1400  1402  1432= 1435  1437 
k             221* 1353= 1355  1355 
lam             2*
lampool       206* 1137  1156  1185 
lamsem        200* 1041* 1074  1084  1127  1142  1158  1217 
lamword       171*  239*  519*  523*
last          161*  374   691:  699   771   780:  786   883:  916:  941:  973: 1351  1398  1432 
level           5* 1139 
lock          305:  371:  387:  623:  645:  690:  712:  769:  779:  849:  882:  905:  915:  940:  972:
             1237: 1348: 1395: 1429: 1453:
long_time      40*
mainsem         6*  261   281  1137  1145  1156  1183 
mask           33* 1139 
max_channel_no                                                   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               30*  154* 1163 
\f

hjlaplst    81.05.04.   08.25.                                                    page    53

max_port_no    29*   30*  156*
next          161*  189*  373=  373   381=  389=  609   632   633=  633   646   652=  652   653   680=
              691:  695   696=  696   697=  697   698   699   714=  780:  784   785=  785   786   850 
              851=  851   853=  853   883:  887   887=  888   889=  889   890   891=  891   893   906 
              907=  907   916:  921   922   924   925=  925   928=  928   941:  946   946=  947   948=
              948   949   950=  950   952   973:  984   985=  985   986   987=  987   989  1239  1433=
             1455 
nl             98*  924  1003  1018 
normal_time    41*  959   960  1456 
not_created    69* 1167 
no_input     1047* 1091 
no_of_lambufs                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               37*  206* 1154 
no_time        43* 1458 
ok_result     311   617   655   735   811   895   954   991  1005  1279 
old_result    184*  422=  430   670=  732 
opsem           3* 1122 
op_codes       65*  672 
outword       239*  632   823   857   897   908   929   955   984  1003  1011  1018  1240  1242 
overrun        54*
overrun_and_parity                                               <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               56*
own          1122 
ownertest    1185  1222  1259 
packed_word   519*  528=  632   823   857   897   908   929   955   984  1003  1011  1018  1240  1242 
parity         55*
persistent_error                                                 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              113*
persi_err     113*
pool          203*  204*  206*
portset       156*  219*
port_and_bit15                                                   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              175*  527= 1055* 1089  1095  1100 
prio           34* 1128 
process         2* 1041*
pu              4*
queue         216*  451   484   870  1336  1375  1409  1444 
reading_tty   186*  365=  490=  496=  845   864   903   911   936   958   965  1004  1169= 1234= 1451 
readytoread    50*  427   537 
readytosend    57* 1044*
ready_to_send                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              568*  579=  581=
read_at      1327:
read_it        62*
\f

hjlaplst    81.05.04.   08.25.                                                    page    54

read_tty     1231  1385:
ref           196*  259*  261   262   263   264   267   279*  281   282   283   284   287   298   305:
              311   312  1059* 1084  1086  1112  1137  1139  1142  1145  1147  1148  1148  1150  1156 
             1157  1158  1183  1185  1190  1195  1197  1197  1201  1202  1217  1222  1224  1224  1225 
             1259  1261  1265  1286  1291  1291  1298  1301  1303  1332  1333  1336  1339  1346  1348:
             1353  1359  1360  1365  1369  1370  1375  1378  1390  1391  1395: 1402  1404  1405  1408 
             1409  1412  1424  1425  1429: 1437  1439  1440  1442  1444  1447  1473  1474 
reference     182*  196*  227*  236*  239*  243*  259*  279* 1059* 1063* 1066* 1069*
release      1286 
request       182*  369   371:  379   386   387:  446   449   450   451   453=  453   472   474   478 
              484   487   489   503   505   512   557   563   613   623:  645:  689   690:  711   712:
              732   763   769:  778   779:  849:  866   868   869   870   873   880   882:  905:  913 
              915:  938   940:  970   972: 1193  1231  1232  1237: 1278  1336  1339= 1375  1378= 1409 
             1412= 1414  1443  1447= 1453: 1463 
requesttosend                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               49*  354   539 
reservech    1139 
result        249*  407*  422   430=  440   474 
return        312   450   478   869  1112  1291  1333  1360  1370  1391  1405  1425  1440  1474 
rtr_delay_u3   89*  282 
rtr_delay_u4   90*  283 
rts_delay_u3   86*  262 
rts_delay_u4   87*  263 
r_kind        291*  300 
s             261   281  1137  1145  1156 
semaphore     200*  216*  230* 1041*
sempointer      3*
sendtimer     267   287  1150  1225 
sense         243*  576  1069* 1095 
sensesem      451   484   870 
set_lam_control                                                  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              531*  553  1202 
shadow        198*
short_time     42*
signal       1142  1158  1217  1336  1375  1409  1444 
size          689   778   880   913   938   970  1353  1402  1437 
sp            102*
start        1128 
startscanner 1045* 1080 
start_new_channel                                                <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              544* 1252  1308  1314  1322 
start_next_request                                               <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              337*  454   492   497   506   509   513   858   874  1235  1340  1379  1415  1462 
start_rtr_delay                                                  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              274*  420 
\f

hjlaplst    81.05.04.   08.25.                                                    page    55

start_rts_delay                                                  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              254*  358 
status        191*  302=  303=  472   554=  576   578  1061* 1095  1096  1195= 1196 
std           174*  526=
stop_actual_request                                              <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              248*  406*  558   564   614   616   654   703   727   734   810   894   953   990  1005 
             1200  1246  1250  1278  1280 
store          35* 1127 
stx            95*  666   757 
testopen      230* 1122 
testout       233* 1124 
test_b        222* 1139 
text          884:  888=  917:  921=  924=  942:  947=  974:  984 
time          219*  308=  343 
timeout       188*  343=  393=  393   483=  847=  872=  959   960= 1166= 1227  1229= 1229  1230  1456=
             1458=
timeout_err  1247  1251 
timerpool     204* 1145  1222 
top           190*  374=  382=  391=  609   653   662   666=  673=  673=  674=  681=  698=  700=  702 
              716=  718=  752   758=  765=  765=  772=  786=  794=  803=  890   893   922   949   952 
              986   989 
transient_error                                                  <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              112*  115*  703   728  1201 
transi_err    112*
true          365   366   579  1078  1271  1320  1321 
tst           223*
ts_pointer      6*
tty_read_channel                                                 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               77*  364   485   829: 1319 
tty_wait_cr    79*  848  1009:
tty_wait_input                                                   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               81* 1019  1023: 1450 
tty_wait_nl    80*  856  1012  1016:
tty_write_channel                                                <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               76*  501   963: 1006  1319  1388  1422 
u1            264=  284=  369   379   613  1147= 1157= 1231  1261  1265  1278  1301  1303 
u2            298   311=  449=  474=  868= 1088= 1096= 1195  1298  1332= 1359= 1369= 1390= 1404= 1424=
             1439= 1473=
u3            262=  282=  386   711   732=  763  1091= 1099= 1148= 1197  1224= 1291  1346 
u4            263=  283=  472= 1100= 1148= 1190  1197  1201  1202  1224=
unused       1053*
version        27* 1124 
w             523*  525   526   527   528  1183 
wait         1074  1084  1183 
\f

hjlaplst    81.05.04.   08.25.                                                    page    56

write_alc_read                                                   <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               63*  369  1343:
write_at     1278  1327:
write_error   115*
write_it       61*
write_read_at                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              379   613  1327:
write_read_it                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               63*
write_read_mixed                                                 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
              116*  449 
write_read_ok                                                    <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
               53*  302   303   554  1196 
write_tty    1419:
w_kind        291*  299 
x             227*  230*  233*  236*  239*  243* 1063* 1066* 1069*
y             227*  230*  233*  236*  239*  243* 1063* 1066* 1069*
z             211*  230*  233*  243* 1069* 1122  1124 
zone          211*  230*  233*
\f

hjlaplst    81.05.04.   08.25.                                                    page    57

AND                1
ARRAY             10
BEGIN            123
CASE               7
CONST              2
DIV                6
DO                51
ELSE              45
END              140
FOR                3
FORWARD            1
FUNCTION           3
IF                93
IN                 1
MOD               11
NIL               21
NOT               19
OF                17
OR                10
OTHERWISE          5
PACKED             2
PROCEDURE         17
RECORD            10
REPEAT             1
THEN              93
TO                 3
TYPE               2
UNTIL              1
VAR               23
WHILE              5
WITH              22
81.05.04.      08.25.                         pascal80     version 1981.04.01


   name        headline beginline endline  appetite(words) 

   start_rts_de   259       261     268  :      18            
   start_rtr_de   279       281     288  :      18            
   createchanne   296       298     319  :      12            
   start_next_r   338       340     396  :      14            
   stop_actual_   409       414     516  :      15            
   packed_word    523       525     529  :       6            
   set_lam_cont   532       534     542  :       6            
   start_new_ch   552       553     566  :      15            
   ready_to_sen   573       574     583  :       7            
   handle_ok_la   599       603    1030  :      70            
   highlevellam  1044      1074    1114  :      77            
   lam             27      1122    1482  :     647            

 code: 1 . 2000  = 10000 bytes


end of PASCAL80 compilation 

end
blocksread = 53
▶EOF◀