1 "         Macros for creating IOM control words. They require that make_data_macros
  2 "         have already been included. Formats:
  3 "
  4 "         make_pcw  PCW_name,
  5 "                   Command,
  6 "                   Channel,
  7 "                   Device,
  8 "                   {record,multirecord,character,nondata},
  9 "                   {proceed,terminate,marker},
 10 "                   [ChanData,]
 11 "                   [Extension,]
 12 "                   [mask,]
 13 "
 14 "         make_ddcw DDCW_name,
 15 "                   Address,
 16 "                   Tally,
 17 "                   {iotd,iotp,iontp},
 18 "                   [{char,word},]
 19 "                   [CharOffset]
 20 "
 21 "         make_idcw IDCW_name,
 22 "                   Command,
 23 "                   Device,
 24 "                   {record,multirecord,character,nondata},
 25 "                   {proceed,terminate,marker},
 26 "                   [ChanData,]
 27 "                   [Extension,]
 28 "                   [mask,]
 29 "
 30 "         make_tdcw TDCW_name,
 31 "                   Address,
 32 "                   [([restrict,][extend,][relative])]
 33 "
 34 "
 35 
 36 " ------------------------------------------------------------
 37 
 38           macro     make_pcw
 39           maclist   off,save
 40 &>6,&K&[  ife       foo,foo
 41             warn    (make_pcw: At least six arguments are required.)
 42             maclist restore
 43           ifend_exit                    " give up on this one
 44 &]
 45 
 46           assign_by_keyword   make_pcw.chan_cmd,(&5),make_pcw,
 47                     (Channel command must be one of record, nondata, multirecord, or character, not &5),
 48                     (record,0),(rec,0),(nondata,2),(multirecord,6),(character,8),(char,8)
 49 
 50           assign_by_keyword   make_pcw.chan_ctrl,(&6),make_pcw,
 51                     (Channel control must be one of terminate, proceed, or marker, not &6),
 52                     (terminate,0),(proceed,2),(marker,3)
 53 
 54           assign_by_keyword   make_pcw.mask,(&9),make_pcw,
 55                     (Mask must be either mask, or omitted, not &9.),
 56                     ((),0),(mask,1)
 57 
 58 
 59           set                 make_pcw.command,&2
 60           set                 make_pcw.channel,&3
 61           set                 make_pcw.device,&4
 62           set                 make_pcw.chan_data,(&7)
 63           set                 make_pcw.extension,(&8)
 64 
 65 "         Now, generate it
 66 
 67           maclist   on
 68           even
 69 &1:
 70           maclist   object
 71           vfd_mac   6/make_pcw.command,
 72                     6/make_pcw.device,
 73                     6/make_pcw.extension,
 74                     3/7,
 75                     1/make_pcw.mask,
 76                     2/make_pcw.chan_ctrl,
 77                     6/make_pcw.chan_cmd,
 78                     6/make_pcw.chan_data
 79 
 80           vfd_mac   3/0,
 81                     6/make_pcw.channel,
 82                     27/0
 83 
 84           maclist   restore
 85 &end
 86 
 87 " ------------------------------------------------------------
 88 
 89           macro     make_idcw
 90           maclist   off,save
 91 &>5,&K&[  ife       foo,foo
 92             warn    (make_idcw: At least five arguments are required.)
 93             maclist restore
 94           ifend_exit                    " give up on this one
 95 &]
 96 
 97           assign_by_keyword   make_pcw.chan_cmd,(&4),make_idcw,
 98                     (Channel command must be one of record, nondata, multirecord, or character, not &4),
 99                     (record,0),(rec,0),(nondata,2),(multirecord,6),(character,8),(char,8)
100 
101           assign_by_keyword   make_pcw.chan_ctrl,(&5),make_idcw,
102                     (Channel control must be one of terminate, proceed, or marker, not &5),
103                     (terminate,0),(proceed,2),(marker,3)
104 
105           assign_by_keyword   make_pcw.mask,(&8),make_idcw,
106                     (Mask must be either mask, or omitted, not &8.),
107                     ((),0),(mask,1)
108 
109           set                 make_pcw.command,&2
110           set                 make_pcw.device,&3
111           set                 make_pcw.chan_data,(&6)
112           set                 make_pcw.extension,(&7)
113 
114 "         Now, generate it
115 
116           maclist   on
117 &1:
118           maclist   object
119           vfd_mac   6/make_pcw.command,
120                     6/make_pcw.device,
121                     6/make_pcw.extension,
122                     o3/7,
123                     1/make_pcw.mask,
124                     2/make_pcw.chan_ctrl,
125                     6/make_pcw.chan_cmd,
126                     6/make_pcw.chan_data
127 
128           maclist   restore
129 &end
130 
131 " ------------------------------------------------------------
132 
133           macro     make_ddcw
134           maclist   off,save
135 &>4,&K&[  ife       foo,foo
136             warn    (make_ddcw: At least four arguments are required.)
137             maclist restore
138           ifend_exit                    " give up on this one
139 &]
140 
141           assign_by_keyword   make_ddcw.op_type,&4,make_ddcw,
142                     (Operation type must be one of iotd, iotp, or iontp, not &4.),
143                     (iotd,0),(iotp,1),(iontp,3)
144 
145           assign_by_keyword   make_ddcw.tally_type,(&5),make_ddcw,
146                     (Tally type must be either word, character, or omitted, not &5.),
147                     ((),0),(word,0),(character,1),(char,1)
148 
149           set                 make_ddcw.address,&2
150           set                 make_ddcw.tally,&3
151           set                 make_ddcw.char_offset,(&6)
152 
153 "         Now, generate it
154 
155           maclist   on
156 &1:
157           maclist   object
158           vfd_mac   18/make_ddcw.address,
159                     3/make_ddcw.char_offset,
160                     1/make_ddcw.tally_type,
161                     2/make_ddcw.op_type,
162                     12/make_ddcw.tally
163 
164           maclist   restore
165 &end
166 
167 " ------------------------------------------------------------
168 
169           macro     make_tdcw
170           maclist   off,save
171 &>2,&K&[  ife       foo,foo
172             warn    (make_tdcw: At least two arguments are required.)
173             maclist restore
174           ifend_exit                    " give up on this one
175 &]
176 
177           set                 make_tdcw.address,&2
178           set                 make_tdcw.bits,0
179 &(3       make_tdcw.get_bits  &i
180 &)
181 
182 "         Now, generate it
183 
184           maclist   on
185 &1:
186           maclist   object
187           vfd_mac   18/make_tdcw.address,
188                     4/0,
189                     2/2,
190                     9/0,
191                     3/make_tdcw.bits
192 
193           maclist   restore
194 &end