1 * ***********************************************************
  2 * *                                                         *
  3 * * Copyright, (C) Honeywell Information Systems Inc., 1982 *
  4 * *                                                         *
  5 * * Copyright (c) 1972 by Massachusetts Institute of        *
  6 * * Technology and Honeywell Information Systems, Inc.      *
  7 * *                                                         *
  8 * ***********************************************************
  9 
 10           lbl       ,sim_tables
 11           ttl       sim_tables -- to control sync line simulator
 12           pcc       off
 13           pmc       off
 14 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 15 *
 16 *         sim_tables
 17 *
 18 *         these tables implement the protocol of the
 19 *         sync line simulator designed for the usgs benchmark.
 20 *         the simulator is based on the vip7700 protocol.
 21 *
 22 *         these cannot be used with the g115 protocol since they
 23 *         share the same line type, 6.
 24 *
 25 *         coded by adsit and grady for usgs.
 26 *
 27 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 28           rem
 29 sim       null
 30           rem
 31           symdef    sim
 32           symdef    gstar
 33           rem
 34           symref    begin
 35           symref    error
 36           symref    hanga
 37           rem
 38           start     sim
 39           rem
 40           pmc       save,on
 41           tib
 42           csbits
 43           tconst
 44           pmc       restore
 45           ttls      constants for sync line simulator tables
 46 chr100    bool      100
 47 chr140    bool      140
 48 chr141    bool      141
 49 chr124    bool      124
 50 chr146    bool      146
 51           rem
 52 iscn6     chstr     (rescan,search,soh,ignore,strlrc,search,etx,ignore,cmplrc)
 53 iscn7     chstr     (rescan,search,soh,ignore,ignore,match,ack)
 54 iscn8     chstr     (rescan,search,soh,ignore,ignore,match,dle)
 55           rem
 56 oscn1     chstr     (rescan,search,etx)
 57 oscn2     chstr     (rescan,search,soh,ignore,strlrc,search,etx,ignore,outlrc)
 58 oscn3     chstr     (rescan,chktrm,etx)
 59           rem
 60 ackmsg    chstr     (syn,syn,syn,syn,soh,chr141,ack,stx,etx,chr146,eot,seteom)
 61 nakmsg    chstr     (syn,syn,syn,syn,soh,chr141,nak,stx,chr100,chr141,etx,chr
 62           etc       124,eot,seteom)
 63 idlmsg    chstr     (syn,syn,syn,syn,soh,chr100,dle,chr100,etx,seteom)
 64           rem
 65           ttls      dial up control for simulator lines
 66 gstar     tstflg    tflisn,slisn        /* shall we listen to line? */
 67           wait      0,0,begin
 68           rem
 69 slisn     contrl    sdtr+srts+stat      /* bring up dataset leads */
 70           rem
 71           wait      0,0,tshang          /* look for dial or hanh */
 72           status    cd+cts+dsr,0,sdiald
 73           rem
 74 sdiald    signal    dialup
 75           goto      sget      /* start off protocol */
 76           ttls      sget and srcvd input for sync lines
 77 sget      tstwrt    sendr
 78           tstflg    tfhang,shang
 79           rem
 80           contrl    srec+rxmit
 81           setime    0
 82           wait      0,sendr,tshang
 83           status    brkchr,0,srcvd
 84           status    parity,0,nakit
 85           status    exh,0,pause
 86           status    xte,0,pause
 87           status    0,dsr+cd,shang
 88           rem
 89 srcvd     inscan    iscn6,nakit
 90           inscan    iscn8,notidl
 91           dumpin
 92           goto      sntack
 93           rem
 94 notidl    sendin
 95           dmpout
 96           rem
 97           bldmsg    ackmsg,error
 98           rem
 99 sndmsg    holdot
100           dcwlst
101           cmd       sxmit
102           output    (outmsg)
103           cmd       sterm+rxmit
104           rem
105           wait      0,0,0
106           status    term,0,sntack
107           status    0,dsr+cd,shang
108           rem
109 sntack    setime    0
110           tstflg    tfhang,shang
111           rem
112           wait      0,0,tshang
113           status    brkchr,0,srcvd
114           status    parity,0,nakit
115           status    exh,0,pause
116           status    xte,0,pause
117           status    0,dsr+cd,shang
118           rem
119 pause     stpchn
120           dumpin
121           dmpout
122           setime    1
123           wait      nakit1,0,tshang
124           status    0,dsr+cd,shang
125           rem
126 nakit     stpchn
127           dumpin
128           dmpout
129           rem
130 nakit1    tcntr     2000,rstcnt
131           acntr     1
132           contrl    srec
133           rem
134 nakit2    bldmsg    nakmsg,error
135           goto      sndmsg
136           rem
137 rstcnt    scntr     0
138           goto      nakit1
139 tshang    tstflg    tfhang,shang
140           waitm
141           rem
142 shang     stpchn
143           dumpin
144           dmpout
145           goto      hanga
146           ttls      sendr for sync lines
147 sendr     outscn    oscn3,gtmore
148           goto      sendit
149           rem
150 gtmore    signal    sndout
151           wait      0,sendr,tshang
152           rem
153 sendit    holdot
154           rem
155 resend    dcwlst
156           cmd       sxmit+srec
157           output    (outmsg)
158           cmd       rxmit
159           rem
160 sndone    setime    30
161           tstflg    tfhang,shang
162           rem
163           wait      badack,0,tshang
164           status    brkchr,0,gotack
165           status    parity,0,badack
166           status    exh,0,badack
167           rem
168 badack    stpchn
169           dumpin
170           goto      resend
171           rem
172 gotack    inscan    iscn6,badack
173           inscan    iscn7,badack
174           dumpin
175           dmpout
176           setime    10
177           contrl    rrec
178           wait      sndidl,sendr,tshang
179           rem
180 sndidl    bldmsg    idlmsg,error
181           outscn    oscn2,error
182           holdot
183           rem
184           dcwlst
185           cmd       sxmit
186           output    (outmsg)
187           cmd       sterm+rxmit
188           rem
189           setime    0
190           wait      0,0,0
191           status    term,0,sntidl
192           rem
193 sntidl    dmpout
194           tstflg    tfhang,shang
195           tstwrt    sendr
196           wait      0,sendr,tshang
197           end