1                       radix   dec
2                       ; Code bank 0; Start address: 0; End address: 1023
3      0000 :           org     0
4               
5                       ; Define start addresses for data regions
6    00000020 = shared___globals equ 32
7    00000000 = __indf equ 0
8    00000002 = __pcl equ 2
9    00000003 = __status equ 3
10   00000004 = __fsr equ 4
11   00000003 = __c___byte equ 3
12   00000000 = __c___bit equ 0
13   00000003 = __z___byte equ 3
14   00000002 = __z___bit equ 2
15   00000003 = __rp0___byte equ 3
16   00000005 = __rp0___bit equ 5
17   00000003 = __rp1___byte equ 3
18   00000006 = __rp1___bit equ 6
19   00000003 = __irp___byte equ 3
20   00000007 = __irp___bit equ 7
21   0000000a = __pclath equ 10
22   0000000a = __cb0___byte equ 10
23   00000003 = __cb0___bit equ 3
24   0000000a = __cb1___byte equ 10
25   00000004 = __cb1___bit equ 4
26                      ; # ##########################################################################
27                      ; #
28                      ; # Copyright (c) 2000-2004 by Wayne C. Gramlich & William T. Benson.
29                      ; # All rights reserved.
30                      ; #
31                      ; # This is the code that implements the Switch8 RoboBrick.  Basically
32                      ; # it just waits for commands that come in at 2400 baud and responds
33                      ; # to them.  See:
34                      ; #
35                      ; #   http://web.gramlich.net/projects/robobricks/switch8/index.html
36                      ; #
37                      ; # for more details.
38                      ; #
39                      ; # ##########################################################################
40              
41                      ; buffer = 'switch8'
42                      ; line_number = 16
43                      ; library _pic12f629 entered
44              
45                      ; # Copyright (c) 2004 by Wayne C. Gramlich
46                      ; # All rights reserved.
47              
48                      ; buffer = '_pic12f629'
49                      ; line_number = 6
50                      ; processor pic12f675
51                      ; line_number = 7
52                      ; configure_address 0x2007
53                      ; line_number = 8
54                      ;  configure_fill 0x0
55                      ; line_number = 9
56                      ;  configure_option bg: bg11 = 0x3000
57                      ; line_number = 10
58                      ;  configure_option bg: bg00 = 0x0000
59                      ; line_number = 11
60                      ;  configure_option cpd: on = 0x000
61                      ; line_number = 12
62                      ;  configure_option cpd: off = 0x100
63                      ; line_number = 13
64                      ;  configure_option cp: on = 0x00
65                      ; line_number = 14
66                      ;  configure_option cp: off = 0x80
67                      ; line_number = 15
68                      ;  configure_option boden: on = 0x40
69                      ; line_number = 16
70                      ;  configure_option boden: off = 0x00
71                      ; line_number = 17
72                      ;  configure_option mclre: on = 0x20
73                      ; line_number = 18
74                      ;  configure_option mclre: off = 0x00
75                      ; line_number = 19
76                      ;  configure_option pwrte: on = 0x00
77                      ; line_number = 20
78                      ;  configure_option pwrte: off = 0x10
79                      ; line_number = 21
80                      ;  configure_option wdte: on = 8
81                      ; line_number = 22
82                      ;  configure_option wdte: off = 0
83                      ; line_number = 23
84                      ;  configure_option fosc: rc_clk = 7
85                      ; line_number = 24
86                      ;  configure_option fosc: rc_no_clk = 6
87                      ; line_number = 25
88                      ;  configure_option fosc: int_clk = 5
89                      ; line_number = 26
90                      ;  configure_option fosc: int_no_clk = 4
91                      ; line_number = 27
92                      ;  configure_option fosc: ec = 3
93                      ; line_number = 28
94                      ;  configure_option fosc: hs = 2
95                      ; line_number = 29
96                      ;  configure_option fosc: xt = 1
97                      ; line_number = 30
98                      ;  configure_option fosc: lp = 0
99                      ; line_number = 31
100                     ;  code_bank 0x0 : 0x3ff
101                     ; line_number = 32
102                     ;  data_bank 0x0 : 0x7f
103                     ; line_number = 33
104                     ;  data_bank 0x80 : 0xff
105                     ; line_number = 34
106                     ;  shared_region 0x20 : 0x5f
107                     ; line_number = 35
108                     ;  interrupts_possible
109                     ; line_number = 36
110                     ;  osccal_register_symbol _osccal
111                     ; line_number = 37
112                     ;  osccal_at_address 0x3ff
113                     ; line_number = 38
114                     ;  packages pdip=8, soic=8, dfn_s=8
115                     ; line_number = 39
116                     ;  pin vdd, power_supply
117                     ; line_number = 40
118                     ; pin_bindings pdip=1, soic=1, dfn_s=1
119                     ; line_number = 41
120                     ; pin gp5_in, gp5_out, t1cki, osc1, clkin, gp5_unused
121                     ; line_number = 42
122                     ; pin_bindings pdip=2, soic=2, dfn_s=2
123                     ; line_number = 43
124                     ;  bind_to _gpio@5
125                     ; line_number = 44
126                     ;  or_if gp5_in _trisio 16
127                     ; line_number = 45
128                     ;  or_if gp5_out _trisio 0
129                     ; line_number = 46
130                     ; pin gp4_in, gp4_out, t1g, osc2, clkout, gp4_unused
131                     ; line_number = 47
132                     ; pin_bindings pdip=3, soic=3, dfn_s=3
133                     ; line_number = 48
134                     ;  bind_to _gpio@4
135                     ; line_number = 49
136                     ;  or_if gp4_in _trisio 8
137                     ; line_number = 50
138                     ;  or_if gp4_out _trisio 0
139                     ; line_number = 51
140                     ; pin gp3_in, mclr, vpp, rp3_unused
141                     ; line_number = 52
142                     ; pin_bindings pdip=4, soic=4, dfn_s=4
143                     ; line_number = 53
144                     ;  bind_to _gpio@4
145                     ; line_number = 54
146                     ;  or_if gp3_in _trisio 4
147                     ; line_number = 55
148                     ; pin gp2_in, gp2_out, t0cki, int, cout, gp2_unused
149                     ; line_number = 56
150                     ; pin_bindings pdip=5, soic=5, dfn_s=5
151                     ; line_number = 57
152                     ;  bind_to _gpio@2
153                     ; line_number = 58
154                     ;  or_if gp2_in _trisio 4
155                     ; line_number = 59
156                     ;  or_if gp2_out _trisio 0
157                     ; line_number = 60
158                     ; pin gp1_in, gp1_out, cin_minus, gp1_unused
159                     ; line_number = 61
160                     ; pin_bindings pdip=6, soic=6, dfn_s=6
161                     ; line_number = 62
162                     ;  bind_to _gpio@1
163                     ; line_number = 63
164                     ;  or_if gp1_in _trisio 2
165                     ; line_number = 64
166                     ;  or_if gp1_out _trisio 0
167                     ; line_number = 65
168                     ; pin gp0_in, gp0_out, gp0_unused
169                     ; line_number = 66
170                     ; pin_bindings pdip=7, soic=7, dfn_s=7
171                     ; line_number = 67
172                     ;  bind_to _gpio@0
173                     ; line_number = 68
174                     ;  or_if gp0_in _trisio 1
175                     ; line_number = 69
176                     ;  or_if gp0_out _trisio 0
177                     ; line_number = 70
178                     ; pin vss, ground
179                     ; line_number = 71
180                     ; pin_bindings pdip=8, soic=8, dfn_s=8
181             
182             
183                     ; line_number = 76
184                     ; library _pic12f629_675 entered
185                     ; # Copyright (c) 2004 by Wayne C. Gramlich
186                     ; # All rights reserved.
187             
188                     ; # Shared register definitions for the PIC12F629 and PIC12F675.
189             
190                     ; buffer = '_pic12f629_675'
191                     ; line_number = 7
192                     ; register _indf = 
193  00000000 = _indf equ 0
194             
195                     ; line_number = 9
196                     ; register _tmr0 = 
197  00000001 = _tmr0 equ 1
198             
199                     ; line_number = 11
200                     ; register _pcl = 
201  00000002 = _pcl equ 2
202             
203                     ; line_number = 13
204                     ; register _status = 
205  00000003 = _status equ 3
206                     ; line_number = 14
207                     ; bind _rp0 = _status@5
208  00000003 = _rp0___byte equ _status
209  00000005 = _rp0___bit equ 5
210                     ; line_number = 15
211                     ; bind _to = _status@4
212  00000003 = _to___byte equ _status
213  00000004 = _to___bit equ 4
214                     ; line_number = 16
215                     ; bind _pd = _status@3
216  00000003 = _pd___byte equ _status
217  00000003 = _pd___bit equ 3
218                     ; line_number = 17
219                     ; bind _z = _status@2
220  00000003 = _z___byte equ _status
221  00000002 = _z___bit equ 2
222                     ; line_number = 18
223                     ; bind _dc = _status@1
224  00000003 = _dc___byte equ _status
225  00000001 = _dc___bit equ 1
226                     ; line_number = 19
227                     ; bind _c = _status@0
228  00000003 = _c___byte equ _status
229  00000000 = _c___bit equ 0
230             
231                     ; line_number = 21
232                     ; register _fsr = 
233  00000004 = _fsr equ 4
234             
235                     ; line_number = 23
236                     ; register _gpio = 
237  00000005 = _gpio equ 5
238                     ; line_number = 24
239                     ; bind _gpio5 = _gpio@5
240  00000005 = _gpio5___byte equ _gpio
241  00000005 = _gpio5___bit equ 5
242                     ; line_number = 25
243                     ; bind _gpio4 = _gpio@4
244  00000005 = _gpio4___byte equ _gpio
245  00000004 = _gpio4___bit equ 4
246                     ; line_number = 26
247                     ; bind _gpio3 = _gpio@3
248  00000005 = _gpio3___byte equ _gpio
249  00000003 = _gpio3___bit equ 3
250                     ; line_number = 27
251                     ; bind _gpio2 = _gpio@2
252  00000005 = _gpio2___byte equ _gpio
253  00000002 = _gpio2___bit equ 2
254                     ; line_number = 28
255                     ; bind _gpio1 = _gpio@1
256  00000005 = _gpio1___byte equ _gpio
257  00000001 = _gpio1___bit equ 1
258                     ; line_number = 29
259                     ; bind _gpio0 = _gpio@0
260  00000005 = _gpio0___byte equ _gpio
261  00000000 = _gpio0___bit equ 0
262             
263                     ; line_number = 31
264                     ; register _pclath = 
265  0000000a = _pclath equ 10
266             
267                     ; line_number = 33
268                     ; register _intcon = 
269  0000000b = _intcon equ 11
270                     ; line_number = 34
271                     ; bind _gie = _intcon@7
272  0000000b = _gie___byte equ _intcon
273  00000007 = _gie___bit equ 7
274                     ; line_number = 35
275                     ; bind _peie = _intcon@6
276  0000000b = _peie___byte equ _intcon
277  00000006 = _peie___bit equ 6
278                     ; line_number = 36
279                     ; bind _t0ie = _intcon@5
280  0000000b = _t0ie___byte equ _intcon
281  00000005 = _t0ie___bit equ 5
282                     ; line_number = 37
283                     ; bind _inte = _intcon@4
284  0000000b = _inte___byte equ _intcon
285  00000004 = _inte___bit equ 4
286                     ; line_number = 38
287                     ; bind _gpie = _intcon@3
288  0000000b = _gpie___byte equ _intcon
289  00000003 = _gpie___bit equ 3
290                     ; line_number = 39
291                     ; bind _t0if = _intcon@2
292  0000000b = _t0if___byte equ _intcon
293  00000002 = _t0if___bit equ 2
294                     ; line_number = 40
295                     ; bind _intf = _intcon@1
296  0000000b = _intf___byte equ _intcon
297  00000001 = _intf___bit equ 1
298                     ; line_number = 41
299                     ; bind _gpif = _intcon@0
300  0000000b = _gpif___byte equ _intcon
301  00000000 = _gpif___bit equ 0
302             
303                     ; line_number = 43
304                     ; register _pir1 = 
305  0000000c = _pir1 equ 12
306                     ; line_number = 44
307                     ; bind _eeif = _pir1@7
308  0000000c = _eeif___byte equ _pir1
309  00000007 = _eeif___bit equ 7
310                     ; line_number = 45
311                     ; bind _cmif = _pir1@3
312  0000000c = _cmif___byte equ _pir1
313  00000003 = _cmif___bit equ 3
314                     ; line_number = 46
315                     ; bind _tmr1if = _pir1@0
316  0000000c = _tmr1if___byte equ _pir1
317  00000000 = _tmr1if___bit equ 0
318             
319                     ; line_number = 48
320                     ; register _tmr1l = 
321  0000000e = _tmr1l equ 14
322             
323                     ; line_number = 50
324                     ; register _tmr1h = 
325  0000000f = _tmr1h equ 15
326             
327                     ; line_number = 52
328                     ; register _t1con = 
329  00000010 = _t1con equ 16
330                     ; line_number = 53
331                     ; bind _t1ge = _t1con@6
332  00000010 = _t1ge___byte equ _t1con
333  00000006 = _t1ge___bit equ 6
334                     ; line_number = 54
335                     ; bind _t1ckps1 = _t1con@5
336  00000010 = _t1ckps1___byte equ _t1con
337  00000005 = _t1ckps1___bit equ 5
338                     ; line_number = 55
339                     ; bind _t1ckps0 = _t1con@4
340  00000010 = _t1ckps0___byte equ _t1con
341  00000004 = _t1ckps0___bit equ 4
342                     ; line_number = 56
343                     ; bind _t1oscen = _t1con@3
344  00000010 = _t1oscen___byte equ _t1con
345  00000003 = _t1oscen___bit equ 3
346                     ; line_number = 57
347                     ; bind _t1sync = _t1con@2
348  00000010 = _t1sync___byte equ _t1con
349  00000002 = _t1sync___bit equ 2
350                     ; line_number = 58
351                     ; bind _tmr1cs = _t1con@1
352  00000010 = _tmr1cs___byte equ _t1con
353  00000001 = _tmr1cs___bit equ 1
354                     ; line_number = 59
355                     ; bind _tmr1on = _t1con@0
356  00000010 = _tmr1on___byte equ _t1con
357  00000000 = _tmr1on___bit equ 0
358             
359                     ; line_number = 61
360                     ; register _cmcon = 
361  00000019 = _cmcon equ 25
362                     ; line_number = 62
363                     ; bind _cout = _cmcon@6
364  00000019 = _cout___byte equ _cmcon
365  00000006 = _cout___bit equ 6
366                     ; line_number = 63
367                     ; bind _cinv = _cmcon@4
368  00000019 = _cinv___byte equ _cmcon
369  00000004 = _cinv___bit equ 4
370                     ; line_number = 64
371                     ; bind _cis = _cmcon@3
372  00000019 = _cis___byte equ _cmcon
373  00000003 = _cis___bit equ 3
374                     ; line_number = 65
375                     ; bind _cm2 = _cmcon@2
376  00000019 = _cm2___byte equ _cmcon
377  00000002 = _cm2___bit equ 2
378                     ; line_number = 66
379                     ; bind _cm1 = _cmcon@1
380  00000019 = _cm1___byte equ _cmcon
381  00000001 = _cm1___bit equ 1
382                     ; line_number = 67
383                     ; bind _cm0 = _cmcon@0
384  00000019 = _cm0___byte equ _cmcon
385  00000000 = _cm0___bit equ 0
386             
387                     ; line_number = 69
388                     ; register _adcon0 = 
389  0000001f = _adcon0 equ 31
390                     ; line_number = 70
391                     ; bind _adfm = _adcon0@7
392  0000001f = _adfm___byte equ _adcon0
393  00000007 = _adfm___bit equ 7
394                     ; line_number = 71
395                     ; bind _vcfg = _adcon0@6
396  0000001f = _vcfg___byte equ _adcon0
397  00000006 = _vcfg___bit equ 6
398                     ; line_number = 72
399                     ; bind _csh1 = _adcon0@3
400  0000001f = _csh1___byte equ _adcon0
401  00000003 = _csh1___bit equ 3
402                     ; line_number = 73
403                     ; bind _csh0 = _adcon0@2
404  0000001f = _csh0___byte equ _adcon0
405  00000002 = _csh0___bit equ 2
406                     ; line_number = 74
407                     ; bind _go = _adcon0@1
408  0000001f = _go___byte equ _adcon0
409  00000001 = _go___bit equ 1
410                     ; line_number = 75
411                     ; bind _adon = _adcon0@0
412  0000001f = _adon___byte equ _adcon0
413  00000000 = _adon___bit equ 0
414             
415                     ; # Data bank 1 (0x80-0xff):
416             
417                     ; line_number = 79
418                     ; register _option_reg = 
419  00000081 = _option_reg equ 129
420                     ; line_number = 80
421                     ; bind _gppu = _option_reg@7
422  00000081 = _gppu___byte equ _option_reg
423  00000007 = _gppu___bit equ 7
424                     ; line_number = 81
425                     ; bind _intedg = _option_reg@6
426  00000081 = _intedg___byte equ _option_reg
427  00000006 = _intedg___bit equ 6
428                     ; line_number = 82
429                     ; bind _t0cs = _option_reg@5
430  00000081 = _t0cs___byte equ _option_reg
431  00000005 = _t0cs___bit equ 5
432                     ; line_number = 83
433                     ; bind _t0se = _option_reg@4
434  00000081 = _t0se___byte equ _option_reg
435  00000004 = _t0se___bit equ 4
436                     ; line_number = 84
437                     ; bind _psa = _option_reg@3
438  00000081 = _psa___byte equ _option_reg
439  00000003 = _psa___bit equ 3
440                     ; line_number = 85
441                     ; bind _ps2 = _option_reg@2
442  00000081 = _ps2___byte equ _option_reg
443  00000002 = _ps2___bit equ 2
444                     ; line_number = 86
445                     ; bind _ps1 = _option_reg@1
446  00000081 = _ps1___byte equ _option_reg
447  00000001 = _ps1___bit equ 1
448                     ; line_number = 87
449                     ; bind _ps0 = _option_reg@0
450  00000081 = _ps0___byte equ _option_reg
451  00000000 = _ps0___bit equ 0
452             
453                     ; line_number = 89
454                     ; register _trisio = 
455  00000085 = _trisio equ 133
456                     ; line_number = 90
457                     ; bind _trisio5 = _trisio@5
458  00000085 = _trisio5___byte equ _trisio
459  00000005 = _trisio5___bit equ 5
460                     ; line_number = 91
461                     ; bind _trisio4 = _trisio@4
462  00000085 = _trisio4___byte equ _trisio
463  00000004 = _trisio4___bit equ 4
464                     ; line_number = 92
465                     ; bind _trisio3 = _trisio@3
466  00000085 = _trisio3___byte equ _trisio
467  00000003 = _trisio3___bit equ 3
468                     ; line_number = 93
469                     ; bind _trisio2 = _trisio@2
470  00000085 = _trisio2___byte equ _trisio
471  00000002 = _trisio2___bit equ 2
472                     ; line_number = 94
473                     ; bind _trisio1 = _trisio@1
474  00000085 = _trisio1___byte equ _trisio
475  00000001 = _trisio1___bit equ 1
476                     ; line_number = 95
477                     ; bind _trisio0 = _trisio@0
478  00000085 = _trisio0___byte equ _trisio
479  00000000 = _trisio0___bit equ 0
480             
481                     ; line_number = 97
482                     ; register _pie1 = 
483  0000008c = _pie1 equ 140
484                     ; line_number = 98
485                     ; bind _eeie = _pie1@7
486  0000008c = _eeie___byte equ _pie1
487  00000007 = _eeie___bit equ 7
488                     ; line_number = 99
489                     ; bind _cmie = _pie1@3
490  0000008c = _cmie___byte equ _pie1
491  00000003 = _cmie___bit equ 3
492                     ; line_number = 100
493                     ; bind _tmr1ie = _pie1@0
494  0000008c = _tmr1ie___byte equ _pie1
495  00000000 = _tmr1ie___bit equ 0
496             
497                     ; line_number = 102
498                     ; register _pcon = 
499  0000008e = _pcon equ 142
500                     ; line_number = 103
501                     ; bind _por = _pcon@1
502  0000008e = _por___byte equ _pcon
503  00000001 = _por___bit equ 1
504                     ; line_number = 104
505                     ; bind _bor = _pcon@0
506  0000008e = _bor___byte equ _pcon
507  00000000 = _bor___bit equ 0
508             
509                     ; line_number = 106
510                     ; register _osccal = 
511  00000090 = _osccal equ 144
512                     ; line_number = 107
513                     ; bind _cal5 = _osccal@7
514  00000090 = _cal5___byte equ _osccal
515  00000007 = _cal5___bit equ 7
516                     ; line_number = 108
517                     ; bind _cal4 = _osccal@6
518  00000090 = _cal4___byte equ _osccal
519  00000006 = _cal4___bit equ 6
520                     ; line_number = 109
521                     ; bind _cal3 = _osccal@5
522  00000090 = _cal3___byte equ _osccal
523  00000005 = _cal3___bit equ 5
524                     ; line_number = 110
525                     ; bind _cal2 = _osccal@4
526  00000090 = _cal2___byte equ _osccal
527  00000004 = _cal2___bit equ 4
528                     ; line_number = 111
529                     ; bind _cal1 = _osccal@3
530  00000090 = _cal1___byte equ _osccal
531  00000003 = _cal1___bit equ 3
532                     ; line_number = 112
533                     ; bind _cal0 = _osccal@2
534  00000090 = _cal0___byte equ _osccal
535  00000002 = _cal0___bit equ 2
536                     ; line_number = 113
537                     ; constant _osccal_lsb = 4
538  00000004 = _osccal_lsb equ 4
539             
540                     ; line_number = 115
541                     ; register _wpua = 
542  00000095 = _wpua equ 149
543                     ; line_number = 116
544                     ; bind _wpua5 = _wpua@5
545  00000095 = _wpua5___byte equ _wpua
546  00000005 = _wpua5___bit equ 5
547                     ; line_number = 117
548                     ; bind _wpua4 = _wpua@4
549  00000095 = _wpua4___byte equ _wpua
550  00000004 = _wpua4___bit equ 4
551                     ; line_number = 118
552                     ; bind _wpua2 = _wpua@2
553  00000095 = _wpua2___byte equ _wpua
554  00000002 = _wpua2___bit equ 2
555                     ; line_number = 119
556                     ; bind _wpua1 = _wpua@1
557  00000095 = _wpua1___byte equ _wpua
558  00000001 = _wpua1___bit equ 1
559                     ; line_number = 120
560                     ; bind _wpua0 = _wpua@0
561  00000095 = _wpua0___byte equ _wpua
562  00000000 = _wpua0___bit equ 0
563             
564                     ; line_number = 122
565                     ; register _ioca = 
566  00000096 = _ioca equ 150
567                     ; line_number = 123
568                     ; bind _ioca5 = _ioca@5
569  00000096 = _ioca5___byte equ _ioca
570  00000005 = _ioca5___bit equ 5
571                     ; line_number = 124
572                     ; bind _ioca4 = _ioca@4
573  00000096 = _ioca4___byte equ _ioca
574  00000004 = _ioca4___bit equ 4
575                     ; line_number = 125
576                     ; bind _ioca3 = _ioca@3
577  00000096 = _ioca3___byte equ _ioca
578  00000003 = _ioca3___bit equ 3
579                     ; line_number = 126
580                     ; bind _ioca2 = _ioca@2
581  00000096 = _ioca2___byte equ _ioca
582  00000002 = _ioca2___bit equ 2
583                     ; line_number = 127
584                     ; bind _ioca1 = _ioca@1
585  00000096 = _ioca1___byte equ _ioca
586  00000001 = _ioca1___bit equ 1
587                     ; line_number = 128
588                     ; bind _ioca0 = _ioca@0
589  00000096 = _ioca0___byte equ _ioca
590  00000000 = _ioca0___bit equ 0
591             
592                     ; line_number = 130
593                     ; register _vrcon = 
594  00000099 = _vrcon equ 153
595                     ; line_number = 131
596                     ; bind _vren = _vrcon@7
597  00000099 = _vren___byte equ _vrcon
598  00000007 = _vren___bit equ 7
599                     ; line_number = 132
600                     ; bind _vrr = _vrcon@5
601  00000099 = _vrr___byte equ _vrcon
602  00000005 = _vrr___bit equ 5
603                     ; line_number = 133
604                     ; bind _vr3 = _vrcon@3
605  00000099 = _vr3___byte equ _vrcon
606  00000003 = _vr3___bit equ 3
607                     ; line_number = 134
608                     ; bind _vr2 = _vrcon@2
609  00000099 = _vr2___byte equ _vrcon
610  00000002 = _vr2___bit equ 2
611                     ; line_number = 135
612                     ; bind _vr1 = _vrcon@1
613  00000099 = _vr1___byte equ _vrcon
614  00000001 = _vr1___bit equ 1
615                     ; line_number = 136
616                     ; bind _vr0 = _vrcon@0
617  00000099 = _vr0___byte equ _vrcon
618  00000000 = _vr0___bit equ 0
619             
620                     ; line_number = 138
621                     ; register _eedata = 
622  0000009a = _eedata equ 154
623             
624                     ; line_number = 140
625                     ; register _eeadr = 
626  0000009b = _eeadr equ 155
627             
628                     ; line_number = 142
629                     ; register _eecon1 = 
630  0000009c = _eecon1 equ 156
631                     ; line_number = 143
632                     ; bind _wrerr = _eecon1@3
633  0000009c = _wrerr___byte equ _eecon1
634  00000003 = _wrerr___bit equ 3
635                     ; line_number = 144
636                     ; bind _wren = _eecon1@2
637  0000009c = _wren___byte equ _eecon1
638  00000002 = _wren___bit equ 2
639                     ; line_number = 145
640                     ; bind _wr = _eecon1@1
641  0000009c = _wr___byte equ _eecon1
642  00000001 = _wr___bit equ 1
643                     ; line_number = 146
644                     ; bind _rd = _eecon1@0
645  0000009c = _rd___byte equ _eecon1
646  00000000 = _rd___bit equ 0
647             
648                     ; line_number = 148
649                     ; register _eecon2 = 
650  0000009d = _eecon2 equ 157
651             
652             
653                     ; buffer = '_pic12f629'
654                     ; line_number = 76
655                     ; library _pic12f629_675 exited
656             
657             
658             
659                     ; buffer = 'switch8'
660                     ; line_number = 16
661                     ; library _pic12f629 exited
662                     ; line_number = 17
663                     ; library clock4mhz entered
664                     ; # Copyright (c) 2004 by Wayne C. Gramlich
665                     ; # All rights reserved.
666             
667                     ; # This library defines the contstants {clock_rate}, {instruction_rate},
668                     ; # and {clocks_per_instruction}.
669             
670                     ; # Define processor constants:
671                     ; buffer = 'clock4mhz'
672                     ; line_number = 9
673                     ; constant clock_rate = 4000000
674  003d0900 = clock_rate equ 4000000
675                     ; line_number = 10
676                     ; constant clocks_per_instruction = 4
677  00000004 = clocks_per_instruction equ 4
678                     ; line_number = 11
679                     ; constant instruction_rate = clock_rate / clocks_per_instruction
680  000f4240 = instruction_rate equ 1000000
681             
682             
683                     ; buffer = 'switch8'
684                     ; line_number = 17
685                     ; library clock4mhz exited
686                     ; line_number = 18
687                     ; library bit_bang entered
688                     ; # Copyright (c) 2004 by Wayne C. Gramlich
689                     ; # All rights reserved.
690             
691                     ; # This library provides bit bang routines for sending and receiving
692                     ; # serial data at 2400 baud in 8N1 format (1 start bit, 8 data bits,
693                     ; # No parity bit, 1 stop stop bit.)
694                     ; #
695                     ; # This library requires that the pins {serial_in} and {serial_out}
696                     ; # be defined.  In addition, the variable {instruction_rate} needs
697                     ; # to be defined.  Lastly, there needs to be a {delay} procedure
698                     ; # with an "exact_delay delay_instructions" clause in it.  The {delay}
699                     ; # routine should invoke "watch_dog_reset" so that the watch dog time
700                     ; # can be set.
701             
702                     ; # Define some constants that we will be needing:
703                     ; buffer = 'bit_bang'
704                     ; line_number = 17
705                     ; constant baud_rate = 2400
706  00000960 = baud_rate equ 2400
707                     ; line_number = 18
708                     ; constant instructions_per_bit = instruction_rate / baud_rate
709  000001a0 = instructions_per_bit equ 416
710                     ; line_number = 19
711                     ; constant delays_per_bit = 3
712  00000003 = delays_per_bit equ 3
713                     ; line_number = 20
714                     ; constant instructions_per_delay = instructions_per_bit / delays_per_bit
715  0000008a = instructions_per_delay equ 138
716                     ; line_number = 21
717                     ; constant extra_instructions = 5
718  00000005 = extra_instructions equ 5
719                     ; line_number = 22
720                     ; constant delay_instructions = instructions_per_delay - extra_instructions
721  00000085 = delay_instructions equ 133
722             
723                     ; # The {receiving} bit is sent when data is being received.
724                     ; # It gets cleared whenever data gets sent.  It is used to
725                     ; # determine whether additional delay is needed to turn a
726                     ; # line around for slow interpretted chips like the Basic
727                     ; # Stamp 2 and the OOPIC.
728             
729                     ; line_number = 30
730                     ; global receiving bit
731  0000005f = receiving___byte equ shared___globals+63
732  00000000 = receiving___bit equ 0
733                     ; line_number = 31
734                     ; global waiting bit
735  0000005f = waiting___byte equ shared___globals+63
736  00000001 = waiting___bit equ 1
737             
738                     ; Delaying code generation for procedure  byte_get
739                     ; Delaying code generation for procedure  byte_put
740             
741                     ; buffer = 'switch8'
742                     ; line_number = 18
743                     ; library bit_bang exited
744             
745                     ; line_number = 20
746                     ; package pdip
747                     ; line_number = 21
748                     ; pin 1 = power_supply
749                     ; line_number = 22
750                     ;  pin 2 = gp5_out, name = serial_out
751  00000005 = serial_out___byte equ _gpio
752  00000005 = serial_out___bit equ 5
753                     ; line_number = 23
754                     ;  pin 3 = gp4_in, name = serial_in
755  00000005 = serial_in___byte equ _gpio
756  00000004 = serial_in___bit equ 4
757                     ; line_number = 24
758                     ;  pin 4 = gp3_in, name = in3
759  00000005 = in3___byte equ _gpio
760  00000004 = in3___bit equ 4
761                     ; line_number = 25
762                     ;  pin 5 = gp2_out, name = out2
763  00000005 = out2___byte equ _gpio
764  00000002 = out2___bit equ 2
765                     ; line_number = 26
766                     ;  pin 6 = gp1_out, name = out1
767  00000005 = out1___byte equ _gpio
768  00000001 = out1___bit equ 1
769                     ; line_number = 27
770                     ;  pin 7 = gp0_out, name = out0
771  00000005 = out0___byte equ _gpio
772  00000000 = out0___bit equ 0
773                     ; line_number = 28
774                     ;  pin 8 = ground
775             
776                     ; # Define some globals:
777                     ; line_number = 31
778                     ; global inputs byte
779  00000024 = inputs equ shared___globals+4
780                     ; line_number = 32
781                     ; global complement byte
782  00000025 = complement equ shared___globals+5
783             
784                     ; # Interrupt masks:
785                     ; line_number = 35
786                     ; global interrupt_enable bit
787  0000005f = interrupt_enable___byte equ shared___globals+63
788  00000002 = interrupt_enable___bit equ 2
789                     ; line_number = 36
790                     ; global interrupt_pending bit
791  0000005f = interrupt_pending___byte equ shared___globals+63
792  00000003 = interrupt_pending___bit equ 3
793                     ; line_number = 37
794                     ; global falling byte
795  00000026 = falling equ shared___globals+6
796                     ; line_number = 38
797                     ; global high byte
798  00000027 = high equ shared___globals+7
799                     ; line_number = 39
800                     ; global low byte
801  00000028 = low equ shared___globals+8
802                     ; line_number = 40
803                     ; global raising byte
804  00000029 = raising equ shared___globals+9
805                     ; line_number = 41
806                     ; global command_previous byte
807  0000002a = command_previous equ shared___globals+10
808                     ; line_number = 42
809                     ; global command_last byte
810  0000002b = command_last equ shared___globals+11
811                     ; line_number = 43
812                     ; global sent_previous byte
813  0000002c = sent_previous equ shared___globals+12
814                     ; line_number = 44
815                     ; global sent_last byte
816  0000002d = sent_last equ shared___globals+13
817             
818                     ; line_number = 46
819                     ; procedure main
820    0000 :   main:
821                     ; Need to calibrate the oscillator
822  0000 23ff          call    1023
823  0001 1683          bsf     __rp0___byte, __rp0___bit
824  0002 0090          movwf   _osccal
825                     ; Initialize some registers
826  0003 300c          movlw   12
827  0004 0085          movwf   _trisio
828                     ; arguments_none
829                     ; line_number = 48
830                     ;  returns_nothing
831             
832                     ; # This is the main program that is responsible for processing commands
833                     ; # from the master.
834             
835                     ; line_number = 53
836                     ;  local command byte
837  0000002e = main__command equ shared___globals+14
838                     ; line_number = 54
839                     ;  local glitch byte
840  0000002f = main__glitch equ shared___globals+15
841                     ; line_number = 55
842                     ;  local id_index byte
843  00000030 = main__id_index equ shared___globals+16
844                     ; line_number = 56
845                     ;  local result byte
846  00000031 = main__result equ shared___globals+17
847                     ; line_number = 57
848                     ;  local temp byte
849  00000032 = main__temp equ shared___globals+18
850             
851                     ; before procedure statements delay=non-uniform, bit states=(data:X0=>X1 code:XX=>XX)
852                     ; line_number = 59
853                     ;  complement := 0
854  0005 3000          movlw   0
855  0006 1283          bcf     __rp0___byte, __rp0___bit
856  0007 00a5          movwf   complement
857                     ; line_number = 60
858                     ;  interrupt_enable := 0
859  0008 115f          bcf     interrupt_enable___byte, interrupt_enable___bit
860                     ; line_number = 61
861                     ;  interrupt_pending := 0
862  0009 11df          bcf     interrupt_pending___byte, interrupt_pending___bit
863                     ; line_number = 62
864                     ;  falling := 0
865  000a 3000          movlw   0
866  000b 00a6          movwf   falling
867                     ; line_number = 63
868                     ;  high := 0
869  000c 3000          movlw   0
870  000d 00a7          movwf   high
871                     ; line_number = 64
872                     ;  low := 0
873  000e 3000          movlw   0
874  000f 00a8          movwf   low
875                     ; line_number = 65
876                     ;  raising := 0
877  0010 3000          movlw   0
878  0011 00a9          movwf   raising
879                     ; line_number = 66
880                     ;  glitch := 0
881  0012 3000          movlw   0
882  0013 00af          movwf   main__glitch
883                     ; line_number = 67
884                     ;  id_index := 0
885  0014 3000          movlw   0
886  0015 00b0          movwf   main__id_index
887                     ; line_number = 68
888                     ;  loop_forever start
889    0016 :   main__1:
890                     ; line_number = 69
891                     ; command := byte_get()
892  0016 216d          call    byte_get
893  0017 00ae          movwf   main__command
894                     ; line_number = 70
895                     ;  switch command >> 6 start
896  0018 3000          movlw   main__57>>8
897  0019 008a          movwf   __pclath
898  00000037 = main__58 equ shared___globals+23
899  001a 0e2e          swapf   main__command,w
900  001b 00b7          movwf   main__58
901  001c 0cb7          rrf     main__58,f
902  001d 0c37          rrf     main__58,w
903  001e 3903          andlw   3
904  001f 3e21          addlw   main__57
905  0020 0082          movwf   __pcl
906                     ; page_group 4
907    0021 :   main__57:
908  0021 2825          goto    main__54
909  0022 287a          goto    main__55
910  0023 287a          goto    main__55
911  0024 287b          goto    main__56
912                     ; line_number = 71
913                     ; case 0
914    0025 :   main__54:
915                     ; # Command = 00xx xxxx:
916                     ; line_number = 73
917                     ;  switch command >> 3 start
918  0025 3000          movlw   main__23>>8
919  0026 008a          movwf   __pclath
920  00000037 = main__24 equ shared___globals+23
921  0027 0c2e          rrf     main__command,w
922  0028 00b7          movwf   main__24
923  0029 0cb7          rrf     main__24,f
924  002a 0c37          rrf     main__24,w
925  002b 391f          andlw   31
926  002c 3e2e          addlw   main__23
927  002d 0082          movwf   __pcl
928                     ; page_group 8
929    002e :   main__23:
930  002e 2836          goto    main__20
931  002f 2858          goto    main__21
932  0030 2879          goto    main__22
933  0031 2879          goto    main__22
934  0032 2879          goto    main__22
935  0033 2879          goto    main__22
936  0034 2879          goto    main__22
937  0035 2879          goto    main__22
938                     ; line_number = 74
939                     ; case 0
940    0036 :   main__20:
941                     ; # Command = 0000 0xxx:
942                     ; line_number = 76
943                     ;  switch command & 7 start
944  0036 3000          movlw   main__9>>8
945  0037 008a          movwf   __pclath
946  0038 3007          movlw   7
947  0039 052e          andwf   main__command,w
948  003a 3e3c          addlw   main__9
949  003b 0082          movwf   __pcl
950                     ; page_group 8
951    003c :   main__9:
952  003c 2844          goto    main__2
953  003d 2848          goto    main__3
954  003e 284b          goto    main__4
955  003f 284e          goto    main__5
956  0040 2851          goto    main__6
957  0041 2854          goto    main__7
958  0042 2857          goto    main__8
959  0043 2857          goto    main__8
960                     ; line_number = 77
961                     ; case 0
962    0044 :   main__2:
963                     ; # Read Inputs (Command = 0000 0000):
964                     ; line_number = 79
965                     ;  call byte_put(inputs ^ complement)
966  0044 0824          movf    inputs,w
967  0045 0625          xorwf   complement,w
968  0046 2196          call    byte_put
969  0047 2857          goto    main__10
970                     ; line_number = 80
971                     ; case 1
972    0048 :   main__3:
973                     ; # Read Complement Mask (Command = 0000 0001):
974                     ; line_number = 82
975                     ;  call byte_put(complement)
976  0048 0825          movf    complement,w
977  0049 2196          call    byte_put
978  004a 2857          goto    main__10
979                     ; line_number = 83
980                     ; case 2
981    004b :   main__4:
982                     ; # Read Low Mask (Command = 0000 0010):
983                     ; line_number = 85
984                     ;  call byte_put(low)
985  004b 0828          movf    low,w
986  004c 2196          call    byte_put
987  004d 2857          goto    main__10
988                     ; line_number = 86
989                     ; case 3
990    004e :   main__5:
991                     ; # Read High Mask (Command = 0000 0011):
992                     ; line_number = 88
993                     ;  call byte_put(high)
994  004e 0827          movf    high,w
995  004f 2196          call    byte_put
996  0050 2857          goto    main__10
997                     ; line_number = 89
998                     ; case 4
999    0051 :   main__6:
1000                    ; # Read Raising Mask (Command = 0000 0100):
1001                    ; line_number = 91
1002                    ;  call byte_put(raising)
1003 0051 0829          movf    raising,w
1004 0052 2196          call    byte_put
1005 0053 2857          goto    main__10
1006                    ; line_number = 92
1007                    ; case 5
1008   0054 :   main__7:
1009                    ; # Read Falling Mask (Command = 0000 0101):
1010                    ; line_number = 94
1011                    ;  call byte_put(falling)
1012 0054 0826          movf    falling,w
1013 0055 2196          call    byte_put
1014 0056 2857          goto    main__10
1015                    ; line_number = 95
1016                    ; case 6, 7
1017   0057 :   main__8:
1018                    ; line_number = 96
1019                    ; do_nothing
1020   0057 :   main__10:
1021                    ; switch end:(data:X0=>X? code:XX=>XX)
1022                    ; line_number = 76
1023                    ;  switch command & 7 done
1024 0057 2879          goto    main__25
1025                    ; line_number = 97
1026                    ; case 1
1027   0058 :   main__21:
1028                    ; # Command = 0000 1xxx:
1029                    ; line_number = 99
1030                    ;  switch command & 7 start
1031 0058 3000          movlw   main__18>>8
1032 0059 008a          movwf   __pclath
1033 005a 3007          movlw   7
1034 005b 052e          andwf   main__command,w
1035 005c 3e5e          addlw   main__18
1036 005d 0082          movwf   __pcl
1037                    ; page_group 8
1038   005e :   main__18:
1039 005e 2866          goto    main__11
1040 005f 2869          goto    main__12
1041 0060 286c          goto    main__13
1042 0061 286f          goto    main__14
1043 0062 2872          goto    main__15
1044 0063 2875          goto    main__16
1045 0064 2878          goto    main__17
1046 0065 2878          goto    main__17
1047                    ; line_number = 100
1048                    ; case 0
1049   0066 :   main__11:
1050                    ; # Read Raw (Command = 0000 1000):
1051                    ; line_number = 102
1052                    ;  call byte_put(inputs)
1053 0066 0824          movf    inputs,w
1054 0067 2196          call    byte_put
1055 0068 2878          goto    main__19
1056                    ; line_number = 103
1057                    ; case 1
1058   0069 :   main__12:
1059                    ; # Read Complement (Command = 0000 1001):
1060                    ; line_number = 105
1061                    ;  complement := byte_get()
1062 0069 216d          call    byte_get
1063 006a 00a5          movwf   complement
1064 006b 2878          goto    main__19
1065                    ; line_number = 106
1066                    ; case 2
1067   006c :   main__13:
1068                    ; # Read Low (Command = 0000 1010):
1069                    ; line_number = 108
1070                    ;  low := byte_get()
1071 006c 216d          call    byte_get
1072 006d 00a8          movwf   low
1073 006e 2878          goto    main__19
1074                    ; line_number = 109
1075                    ; case 3
1076   006f :   main__14:
1077                    ; # Read High (Command = 0000 1011):
1078                    ; line_number = 111
1079                    ;  high := byte_get()
1080 006f 216d          call    byte_get
1081 0070 00a7          movwf   high
1082 0071 2878          goto    main__19
1083                    ; line_number = 112
1084                    ; case 4
1085   0072 :   main__15:
1086                    ; # Read Raising (Command = 0000 1100):
1087                    ; line_number = 114
1088                    ;  raising := byte_get()
1089 0072 216d          call    byte_get
1090 0073 00a9          movwf   raising
1091 0074 2878          goto    main__19
1092                    ; line_number = 115
1093                    ; case 5
1094   0075 :   main__16:
1095                    ; # Read Falling (Command = 0000 1101):
1096                    ; line_number = 117
1097                    ;  falling := byte_get()
1098 0075 216d          call    byte_get
1099 0076 00a6          movwf   falling
1100 0077 2878          goto    main__19
1101                    ; line_number = 118
1102                    ; case 6, 7
1103   0078 :   main__17:
1104                    ; line_number = 119
1105                    ; do_nothing
1106   0078 :   main__19:
1107                    ; switch end:(data:X0=>X? code:XX=>XX)
1108                    ; line_number = 99
1109                    ;  switch command & 7 done
1110 0078 2879          goto    main__25
1111                    ; line_number = 120
1112                    ; case 2, 3, 4, 5, 6, 7
1113   0079 :   main__22:
1114                    ; line_number = 121
1115                    ; do_nothing
1116            
1117   0079 :   main__25:
1118                    ; switch end:(data:X0=>X? code:XX=>XX)
1119                    ; line_number = 73
1120                    ;  switch command >> 3 done
1121 0079 28ee          goto    main__59
1122                    ; line_number = 123
1123                    ; case 1, 2
1124   007a :   main__55:
1125                    ; line_number = 124
1126                    ; do_nothing
1127 007a 28ee          goto    main__59
1128                    ; line_number = 125
1129                    ; case 3
1130   007b :   main__56:
1131                    ; # Command = 11xx xxxx:
1132                    ; line_number = 127
1133                    ;  switch (command >> 3) & 7 start
1134 007b 3000          movlw   main__51>>8
1135 007c 008a          movwf   __pclath
1136 00000037 = main__52 equ shared___globals+23
1137 007d 0c2e          rrf     main__command,w
1138 007e 00b7          movwf   main__52
1139 007f 0cb7          rrf     main__52,f
1140 0080 0c37          rrf     main__52,w
1141 0081 3907          andlw   7
1142 0082 3e84          addlw   main__51
1143 0083 0082          movwf   __pcl
1144                    ; page_group 8
1145   0084 :   main__51:
1146 0084 288c          goto    main__47
1147 0085 288c          goto    main__47
1148 0086 288c          goto    main__47
1149 0087 288c          goto    main__47
1150 0088 288c          goto    main__47
1151 0089 288d          goto    main__48
1152 008a 289b          goto    main__49
1153 008b 28b8          goto    main__50
1154                    ; line_number = 128
1155                    ; case 0, 1, 2, 3, 4
1156   008c :   main__47:
1157                    ; # Command = 1100 xxxx or 1110 0xxx:
1158                    ; line_number = 130
1159                    ;  do_nothing
1160 008c 28ee          goto    main__53
1161                    ; line_number = 131
1162                    ; case 5
1163   008d :   main__48:
1164                    ; # Read Interrupt Bits (Command = 1110 1111):
1165                    ; line_number = 133
1166                    ;  if (command & 7) = 7 start
1167                    ; Left minus Right
1168 008d 3007          movlw   7
1169 008e 052e          andwf   main__command,w
1170 008f 3ef9          addlw   249
1171                    ; (after recombine) true_delay=non-uniform, false_delay=non-uniform
1172                    ; CASE: true_code.size = 0 && false_code.size > 1
1173                    ; bit_code_emit_helper1: body_code.size=8 true_test=true body_code.delay=0 (non-uniform delay)
1174 0090 1d03          btfss   __z___byte, __z___bit
1175 0091 289a          goto    main__26
1176                    ; # Return Interrupt Bits:
1177                    ; line_number = 135
1178                    ;  result := 0
1179 0092 3000          movlw   0
1180 0093 00b1          movwf   main__result
1181                    ; line_number = 136
1182                    ;  if interrupt_enable start
1183                    ; (after recombine) true_delay=non-uniform, false_delay=non-uniform
1184                    ; CASE: True.size=1 False.size=0
1185 0094 195f          btfsc   interrupt_enable___byte, interrupt_enable___bit
1186                    ; line_number = 137
1187                    ; result := result | 2
1188 0095 14b1          bsf     main__result, 1
1189                    ; Recombine size1 = 0 || size2 = 0
1190                    ; code.delay=4294967295 back_code.delay=4294967295
1191                    ; <=bit_code_emit@symbol; sym=interrupt_enable (data:X0=>X0 code:XX=>XX)
1192                    ; line_number = 136
1193                    ;  if interrupt_enable done
1194                    ; line_number = 138
1195                    ; if interrupt_pending start
1196                    ; (after recombine) true_delay=non-uniform, false_delay=non-uniform
1197                    ; CASE: True.size=1 False.size=0
1198 0096 19df          btfsc   interrupt_pending___byte, interrupt_pending___bit
1199                    ; line_number = 139
1200                    ; result := result + 1
1201 0097 0ab1          incf    main__result,f
1202                    ; Recombine size1 = 0 || size2 = 0
1203                    ; code.delay=4294967295 back_code.delay=4294967295
1204                    ; <=bit_code_emit@symbol; sym=interrupt_pending (data:X0=>X0 code:XX=>XX)
1205                    ; line_number = 138
1206                    ; if interrupt_pending done
1207                    ; line_number = 140
1208                    ; call byte_put(result)
1209 0098 0831          movf    main__result,w
1210 0099 2196          call    byte_put
1211                    ; Recombine size1 = 0 || size2 = 0
1212   009a :   main__26:
1213                    ; code.delay=4294967295 back_code.delay=4294967295
1214                    ; <=bit_code_emit@symbol; sym=__z (data:X0=>X0 code:XX=>XX)
1215                    ; line_number = 133
1216                    ;  if (command & 7) = 7 done
1217 009a 28ee          goto    main__53
1218                    ; line_number = 141
1219                    ; case 6
1220   009b :   main__49:
1221                    ; # Shared Interrupt commands (Command = 1111 0xxx):
1222                    ; line_number = 143
1223                    ;  switch command & 7 start
1224 009b 3000          movlw   main__34>>8
1225 009c 008a          movwf   __pclath
1226 009d 3007          movlw   7
1227 009e 052e          andwf   main__command,w
1228 009f 3ea1          addlw   main__34
1229 00a0 0082          movwf   __pcl
1230                    ; page_group 8
1231   00a1 :   main__34:
1232 00a1 28a9          goto    main__31
1233 00a2 28a9          goto    main__31
1234 00a3 28a9          goto    main__31
1235 00a4 28a9          goto    main__31
1236 00a5 28b0          goto    main__32
1237 00a6 28b0          goto    main__32
1238 00a7 28b4          goto    main__33
1239 00a8 28b4          goto    main__33
1240                    ; line_number = 144
1241                    ; case 0, 1, 2, 3
1242   00a9 :   main__31:
1243                    ; # Set interrupt bits (Command = 1111 00ep):
1244                    ; line_number = 146
1245                    ;  interrupt_enable := command@1
1246 00a9 115f          bcf     interrupt_enable___byte, interrupt_enable___bit
1247 0000002e = main__select__27___byte equ main__command
1248 00000001 = main__select__27___bit equ 1
1249                    ; (after recombine) true_delay=non-uniform, false_delay=non-uniform
1250                    ; CASE: True.size=1 False.size=0
1251 00aa 18ae          btfsc   main__select__27___byte, main__select__27___bit
1252 00ab 155f          bsf     interrupt_enable___byte, interrupt_enable___bit
1253                    ; Recombine size1 = 0 || size2 = 0
1254                    ; code.delay=4294967295 back_code.delay=4294967295
1255                    ; <=bit_code_emit@symbol; sym=main__select__27 (data:X0=>X0 code:XX=>XX)
1256                    ; line_number = 147
1257                    ;  interrupt_pending := command@0
1258 00ac 11df          bcf     interrupt_pending___byte, interrupt_pending___bit
1259 0000002e = main__select__28___byte equ main__command
1260 00000000 = main__select__28___bit equ 0
1261                    ; (after recombine) true_delay=non-uniform, false_delay=non-uniform
1262                    ; CASE: True.size=1 False.size=0
1263 00ad 182e          btfsc   main__select__28___byte, main__select__28___bit
1264 00ae 15df          bsf     interrupt_pending___byte, interrupt_pending___bit
1265                    ; Recombine size1 = 0 || size2 = 0
1266                    ; code.delay=4294967295 back_code.delay=4294967295
1267                    ; <=bit_code_emit@symbol; sym=main__select__28 (data:X0=>X0 code:XX=>XX)
1268 00af 28b7          goto    main__35
1269                    ; line_number = 148
1270                    ; case 4, 5
1271   00b0 :   main__32:
1272                    ; # Set Interrupt Pending (Command = 1111 010p):
1273                    ; line_number = 150
1274                    ;  interrupt_pending := command@0
1275 00b0 11df          bcf     interrupt_pending___byte, interrupt_pending___bit
1276 0000002e = main__select__29___byte equ main__command
1277 00000000 = main__select__29___bit equ 0
1278                    ; (after recombine) true_delay=non-uniform, false_delay=non-uniform
1279                    ; CASE: True.size=1 False.size=0
1280 00b1 182e          btfsc   main__select__29___byte, main__select__29___bit
1281 00b2 15df          bsf     interrupt_pending___byte, interrupt_pending___bit
1282                    ; Recombine size1 = 0 || size2 = 0
1283                    ; code.delay=4294967295 back_code.delay=4294967295
1284                    ; <=bit_code_emit@symbol; sym=main__select__29 (data:X0=>X0 code:XX=>XX)
1285 00b3 28b7          goto    main__35
1286                    ; line_number = 151
1287                    ; case 6, 7
1288   00b4 :   main__33:
1289                    ; # Set Interrupt Enable (Command = 1110 011e):
1290                    ; line_number = 153
1291                    ;  interrupt_enable := command@0
1292 00b4 115f          bcf     interrupt_enable___byte, interrupt_enable___bit
1293 0000002e = main__select__30___byte equ main__command
1294 00000000 = main__select__30___bit equ 0
1295                    ; (after recombine) true_delay=non-uniform, false_delay=non-uniform
1296                    ; CASE: True.size=1 False.size=0
1297 00b5 182e          btfsc   main__select__30___byte, main__select__30___bit
1298 00b6 155f          bsf     interrupt_enable___byte, interrupt_enable___bit
1299                    ; Recombine size1 = 0 || size2 = 0
1300                    ; code.delay=4294967295 back_code.delay=4294967295
1301                    ; <=bit_code_emit@symbol; sym=main__select__30 (data:X0=>X0 code:XX=>XX)
1302   00b7 :   main__35:
1303                    ; switch end:(data:X0=>X0 code:XX=>XX)
1304                    ; line_number = 143
1305                    ;  switch command & 7 done
1306 00b7 28ee          goto    main__53
1307                    ; line_number = 154
1308                    ; case 7
1309   00b8 :   main__50:
1310                    ; # Shared commands (Command = 1111 1xxx):
1311                    ; line_number = 156
1312                    ;  switch command & 7 start
1313 00b8 3000          movlw   main__45>>8
1314 00b9 008a          movwf   __pclath
1315 00ba 3007          movlw   7
1316 00bb 052e          andwf   main__command,w
1317 00bc 3ebe          addlw   main__45
1318 00bd 0082          movwf   __pcl
1319                    ; page_group 8
1320   00be :   main__45:
1321 00be 28c6          goto    main__37
1322 00bf 28ca          goto    main__38
1323 00c0 28ce          goto    main__39
1324 00c1 28d3          goto    main__40
1325 00c2 28d6          goto    main__41
1326 00c3 28e3          goto    main__42
1327 00c4 28e6          goto    main__43
1328 00c5 28eb          goto    main__44
1329                    ; line_number = 157
1330                    ; case 0
1331   00c6 :   main__37:
1332                    ; This case body wants this bit set
1333 00c6 1683          bsf     __rp0___byte, __rp0___bit
1334                    ; # Clock Decrement (Command = 1111 1000):
1335                    ; line_number = 159
1336                    ;  _osccal := _osccal - _osccal_lsb
1337 00c7 30fc          movlw   252
1338 00c8 0790          addwf   _osccal,f
1339 00c9 28ee          goto    main__46
1340                    ; line_number = 160
1341                    ; case 1
1342   00ca :   main__38:
1343                    ; This case body wants this bit set
1344 00ca 1683          bsf     __rp0___byte, __rp0___bit
1345                    ; # Clock Increment (Command = 1111 1001):
1346                    ; line_number = 162
1347                    ;  _osccal := _osccal + _osccal_lsb
1348 00cb 3004          movlw   4
1349 00cc 0790          addwf   _osccal,f
1350 00cd 28ee          goto    main__46
1351                    ; line_number = 163
1352                    ; case 2
1353   00ce :   main__39:
1354                    ; This case body wants this bit set
1355 00ce 1683          bsf     __rp0___byte, __rp0___bit
1356                    ; # Clock Read (Command = 1111 1010):
1357                    ; line_number = 165
1358                    ;  call byte_put(_osccal)
1359 00cf 0810          movf    _osccal,w
1360 00d0 1283          bcf     __rp0___byte, __rp0___bit
1361 00d1 2196          call    byte_put
1362 00d2 28ee          goto    main__46
1363                    ; line_number = 166
1364                    ; case 3
1365   00d3 :   main__40:
1366                    ; # Clock Pulse (Command = 1111 1011):
1367                    ; line_number = 168
1368                    ;  call byte_put(0)
1369 00d3 3000          movlw   0
1370 00d4 2196          call    byte_put
1371 00d5 28ee          goto    main__46
1372                    ; line_number = 169
1373                    ; case 4
1374   00d6 :   main__41:
1375                    ; # ID Next (Command = 1111 1100):
1376                    ; line_number = 171
1377                    ;  temp := 0
1378 00d6 3000          movlw   0
1379 00d7 00b2          movwf   main__temp
1380                    ; line_number = 172
1381                    ;  if id_index < id.size start
1382 00d8 3031          movlw   49
1383 00d9 0230          subwf   main__id_index,w
1384                    ; (after recombine) true_delay=non-uniform, false_delay=non-uniform
1385                    ; CASE: true.size=0 && false.size>1
1386                    ; bit_code_emit_helper1: body_code.size=4 true_test=false body_code.delay=0 (non-uniform delay)
1387 00da 1803          btfsc   __c___byte, __c___bit
1388 00db 28e0          goto    main__36
1389                    ; line_number = 173
1390                    ; temp := id[id_index]
1391 00dc 0830          movf    main__id_index,w
1392 00dd 2136          call    id
1393 00de 00b2          movwf   main__temp
1394                    ; line_number = 174
1395                    ;  id_index := id_index + 1
1396 00df 0ab0          incf    main__id_index,f
1397   00e0 :   main__36:
1398                    ; Recombine size1 = 0 || size2 = 0
1399                    ; code.delay=4294967295 back_code.delay=4294967295
1400                    ; <=bit_code_emit@symbol; sym=__c (data:X0=>X0 code:XX=>XX)
1401                    ; line_number = 172
1402                    ;  if id_index < id.size done
1403                    ; line_number = 175
1404                    ; call byte_put(temp)
1405 00e0 0832          movf    main__temp,w
1406 00e1 2196          call    byte_put
1407 00e2 28ee          goto    main__46
1408                    ; line_number = 176
1409                    ; case 5
1410   00e3 :   main__42:
1411                    ; # ID Reset (Command = 1111 1101):
1412                    ; line_number = 178
1413                    ;  id_index := 0
1414 00e3 3000          movlw   0
1415 00e4 00b0          movwf   main__id_index
1416 00e5 28ee          goto    main__46
1417                    ; line_number = 179
1418                    ; case 6
1419   00e6 :   main__43:
1420                    ; # Glitch Read (Command = 1111 1110):
1421                    ; line_number = 181
1422                    ;  call byte_put(glitch)
1423 00e6 082f          movf    main__glitch,w
1424 00e7 2196          call    byte_put
1425                    ; line_number = 182
1426                    ;  glitch := 0
1427 00e8 3000          movlw   0
1428 00e9 00af          movwf   main__glitch
1429 00ea 28ee          goto    main__46
1430                    ; line_number = 183
1431                    ; case 7
1432   00eb :   main__44:
1433                    ; # Glitch (Command = 1111 1111):
1434                    ; line_number = 185
1435                    ;  if glitch != 0xff start
1436                    ; Left minus Right
1437 00eb 0a2f          incf    main__glitch,w
1438                    ; (after recombine) true_delay=non-uniform, false_delay=non-uniform
1439                    ; CASE: true_code.size=0 && false_code.size=1
1440 00ec 1d03          btfss   __z___byte, __z___bit
1441                    ; line_number = 186
1442                    ; glitch := glitch + 1
1443 00ed 0aaf          incf    main__glitch,f
1444            
1445                    ; Recombine size1 = 0 || size2 = 0
1446                    ; code.delay=4294967295 back_code.delay=4294967295
1447                    ; <=bit_code_emit@symbol; sym=__z (data:X0=>X0 code:XX=>XX)
1448                    ; line_number = 185
1449                    ;  if glitch != 0xff done
1450   00ee :   main__46:
1451                    ; switch end:(data:X0=>X? code:XX=>XX)
1452                    ; line_number = 156
1453                    ;  switch command & 7 done
1454   00ee :   main__53:
1455                    ; switch end:(data:X0=>X? code:XX=>XX)
1456                    ; line_number = 127
1457                    ;  switch (command >> 3) & 7 done
1458   00ee :   main__59:
1459                    ; switch end:(data:X0=>X? code:XX=>XX)
1460                    ; line_number = 70
1461                    ;  switch command >> 6 done
1462                    ; line_number = 68
1463                    ;  loop_forever wrap-up
1464                    ; Need to adjust code banks to match front of loop
1465 00ee 1283          bcf     __rp0___byte, __rp0___bit
1466 00ef 2816          goto    main__1
1467                    ; line_number = 68
1468                    ;  loop_forever done
1469                    ; delay after procedure statements=non-uniform
1470            
1471            
1472            
1473            
1474                    ; line_number = 188
1475                    ; procedure delay
1476   00f0 :   delay:
1477                    ; arguments_none
1478                    ; line_number = 190
1479                    ;  returns_nothing
1480                    ; line_number = 191
1481                    ;  exact_delay delay_instructions
1482            
1483                    ; # This procedure delays for 1 third of a bit time.  It is responsible
1484                    ; # for reading the inputs and dealing with interrupts.
1485            
1486                    ; line_number = 196
1487                    ;  local changed byte
1488 00000033 = delay__changed equ shared___globals+19
1489                    ; line_number = 197
1490                    ;  local previous byte
1491 00000034 = delay__previous equ shared___globals+20
1492                    ; line_number = 198
1493                    ;  local not_inputs byte
1494 00000035 = delay__not_inputs equ shared___globals+21
1495                    ; line_number = 199
1496                    ;  local counter byte
1497 00000036 = delay__counter equ shared___globals+22
1498            
1499                    ; before procedure statements delay=0, bit states=(data:X0=>X0 code:XX=>XX)
1500                    ; line_number = 201
1501                    ;  watch_dog_reset done
1502                    ; Delay at watch_dog_reset is 0
1503 00f0 0064          clrwdt  
1504            
1505                    ; # Clear the select bits:
1506                    ; line_number = 204
1507                    ;  _gpio := _gpio & 0xf8
1508                    ; Delay at assignment is 1
1509 00f1 30f8          movlw   248
1510 00f2 0585          andwf   _gpio,f
1511            
1512                    ; line_number = 206
1513                    ;  inputs := 0
1514                    ; Delay at assignment is 3
1515 00f3 3000          movlw   0
1516 00f4 00a4          movwf   inputs
1517                    ; line_number = 207
1518                    ;  if in3 start
1519                    ; Delay at if is 5
1520                    ; (after recombine) true_delay=1, false_delay=0 uniform_delay=true
1521                    ; CASE: True.size=1 False.size=0
1522 00f5 1a05          btfsc   in3___byte, in3___bit
1523                    ; line_number = 208
1524                    ; inputs@7 := 1
1525                    ; Delay at assignment is 0
1526 00000024 = delay__select__1___byte equ inputs
1527 00000007 = delay__select__1___bit equ 7
1528 00f6 17a4          bsf     delay__select__1___byte, delay__select__1___bit
1529                    ; code.delay=7 back_code.delay=0
1530                    ; <=bit_code_emit@symbol; sym=in3 (data:X0=>X0 code:XX=>XX)
1531                    ; if final true delay=1 false delay=0 code delay=7
1532                    ; line_number = 207
1533                    ;  if in3 done
1534                    ; line_number = 209
1535                    ; out0 := 1
1536                    ; Delay at assignment is 7
1537 00f7 1405          bsf     out0___byte, out0___bit
1538                    ; line_number = 210
1539                    ;  if in3 start
1540                    ; Delay at if is 8
1541                    ; (after recombine) true_delay=1, false_delay=0 uniform_delay=true
1542                    ; CASE: True.size=1 False.size=0
1543 00f8 1a05          btfsc   in3___byte, in3___bit
1544                    ; line_number = 211
1545                    ; inputs@6 := 1
1546                    ; Delay at assignment is 0
1547 00000024 = delay__select__2___byte equ inputs
1548 00000006 = delay__select__2___bit equ 6
1549 00f9 1724          bsf     delay__select__2___byte, delay__select__2___bit
1550                    ; code.delay=10 back_code.delay=0
1551                    ; <=bit_code_emit@symbol; sym=in3 (data:X0=>X0 code:XX=>XX)
1552                    ; if final true delay=1 false delay=0 code delay=10
1553                    ; line_number = 210
1554                    ;  if in3 done
1555                    ; line_number = 212
1556                    ; out1 := 1
1557                    ; Delay at assignment is 10
1558 00fa 1485          bsf     out1___byte, out1___bit
1559                    ; line_number = 213
1560                    ;  if in3 start
1561                    ; Delay at if is 11
1562                    ; (after recombine) true_delay=1, false_delay=0 uniform_delay=true
1563                    ; CASE: True.size=1 False.size=0
1564 00fb 1a05          btfsc   in3___byte, in3___bit
1565                    ; line_number = 214
1566                    ; inputs@4 := 1
1567                    ; Delay at assignment is 0
1568 00000024 = delay__select__3___byte equ inputs
1569 00000004 = delay__select__3___bit equ 4
1570 00fc 1624          bsf     delay__select__3___byte, delay__select__3___bit
1571                    ; code.delay=13 back_code.delay=0
1572                    ; <=bit_code_emit@symbol; sym=in3 (data:X0=>X0 code:XX=>XX)
1573                    ; if final true delay=1 false delay=0 code delay=13
1574                    ; line_number = 213
1575                    ;  if in3 done
1576                    ; line_number = 215
1577                    ; out0 := 0
1578                    ; Delay at assignment is 13
1579 00fd 1005          bcf     out0___byte, out0___bit
1580                    ; line_number = 216
1581                    ;  if in3 start
1582                    ; Delay at if is 14
1583                    ; (after recombine) true_delay=1, false_delay=0 uniform_delay=true
1584                    ; CASE: True.size=1 False.size=0
1585 00fe 1a05          btfsc   in3___byte, in3___bit
1586                    ; line_number = 217
1587                    ; inputs@5 := 1
1588                    ; Delay at assignment is 0
1589 00000024 = delay__select__4___byte equ inputs
1590 00000005 = delay__select__4___bit equ 5
1591 00ff 16a4          bsf     delay__select__4___byte, delay__select__4___bit
1592                    ; code.delay=16 back_code.delay=0
1593                    ; <=bit_code_emit@symbol; sym=in3 (data:X0=>X0 code:XX=>XX)
1594                    ; if final true delay=1 false delay=0 code delay=16
1595                    ; line_number = 216
1596                    ;  if in3 done
1597                    ; line_number = 218
1598                    ; out2 := 1
1599                    ; Delay at assignment is 16
1600 0100 1505          bsf     out2___byte, out2___bit
1601                    ; line_number = 219
1602                    ;  if in3 start
1603                    ; Delay at if is 17
1604                    ; (after recombine) true_delay=1, false_delay=0 uniform_delay=true
1605                    ; CASE: True.size=1 False.size=0
1606 0101 1a05          btfsc   in3___byte, in3___bit
1607                    ; line_number = 220
1608                    ; inputs@1 := 1
1609                    ; Delay at assignment is 0
1610 00000024 = delay__select__5___byte equ inputs
1611 00000001 = delay__select__5___bit equ 1
1612 0102 14a4          bsf     delay__select__5___byte, delay__select__5___bit
1613                    ; code.delay=19 back_code.delay=0
1614                    ; <=bit_code_emit@symbol; sym=in3 (data:X0=>X0 code:XX=>XX)
1615                    ; if final true delay=1 false delay=0 code delay=19
1616                    ; line_number = 219
1617                    ;  if in3 done
1618                    ; line_number = 221
1619                    ; out0 := 1
1620                    ; Delay at assignment is 19
1621 0103 1405          bsf     out0___byte, out0___bit
1622                    ; line_number = 222
1623                    ;  if in3 start
1624                    ; Delay at if is 20
1625                    ; (after recombine) true_delay=1, false_delay=0 uniform_delay=true
1626                    ; CASE: True.size=1 False.size=0
1627 0104 1a05          btfsc   in3___byte, in3___bit
1628                    ; line_number = 223
1629                    ; inputs@0 := 1
1630                    ; Delay at assignment is 0
1631 00000024 = delay__select__6___byte equ inputs
1632 00000000 = delay__select__6___bit equ 0
1633 0105 1424          bsf     delay__select__6___byte, delay__select__6___bit
1634                    ; code.delay=22 back_code.delay=0
1635                    ; <=bit_code_emit@symbol; sym=in3 (data:X0=>X0 code:XX=>XX)
1636                    ; if final true delay=1 false delay=0 code delay=22
1637                    ; line_number = 222
1638                    ;  if in3 done
1639                    ; line_number = 224
1640                    ; out1 := 0
1641                    ; Delay at assignment is 22
1642 0106 1085          bcf     out1___byte, out1___bit
1643                    ; line_number = 225
1644                    ;  if in3 start
1645                    ; Delay at if is 23
1646                    ; (after recombine) true_delay=1, false_delay=0 uniform_delay=true
1647                    ; CASE: True.size=1 False.size=0
1648 0107 1a05          btfsc   in3___byte, in3___bit
1649                    ; line_number = 226
1650                    ; inputs@2 := 1
1651                    ; Delay at assignment is 0
1652 00000024 = delay__select__7___byte equ inputs
1653 00000002 = delay__select__7___bit equ 2
1654 0108 1524          bsf     delay__select__7___byte, delay__select__7___bit
1655                    ; code.delay=25 back_code.delay=0
1656                    ; <=bit_code_emit@symbol; sym=in3 (data:X0=>X0 code:XX=>XX)
1657                    ; if final true delay=1 false delay=0 code delay=25
1658                    ; line_number = 225
1659                    ;  if in3 done
1660                    ; line_number = 227
1661                    ; out0 := 0
1662                    ; Delay at assignment is 25
1663 0109 1005          bcf     out0___byte, out0___bit
1664                    ; line_number = 228
1665                    ;  if in3 start
1666                    ; Delay at if is 26
1667                    ; (after recombine) true_delay=1, false_delay=0 uniform_delay=true
1668                    ; CASE: True.size=1 False.size=0
1669 010a 1a05          btfsc   in3___byte, in3___bit
1670                    ; line_number = 229
1671                    ; inputs@3 := 1
1672                    ; Delay at assignment is 0
1673 00000024 = delay__select__8___byte equ inputs
1674 00000003 = delay__select__8___bit equ 3
1675 010b 15a4          bsf     delay__select__8___byte, delay__select__8___bit
1676                    ; code.delay=28 back_code.delay=0
1677                    ; <=bit_code_emit@symbol; sym=in3 (data:X0=>X0 code:XX=>XX)
1678                    ; if final true delay=1 false delay=0 code delay=28
1679                    ; line_number = 228
1680                    ;  if in3 done
1681                    ; line_number = 230
1682                    ; out2 := 0
1683                    ; Delay at assignment is 28
1684 010c 1105          bcf     out2___byte, out2___bit
1685            
1686                    ; # Deal with interrupts:
1687                    ; line_number = 233
1688                    ;  not_inputs := inputs ^ 0xff
1689                    ; Delay at assignment is 29
1690 010d 30ff          movlw   255
1691 010e 0624          xorwf   inputs,w
1692 010f 00b5          movwf   delay__not_inputs
1693                    ; line_number = 234
1694                    ;  changed := inputs ^ previous
1695                    ; Delay at assignment is 32
1696 0110 0824          movf    inputs,w
1697 0111 0634          xorwf   delay__previous,w
1698 0112 00b3          movwf   delay__changed
1699                    ; line_number = 235
1700                    ;  if (low & not_inputs) | (high & inputs) | (changed & inputs & raising) | (changed & not_inputs & falling) != 0 start
1701                    ; Delay at if is 35
1702                    ; Left minus Right
1703 00000038 = delay__9 equ shared___globals+24
1704 0113 0828          movf    low,w
1705 0114 0535          andwf   delay__not_inputs,w
1706 0115 00b8          movwf   delay__9
1707 0116 0827          movf    high,w
1708 0117 0524          andwf   inputs,w
1709 0118 04b8          iorwf   delay__9,f
1710 0119 0833          movf    delay__changed,w
1711 011a 0524          andwf   inputs,w
1712 011b 0529          andwf   raising,w
1713 011c 04b8          iorwf   delay__9,f
1714 011d 0833          movf    delay__changed,w
1715 011e 0535          andwf   delay__not_inputs,w
1716 011f 0526          andwf   falling,w
1717 0120 0438          iorwf   delay__9,w
1718                    ; (after recombine) true_delay=0, false_delay=1 uniform_delay=true
1719                    ; CASE: true_code.size=0 && false_code.size=1
1720 0121 1d03          btfss   __z___byte, __z___bit
1721                    ; line_number = 237
1722                    ; interrupt_pending := 1
1723                    ; Delay at assignment is 0
1724 0122 15df          bsf     interrupt_pending___byte, interrupt_pending___bit
1725                    ; code.delay=51 back_code.delay=0
1726                    ; <=bit_code_emit@symbol; sym=__z (data:X0=>X0 code:XX=>XX)
1727                    ; Uniform delay broke in relation_code_emit
1728                    ; if final true delay=1 false delay=0 code delay=51
1729                    ; line_number = 235
1730                    ;  if (low & not_inputs) | (high & inputs) | (changed & inputs & raising) | (changed & not_inputs & falling) != 0 done
1731            
1732                    ; # Remember current inputs for next time around:
1733                    ; line_number = 239
1734                    ;  previous := inputs
1735                    ; Delay at assignment is 51
1736 0123 0824          movf    inputs,w
1737 0124 00b4          movwf   delay__previous
1738            
1739                    ; # Send an interrupt if interrupts are enabled:
1740                    ; line_number = 242
1741                    ;  if interrupt_pending && interrupt_enable start
1742                    ; Delay at if is 53
1743                    ; (after recombine) true_delay=5, false_delay=2 uniform_delay=true
1744                    ; CASE: true.size>1 false.size=1; false=GOTO
1745                    ; Uniform delay
1746 0125 19df          btfsc   interrupt_pending___byte, interrupt_pending___bit
1747 0126 292a          goto    delay__13
1748 0127 2930          goto    delay__10
1749                    ; Delay 2 cycles
1750 0128 2929          goto    delay__15
1751   0129 :   delay__15:
1752 0129 2930          goto    delay__14
1753   012a :   delay__13:
1754                    ; &&||: index=1 true_delay=2 false_delay=0 goto_delay=2
1755                    ; (after recombine) true_delay=2, false_delay=0 uniform_delay=true
1756                    ; CASE: true_code.size = 0 && false_code.size > 1
1757                    ; bit_code_emit_helper1: body_code.size=2 true_test=true body_code.delay=2 (uniform delay)
1758 012a 195f          btfsc   interrupt_enable___byte, interrupt_enable___bit
1759 012b 292e          goto    delay__11
1760                    ; Delay 1 cycles
1761 012c 0000          nop     
1762 012d 2930          goto    delay__12
1763   012e :   delay__11:
1764                    ; # Shove serial out to low to indicate an interrupt:
1765                    ; line_number = 244
1766                    ;  interrupt_enable := 0
1767                    ; Delay at assignment is 0
1768 012e 115f          bcf     interrupt_enable___byte, interrupt_enable___bit
1769                    ; line_number = 245
1770                    ;  serial_out := 0
1771                    ; Delay at assignment is 1
1772 012f 1285          bcf     serial_out___byte, serial_out___bit
1773            
1774            
1775   0130 :   delay__12:
1776   0130 :   delay__10:
1777                    ; code.delay=5 back_code.delay=0
1778                    ; <=bit_code_emit@symbol; sym=interrupt_enable (data:X0=>X0 code:XX=>XX)
1779                    ; &&||: index=0 true_delay=2 false_delay=0 goto_delay=2
1780                    ; &&||:: index=0 new_delay=5 goto_delay=2
1781   0130 :   delay__14:
1782                    ; code.delay=4294967295 back_code.delay=0
1783                    ; <=bit_code_emit@symbol; sym=interrupt_pending (data:X0=>X0 code:XX=>XX)
1784                    ; if final true delay=2 false delay=0 code delay=53
1785                    ; line_number = 242
1786                    ;  if interrupt_pending && interrupt_enable done
1787                    ; delay after procedure statements=53
1788                    ; Delay 78 cycles
1789                    ; Delay loop takes 19 * 4 = 76 cycles
1790 0130 3013          movlw   19
1791   0131 :   delay__16:
1792 0131 3eff          addlw   255
1793 0132 1d03          btfss   __z___byte, __z___bit
1794 0133 2931          goto    delay__16
1795 0134 2935          goto    delay__17
1796   0135 :   delay__17:
1797                    ; Implied return
1798 0135 3400          retlw   0
1799                    ; Final delay = 133
1800            
1801            
1802            
1803            
1804                    ; line_number = 248
1805                    ; constant zero8 = "\0,0,0,0,0,0,0,0\"
1806                    ; zero8 = '\0,0,0,0,0,0,0,0\'
1807                    ; line_number = 249
1808                    ; constant vendor_name = "\15\Gramlich&Benson"
1809                    ; vendor_name = '\15\Gramlich&Benson'
1810                    ; line_number = 250
1811                    ; constant module_name = "\8\Switch8A"
1812                    ; module_name = '\8\Switch8A'
1813            
1814                    ; line_number = 252
1815                    ; string id = "\1,0,18,0,0,0,0,0\" ~ zero8 ~ zero8 ~ module_name ~ vendor_name start
1816                    ; id = '\1,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8\Switch8A\15\Gramlich&Benson'
1817   0136 :   id:
1818                    ; Temporarily save index into FSR
1819 0136 0084          movwf   __fsr
1820                    ; Initialize PCLATH to point to this code page
1821 0137 3001          movlw   id___base>>8
1822 0138 008a          movwf   __pclath
1823                    ; Restore index from FSR
1824 0139 0804          movf    __fsr,w
1825 013a 3e3c          addlw   id___base
1826                    ; Index to the correct return value
1827 013b 0082          movwf   __pcl
1828                    ; page_group 49
1829   013c :   id___base:
1830 013c 3401          retlw   1
1831 013d 3400          retlw   0
1832 013e 3412          retlw   18
1833 013f 3400          retlw   0
1834 0140 3400          retlw   0
1835 0141 3400          retlw   0
1836 0142 3400          retlw   0
1837 0143 3400          retlw   0
1838 0144 3400          retlw   0
1839 0145 3400          retlw   0
1840 0146 3400          retlw   0
1841 0147 3400          retlw   0
1842 0148 3400          retlw   0
1843 0149 3400          retlw   0
1844 014a 3400          retlw   0
1845 014b 3400          retlw   0
1846 014c 3400          retlw   0
1847 014d 3400          retlw   0
1848 014e 3400          retlw   0
1849 014f 3400          retlw   0
1850 0150 3400          retlw   0
1851 0151 3400          retlw   0
1852 0152 3400          retlw   0
1853 0153 3400          retlw   0
1854 0154 3408          retlw   8
1855 0155 3453          retlw   83
1856 0156 3477          retlw   119
1857 0157 3469          retlw   105
1858 0158 3474          retlw   116
1859 0159 3463          retlw   99
1860 015a 3468          retlw   104
1861 015b 3438          retlw   56
1862 015c 3441          retlw   65
1863 015d 340f          retlw   15
1864 015e 3447          retlw   71
1865 015f 3472          retlw   114
1866 0160 3461          retlw   97
1867 0161 346d          retlw   109
1868 0162 346c          retlw   108
1869 0163 3469          retlw   105
1870 0164 3463          retlw   99
1871 0165 3468          retlw   104
1872 0166 3426          retlw   38
1873 0167 3442          retlw   66
1874 0168 3465          retlw   101
1875 0169 346e          retlw   110
1876 016a 3473          retlw   115
1877 016b 346f          retlw   111
1878 016c 346e          retlw   110
1879                    ; line_number = 252
1880                    ; string id = "\1,0,18,0,0,0,0,0\" ~ zero8 ~ zero8 ~ module_name ~ vendor_name start
1881            
1882            
1883            
1884                    ; Appending 2 delayed procedures to code bank 0
1885                    ; buffer = 'bit_bang'
1886                    ; line_number = 33
1887                    ; procedure byte_get
1888   016d :   byte_get:
1889                    ; arguments_none
1890                    ; line_number = 35
1891                    ;  returns byte
1892            
1893                    ; # This procedure will wait for a byte to be received from
1894                    ; # serial_in_bit.  It calls the delay procedure for all delays.
1895                    ; # This procedure will keep calling the {delay} routine until
1896                    ; # data is received.
1897            
1898                    ; line_number = 42
1899                    ;  local count byte
1900 00000020 = byte_get__count equ shared___globals
1901                    ; line_number = 43
1902                    ;  local byte byte
1903 00000021 = byte_get__byte equ shared___globals+1
1904            
1905                    ; # Why does the delay procedure wait for a third of bit?  Well, it
1906                    ; # has to do with the loop immediately below.  If we catch the
1907                    ; # start bit at the beginning of a 1/3 bit time, we will be
1908                    ; # sampling data at approximately 1/3 of the way into each bit.
1909                    ; # Conversely, if we catch the start near the end of a 1/3 bit
1910                    ; # bit time, we will be sampling data at approximately 2/3 of the
1911                    ; # way into each bit.  So, what this means is that our bit sample
1912                    ; # times will be somewhere between 1/3 and 2/3 of bit (i.e. in
1913                    ; # the middle of the bit.
1914            
1915                    ; # It would be nice to tweak the code to shorter delay times
1916                    ; # (1/4 bit, 1/5 bit, etc.) but then it gets too hard to get
1917                    ; # the bookeeping done in the delay routine.  A PIC running at
1918                    ; # 4MHz (=1MIPS), only has 138 instructions available for the
1919                    ; # delay routine when at 1/3 of bit.
1920            
1921                    ; # Wait for a start bit:
1922                    ; before procedure statements delay=non-uniform, bit states=(data:X0=>X0 code:XX=>XX)
1923                    ; line_number = 62
1924                    ;  waiting := 1
1925 016d 14df          bsf     waiting___byte, waiting___bit
1926                    ; line_number = 63
1927                    ;  receiving := 1
1928 016e 145f          bsf     receiving___byte, receiving___bit
1929                    ; line_number = 64
1930                    ;  while serial_in start
1931   016f :   byte_get__1:
1932                    ; (after recombine) true_delay=non-uniform, false_delay=non-uniform
1933                    ; CASE: true_code.size = 0 && false_code.size > 1
1934                    ; bit_code_emit_helper1: body_code.size=2 true_test=true body_code.delay=0 (non-uniform delay)
1935 016f 1e05          btfss   serial_in___byte, serial_in___bit
1936 0170 2973          goto    byte_get__2
1937                    ; line_number = 65
1938                    ; delay instructions_per_delay - 3 start
1939                    ; Delay expression evaluates to 135
1940                    ; line_number = 66
1941                    ; call delay()
1942                    ; Delay at call is 0
1943 0171 20f0          call    delay
1944                    ; line_number = 65
1945                    ; delay instructions_per_delay - 3 done
1946 0172 296f          goto    byte_get__1
1947                    ; Recombine size1 = 0 || size2 = 0
1948   0173 :   byte_get__2:
1949                    ; code.delay=4294967295 back_code.delay=4294967295
1950                    ; <=bit_code_emit@symbol; sym=serial_in (data:X0=>X0 code:XX=>XX)
1951                    ; line_number = 64
1952                    ;  while serial_in done
1953                    ; line_number = 67
1954                    ; waiting := 0
1955 0173 10df          bcf     waiting___byte, waiting___bit
1956            
1957                    ; # Clear out any preceeding interrupt condition:
1958                    ; line_number = 70
1959                    ;  serial_out := 1
1960 0174 1685          bsf     serial_out___byte, serial_out___bit
1961            
1962                    ; # Skip over start bit:
1963                    ; line_number = 73
1964                    ;  delay instructions_per_bit - 2 start
1965                    ; Delay expression evaluates to 414
1966                    ; # There are two instructions of set-up for following loop_exactly:
1967                    ; line_number = 75
1968                    ;  call delay()
1969                    ; Delay at call is 0
1970 0175 20f0          call    delay
1971                    ; line_number = 76
1972                    ;  call delay()
1973                    ; Delay at call is 135
1974 0176 20f0          call    delay
1975                    ; line_number = 77
1976                    ;  call delay()
1977                    ; Delay at call is 270
1978 0177 20f0          call    delay
1979                    ; line_number = 78
1980                    ;  byte := 0
1981                    ; Delay at assignment is 405
1982 0178 3000          movlw   0
1983 0179 00a1          movwf   byte_get__byte
1984            
1985                    ; Delay 7 cycles
1986 017a 297b          goto    byte_get__3
1987   017b :   byte_get__3:
1988 017b 297c          goto    byte_get__4
1989   017c :   byte_get__4:
1990 017c 297d          goto    byte_get__5
1991   017d :   byte_get__5:
1992 017d 0000          nop     
1993                    ; line_number = 73
1994                    ;  delay instructions_per_bit - 2 done
1995                    ; # Read in 8 bits of data:
1996                    ; line_number = 81
1997                    ;  loop_exactly 8 start
1998 00000039 = byte_get__6 equ shared___globals+25
1999 017e 3008          movlw   8
2000 017f 00b9          movwf   byte_get__6
2001   0180 :   byte_get__7:
2002                    ; # There are 3 instrucitons of loop_exactly overhead:
2003                    ; line_number = 83
2004                    ;  delay instructions_per_bit - 3 start
2005                    ; Delay expression evaluates to 413
2006                    ; line_number = 84
2007                    ; call delay()
2008                    ; Delay at call is 0
2009 0180 20f0          call    delay
2010                    ; line_number = 85
2011                    ;  byte := byte >> 1
2012                    ; Delay at assignment is 135
2013                    ; Assignment of variable to self (no code needed)
2014 0181 0ca1          rrf     byte_get__byte,f
2015 0182 13a1          bcf     byte_get__byte, 7
2016                    ; line_number = 86
2017                    ;  if serial_in start
2018                    ; Delay at if is 137
2019                    ; (after recombine) true_delay=1, false_delay=0 uniform_delay=true
2020                    ; CASE: True.size=1 False.size=0
2021 0183 1a05          btfsc   serial_in___byte, serial_in___bit
2022                    ; line_number = 87
2023                    ; byte@7 := 1
2024                    ; Delay at assignment is 0
2025 00000021 = byte_get__select__8___byte equ byte_get__byte
2026 00000007 = byte_get__select__8___bit equ 7
2027 0184 17a1          bsf     byte_get__select__8___byte, byte_get__select__8___bit
2028                    ; code.delay=139 back_code.delay=0
2029                    ; <=bit_code_emit@symbol; sym=serial_in (data:X0=>X0 code:XX=>XX)
2030                    ; if final true delay=1 false delay=0 code delay=139
2031                    ; line_number = 86
2032                    ;  if serial_in done
2033                    ; line_number = 88
2034                    ; call delay()
2035                    ; Delay at call is 139
2036 0185 20f0          call    delay
2037                    ; line_number = 89
2038                    ;  call delay()
2039                    ; Delay at call is 274
2040 0186 20f0          call    delay
2041            
2042                    ; Delay 4 cycles
2043 0187 2988          goto    byte_get__9
2044   0188 :   byte_get__9:
2045 0188 2989          goto    byte_get__10
2046   0189 :   byte_get__10:
2047                    ; line_number = 83
2048                    ;  delay instructions_per_bit - 3 done
2049                    ; line_number = 81
2050                    ;  loop_exactly 8 wrap-up
2051 0189 0bb9          decfsz  byte_get__6,f
2052 018a 2980          goto    byte_get__7
2053                    ; line_number = 81
2054                    ;  loop_exactly 8 done
2055                    ; # Skip over 2/3's of stop bit; 3 cycles for return:
2056                    ; line_number = 92
2057                    ;  delay instructions_per_delay*2 - 3 start
2058                    ; Delay expression evaluates to 273
2059                    ; line_number = 93
2060                    ; call delay()
2061                    ; Delay at call is 0
2062 018b 20f0          call    delay
2063                    ; line_number = 94
2064                    ;  call delay()
2065                    ; Delay at call is 135
2066 018c 20f0          call    delay
2067                    ; Delay 3 cycles
2068 018d 298e          goto    byte_get__11
2069   018e :   byte_get__11:
2070 018e 0000          nop     
2071                    ; line_number = 92
2072                    ;  delay instructions_per_delay*2 - 3 done
2073                    ; line_number = 95
2074                    ; command_previous := command_last
2075 018f 082b          movf    command_last,w
2076 0190 00aa          movwf   command_previous
2077                    ; line_number = 96
2078                    ;  command_last := byte
2079 0191 0821          movf    byte_get__byte,w
2080 0192 00ab          movwf   command_last
2081                    ; line_number = 97
2082                    ;  serial_out := 1
2083 0193 1685          bsf     serial_out___byte, serial_out___bit
2084                    ; line_number = 98
2085                    ;  return byte start
2086                    ; line_number = 98
2087 0194 0821          movf    byte_get__byte,w
2088 0195 0008          return  
2089                    ; line_number = 98
2090                    ;  return byte done
2091            
2092            
2093                    ; delay after procedure statements=non-uniform
2094            
2095            
2096            
2097            
2098                    ; line_number = 101
2099                    ; procedure byte_put
2100   0196 :   byte_put:
2101                    ; Last argument is sitting in W; save into argument variable
2102 0196 00a3          movwf   byte_put__byte
2103                    ; delay=4294967295
2104                    ; line_number = 102
2105                    ; argument byte byte
2106 00000023 = byte_put__byte equ shared___globals+3
2107                    ; line_number = 103
2108                    ;  returns_nothing
2109            
2110                    ; # This procedure will send {byte} to {serial_out} pin.  The {delay}
2111                    ; # procedure is called to provide the appropriate bit timing.
2112            
2113                    ; line_number = 108
2114                    ;  local count byte
2115 00000022 = byte_put__count equ shared___globals+2
2116            
2117                    ; # {receiving} will be 1 if the last get/put routine was a get.
2118                    ; # Before we start transmitting a response back, we want to ensure
2119                    ; # that there has been enough time to turn the line around.
2120                    ; # We delay the first 1/3 of a bit to pad out the 9-2/3 bits
2121                    ; # from get_byte to 10 bits.  We delay another 3 bits just to
2122                    ; # ensure that slow interpreters do not get overrun.
2123                    ; before procedure statements delay=non-uniform, bit states=(data:X0=>X0 code:XX=>XX)
2124                    ; line_number = 116
2125                    ;  sent_previous := sent_last
2126 0197 082d          movf    sent_last,w
2127 0198 00ac          movwf   sent_previous
2128                    ; line_number = 117
2129                    ;  sent_last := byte
2130 0199 0823          movf    byte_put__byte,w
2131 019a 00ad          movwf   sent_last
2132                    ; line_number = 118
2133                    ;  if receiving start
2134                    ; (after recombine) true_delay=non-uniform, false_delay=non-uniform
2135                    ; CASE: true_code.size = 0 && false_code.size > 1
2136                    ; bit_code_emit_helper1: body_code.size=4 true_test=true body_code.delay=0 (non-uniform delay)
2137 019b 1c5f          btfss   receiving___byte, receiving___bit
2138 019c 29a3          goto    byte_put__3
2139                    ; line_number = 119
2140                    ; receiving := 0
2141 019d 105f          bcf     receiving___byte, receiving___bit
2142                    ; # 10 = 1 + 3*3 = 3-1/3 extra bits of delay:
2143                    ; line_number = 121
2144                    ;  loop_exactly 10 start
2145 0000003a = byte_put__1 equ shared___globals+26
2146 019e 300a          movlw   10
2147 019f 00ba          movwf   byte_put__1
2148   01a0 :   byte_put__2:
2149                    ; line_number = 122
2150                    ; call delay()
2151 01a0 20f0          call    delay
2152            
2153                    ; line_number = 121
2154                    ;  loop_exactly 10 wrap-up
2155 01a1 0bba          decfsz  byte_put__1,f
2156 01a2 29a0          goto    byte_put__2
2157                    ; line_number = 121
2158                    ;  loop_exactly 10 done
2159                    ; Recombine size1 = 0 || size2 = 0
2160   01a3 :   byte_put__3:
2161                    ; code.delay=4294967295 back_code.delay=4294967295
2162                    ; <=bit_code_emit@symbol; sym=receiving (data:X0=>X0 code:XX=>XX)
2163                    ; line_number = 118
2164                    ;  if receiving done
2165                    ; # Send the start bit:
2166                    ; line_number = 125
2167                    ;  delay instructions_per_bit - 2 start
2168                    ; Delay expression evaluates to 414
2169                    ; # The loop_exactly setup after this is 2 instructions:
2170                    ; line_number = 127
2171                    ;  serial_out := 0
2172                    ; Delay at assignment is 0
2173 01a3 1285          bcf     serial_out___byte, serial_out___bit
2174                    ; line_number = 128
2175                    ;  call delay()
2176                    ; Delay at call is 1
2177 01a4 20f0          call    delay
2178                    ; line_number = 129
2179                    ;  call delay()
2180                    ; Delay at call is 136
2181 01a5 20f0          call    delay
2182                    ; line_number = 130
2183                    ;  call delay()
2184                    ; Delay at call is 271
2185 01a6 20f0          call    delay
2186            
2187                    ; Delay 8 cycles
2188                    ; Delay loop takes 2 * 4 = 8 cycles
2189 01a7 3002          movlw   2
2190   01a8 :   byte_put__4:
2191 01a8 3eff          addlw   255
2192 01a9 1d03          btfss   __z___byte, __z___bit
2193 01aa 29a8          goto    byte_put__4
2194                    ; line_number = 125
2195                    ;  delay instructions_per_bit - 2 done
2196                    ; # Send the data:
2197                    ; line_number = 133
2198                    ;  loop_exactly 8 start
2199 0000003a = byte_put__5 equ shared___globals+26
2200 01ab 3008          movlw   8
2201 01ac 00ba          movwf   byte_put__5
2202   01ad :   byte_put__6:
2203                    ; # Loop_exactly overhead is 3 instructions:
2204                    ; line_number = 135
2205                    ;  delay instructions_per_bit - 3 start
2206                    ; Delay expression evaluates to 413
2207                    ; line_number = 136
2208                    ; if byte@0 start
2209                    ; Delay at if is 0
2210 00000023 = byte_put__select__7___byte equ byte_put__byte
2211 00000000 = byte_put__select__7___bit equ 0
2212                    ; (after recombine) true_delay=1, false_delay=1 uniform_delay=true
2213                    ; CASE: true_size=1 && false_size=1
2214                    ; SUBCASE: Double test; true, then false
2215 01ad 1823          btfsc   byte_put__select__7___byte, byte_put__select__7___bit
2216                    ; line_number = 137
2217                    ; serial_out := 1
2218                    ; Delay at assignment is 0
2219 01ae 1685          bsf     serial_out___byte, serial_out___bit
2220 01af 1c23          btfss   byte_put__select__7___byte, byte_put__select__7___bit
2221                    ; line_number = 139
2222                    ; serial_out := 0
2223                    ; Delay at assignment is 0
2224 01b0 1285          bcf     serial_out___byte, serial_out___bit
2225                    ; code.delay=4 back_code.delay=0
2226                    ; <=bit_code_emit@symbol; sym=byte_put__select__7 (data:X0=>X0 code:XX=>XX)
2227                    ; if final true delay=1 false delay=1 code delay=4
2228                    ; line_number = 136
2229                    ; if byte@0 done
2230                    ; line_number = 140
2231                    ; byte := byte >> 1
2232                    ; Delay at assignment is 4
2233                    ; Assignment of variable to self (no code needed)
2234 01b1 0ca3          rrf     byte_put__byte,f
2235 01b2 13a3          bcf     byte_put__byte, 7
2236                    ; line_number = 141
2237                    ;  call delay()
2238                    ; Delay at call is 6
2239 01b3 20f0          call    delay
2240                    ; line_number = 142
2241                    ;  call delay()
2242                    ; Delay at call is 141
2243 01b4 20f0          call    delay
2244                    ; line_number = 143
2245                    ;  call delay()
2246                    ; Delay at call is 276
2247 01b5 20f0          call    delay
2248            
2249                    ; Delay 2 cycles
2250 01b6 29b7          goto    byte_put__8
2251   01b7 :   byte_put__8:
2252                    ; line_number = 135
2253                    ;  delay instructions_per_bit - 3 done
2254                    ; line_number = 133
2255                    ;  loop_exactly 8 wrap-up
2256 01b7 0bba          decfsz  byte_put__5,f
2257 01b8 29ad          goto    byte_put__6
2258                    ; line_number = 133
2259                    ;  loop_exactly 8 done
2260                    ; # Send the stop bit:
2261                    ; line_number = 146
2262                    ;  delay instructions_per_bit start
2263                    ; Delay expression evaluates to 416
2264                    ; line_number = 147
2265                    ; serial_out := 1
2266                    ; Delay at assignment is 0
2267 01b9 1685          bsf     serial_out___byte, serial_out___bit
2268                    ; line_number = 148
2269                    ;  call delay()
2270                    ; Delay at call is 1
2271 01ba 20f0          call    delay
2272                    ; line_number = 149
2273                    ;  call delay()
2274                    ; Delay at call is 136
2275 01bb 20f0          call    delay
2276                    ; line_number = 150
2277                    ;  call delay()
2278                    ; Delay at call is 271
2279 01bc 20f0          call    delay
2280            
2281            
2282                    ; Delay 10 cycles
2283                    ; Delay loop takes 2 * 4 = 8 cycles
2284 01bd 3002          movlw   2
2285   01be :   byte_put__9:
2286 01be 3eff          addlw   255
2287 01bf 1d03          btfss   __z___byte, __z___bit
2288 01c0 29be          goto    byte_put__9
2289 01c1 29c2          goto    byte_put__10
2290   01c2 :   byte_put__10:
2291                    ; line_number = 146
2292                    ;  delay instructions_per_bit done
2293                    ; delay after procedure statements=non-uniform
2294                    ; Implied return
2295 01c2 3400          retlw   0
2296            
2297            
2298            
2299            
2300                    ; Configuration bits
2301                    ; fill = 0x0
2302                    ; bg = bg11 (0x3000)
2303                    ; cpd = off (0x100)
2304                    ; cp = off (0x80)
2305                    ; boden = off (0x0)
2306                    ; mclre = off (0x0)
2307                    ; pwrte = off (0x10)
2308                    ; wdte = off (0x0)
2309                    ; fosc = int_no_clk (0x4)
2310                    ; 12692 = 0x3194
2311   3194 =           __config 12692
2312                    ; Define start addresses for data regions
2313                    ; Region="shared___globals" Address=32" Size=64 Bytes=27 Bits=4 Available=36
2314                    ; Region="shared___globals" Address=32" Size=64 Bytes=27 Bits=4 Available=36
2315                    ; Region="shared___globals" Address=32" Size=64 Bytes=27 Bits=4 Available=36
2316                    end
