1                       radix   dec
2                       ; Code bank 0; Start address: 0; End address: 2047
3      0000 :           org     0
4               
5                       ; Define start addresses for data regions
6    00000070 = shared___globals equ 112
7    00000020 = globals___0 equ 32
8    000000a0 = globals___1 equ 160
9    00000120 = globals___2 equ 288
10   00000000 = __indf equ 0
11   00000002 = __pcl equ 2
12   00000003 = __status equ 3
13   00000004 = __fsr equ 4
14   00000003 = __c___byte equ 3
15   00000000 = __c___bit equ 0
16   00000003 = __z___byte equ 3
17   00000002 = __z___bit equ 2
18   00000003 = __rp0___byte equ 3
19   00000005 = __rp0___bit equ 5
20   00000003 = __rp1___byte equ 3
21   00000006 = __rp1___bit equ 6
22   00000003 = __irp___byte equ 3
23   00000007 = __irp___bit equ 7
24   0000000a = __pclath equ 10
25   0000000a = __cb0___byte equ 10
26   00000003 = __cb0___bit equ 3
27   0000000a = __cb1___byte equ 10
28   00000004 = __cb1___bit equ 4
29              
30                      ; # Copyright (c) 2002-2006 by Wayne C. Gramlich.
31                      ; # All rights reserved.
32              
33                      ; # This code started out as some assembly code that was written by
34                      ; # Chuck McManis.  It has been modified basically beyond recognition.
35                      ; # None-the-less, I would like to thank Chuck for his contribution
36                      ; # to the effort.
37              
38                      ; # The Lumix(r) LCM-S01602DTR/M 2 line by 16 character LCD panel uses the
39                      ; # Samsung(r) S6A0069 LCD controller.  The S6A0069 LCD controller has
40                      ; # 80 bytes of internal memory available for displaying characters.
41                      ; # The byte addresses for these data bytes are 0x00 through 0x4f(=79).
42                      ; # The controller will display the 16 characters of data starting at
43                      ; # 0x00 + N on the first line, and 0x20 + N on the second line, where
44                      ; # N is a number between 0 and 0x18(=24).
45              
46                      ; # The LCD32 module provides the user with 4 lines of 16 characters
47                      ; # each.  These are arranged as follows:
48                      ; #
49                      ; #   Line  Addresses Shift(N)
50                      ; #     0    00 - 0f    00
51                      ; #     1    20 - 2f    00
52                      ; #     2    10 - 1f    10
53                      ; #     3    30 - 3f    10
54                      ; #
55                      ; # In order to display lines 0 and 1, the shift amount (N) is set to 0.
56                      ; # In order to display lines 2 and 3, the shift amount is set to 0x10(=16).
57                      ; # The Samsung chip can only change the shift amount in increments of
58                      ; # +/- 1 per shift command.  However, since the command only requires
59                      ; # ~40uS, 16 shifts can take place so fast that it appears to be
60                      ; # instantenous to the end user.
61              
62                      ; # The operations to access the LCD controller take 39uS
63                      ; # to write a command or data and 43uS to read some data.
64                      ; # What this means is that for commands that do not return
65                      ; # any data, we only have time to perform two LCD access
66                      ; # commands.   There is one command, clear display, that
67                      ; # that takes 1.53mS.  In addition, some commands, like
68                      ; # line feed, that needs to clear the entire contents
69                      ; # of the next line.  This takes 16+ commands.
70                      ; #
71                      ; # The solution to all of these problems is to have all of
72                      ; # the LCD access commands take place from the delay()
73                      ; # procedure.  As long as everything important is performed
74                      ; # there and in the right sequence, we won't violate the
75                      ; # "do everything in 1/3 of a bit time" rule in this procedure.
76                      ; #
77                      ; # For more details on the architecture of the delay procedure,
78                      ; # see the delay procedure comments further below.
79              
80              
81                      ; # This module uses a PIC16F628A
82                      ; buffer = 'lcd32'
83                      ; line_number = 55
84                      ; library _pic16f628 entered
85              
86                      ; # Copyright (c) 2006 by Wayne C. Gramlich
87                      ; # All rights reserved.
88              
89                      ; buffer = '_pic16f628'
90                      ; line_number = 6
91                      ; processor pic16f628
92                      ; line_number = 7
93                      ; configure_address 0x2007
94                      ; line_number = 8
95                      ;  configure_fill 0x0200
96                      ; line_number = 9
97                      ;  configure_option cp: off = 0x3c00
98                      ; line_number = 10
99                      ;  configure_option cp: after400 = 0x2800
100                     ; line_number = 11
101                     ;  configure_option cp: after200 = 0x1400
102                     ; line_number = 12
103                     ;  configure_option cp: on = 0x0000
104                     ; line_number = 13
105                     ;  configure_option cpd: off = 0x100
106                     ; line_number = 14
107                     ;  configure_option cpd: on = 0x000
108                     ; line_number = 15
109                     ;  configure_option lvp: on = 0x80
110                     ; line_number = 16
111                     ;  configure_option lvp: off = 0x00
112                     ; line_number = 17
113                     ;  configure_option boden: on = 0x40
114                     ; line_number = 18
115                     ;  configure_option boden: off = 0x00
116                     ; line_number = 19
117                     ;  configure_option mclre: on = 0x20
118                     ; line_number = 20
119                     ;  configure_option mclre: off = 0x00
120                     ; line_number = 21
121                     ;  configure_option pwrte: on = 0
122                     ; line_number = 22
123                     ;  configure_option pwrte: off = 8
124                     ; line_number = 23
125                     ;  configure_option wdte: on = 4
126                     ; line_number = 24
127                     ;  configure_option wdte: off = 0
128                     ; line_number = 25
129                     ;  configure_option fosc: er_clk = 0x13
130                     ; line_number = 26
131                     ;  configure_option fosc: er_no_clk = 0x12
132                     ; line_number = 27
133                     ;  configure_option fosc: intrc_clk = 0x11
134                     ; line_number = 28
135                     ;  configure_option fosc: intrc_no_clk = 0x10
136                     ; line_number = 29
137                     ;  configure_option fosc: ec = 3
138                     ; line_number = 30
139                     ;  configure_option fosc: hs = 2
140                     ; line_number = 31
141                     ;  configure_option fosc: xt = 1
142                     ; line_number = 32
143                     ;  configure_option fosc: lp = 0
144                     ; line_number = 33
145                     ;  code_bank 0x0 : 0x7ff
146                     ; line_number = 34
147                     ;  data_bank 0x0 : 0x7f
148                     ; line_number = 35
149                     ;  data_bank 0x80 : 0xff
150                     ; line_number = 36
151                     ;  data_bank 0x100 : 0x17f
152                     ; line_number = 37
153                     ;  data_bank 0x180 : 0x1ff
154                     ; line_number = 38
155                     ;  global_region 0x20 : 0x6f
156                     ; line_number = 39
157                     ;  global_region 0xa0 : 0xef
158                     ; line_number = 40
159                     ;  global_region 0x120 : 0x14f
160                     ; line_number = 41
161                     ;  shared_region 0x70 : 0x7f
162                     ; line_number = 42
163                     ;  packages dip=18, soic=18, ssop=20
164                     ; line_number = 43
165                     ;  pin ra2_in, ra2_out, ra2_unused
166                     ; line_number = 44
167                     ; pin_bindings dip=1, soic=1, ssop=1
168                     ; line_number = 45
169                     ;  bind_to _porta@2
170                     ; line_number = 46
171                     ;  or_if ra2_in _trisa 4
172                     ; line_number = 47
173                     ;  or_if ra2_out _trisa 0
174                     ; line_number = 48
175                     ;  or_if ra2_in _cmcon 7
176                     ; line_number = 49
177                     ;  or_if ra2_out _cmcon 7
178                     ; line_number = 50
179                     ; pin ra3_in, ra3_out, cmp1, ra3_unused
180                     ; line_number = 51
181                     ; pin_bindings dip=2, soic=2, ssop=2
182                     ; line_number = 52
183                     ;  bind_to _porta@3
184                     ; line_number = 53
185                     ;  or_if ra3_in _trisa 8
186                     ; line_number = 54
187                     ;  or_if ra3_out _trisa 0
188                     ; line_number = 55
189                     ;  or_if ra3_in _cmcon 7
190                     ; line_number = 56
191                     ;  or_if ra3_out _cmcon 7
192                     ; line_number = 57
193                     ; pin ra4_in, ra4_open_collector, tocki, cmp2, ra4_unused
194                     ; line_number = 58
195                     ; pin_bindings dip=3, soic=3, ssop=3
196                     ; line_number = 59
197                     ;  bind_to _porta@4
198                     ; line_number = 60
199                     ;  or_if ra4_in _trisa 16
200                     ; line_number = 61
201                     ;  or_if ra4_open_collector _trisa 0
202                     ; line_number = 62
203                     ; pin ra5_in, mclr, thv, ra5_unused
204                     ; line_number = 63
205                     ; pin_bindings dip=4, soic=4, ssop=4
206                     ; line_number = 64
207                     ;  bind_to _porta@5
208                     ; line_number = 65
209                     ;  or_if ra5_in _trisa 32
210                     ; line_number = 66
211                     ; pin vss, ground
212                     ; line_number = 67
213                     ; pin_bindings dip=5, soic=5, ssop=5
214                     ; line_number = 68
215                     ; pin vss2, ground2
216                     ; line_number = 69
217                     ; pin_bindings ssop=6
218                     ; line_number = 70
219                     ; pin rb0_in, rb0_out, int, rb0_unused
220                     ; line_number = 71
221                     ; pin_bindings dip=6, soic=6, ssop=7
222                     ; line_number = 72
223                     ;  bind_to _portb@0
224                     ; line_number = 73
225                     ;  or_if rb0_in _trisb 1
226                     ; line_number = 74
227                     ;  or_if rb0_out _trisb 0
228                     ; line_number = 75
229                     ;  or_if int _trisb 1
230                     ; line_number = 76
231                     ; pin rb1_in, rb1_out, rx, dt, rb1_unused
232                     ; line_number = 77
233                     ; pin_bindings dip=7, soic=7, ssop=8
234                     ; line_number = 78
235                     ;  bind_to _portb@1
236                     ; line_number = 79
237                     ;  or_if rb1_in _trisb 2
238                     ; line_number = 80
239                     ;  or_if rb1_out _trisb 0
240                     ; line_number = 81
241                     ;  or_if rx _trisb 2
242                     ; line_number = 82
243                     ; pin rb2_in, rb2_out, tx, ck, rb2_unused
244                     ; line_number = 83
245                     ; pin_bindings dip=8, soic=8, ssop=9
246                     ; line_number = 84
247                     ;  bind_to _portb@2
248                     ; line_number = 85
249                     ;  or_if rb2_in _trisb 4
250                     ; line_number = 86
251                     ;  or_if rb2_out _trisb 0
252                     ; line_number = 87
253                     ;  or_if tx _trisb 4
254                     ; line_number = 88
255                     ;  or_if ck _trisb 0
256                     ; line_number = 89
257                     ; pin rb3_in, rb3_out, ccp1, rb3unused
258                     ; line_number = 90
259                     ; pin_bindings dip=9, soic=9, ssop=10
260                     ; line_number = 91
261                     ;  bind_to _portb@3
262                     ; line_number = 92
263                     ;  or_if rb3_in _trisb 8
264                     ; line_number = 93
265                     ;  or_if rb3_out _trisb 0
266                     ; line_number = 94
267                     ;  or_if ccp1 _trisb 8
268                     ; line_number = 95
269                     ; pin rb4_in, rb4_out, pgm, rb4_unused
270                     ; line_number = 96
271                     ; pin_bindings dip=10, soic=10, ssop=11
272                     ; line_number = 97
273                     ;  bind_to _portb@4
274                     ; line_number = 98
275                     ;  or_if rb4_in _trisb 16
276                     ; line_number = 99
277                     ;  or_if rb4_out _trisb 0
278                     ; line_number = 100
279                     ;  or_if pgm _trisb 16
280                     ; line_number = 101
281                     ; pin rb5_in, rb5_out, rb5_unused
282                     ; line_number = 102
283                     ; pin_bindings dip=11, soic=11, ssop=12
284                     ; line_number = 103
285                     ;  bind_to _portb@5
286                     ; line_number = 104
287                     ;  or_if rb5_in _trisb 32
288                     ; line_number = 105
289                     ;  or_if rb5_out _trisb 0
290                     ; line_number = 106
291                     ; pin rb6_in, rb6_out, t1oso, t1cki, rb6_unused
292                     ; line_number = 107
293                     ; pin_bindings dip=12, soic=12, ssop=13
294                     ; line_number = 108
295                     ;  bind_to _portb@6
296                     ; line_number = 109
297                     ;  or_if rb6_in _trisb 64
298                     ; line_number = 110
299                     ;  or_if rb6_out _trisb 0
300                     ; line_number = 111
301                     ;  or_if t1oso _trisb 0
302                     ; line_number = 112
303                     ;  or_if t1cki _trisb 64
304                     ; line_number = 113
305                     ; pin rb7_in, rb7_out, t1osi, rb7_unused
306                     ; line_number = 114
307                     ; pin_bindings dip=13, soic=13, ssop=14
308                     ; line_number = 115
309                     ;  bind_to _portb@6
310                     ; line_number = 116
311                     ;  or_if rb7_in _trisb 128
312                     ; line_number = 117
313                     ;  or_if rb7_out _trisb 0
314                     ; line_number = 118
315                     ;  or_if t1osi _trisb 128
316                     ; line_number = 119
317                     ; pin vdd, power_supply
318                     ; line_number = 120
319                     ; pin_bindings dip=14, soic=14, ssop=15
320                     ; line_number = 121
321                     ; pin vdd2, power_spply2
322                     ; line_number = 122
323                     ; pin_bindings ssop=16
324                     ; line_number = 123
325                     ; pin ra6_in, ra6_out, osc2, clkout, ra6_unused
326                     ; line_number = 124
327                     ; pin_bindings dip=15, soic=15, ssop=17
328                     ; line_number = 125
329                     ;  bind_to _porta@6
330                     ; line_number = 126
331                     ;  or_if ra6_in _trisa 64
332                     ; line_number = 127
333                     ;  or_if ra6_out _trisa 0
334                     ; line_number = 128
335                     ;  or_if clkout _trisa 0
336                     ; line_number = 129
337                     ; pin ra7_in, ra7_out, osc1, clkin, ra7_unused
338                     ; line_number = 130
339                     ; pin_bindings dip=16, soic=16, ssop=18
340                     ; line_number = 131
341                     ;  bind_to _porta@7
342                     ; line_number = 132
343                     ;  or_if ra7_in _trisa 128
344                     ; line_number = 133
345                     ;  or_if ra7_out _trisa 0
346                     ; line_number = 134
347                     ;  or_if clkin _trisa 128
348                     ; line_number = 135
349                     ; pin ra0_in, ra0_out, ra0_unused
350                     ; line_number = 136
351                     ; pin_bindings dip=17, soic=17, ssop=19
352                     ; line_number = 137
353                     ;  bind_to _porta@0
354                     ; line_number = 138
355                     ;  or_if ra0_in _trisa 1
356                     ; line_number = 139
357                     ;  or_if ra0_in _cmcon 7
358                     ; line_number = 140
359                     ;  or_if ra0_out _cmcon 7
360                     ; line_number = 141
361                     ;  or_if ra0_out _trisa 0
362                     ; line_number = 142
363                     ; pin ra1_in, ra1_out, ra1_unused
364                     ; line_number = 143
365                     ; pin_bindings dip=18, soic=18, ssop=20
366                     ; line_number = 144
367                     ;  bind_to _porta@1
368                     ; line_number = 145
369                     ;  or_if ra1_in _trisa 2
370                     ; line_number = 146
371                     ;  or_if ra1_out _trisa 0
372                     ; line_number = 147
373                     ;  or_if ra1_in _cmcon 7
374                     ; line_number = 148
375                     ;  or_if ra1_out _cmcon 7
376             
377             
378             
379                     ; line_number = 153
380                     ; library _standard entered
381             
382                     ; # Copyright (c) 2006 by Wayne C. Gramlich
383                     ; # All rights reserved.
384             
385                     ; # Standard definition for uCL:
386             
387                     ; buffer = '_standard'
388                     ; line_number = 8
389                     ; constant _true = (1 = 1)
390  00000001 = _true equ 1
391                     ; line_number = 9
392                     ; constant _false = (0 != 0)
393  00000000 = _false equ 0
394             
395             
396                     ; buffer = '_pic16f628'
397                     ; line_number = 153
398                     ; library _standard exited
399             
400                     ; # Data bank 0:
401             
402                     ; line_number = 157
403                     ; register _indf = 
404  00000000 = _indf equ 0
405             
406                     ; line_number = 159
407                     ; register _tmr0 = 
408  00000001 = _tmr0 equ 1
409             
410                     ; line_number = 161
411                     ; register _pcl = 
412  00000002 = _pcl equ 2
413             
414                     ; line_number = 163
415                     ; register _status = 
416  00000003 = _status equ 3
417                     ; line_number = 164
418                     ; bind _irp = _status@7
419  00000003 = _irp___byte equ _status
420  00000007 = _irp___bit equ 7
421                     ; line_number = 165
422                     ; bind _rp1 = _status@6
423  00000003 = _rp1___byte equ _status
424  00000006 = _rp1___bit equ 6
425                     ; line_number = 166
426                     ; bind _rp0 = _status@5
427  00000003 = _rp0___byte equ _status
428  00000005 = _rp0___bit equ 5
429                     ; line_number = 167
430                     ; bind _to = _status@4
431  00000003 = _to___byte equ _status
432  00000004 = _to___bit equ 4
433                     ; line_number = 168
434                     ; bind _pd = _status@3
435  00000003 = _pd___byte equ _status
436  00000003 = _pd___bit equ 3
437                     ; line_number = 169
438                     ; bind _z = _status@2
439  00000003 = _z___byte equ _status
440  00000002 = _z___bit equ 2
441                     ; line_number = 170
442                     ; bind _dc = _status@1
443  00000003 = _dc___byte equ _status
444  00000001 = _dc___bit equ 1
445                     ; line_number = 171
446                     ; bind _c = _status@0
447  00000003 = _c___byte equ _status
448  00000000 = _c___bit equ 0
449             
450                     ; line_number = 173
451                     ; register _fsr = 
452  00000004 = _fsr equ 4
453             
454                     ; line_number = 175
455                     ; register _porta = 
456  00000005 = _porta equ 5
457                     ; line_number = 176
458                     ; bind _ra7 = _porta@7
459  00000005 = _ra7___byte equ _porta
460  00000007 = _ra7___bit equ 7
461                     ; line_number = 177
462                     ; bind _ra6 = _porta@6
463  00000005 = _ra6___byte equ _porta
464  00000006 = _ra6___bit equ 6
465                     ; line_number = 178
466                     ; bind _ra5 = _porta@5
467  00000005 = _ra5___byte equ _porta
468  00000005 = _ra5___bit equ 5
469                     ; line_number = 179
470                     ; bind _ra4 = _porta@4
471  00000005 = _ra4___byte equ _porta
472  00000004 = _ra4___bit equ 4
473                     ; line_number = 180
474                     ; bind _ra3 = _porta@3
475  00000005 = _ra3___byte equ _porta
476  00000003 = _ra3___bit equ 3
477                     ; line_number = 181
478                     ; bind _ra2 = _porta@2
479  00000005 = _ra2___byte equ _porta
480  00000002 = _ra2___bit equ 2
481                     ; line_number = 182
482                     ; bind _ra1 = _porta@1
483  00000005 = _ra1___byte equ _porta
484  00000001 = _ra1___bit equ 1
485                     ; line_number = 183
486                     ; bind _ra0 = _porta@0
487  00000005 = _ra0___byte equ _porta
488  00000000 = _ra0___bit equ 0
489             
490                     ; line_number = 185
491                     ; register _portb = 
492  00000006 = _portb equ 6
493                     ; line_number = 186
494                     ; bind _rb7 = _portb@7
495  00000006 = _rb7___byte equ _portb
496  00000007 = _rb7___bit equ 7
497                     ; line_number = 187
498                     ; bind _rb6 = _portb@6
499  00000006 = _rb6___byte equ _portb
500  00000006 = _rb6___bit equ 6
501                     ; line_number = 188
502                     ; bind _rb5 = _portb@5
503  00000006 = _rb5___byte equ _portb
504  00000005 = _rb5___bit equ 5
505                     ; line_number = 189
506                     ; bind _rb4 = _portb@4
507  00000006 = _rb4___byte equ _portb
508  00000004 = _rb4___bit equ 4
509                     ; line_number = 190
510                     ; bind _rb3 = _portb@3
511  00000006 = _rb3___byte equ _portb
512  00000003 = _rb3___bit equ 3
513                     ; line_number = 191
514                     ; bind _rb2 = _portb@2
515  00000006 = _rb2___byte equ _portb
516  00000002 = _rb2___bit equ 2
517                     ; line_number = 192
518                     ; bind _rb1 = _portb@1
519  00000006 = _rb1___byte equ _portb
520  00000001 = _rb1___bit equ 1
521                     ; line_number = 193
522                     ; bind _rb0 = _portb@0
523  00000006 = _rb0___byte equ _portb
524  00000000 = _rb0___bit equ 0
525             
526                     ; line_number = 195
527                     ; register _pclath = 
528  0000000a = _pclath equ 10
529             
530                     ; line_number = 197
531                     ; register _intcon = 
532  0000000b = _intcon equ 11
533                     ; line_number = 198
534                     ; bind _gie = _intcon@7
535  0000000b = _gie___byte equ _intcon
536  00000007 = _gie___bit equ 7
537                     ; line_number = 199
538                     ; bind _peie = _intcon@6
539  0000000b = _peie___byte equ _intcon
540  00000006 = _peie___bit equ 6
541                     ; line_number = 200
542                     ; bind _t0ie = _intcon@5
543  0000000b = _t0ie___byte equ _intcon
544  00000005 = _t0ie___bit equ 5
545                     ; line_number = 201
546                     ; bind _inte = _intcon@4
547  0000000b = _inte___byte equ _intcon
548  00000004 = _inte___bit equ 4
549                     ; line_number = 202
550                     ; bind _rbie = _intcon@3
551  0000000b = _rbie___byte equ _intcon
552  00000003 = _rbie___bit equ 3
553                     ; line_number = 203
554                     ; bind _t0if = _intcon@2
555  0000000b = _t0if___byte equ _intcon
556  00000002 = _t0if___bit equ 2
557                     ; line_number = 204
558                     ; bind _intf = _intcon@1
559  0000000b = _intf___byte equ _intcon
560  00000001 = _intf___bit equ 1
561                     ; line_number = 205
562                     ; bind _rbif = _intcon@0
563  0000000b = _rbif___byte equ _intcon
564  00000000 = _rbif___bit equ 0
565             
566                     ; line_number = 207
567                     ; register _pir1 = 
568  0000000c = _pir1 equ 12
569                     ; line_number = 208
570                     ; bind _eeif = _pir1@7
571  0000000c = _eeif___byte equ _pir1
572  00000007 = _eeif___bit equ 7
573                     ; line_number = 209
574                     ; bind _cmif = _pir1@6
575  0000000c = _cmif___byte equ _pir1
576  00000006 = _cmif___bit equ 6
577                     ; line_number = 210
578                     ; bind _rcif = _pir1@5
579  0000000c = _rcif___byte equ _pir1
580  00000005 = _rcif___bit equ 5
581                     ; line_number = 211
582                     ; bind _txif = _pir1@4
583  0000000c = _txif___byte equ _pir1
584  00000004 = _txif___bit equ 4
585                     ; line_number = 212
586                     ; bind _ccp1if = _pir1@2
587  0000000c = _ccp1if___byte equ _pir1
588  00000002 = _ccp1if___bit equ 2
589                     ; line_number = 213
590                     ; bind _tmr2if = _pir1@1
591  0000000c = _tmr2if___byte equ _pir1
592  00000001 = _tmr2if___bit equ 1
593                     ; line_number = 214
594                     ; bind _tmr1if = _pir1@0
595  0000000c = _tmr1if___byte equ _pir1
596  00000000 = _tmr1if___bit equ 0
597             
598                     ; line_number = 216
599                     ; register _tmr1l = 
600  0000000e = _tmr1l equ 14
601             
602                     ; line_number = 218
603                     ; register _tmr1h = 
604  0000000f = _tmr1h equ 15
605             
606                     ; line_number = 220
607                     ; register _t1con = 
608  00000010 = _t1con equ 16
609                     ; line_number = 221
610                     ; bind _t1ckps1 = _t1con@5
611  00000010 = _t1ckps1___byte equ _t1con
612  00000005 = _t1ckps1___bit equ 5
613                     ; line_number = 222
614                     ; bind _t1ckps0 = _t1con@4
615  00000010 = _t1ckps0___byte equ _t1con
616  00000004 = _t1ckps0___bit equ 4
617                     ; line_number = 223
618                     ; bind _t1oscen = _t1con@3
619  00000010 = _t1oscen___byte equ _t1con
620  00000003 = _t1oscen___bit equ 3
621                     ; line_number = 224
622                     ; bind _t1sync = _t1con@2
623  00000010 = _t1sync___byte equ _t1con
624  00000002 = _t1sync___bit equ 2
625                     ; line_number = 225
626                     ; bind _tmr1cs = _t1con@1
627  00000010 = _tmr1cs___byte equ _t1con
628  00000001 = _tmr1cs___bit equ 1
629                     ; line_number = 226
630                     ; bind _tmr1on = _t1con@0
631  00000010 = _tmr1on___byte equ _t1con
632  00000000 = _tmr1on___bit equ 0
633             
634                     ; line_number = 228
635                     ; register _tmr2 = 
636  00000011 = _tmr2 equ 17
637             
638                     ; line_number = 230
639                     ; register _t2con = 
640  00000012 = _t2con equ 18
641                     ; line_number = 231
642                     ; bind _toutps3 = _t2con@6
643  00000012 = _toutps3___byte equ _t2con
644  00000006 = _toutps3___bit equ 6
645                     ; line_number = 232
646                     ; bind _toutps2 = _t2con@5
647  00000012 = _toutps2___byte equ _t2con
648  00000005 = _toutps2___bit equ 5
649                     ; line_number = 233
650                     ; bind _toutps1 = _t2con@4
651  00000012 = _toutps1___byte equ _t2con
652  00000004 = _toutps1___bit equ 4
653                     ; line_number = 234
654                     ; bind _toutps0 = _t2con@3
655  00000012 = _toutps0___byte equ _t2con
656  00000003 = _toutps0___bit equ 3
657                     ; line_number = 235
658                     ; bind _trm2on = _t2con@2
659  00000012 = _trm2on___byte equ _t2con
660  00000002 = _trm2on___bit equ 2
661                     ; line_number = 236
662                     ; bind _t2ckps1 = _t2con@1
663  00000012 = _t2ckps1___byte equ _t2con
664  00000001 = _t2ckps1___bit equ 1
665                     ; line_number = 237
666                     ; bind _t2ckps0 = _t2con@0
667  00000012 = _t2ckps0___byte equ _t2con
668  00000000 = _t2ckps0___bit equ 0
669             
670                     ; line_number = 239
671                     ; register _ccpr1l = 
672  00000015 = _ccpr1l equ 21
673             
674                     ; line_number = 241
675                     ; register _ccpr1h = 
676  00000016 = _ccpr1h equ 22
677             
678                     ; line_number = 243
679                     ; register _ccp1con = 
680  00000017 = _ccp1con equ 23
681                     ; line_number = 244
682                     ; bind _ccp1x = _ccp1con@5
683  00000017 = _ccp1x___byte equ _ccp1con
684  00000005 = _ccp1x___bit equ 5
685                     ; line_number = 245
686                     ; bind _ccp1y = _ccp1con@4
687  00000017 = _ccp1y___byte equ _ccp1con
688  00000004 = _ccp1y___bit equ 4
689                     ; line_number = 246
690                     ; bind _ccp1m3 = _ccp1con@3
691  00000017 = _ccp1m3___byte equ _ccp1con
692  00000003 = _ccp1m3___bit equ 3
693                     ; line_number = 247
694                     ; bind _ccp1m2 = _ccp1con@2
695  00000017 = _ccp1m2___byte equ _ccp1con
696  00000002 = _ccp1m2___bit equ 2
697                     ; line_number = 248
698                     ; bind _ccp1m1 = _ccp1con@1
699  00000017 = _ccp1m1___byte equ _ccp1con
700  00000001 = _ccp1m1___bit equ 1
701                     ; line_number = 249
702                     ; bind _ccp1m0 = _ccp1con@0
703  00000017 = _ccp1m0___byte equ _ccp1con
704  00000000 = _ccp1m0___bit equ 0
705             
706                     ; line_number = 251
707                     ; register _rcsta = 
708  00000018 = _rcsta equ 24
709                     ; line_number = 252
710                     ; bind _spen = _rcsta@7
711  00000018 = _spen___byte equ _rcsta
712  00000007 = _spen___bit equ 7
713                     ; line_number = 253
714                     ; bind _rx9 = _rcsta@6
715  00000018 = _rx9___byte equ _rcsta
716  00000006 = _rx9___bit equ 6
717                     ; line_number = 254
718                     ; bind _sren = _rcsta@5
719  00000018 = _sren___byte equ _rcsta
720  00000005 = _sren___bit equ 5
721                     ; line_number = 255
722                     ; bind _cren = _rcsta@4
723  00000018 = _cren___byte equ _rcsta
724  00000004 = _cren___bit equ 4
725                     ; line_number = 256
726                     ; bind _aden = _rcsta@3
727  00000018 = _aden___byte equ _rcsta
728  00000003 = _aden___bit equ 3
729                     ; # Some other modules use _adden instead of _aden:
730                     ; line_number = 258
731                     ; bind _adden = _rcsta@3
732  00000018 = _adden___byte equ _rcsta
733  00000003 = _adden___bit equ 3
734                     ; line_number = 259
735                     ; bind _ferr = _rcsta@2
736  00000018 = _ferr___byte equ _rcsta
737  00000002 = _ferr___bit equ 2
738                     ; line_number = 260
739                     ; bind _oerr = _rcsta@1
740  00000018 = _oerr___byte equ _rcsta
741  00000001 = _oerr___bit equ 1
742                     ; line_number = 261
743                     ; bind _rx9d = _rcsta@0
744  00000018 = _rx9d___byte equ _rcsta
745  00000000 = _rx9d___bit equ 0
746             
747                     ; line_number = 263
748                     ; register _txreg = 
749  00000019 = _txreg equ 25
750             
751                     ; line_number = 265
752                     ; register _rcreg = 
753  0000001a = _rcreg equ 26
754             
755                     ; line_number = 267
756                     ; register _cmcon = 
757  0000001f = _cmcon equ 31
758                     ; line_number = 268
759                     ; bind _c2out = _cmcon@7
760  0000001f = _c2out___byte equ _cmcon
761  00000007 = _c2out___bit equ 7
762                     ; line_number = 269
763                     ; bind _c1out = _cmcon@6
764  0000001f = _c1out___byte equ _cmcon
765  00000006 = _c1out___bit equ 6
766                     ; line_number = 270
767                     ; bind _c2inv = _cmcon@5
768  0000001f = _c2inv___byte equ _cmcon
769  00000005 = _c2inv___bit equ 5
770                     ; line_number = 271
771                     ; bind _c1inv = _cmcon@4
772  0000001f = _c1inv___byte equ _cmcon
773  00000004 = _c1inv___bit equ 4
774                     ; line_number = 272
775                     ; bind _cis = _cmcon@3
776  0000001f = _cis___byte equ _cmcon
777  00000003 = _cis___bit equ 3
778                     ; line_number = 273
779                     ; bind _cm2 = _cmcon@2
780  0000001f = _cm2___byte equ _cmcon
781  00000002 = _cm2___bit equ 2
782                     ; line_number = 274
783                     ; bind _cm1 = _cmcon@1
784  0000001f = _cm1___byte equ _cmcon
785  00000001 = _cm1___bit equ 1
786                     ; line_number = 275
787                     ; bind _cm0 = _cmcon@0
788  0000001f = _cm0___byte equ _cmcon
789  00000000 = _cm0___bit equ 0
790             
791                     ; # Data bank 1:
792             
793                     ; line_number = 279
794                     ; register _option = 
795  00000081 = _option equ 129
796                     ; line_number = 280
797                     ; bind _rbpu = _option@7
798  00000081 = _rbpu___byte equ _option
799  00000007 = _rbpu___bit equ 7
800                     ; line_number = 281
801                     ; bind _intedg = _option@6
802  00000081 = _intedg___byte equ _option
803  00000006 = _intedg___bit equ 6
804                     ; line_number = 282
805                     ; bind _t0cs = _option@5
806  00000081 = _t0cs___byte equ _option
807  00000005 = _t0cs___bit equ 5
808                     ; line_number = 283
809                     ; bind _t0se = _option@4
810  00000081 = _t0se___byte equ _option
811  00000004 = _t0se___bit equ 4
812                     ; line_number = 284
813                     ; bind _psa = _option@3
814  00000081 = _psa___byte equ _option
815  00000003 = _psa___bit equ 3
816                     ; line_number = 285
817                     ; bind _ps2 = _option@2
818  00000081 = _ps2___byte equ _option
819  00000002 = _ps2___bit equ 2
820                     ; line_number = 286
821                     ; bind _ps1 = _option@1
822  00000081 = _ps1___byte equ _option
823  00000001 = _ps1___bit equ 1
824                     ; line_number = 287
825                     ; bind _ps0 = _option@0
826  00000081 = _ps0___byte equ _option
827  00000000 = _ps0___bit equ 0
828             
829                     ; line_number = 289
830                     ; register _trisa = 
831  00000085 = _trisa equ 133
832                     ; line_number = 290
833                     ; bind _trisa7 = _trisa@7
834  00000085 = _trisa7___byte equ _trisa
835  00000007 = _trisa7___bit equ 7
836                     ; line_number = 291
837                     ; bind _trisa6 = _trisa@6
838  00000085 = _trisa6___byte equ _trisa
839  00000006 = _trisa6___bit equ 6
840                     ; # No _trisa5:
841                     ; line_number = 293
842                     ; bind _trisa4 = _trisa@4
843  00000085 = _trisa4___byte equ _trisa
844  00000004 = _trisa4___bit equ 4
845                     ; line_number = 294
846                     ; bind _trisa3 = _trisa@3
847  00000085 = _trisa3___byte equ _trisa
848  00000003 = _trisa3___bit equ 3
849                     ; line_number = 295
850                     ; bind _trisa2 = _trisa@2
851  00000085 = _trisa2___byte equ _trisa
852  00000002 = _trisa2___bit equ 2
853                     ; line_number = 296
854                     ; bind _trisa1 = _trisa@1
855  00000085 = _trisa1___byte equ _trisa
856  00000001 = _trisa1___bit equ 1
857                     ; line_number = 297
858                     ; bind _trisa0 = _trisa@0
859  00000085 = _trisa0___byte equ _trisa
860  00000000 = _trisa0___bit equ 0
861             
862                     ; line_number = 299
863                     ; register _trisb = 
864  00000086 = _trisb equ 134
865                     ; line_number = 300
866                     ; bind _trisb7 = _trisb@7
867  00000086 = _trisb7___byte equ _trisb
868  00000007 = _trisb7___bit equ 7
869                     ; line_number = 301
870                     ; bind _trisb6 = _trisb@6
871  00000086 = _trisb6___byte equ _trisb
872  00000006 = _trisb6___bit equ 6
873                     ; line_number = 302
874                     ; bind _trisb5 = _trisb@5
875  00000086 = _trisb5___byte equ _trisb
876  00000005 = _trisb5___bit equ 5
877                     ; line_number = 303
878                     ; bind _trisb4 = _trisb@4
879  00000086 = _trisb4___byte equ _trisb
880  00000004 = _trisb4___bit equ 4
881                     ; line_number = 304
882                     ; bind _trisb3 = _trisb@3
883  00000086 = _trisb3___byte equ _trisb
884  00000003 = _trisb3___bit equ 3
885                     ; line_number = 305
886                     ; bind _trisb2 = _trisb@2
887  00000086 = _trisb2___byte equ _trisb
888  00000002 = _trisb2___bit equ 2
889                     ; line_number = 306
890                     ; bind _trisb1 = _trisb@1
891  00000086 = _trisb1___byte equ _trisb
892  00000001 = _trisb1___bit equ 1
893                     ; line_number = 307
894                     ; bind _trisb0 = _trisb@0
895  00000086 = _trisb0___byte equ _trisb
896  00000000 = _trisb0___bit equ 0
897             
898                     ; line_number = 309
899                     ; register _pie1 = 
900  0000008c = _pie1 equ 140
901                     ; line_number = 310
902                     ; bind _eeie7 = _pie1@7
903  0000008c = _eeie7___byte equ _pie1
904  00000007 = _eeie7___bit equ 7
905                     ; line_number = 311
906                     ; bind _cmie = _pie1@6
907  0000008c = _cmie___byte equ _pie1
908  00000006 = _cmie___bit equ 6
909                     ; line_number = 312
910                     ; bind _rcie = _pie1@5
911  0000008c = _rcie___byte equ _pie1
912  00000005 = _rcie___bit equ 5
913                     ; line_number = 313
914                     ; bind _txie = _pie1@4
915  0000008c = _txie___byte equ _pie1
916  00000004 = _txie___bit equ 4
917                     ; line_number = 314
918                     ; bind _ccp1ie = _pie1@2
919  0000008c = _ccp1ie___byte equ _pie1
920  00000002 = _ccp1ie___bit equ 2
921                     ; line_number = 315
922                     ; bind _tmr2ie = _pie1@1
923  0000008c = _tmr2ie___byte equ _pie1
924  00000001 = _tmr2ie___bit equ 1
925                     ; line_number = 316
926                     ; bind _tmr1ie = _pie1@0
927  0000008c = _tmr1ie___byte equ _pie1
928  00000000 = _tmr1ie___bit equ 0
929             
930                     ; line_number = 318
931                     ; register _pcon = 
932  0000008e = _pcon equ 142
933                     ; line_number = 319
934                     ; bind _oscf = _pcon@3
935  0000008e = _oscf___byte equ _pcon
936  00000003 = _oscf___bit equ 3
937                     ; line_number = 320
938                     ; bind _por = _pcon@1
939  0000008e = _por___byte equ _pcon
940  00000001 = _por___bit equ 1
941                     ; line_number = 321
942                     ; bind _bod = _pcon@0
943  0000008e = _bod___byte equ _pcon
944  00000000 = _bod___bit equ 0
945             
946                     ; line_number = 323
947                     ; register _pr2 = 
948  00000092 = _pr2 equ 146
949             
950                     ; line_number = 325
951                     ; register _txsta = 
952  00000098 = _txsta equ 152
953                     ; line_number = 326
954                     ; bind _csrc = _txsta@7
955  00000098 = _csrc___byte equ _txsta
956  00000007 = _csrc___bit equ 7
957                     ; line_number = 327
958                     ; bind _tx9 = _txsta@6
959  00000098 = _tx9___byte equ _txsta
960  00000006 = _tx9___bit equ 6
961                     ; line_number = 328
962                     ; bind _txen = _txsta@5
963  00000098 = _txen___byte equ _txsta
964  00000005 = _txen___bit equ 5
965                     ; line_number = 329
966                     ; bind _sync = _txsta@4
967  00000098 = _sync___byte equ _txsta
968  00000004 = _sync___bit equ 4
969                     ; line_number = 330
970                     ; bind _brgh = _txsta@2
971  00000098 = _brgh___byte equ _txsta
972  00000002 = _brgh___bit equ 2
973                     ; line_number = 331
974                     ; bind _trmt = _txsta@1
975  00000098 = _trmt___byte equ _txsta
976  00000001 = _trmt___bit equ 1
977                     ; line_number = 332
978                     ; bind _tx9d = _txsta@0
979  00000098 = _tx9d___byte equ _txsta
980  00000000 = _tx9d___bit equ 0
981             
982                     ; line_number = 334
983                     ; register _spbrg = 
984  00000099 = _spbrg equ 153
985             
986                     ; line_number = 336
987                     ; register _eedat = 
988  0000009a = _eedat equ 154
989             
990                     ; line_number = 338
991                     ; register _eeadr = 
992  0000009b = _eeadr equ 155
993             
994                     ; line_number = 340
995                     ; register _eecon1 = 
996  0000009c = _eecon1 equ 156
997                     ; line_number = 341
998                     ; bind _wrerr = _eecon1@3
999  0000009c = _wrerr___byte equ _eecon1
1000 00000003 = _wrerr___bit equ 3
1001                    ; line_number = 342
1002                    ; bind _wren = _eecon1@2
1003 0000009c = _wren___byte equ _eecon1
1004 00000002 = _wren___bit equ 2
1005                    ; line_number = 343
1006                    ; bind _wr = _eecon1@1
1007 0000009c = _wr___byte equ _eecon1
1008 00000001 = _wr___bit equ 1
1009                    ; line_number = 344
1010                    ; bind _rd = _eecon1@0
1011 0000009c = _rd___byte equ _eecon1
1012 00000000 = _rd___bit equ 0
1013            
1014                    ; line_number = 346
1015                    ; register _eecon2 = 
1016 0000009d = _eecon2 equ 157
1017            
1018                    ; line_number = 348
1019                    ; register _vrcon = 
1020 0000009f = _vrcon equ 159
1021                    ; line_number = 349
1022                    ; bind _vren = _vrcon@7
1023 0000009f = _vren___byte equ _vrcon
1024 00000007 = _vren___bit equ 7
1025                    ; line_number = 350
1026                    ; bind _vroe = _vrcon@6
1027 0000009f = _vroe___byte equ _vrcon
1028 00000006 = _vroe___bit equ 6
1029                    ; line_number = 351
1030                    ; bind _vrr = _vrcon@5
1031 0000009f = _vrr___byte equ _vrcon
1032 00000005 = _vrr___bit equ 5
1033                    ; line_number = 352
1034                    ; bind _vr3 = _vrcon@3
1035 0000009f = _vr3___byte equ _vrcon
1036 00000003 = _vr3___bit equ 3
1037                    ; line_number = 353
1038                    ; bind _vr2 = _vrcon@2
1039 0000009f = _vr2___byte equ _vrcon
1040 00000002 = _vr2___bit equ 2
1041                    ; line_number = 354
1042                    ; bind _vr1 = _vrcon@1
1043 0000009f = _vr1___byte equ _vrcon
1044 00000001 = _vr1___bit equ 1
1045                    ; line_number = 355
1046                    ; bind _vr0 = _vrcon@0
1047 0000009f = _vr0___byte equ _vrcon
1048 00000000 = _vr0___bit equ 0
1049            
1050            
1051            
1052                    ; buffer = 'lcd32'
1053                    ; line_number = 55
1054                    ; library _pic16f628 exited
1055            
1056                    ; # The system is running at 16MHz:
1057                    ; line_number = 58
1058                    ; library clock16mhz entered
1059                    ; # Copyright (c) 2006 by Wayne C. Gramlich
1060                    ; # All rights reserved.
1061            
1062                    ; # This library defines the contstants {clock_rate}, {instruction_rate},
1063                    ; # and {clocks_per_instruction}.
1064            
1065                    ; # Define processor constants:
1066                    ; buffer = 'clock16mhz'
1067                    ; line_number = 9
1068                    ; constant clock_rate = 16000000
1069 00f42400 = clock_rate equ 16000000
1070                    ; line_number = 10
1071                    ; constant clocks_per_instruction = 4
1072 00000004 = clocks_per_instruction equ 4
1073                    ; line_number = 11
1074                    ; constant instruction_rate = clock_rate / clocks_per_instruction
1075 003d0900 = instruction_rate equ 4000000
1076            
1077            
1078                    ; buffer = 'lcd32'
1079                    ; line_number = 58
1080                    ; library clock16mhz exited
1081                    ; # A microsecond takes 4 cycles at 16MHz:
1082                    ; line_number = 60
1083                    ; constant microsecond = 4
1084 00000004 = microsecond equ 4
1085            
1086                    ; # The library of bus access routines for use by the PIC16F628.
1087                    ; line_number = 63
1088                    ; library rb2bus_pic16f628 entered
1089            
1090                    ; # Copyright (c) 2006-2007 by Wayne C. Gramlich
1091                    ; # All rights reserved.
1092            
1093                    ; # This module provides some procedures for accessing a RoboBricks2
1094                    ; # bus via a UART.  It is speicialized for the PIC16F688.
1095                    ; #
1096                    ; # It defines the following procedure:
1097                    ; #
1098                    ; # {rb2bus_initialize}({address}) The procedure that initializes the UART
1099                    ; #                                for bus access.
1100            
1101                    ; # All other bus access procedures are defined in the {rb2bus} library
1102                    ; # which is accessed below:
1103                    ; buffer = 'rb2bus_pic16f628'
1104                    ; line_number = 16
1105                    ; library rb2bus entered
1106            
1107                    ; # Copyright (c) 2006-2007 by Wayne C. Gramlich
1108                    ; # All rights reserved.
1109            
1110                    ; # This module provides some procedures for accessing a RoboBricks2
1111                    ; # bus via a UART.
1112                    ; #
1113                    ; # This procedure defines the following procedures:
1114                    ; #
1115                    ; # {rb2bus_select_wait}  This procedure waits for the module to become selected
1116                    ; # {rb2bus_deselect}     This procedure causes this module to be deselected.
1117                    ; # {rb2bus_byte_get}     This procedure will get a byte form the bus.
1118                    ; # {rb2bus_byte_put}     This procedure will send a byte to the bus.
1119                    ; #
1120                    ; # The global variable {rb2bus_error} is set to 1 whenever the procedures
1121                    ; # feel like there is a command decoding error.
1122                    ; #
1123                    ; # The way to use these procedures is quite as follows:
1124                    ; #
1125                    ; #    # Comamnd byte variable:
1126                    ; #    local command byte
1127                    ; #
1128                    ; #    # Other initialize code goes here:
1129                    ; #
1130                    ; #    # Process commands from bus master:
1131                    ; #    loop_forever
1132                    ; #        rb2bus_error := _true
1133                    ; #	 while rb2bus_error
1134                    ; #	     call rb2bus_select_wait()
1135                    ; #	     command := rb2bus_byte_get()
1136                    ; #
1137                    ; #        # Decode command:
1138                    ; #	 switch command >> 6
1139                    ; #	   ...
1140                    ; #             case 5:
1141                    ; #	        # 0000 0101 (Foo command):
1142                    ; #	          if !rb2bus_error
1143                    ; #		      # Do foo command:
1144                    ; #
1145                    ; # The key concept behind these procedures is to make command
1146                    ; # decoding for the slave module easy.  If the slave module
1147                    ; # is in the middle of command decoding and the master suddenly
1148                    ; # sends out a module select command, we need to gracefully recover
1149                    ; # from the problem.  A command should only be executed if
1150                    ; # {rb2bus_error} is not set.  If {rb2bus_error} is set, we want
1151                    ; # to gracefully get back to the beginning of the loop without
1152                    ; # doing any damage.  Once {rb2bus_error} is set, all calls to
1153                    ; # {rb2bus_byte_get} return 0 and all calls to {rb2bus_byte_put}
1154                    ; # do nothing.  At the beginning of the loop, {rb2bus_error} is
1155                    ; # cleared by the {rb2bus_select_wait}() procedure and we have
1156                    ; # recovered from the situation.
1157            
1158                    ; buffer = 'rb2bus'
1159                    ; line_number = 54
1160                    ; library rb2_constants entered
1161            
1162                    ; # Copyright (c) 2006-2007 by Wayne C. Gramlich.
1163                    ; # All rights reserved.
1164            
1165                    ; buffer = 'rb2_constants'
1166                    ; line_number = 6
1167                    ; constant rb2_ok = 0xa5
1168 000000a5 = rb2_ok equ 165
1169            
1170                    ; line_number = 8
1171                    ; constant rb2_common_address_set = 0xfc
1172 000000fc = rb2_common_address_set equ 252
1173                    ; line_number = 9
1174                    ; constant rb2_common_id_next = 0xfd
1175 000000fd = rb2_common_id_next equ 253
1176                    ; line_number = 10
1177                    ; constant rb2_common_id_start = 0xfe
1178 000000fe = rb2_common_id_start equ 254
1179                    ; line_number = 11
1180                    ; constant rb2_common_deselect = 0xff
1181 000000ff = rb2_common_deselect equ 255
1182            
1183                    ; line_number = 13
1184                    ; constant rb2_laser1_address = 1
1185 00000001 = rb2_laser1_address equ 1
1186            
1187                    ; line_number = 15
1188                    ; constant rb2_minimotor2_address = 2
1189 00000002 = rb2_minimotor2_address equ 2
1190                    ; line_number = 16
1191                    ; constant rb2_midimotor2_address = 3
1192 00000003 = rb2_midimotor2_address equ 3
1193                    ; line_number = 17
1194                    ; constant rb2_motor0_speed_get = 0
1195 00000000 = rb2_motor0_speed_get equ 0
1196                    ; line_number = 18
1197                    ; constant rb2_motor0_speed_set = 1
1198 00000001 = rb2_motor0_speed_set equ 1
1199                    ; line_number = 19
1200                    ; constant rb2_motor1_speed_get = 2
1201 00000002 = rb2_motor1_speed_get equ 2
1202                    ; line_number = 20
1203                    ; constant rb2_motor1_speed_set = 3
1204 00000003 = rb2_motor1_speed_set equ 3
1205                    ; line_number = 21
1206                    ; constant rb2_duty_cycle_get = 4
1207 00000004 = rb2_duty_cycle_get equ 4
1208                    ; line_number = 22
1209                    ; constant rb2_duty_cycle_set = 8
1210 00000008 = rb2_duty_cycle_set equ 8
1211            
1212                    ; line_number = 24
1213                    ; constant rb2_irdistance2_address = 4
1214 00000004 = rb2_irdistance2_address equ 4
1215                    ; line_number = 25
1216                    ; constant rb2_irdistance2_raw0_get = 0
1217 00000000 = rb2_irdistance2_raw0_get equ 0
1218                    ; line_number = 26
1219                    ; constant rb2_irdistance2_raw1_get = 1
1220 00000001 = rb2_irdistance2_raw1_get equ 1
1221                    ; line_number = 27
1222                    ; constant rb2_irdistance2_smooth0_get = 2
1223 00000002 = rb2_irdistance2_smooth0_get equ 2
1224                    ; line_number = 28
1225                    ; constant rb2_irdistance2_smooth1_get = 3
1226 00000003 = rb2_irdistance2_smooth1_get equ 3
1227                    ; line_number = 29
1228                    ; constant rb2_irdistance2_linear0_get = 4
1229 00000004 = rb2_irdistance2_linear0_get equ 4
1230                    ; line_number = 30
1231                    ; constant rb2_irdistance2_linear1_get = 6
1232 00000006 = rb2_irdistance2_linear1_get equ 6
1233            
1234                    ; line_number = 32
1235                    ; constant rb2_shaft2_address = 5
1236 00000005 = rb2_shaft2_address equ 5
1237                    ; line_number = 33
1238                    ; constant rb2_shaft2_count_latch = 0
1239 00000000 = rb2_shaft2_count_latch equ 0
1240                    ; line_number = 34
1241                    ; constant rb2_shaft2_count_clear = 1
1242 00000001 = rb2_shaft2_count_clear equ 1
1243                    ; line_number = 35
1244                    ; constant rb2_shaft2_shaft0_high_get = 2
1245 00000002 = rb2_shaft2_shaft0_high_get equ 2
1246                    ; line_number = 36
1247                    ; constant rb2_shaft2_shaft1_high_get = 3
1248 00000003 = rb2_shaft2_shaft1_high_get equ 3
1249                    ; line_number = 37
1250                    ; constant rb2_shaft2_continue_get = 4
1251 00000004 = rb2_shaft2_continue_get equ 4
1252                    ; line_number = 38
1253                    ; constant rb2_shaft2_shaft0_low_get = rb2_shaft2_continue_get
1254 00000004 = rb2_shaft2_shaft0_low_get equ 4
1255                    ; line_number = 39
1256                    ; constant rb2_shaft2_shaft1_low_get = rb2_shaft2_continue_get
1257 00000004 = rb2_shaft2_shaft1_low_get equ 4
1258                    ; line_number = 40
1259                    ; constant rb2_shaft2_x_get = 0x10
1260 00000010 = rb2_shaft2_x_get equ 16
1261                    ; line_number = 41
1262                    ; constant rb2_shaft2_y_get = 0x11
1263 00000011 = rb2_shaft2_y_get equ 17
1264                    ; line_number = 42
1265                    ; constant rb2_shaft2_bearing16_get = 0x12
1266 00000012 = rb2_shaft2_bearing16_get equ 18
1267                    ; line_number = 43
1268                    ; constant rb2_shaft2_bearing8_get = 0x13
1269 00000013 = rb2_shaft2_bearing8_get equ 19
1270                    ; line_number = 44
1271                    ; constant rb2_shaft2_target_x_get = 0x14
1272 00000014 = rb2_shaft2_target_x_get equ 20
1273                    ; line_number = 45
1274                    ; constant rb2_shaft2_target_y_get = 0x15
1275 00000015 = rb2_shaft2_target_y_get equ 21
1276                    ; line_number = 46
1277                    ; constant rb2_shaft2_target_bearing16_get = 0x16
1278 00000016 = rb2_shaft2_target_bearing16_get equ 22
1279                    ; line_number = 47
1280                    ; constant rb2_shaft2_target_bearing8_get = 0x17
1281 00000017 = rb2_shaft2_target_bearing8_get equ 23
1282                    ; line_number = 48
1283                    ; constant rb2_shaft2_target_distance_get = 0x18
1284 00000018 = rb2_shaft2_target_distance_get equ 24
1285                    ; line_number = 49
1286                    ; constant rb2_shaft2_wheel_spacing_get = 0x19
1287 00000019 = rb2_shaft2_wheel_spacing_get equ 25
1288                    ; line_number = 50
1289                    ; constant rb2_shaft2_wheel_ticks_get = 0x1a
1290 0000001a = rb2_shaft2_wheel_ticks_get equ 26
1291                    ; line_number = 51
1292                    ; constant rb2_shaft2_wheel_diameter_get = 0x1b
1293 0000001b = rb2_shaft2_wheel_diameter_get equ 27
1294                    ; line_number = 52
1295                    ; constant rb2_shaft2_x_set = 0x20
1296 00000020 = rb2_shaft2_x_set equ 32
1297                    ; line_number = 53
1298                    ; constant rb2_shaft2_y_set = 0x21
1299 00000021 = rb2_shaft2_y_set equ 33
1300                    ; line_number = 54
1301                    ; constant rb2_shaft2_bearing16_set = 0x22
1302 00000022 = rb2_shaft2_bearing16_set equ 34
1303                    ; line_number = 55
1304                    ; constant rb2_shaft2_navigation_latch = 0x23
1305 00000023 = rb2_shaft2_navigation_latch equ 35
1306                    ; line_number = 56
1307                    ; constant rb2_shaft2_target_x_set = 0x24
1308 00000024 = rb2_shaft2_target_x_set equ 36
1309                    ; line_number = 57
1310                    ; constant rb2_shaft2_target_y_set = 0x25
1311 00000025 = rb2_shaft2_target_y_set equ 37
1312                    ; line_number = 58
1313                    ; constant rb2_shaft2_wheel_spacing_set = 0x29
1314 00000029 = rb2_shaft2_wheel_spacing_set equ 41
1315                    ; line_number = 59
1316                    ; constant rb2_shaft2_wheel_ticks_set = 0x2a
1317 0000002a = rb2_shaft2_wheel_ticks_set equ 42
1318                    ; line_number = 60
1319                    ; constant rb2_shaft2_wheel_diameter_set = 0x2b
1320 0000002b = rb2_shaft2_wheel_diameter_set equ 43
1321            
1322            
1323                    ; line_number = 63
1324                    ; constant rb2_orient5_address = 6
1325 00000006 = rb2_orient5_address equ 6
1326            
1327                    ; line_number = 65
1328                    ; constant rb2_compass8_address = 7
1329 00000007 = rb2_compass8_address equ 7
1330            
1331                    ; line_number = 67
1332                    ; constant rb2_io8_address = 8
1333 00000008 = rb2_io8_address equ 8
1334                    ; line_number = 68
1335                    ; constant rb2_io8_digital8_get = 0
1336 00000000 = rb2_io8_digital8_get equ 0
1337                    ; line_number = 69
1338                    ; constant rb2_io8_digital8_set = 1
1339 00000001 = rb2_io8_digital8_set equ 1
1340                    ; line_number = 70
1341                    ; constant rb2_io8_direction_get = 2
1342 00000002 = rb2_io8_direction_get equ 2
1343                    ; line_number = 71
1344                    ; constant rb2_io8_direction_set = 3
1345 00000003 = rb2_io8_direction_set equ 3
1346                    ; line_number = 72
1347                    ; constant rb2_io8_analog_mask_get = 4
1348 00000004 = rb2_io8_analog_mask_get equ 4
1349                    ; line_number = 73
1350                    ; constant rb2_io8_analog_mask_set = 5
1351 00000005 = rb2_io8_analog_mask_set equ 5
1352                    ; line_number = 74
1353                    ; constant rb2_io8_analog8_get = 0x10
1354 00000010 = rb2_io8_analog8_get equ 16
1355                    ; line_number = 75
1356                    ; constant rb2_io8_analog10_get = 0x18
1357 00000018 = rb2_io8_analog10_get equ 24
1358                    ; line_number = 76
1359                    ; constant rb2_low_set = 0x20
1360 00000020 = rb2_low_set equ 32
1361                    ; line_number = 77
1362                    ; constant rb2_high_set = 0x30
1363 00000030 = rb2_high_set equ 48
1364            
1365                    ; line_number = 79
1366                    ; constant rb2_sonar2_address = 9
1367 00000009 = rb2_sonar2_address equ 9
1368            
1369                    ; line_number = 81
1370                    ; constant rb2_voice1_address = 10
1371 0000000a = rb2_voice1_address equ 10
1372            
1373                    ; line_number = 83
1374                    ; constant rb2_servo4_address = 11
1375 0000000b = rb2_servo4_address equ 11
1376                    ; line_number = 84
1377                    ; constant rb2_servo4_servo0 = 0
1378 00000000 = rb2_servo4_servo0 equ 0
1379                    ; line_number = 85
1380                    ; constant rb2_servo4_servo1 = 1
1381 00000001 = rb2_servo4_servo1 equ 1
1382                    ; line_number = 86
1383                    ; constant rb2_servo4_servo2 = 2
1384 00000002 = rb2_servo4_servo2 equ 2
1385                    ; line_number = 87
1386                    ; constant rb2_servo4_servo3 = 3
1387 00000003 = rb2_servo4_servo3 equ 3
1388                    ; line_number = 88
1389                    ; constant rb2_servo4_quick_set = 0
1390 00000000 = rb2_servo4_quick_set equ 0
1391                    ; line_number = 89
1392                    ; constant rb2_servo4_quick_low = 0
1393 00000000 = rb2_servo4_quick_low equ 0
1394                    ; line_number = 90
1395                    ; constant rb2_servo4_quick_center = 40
1396 00000028 = rb2_servo4_quick_center equ 40
1397                    ; line_number = 91
1398                    ; constant rb2_servo4_quick_high = 0x7c
1399 0000007c = rb2_servo4_quick_high equ 124
1400                    ; line_number = 92
1401                    ; constant rb2_servo4_high_low_set = 0x80
1402 00000080 = rb2_servo4_high_low_set equ 128
1403                    ; line_number = 93
1404                    ; constant rb2_servo4_short_high_low_set = 0x84
1405 00000084 = rb2_servo4_short_high_low_set equ 132
1406                    ; line_number = 94
1407                    ; constant rb2_servo4_high_set = 0x88
1408 00000088 = rb2_servo4_high_set equ 136
1409                    ; line_number = 95
1410                    ; constant rb2_servo4_low_set = 0x8c
1411 0000008c = rb2_servo4_low_set equ 140
1412                    ; line_number = 96
1413                    ; constant rb2_servo4_enables_set = 0x90
1414 00000090 = rb2_servo4_enables_set equ 144
1415                    ; line_number = 97
1416                    ; constant rb2_servo4_enable0 = 1
1417 00000001 = rb2_servo4_enable0 equ 1
1418                    ; line_number = 98
1419                    ; constant rb2_servo4_enable1 = 2
1420 00000002 = rb2_servo4_enable1 equ 2
1421                    ; line_number = 99
1422                    ; constant rb2_servo4_enable2 = 4
1423 00000004 = rb2_servo4_enable2 equ 4
1424                    ; line_number = 100
1425                    ; constant rb2_servo4_enable3 = 8
1426 00000008 = rb2_servo4_enable3 equ 8
1427                    ; line_number = 101
1428                    ; constant rb2_servo4_enable_all = 0xf
1429 0000000f = rb2_servo4_enable_all equ 15
1430                    ; line_number = 102
1431                    ; constant rb2_servo4_enable_none = 0
1432 00000000 = rb2_servo4_enable_none equ 0
1433                    ; line_number = 103
1434                    ; constant rb2_servo4_high_get = 0xa0
1435 000000a0 = rb2_servo4_high_get equ 160
1436                    ; line_number = 104
1437                    ; constant rb2_servo4_low_get = 0xa4
1438 000000a4 = rb2_servo4_low_get equ 164
1439                    ; line_number = 105
1440                    ; constant rb2_servo4_enables_get = 0xa8
1441 000000a8 = rb2_servo4_enables_get equ 168
1442            
1443                    ; line_number = 107
1444                    ; constant rb2_controller28_address = 28
1445 0000001c = rb2_controller28_address equ 28
1446            
1447                    ; line_number = 109
1448                    ; constant rb2_lcd32_address = 32
1449 00000020 = rb2_lcd32_address equ 32
1450                    ; line_number = 110
1451                    ; constant rb2_lcd32_new_line = 0xa
1452 0000000a = rb2_lcd32_new_line equ 10
1453                    ; line_number = 111
1454                    ; constant rb2_lcd32_form_feed = 0xc
1455 0000000c = rb2_lcd32_form_feed equ 12
1456                    ; line_number = 112
1457                    ; constant rb2_lcd32_carriage_return = 0xd
1458 0000000d = rb2_lcd32_carriage_return equ 13
1459                    ; line_number = 113
1460                    ; constant rb2_lcd32_column_set = 0x20
1461 00000020 = rb2_lcd32_column_set equ 32
1462            
1463            
1464                    ; buffer = 'rb2bus'
1465                    ; line_number = 54
1466                    ; library rb2_constants exited
1467                    ; line_number = 55
1468                    ; library rb2bus_globals entered
1469            
1470                    ; # Copyright (c) 2006-2007 by Wayne C. Gramlich
1471                    ; # All rights reserved.
1472            
1473                    ; # These are the global variables used by both the {rb2bus} and
1474                    ; # the various {rb2bus_picXXXX} libraries.  Poll based firmware
1475                    ; # uses both libraries, whereas interrupt driven software only
1476                    ; # uses the {rb2bus_picXXX} libraries.
1477            
1478                    ; buffer = 'rb2bus_globals'
1479                    ; line_number = 11
1480                    ; global rb2bus_selected bit	# 
1481 0000006f = rb2bus_selected___byte equ globals___0+79
1482 00000000 = rb2bus_selected___bit equ 0
1483                    ; line_number = 12
1484                    ; global rb2bus_error bit		# Global error bit
1485 0000006f = rb2bus_error___byte equ globals___0+79
1486 00000001 = rb2bus_error___bit equ 1
1487                    ; line_number = 13
1488                    ; global rb2bus_address byte	# Bus address to respond to
1489 00000020 = rb2bus_address equ globals___0
1490                    ; line_number = 14
1491                    ; global rb2bus_index byte	# Index into id information
1492 00000021 = rb2bus_index equ globals___0+1
1493            
1494            
1495                    ; buffer = 'rb2bus'
1496                    ; line_number = 55
1497                    ; library rb2bus_globals exited
1498            
1499                    ; Delaying code generation for procedure  rb2bus_select_wait
1500                    ; Delaying code generation for procedure  rb2bus_deselect
1501                    ; Delaying code generation for procedure  rb2bus_byte_get
1502                    ; Delaying code generation for procedure  rb2bus_byte_put
1503                    ; Delaying code generation for procedure  rb2bus_command
1504            
1505                    ; buffer = 'rb2bus_pic16f628'
1506                    ; line_number = 16
1507                    ; library rb2bus exited
1508            
1509                    ; # Baud_Rate = Fosc / (16(X+1))
1510                    ; # 16 * (X+1) = Fosc/Baud_Rate
1511                    ; # X+1 = Fosc/(16*Baud_Rate)
1512                    ; # X = Fosc/(16*Baud_rate) - 1
1513            
1514                    ; line_number = 23
1515                    ; constant baud_rate_500k = 500000
1516 0007a120 = baud_rate_500k equ 500000
1517                    ; line_number = 24
1518                    ; constant spbrg_500k = clock_rate / (16 * baud_rate_500k) - 1
1519 00000001 = spbrg_500k equ 1
1520            
1521                    ; Delaying code generation for procedure  rb2bus_initialize
1522                    ; Delaying code generation for procedure  rb2bus_eedata_read
1523                    ; Delaying code generation for procedure  rb2bus_eedata_write
1524            
1525                    ; buffer = 'lcd32'
1526                    ; line_number = 63
1527                    ; library rb2bus_pic16f628 exited
1528            
1529                    ; # This module uses a 16MHz ceramic resonator; hence fosc = hs:
1530            
1531                    ; # Port stuff:
1532            
1533                    ; line_number = 70
1534                    ; constant trisb_mask = 0x30
1535 00000030 = trisb_mask equ 48
1536                    ; line_number = 71
1537                    ; constant db47_mask = 0xf
1538 0000000f = db47_mask equ 15
1539            
1540                    ; line_number = 73
1541                    ; package dip
1542                    ; line_number = 74
1543                    ; pin 1 = ra2_out, name = db2
1544 00000005 = db2___byte equ _porta
1545 00000002 = db2___bit equ 2
1546                    ; line_number = 75
1547                    ;  pin 2 = ra3_out, name = db3
1548 00000005 = db3___byte equ _porta
1549 00000003 = db3___bit equ 3
1550                    ; line_number = 76
1551                    ;  pin 3 = ra4_open_collector, name = e
1552 00000005 = e___byte equ _porta
1553 00000004 = e___bit equ 4
1554                    ; line_number = 77
1555                    ;  pin 4 = ra5_in, name = lines34
1556 00000005 = lines34___byte equ _porta
1557 00000005 = lines34___bit equ 5
1558                    ; line_number = 78
1559                    ;  pin 5 = ground
1560                    ; line_number = 79
1561                    ;  pin 6 = rb0_out, name = rs
1562 00000006 = rs___byte equ _portb
1563 00000000 = rs___bit equ 0
1564                    ; line_number = 80
1565                    ;  pin 7 = rx
1566                    ; line_number = 81
1567                    ;  pin 8 = tx
1568                    ; line_number = 82
1569                    ;  pin 9 = rb3_out, name = rw
1570 00000006 = rw___byte equ _portb
1571 00000003 = rw___bit equ 3
1572                    ; line_number = 83
1573                    ;  pin 10 = rb4_out, name = db4
1574 00000006 = db4___byte equ _portb
1575 00000004 = db4___bit equ 4
1576                    ; line_number = 84
1577                    ;  pin 11 = rb5_out, name = db5
1578 00000006 = db5___byte equ _portb
1579 00000005 = db5___bit equ 5
1580                    ; line_number = 85
1581                    ;  pin 12 = rb6_out, name = db6
1582 00000006 = db6___byte equ _portb
1583 00000006 = db6___bit equ 6
1584                    ; line_number = 86
1585                    ;  pin 13 = rb7_out, name = db7
1586 00000006 = db7___byte equ _portb
1587 00000006 = db7___bit equ 6
1588                    ; line_number = 87
1589                    ;  pin 14 = power_supply
1590                    ; line_number = 88
1591                    ;  pin 15 = osc2
1592                    ; line_number = 89
1593                    ;  pin 16 = osc1
1594                    ; line_number = 90
1595                    ;  pin 17 = ra0_out, name = db0
1596 00000005 = db0___byte equ _porta
1597 00000000 = db0___bit equ 0
1598                    ; line_number = 91
1599                    ;  pin 18 = ra1_out, name = db1
1600 00000005 = db1___byte equ _porta
1601 00000001 = db1___bit equ 1
1602            
1603                    ; line_number = 93
1604                    ; constant line_mask = 3
1605 00000003 = line_mask equ 3
1606                    ; line_number = 94
1607                    ; constant column_mask = 0xf
1608 0000000f = column_mask equ 15
1609                    ; line_number = 95
1610                    ; constant cursor_mode_mask = 3
1611 00000003 = cursor_mode_mask equ 3
1612            
1613                    ; line_number = 97
1614                    ; global shift byte
1615 0000002a = shift equ globals___0+10
1616                    ; line_number = 98
1617                    ; global column byte
1618 0000002b = column equ globals___0+11
1619                    ; line_number = 99
1620                    ; global line byte
1621 0000002c = line equ globals___0+12
1622                    ; line_number = 100
1623                    ; global cursor_mode byte
1624 0000002d = cursor_mode equ globals___0+13
1625                    ; line_number = 101
1626                    ; global font_address byte
1627 0000002e = font_address equ globals___0+14
1628            
1629                    ; line_number = 103
1630                    ; global command_previous byte
1631 0000002f = command_previous equ globals___0+15
1632                    ; line_number = 104
1633                    ; global command_last byte
1634 00000030 = command_last equ globals___0+16
1635                    ; line_number = 105
1636                    ; global sent_previous byte
1637 00000031 = sent_previous equ globals___0+17
1638                    ; line_number = 106
1639                    ; global sent_last byte
1640 00000032 = sent_last equ globals___0+18
1641            
1642                    ; line_number = 108
1643                    ; constant queue_size = 4
1644 00000004 = queue_size equ 4
1645                    ; line_number = 109
1646                    ; global data_queue[queue_size] array[byte]
1647 00000033 = data_queue equ globals___0+19
1648                    ; line_number = 110
1649                    ; global control_queue[queue_size] array[byte]
1650 00000037 = control_queue equ globals___0+23
1651                    ; line_number = 111
1652                    ; global processed byte
1653 0000003b = processed equ globals___0+27
1654                    ; line_number = 112
1655                    ; global available byte
1656 0000003c = available equ globals___0+28
1657            
1658                    ; # The field layout of a control mask byte is:
1659                    ; #
1660                    ; #  Bits   Name        Description
1661                    ; #  0-3    Count       Execute command count - 1 times (i.e. 0 => execute once)
1662                    ; #  4      Data Write  0 => Command Write(RS=0); 1=> Data Write(RS=1)
1663                    ; #  5      NOP         No Operation 1=>ignore command; 0=>do command
1664            
1665                    ; line_number = 121
1666                    ; constant count_mask = 0x0f
1667 0000000f = count_mask equ 15
1668                    ; line_number = 122
1669                    ; constant data_write = 0x10
1670 00000010 = data_write equ 16
1671                    ; line_number = 123
1672                    ; constant command_write = 0
1673 00000000 = command_write equ 0
1674                    ; line_number = 124
1675                    ; constant nop_mask = 0x20
1676 00000020 = nop_mask equ 32
1677            
1678                    ; line_number = 126
1679                    ;info   126, 0
1680                    ; procedure main
1681   0000 :   main:
1682                    ; Initialize some registers
1683 0000 3007          movlw   7
1684 0001 009f          movwf   _cmcon
1685 0002 3020          movlw   32
1686 0003 1683          bsf     __rp0___byte, __rp0___bit
1687 0004 0085          movwf   _trisa
1688 0005 3006          movlw   6
1689 0006 0086          movwf   _trisb
1690                    ; arguments_none
1691                    ; line_number = 128
1692                    ;  returns_nothing
1693            
1694                    ; line_number = 130
1695                    ;  local command byte
1696 0000003d = main__command equ globals___0+29
1697                    ; line_number = 131
1698                    ;  local temporary byte
1699 0000003e = main__temporary equ globals___0+30
1700                    ; line_number = 132
1701                    ;  local id_index byte
1702 0000003f = main__id_index equ globals___0+31
1703            
1704                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>01 code:XX=cc=>XX)
1705                    ; line_number = 134
1706                    ;  call rb2bus_initialize(32)
1707                    ;info   134, 7
1708 0007 3020          movlw   32
1709 0008 1283          bcf     __rp0___byte, __rp0___bit
1710 0009 2233          call    rb2bus_initialize
1711            
1712                    ; line_number = 136
1713                    ;  column := 0
1714                    ;info   136, 10
1715 000a 01ab          clrf    column
1716                    ; line_number = 137
1717                    ;  line := 0
1718                    ;info   137, 11
1719 000b 01ac          clrf    line
1720                    ; line_number = 138
1721                    ;  cursor_mode := 3
1722                    ;info   138, 12
1723 000c 3003          movlw   3
1724 000d 00ad          movwf   cursor_mode
1725                    ; line_number = 139
1726                    ;  shift := 0
1727                    ;info   139, 14
1728 000e 01aa          clrf    shift
1729                    ; line_number = 140
1730                    ;  processed := 0
1731                    ;info   140, 15
1732 000f 01bb          clrf    processed
1733                    ; line_number = 141
1734                    ;  available := 0
1735                    ;info   141, 16
1736 0010 01bc          clrf    available
1737                    ; line_number = 142
1738                    ;  font_address := 0
1739                    ;info   142, 17
1740 0011 01ae          clrf    font_address
1741            
1742                    ; line_number = 144
1743                    ;  id_index := 0
1744                    ;info   144, 18
1745 0012 01bf          clrf    main__id_index
1746            
1747                    ; # Initialize the LCD:
1748                    ; line_number = 147
1749                    ;  call lcd_init()
1750                    ;info   147, 19
1751 0013 20ec          call    lcd_init
1752            
1753                    ; # Output the message:
1754                    ; line_number = 150
1755                    ;  call line_put(0, '1')
1756                    ;info   150, 20
1757 0014 01c0          clrf    line_put__new_line
1758 0015 3031          movlw   49
1759 0016 2067          call    line_put
1760                    ; line_number = 151
1761                    ;  call line_put(1, '2')
1762                    ;info   151, 23
1763 0017 3001          movlw   1
1764 0018 00c0          movwf   line_put__new_line
1765 0019 3032          movlw   50
1766 001a 2067          call    line_put
1767                    ; line_number = 152
1768                    ;  call line_put(2, '3')
1769                    ;info   152, 27
1770 001b 3002          movlw   2
1771 001c 00c0          movwf   line_put__new_line
1772 001d 3033          movlw   51
1773 001e 2067          call    line_put
1774                    ; line_number = 153
1775                    ;  call line_put(3, '4')
1776                    ;info   153, 31
1777 001f 3003          movlw   3
1778 0020 00c0          movwf   line_put__new_line
1779 0021 3034          movlw   52
1780 0022 2067          call    line_put
1781                    ; line_number = 154
1782                    ;  line := 0
1783                    ;info   154, 35
1784 0023 01ac          clrf    line
1785            
1786                    ; #call lcd_command(0x80)
1787            
1788                    ; line_number = 158
1789                    ;  loop_forever start
1790   0024 :   main__1:
1791                    ; #call delay()
1792                    ; line_number = 160
1793                    ;  do_nothing
1794                    ;info   160, 36
1795            
1796                    ; line_number = 158
1797                    ;  loop_forever wrap-up
1798 0024 2824          goto    main__1
1799                    ; line_number = 158
1800                    ;  loop_forever done
1801                    ; line_number = 162
1802                    ; loop_forever start
1803   0025 :   main__2:
1804                    ; # Make sure that we have been selected:
1805                    ; line_number = 164
1806                    ;  rb2bus_error := _true
1807                    ;info   164, 37
1808 0025 14ef          bsf     rb2bus_error___byte, rb2bus_error___bit
1809                    ; line_number = 165
1810                    ;  while rb2bus_error start
1811   0026 :   main__3:
1812                    ;info   165, 38
1813                    ; =>bit_code_emit@symbol(): sym=rb2bus_error
1814                    ; No 1TEST: true.size=4 false.size=0
1815                    ; No 2TEST: true.size=4 false.size=0
1816                    ; 1GOTO: Single test with GOTO
1817 0026 1cef          btfss   rb2bus_error___byte, rb2bus_error___bit
1818 0027 282c          goto    main__4
1819                    ; line_number = 166
1820                    ; call rb2bus_select_wait()
1821                    ;info   166, 40
1822 0028 2194          call    rb2bus_select_wait
1823                    ; line_number = 167
1824                    ;  command := rb2bus_byte_get()
1825                    ;info   167, 41
1826 0029 21b3          call    rb2bus_byte_get
1827 002a 00bd          movwf   main__command
1828            
1829 002b 2826          goto    main__3
1830                    ; Recombine size1 = 0 || size2 = 0
1831   002c :   main__4:
1832                    ; line_number = 165
1833                    ;  while rb2bus_error done
1834                    ; # Zero the command queue:
1835                    ; line_number = 170
1836                    ;  available := 0
1837                    ;info   170, 44
1838 002c 01bc          clrf    available
1839                    ; line_number = 171
1840                    ;  processed := 0
1841                    ;info   171, 45
1842 002d 01bb          clrf    processed
1843            
1844                    ; # Dispatch on the command:
1845                    ; line_number = 174
1846                    ;  switch command >> 6 start
1847                    ;info   174, 46
1848                    ; switch_before:(data:00=uu=>00 code:XX=cc=>XX) size=9
1849 002e 3000          movlw   main__16>>8
1850 002f 008a          movwf   __pclath
1851 0000004f = main__17 equ globals___0+47
1852 0030 0e3d          swapf   main__command,w
1853 0031 00cf          movwf   main__17
1854 0032 0ccf          rrf     main__17,f
1855 0033 0c4f          rrf     main__17,w
1856 0034 3903          andlw   3
1857                    ; switch after expression:(data:00=uu=>00 code:XX=cc=>XX)
1858 0035 3e37          addlw   main__16
1859 0036 0082          movwf   __pcl
1860                    ; page_group 4
1861   0037 :   main__16:
1862 0037 2866          goto    main__18
1863 0038 2866          goto    main__18
1864 0039 2866          goto    main__18
1865 003a 283b          goto    main__15
1866                    ; line_number = 175
1867                    ; case 3
1868   003b :   main__15:
1869                    ; line_number = 176
1870                    ; switch (command >> 3) & 7 start
1871                    ;info   176, 59
1872                    ; switch_before:(data:XX=cc=>XX code:XX=cc=>XX) size=0
1873 003b 3000          movlw   main__12>>8
1874 003c 008a          movwf   __pclath
1875 0000004f = main__13 equ globals___0+47
1876 003d 0c3d          rrf     main__command,w
1877 003e 00cf          movwf   main__13
1878 003f 0ccf          rrf     main__13,f
1879 0040 0c4f          rrf     main__13,w
1880 0041 3907          andlw   7
1881                    ; switch after expression:(data:00=uu=>00 code:XX=cc=>XX)
1882 0042 3e44          addlw   main__12
1883 0043 0082          movwf   __pcl
1884                    ; page_group 8
1885   0044 :   main__12:
1886 0044 2866          goto    main__14
1887 0045 2866          goto    main__14
1888 0046 2866          goto    main__14
1889 0047 2866          goto    main__14
1890 0048 2866          goto    main__14
1891 0049 2866          goto    main__14
1892 004a 2866          goto    main__14
1893 004b 284c          goto    main__11
1894                    ; line_number = 177
1895                    ; case 7
1896   004c :   main__11:
1897                    ; line_number = 178
1898                    ; switch command & 7 start
1899                    ;info   178, 76
1900                    ; switch_before:(data:XX=cc=>XX code:XX=cc=>XX) size=0
1901 004c 3000          movlw   main__9>>8
1902 004d 008a          movwf   __pclath
1903 004e 3007          movlw   7
1904 004f 053d          andwf   main__command,w
1905                    ; switch after expression:(data:00=uu=>00 code:XX=cc=>XX)
1906 0050 3e52          addlw   main__9
1907 0051 0082          movwf   __pcl
1908                    ; page_group 8
1909   0052 :   main__9:
1910 0052 2866          goto    main__10
1911 0053 2866          goto    main__10
1912 0054 2866          goto    main__10
1913 0055 2866          goto    main__10
1914 0056 2866          goto    main__10
1915 0057 285a          goto    main__6
1916 0058 2863          goto    main__7
1917 0059 2865          goto    main__8
1918                    ; line_number = 179
1919                    ; case 5
1920   005a :   main__6:
1921                    ; # 1111 1101 (Id_next):
1922                    ; line_number = 181
1923                    ;  if id_index < id.size start
1924                    ;info   181, 90
1925 005a 3015          movlw   21
1926 005b 023f          subwf   main__id_index,w
1927                    ; =>bit_code_emit@symbol(): sym=__c
1928                    ; No 1TEST: true.size=0 false.size=4
1929                    ; No 2TEST: true.size=0 false.size=4
1930                    ; 1GOTO: Single test with GOTO
1931 005c 1803          btfsc   __c___byte, __c___bit
1932 005d 2862          goto    main__5
1933                    ; line_number = 182
1934                    ; call rb2bus_byte_put(id[id_index])
1935                    ;info   182, 94
1936 005e 083f          movf    main__id_index,w
1937 005f 2179          call    id
1938 0060 21d5          call    rb2bus_byte_put
1939                    ; line_number = 183
1940                    ;  id_index := id_index + 1
1941                    ;info   183, 97
1942 0061 0abf          incf    main__id_index,f
1943   0062 :   main__5:
1944                    ; Recombine size1 = 0 || size2 = 0
1945                    ; line_number = 181
1946                    ;  if id_index < id.size done
1947 0062 2866          goto    main__10
1948                    ; line_number = 184
1949                    ; case 6
1950   0063 :   main__7:
1951                    ; # 1111 1110 (Id_start):
1952                    ; line_number = 186
1953                    ;  id_index := 0
1954                    ;info   186, 99
1955 0063 01bf          clrf    main__id_index
1956 0064 2866          goto    main__10
1957                    ; line_number = 187
1958                    ; case 7
1959   0065 :   main__8:
1960                    ; # 1111 1111 (Deselect):
1961                    ; line_number = 189
1962                    ;  call rb2bus_deselect()
1963                    ;info   189, 101
1964 0065 21b1          call    rb2bus_deselect
1965            
1966            
1967   0066 :   main__10:
1968                    ; line_number = 178
1969                    ; switch command & 7 done
1970   0066 :   main__14:
1971                    ; line_number = 176
1972                    ; switch (command >> 3) & 7 done
1973   0066 :   main__18:
1974                    ; line_number = 174
1975                    ;  switch command >> 6 done
1976                    ; line_number = 162
1977                    ; loop_forever wrap-up
1978 0066 2825          goto    main__2
1979                    ; line_number = 162
1980                    ; loop_forever done
1981                    ; delay after procedure statements=non-uniform
1982            
1983            
1984            
1985            
1986                    ; #	  case 0
1987                    ; #	    # 00xx xxxx:
1988                    ; #	    switch (command >> 3) & 7
1989                    ; #	      case 1
1990                    ; #		# 0000 1xxx:
1991                    ; #		switch command & 7
1992                    ; #		  case_maximum 7
1993                    ; #		  case 0
1994                    ; #		    # 0000 1000 (Back Space):
1995                    ; #		    if column != 0
1996                    ; #			column := column - 1
1997                    ; #		  case 2
1998                    ; #		    # 0000 1010 (Line Feed):
1999                    ; #		    line := (line + 1) & line_mask
2000                    ; #		    column := 0
2001                    ; #		    # Force cursor to correct location:
2002                    ; #		    call cursor_enqueue()
2003                    ; #
2004                    ; #		    # Write out 16 spaces:
2005                    ; #		    call enqueue(data_write | (16 - 1), ' ')
2006                    ; #		    # There are now 2 commands in queue:
2007                    ; #		  case 4
2008                    ; #		    # 0000 1100 (Form Feed):
2009                    ; #
2010                    ; #		    # Clear the display:
2011                    ; #		    call enqueue(command_write, 0)
2012                    ; #		    # The clear display command takes 1.53mS;
2013                    ; #		    # 12 * .138 = 1.656mS.
2014                    ; #		    call enqueue(nop_mask | (12 - 1), 0)
2015                    ; #		    line := 0
2016                    ; #		    column := 0
2017                    ; #		    shift := 0
2018                    ; #		  case 5
2019                    ; #		    # 0000 1101 (Carriage Return):
2020                    ; #		    column := 0
2021                    ; #		    line := 0
2022                    ; #		call cursor_enqueue()
2023                    ; #	      case 0, 4, 5, 6, 7
2024                    ; #		# 0000 0xxx or 001x xxxx:
2025                    ; #		call character_put(command)
2026                    ; #	  case 1
2027                    ; #	    # 01xx xxxx:
2028                    ; #	    call character_put(command)
2029                    ; #	  case 2
2030                    ; #	    # 10xx xxxx:
2031                    ; #	    switch (command >> 3) & 7
2032                    ; #	      case_maximum 7
2033                    ; #	      case 0
2034                    ; #		# 1000 0xxx:
2035                    ; #		line := command & line_mask
2036                    ; #		column := 0
2037                    ; #		if command@2
2038                    ; #		    # Clear the line:
2039                    ; #		    call cursor_enqueue()
2040                    ; #		    call enqueue(data_write | (16 - 1), ' ')
2041                    ; #		    do_nothing
2042                    ; #		call cursor_enqueue()
2043                    ; #	      case 1
2044                    ; #		# 1000 1xxx:
2045                    ; #		switch command & 7
2046                    ; #		  case 0, 1, 2, 3
2047                    ; #		    # 1000 10vb (Cursor Mode Set):
2048                    ; #		    cursor_mode := command & cursor_mode_mask
2049                    ; #		    call enqueue(command_write, 0xc | cursor_mode)
2050                    ; #		  case 4
2051                    ; #		    # 1000 1100 (Cursor Mode Read):
2052                    ; #		    temporary := cursor_mode
2053                    ; #		    temporary@2 := 1
2054                    ; #		    if lines34
2055                    ; #			temporary@3 := 1
2056                    ; #		    call byte_put(temporary)
2057                    ; #		  case 5
2058                    ; #		    # 1000 1101 (Character Read):
2059                    ; #		    temporary := lcd_read()
2060                    ; #		    call byte_put(temporary)
2061                    ; #		    if column = 15
2062                    ; #			line := (line + 1) & line_mask
2063                    ; #			column := 0
2064                    ; #		    else
2065                    ; #		        column := column + 1
2066                    ; #		    call cursor_enqueue()
2067                    ; #		  case 6
2068                    ; #		    # 1000 1110 (Line Read):
2069                    ; #		    call byte_put(line)
2070                    ; #		  case 7
2071                    ; #		    # 1000 1111 (Column Read):
2072                    ; #		    call byte_put(column)
2073                    ; #	      case 2, 3
2074                    ; #		# 1001 xxxx (Column Set):
2075                    ; #		column := command & column_mask
2076                    ; #		call cursor_enqueue()
2077                    ; #	      case 4, 5
2078                    ; #		# 1010 xxxx (Column Set and Clear):
2079                    ; #		column := column & column_mask
2080                    ; #		call cursor_enqueue()
2081                    ; #		call enqueue(data_write | (16 - column), ' ')
2082                    ; #		call cursor_enqueue()
2083                    ; #	      case 6
2084                    ; #		# 1011 0xxx:
2085                    ; #		switch command & 7
2086                    ; #		  case_maximum 7
2087                    ; #		  case 0
2088                    ; #		    # 1011 0000 (Set Font Address):
2089                    ; #		    font_address := byte_get() & 0x1f
2090                    ; #		  case 1
2091                    ; #		    # 1011 0001 (Read Font Address):
2092                    ; #		    call byte_put(font_address)
2093                    ; #		  case 2
2094                    ; #		    # 1011 0010 (Read Font Line):
2095                    ; #		    # Set the font address, and access font memory:
2096                    ; #		    call lcd_command(0x40 | font_address)
2097                    ; #		    # Read the data:
2098                    ; #		    temporary := lcd_read()
2099                    ; #		    # Force back to display memory:
2100                    ; #		    call cursor_position()
2101                    ; #		    font_address := font_address + 1
2102                    ; #		    # Ship the data back:
2103                    ; #		    call byte_put(temporary)
2104            
2105                    ; #	      case 0, 1, 2, 3
2106                    ; #		# 110p pppp (Write Font Line):
2107                    ; #		# Set font address and access font memory:
2108                    ; #		call enqueue(command_write, 0x40 | font_address)
2109                    ; #		# Write one line of font memory:
2110                    ; #		call enqueue(data_write, command & 0x1f)
2111                    ; #		# Force back to display memory:
2112                    ; #		call cursor_enqueue()
2113                    ; #		font_address := font_address + 1
2114            
2115            
2116                    ; line_number = 322
2117                    ;info   322, 103
2118                    ; procedure line_put
2119   0067 :   line_put:
2120                    ; Last argument is sitting in W; save into argument variable
2121 0067 00c1          movwf   line_put__character
2122                    ; delay=4294967295
2123                    ; line_number = 323
2124                    ; argument new_line byte
2125 00000040 = line_put__new_line equ globals___0+32
2126                    ; line_number = 324
2127                    ; argument character byte
2128 00000041 = line_put__character equ globals___0+33
2129                    ; line_number = 325
2130                    ;  returns_nothing
2131            
2132                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
2133                    ; line_number = 327
2134                    ;  line := new_line
2135                    ;info   327, 104
2136 0068 0840          movf    line_put__new_line,w
2137 0069 00ac          movwf   line
2138                    ; line_number = 328
2139                    ;  column := 0
2140                    ;info   328, 106
2141 006a 01ab          clrf    column
2142                    ; line_number = 329
2143                    ;  call cursor_position()
2144                    ;info   329, 107
2145 006b 2090          call    cursor_position
2146                    ; line_number = 330
2147                    ;  loop_exactly 16 start
2148                    ;info   330, 108
2149 00000050 = line_put__1 equ globals___0+48
2150 006c 3010          movlw   16
2151 006d 00d0          movwf   line_put__1
2152   006e :   line_put__2:
2153                    ; line_number = 331
2154                    ; call lcd_character_put(character)
2155                    ;info   331, 110
2156 006e 0841          movf    line_put__character,w
2157 006f 20a9          call    lcd_character_put
2158            
2159            
2160                    ; line_number = 330
2161                    ;  loop_exactly 16 wrap-up
2162 0070 0bd0          decfsz  line_put__1,f
2163 0071 286e          goto    line_put__2
2164                    ; line_number = 330
2165                    ;  loop_exactly 16 done
2166                    ; delay after procedure statements=non-uniform
2167                    ; Implied return
2168 0072 3400          retlw   0
2169            
2170            
2171            
2172            
2173                    ; line_number = 334
2174                    ;info   334, 115
2175                    ; procedure character_put
2176   0073 :   character_put:
2177                    ; Last argument is sitting in W; save into argument variable
2178 0073 00c2          movwf   character_put__character
2179                    ; delay=4294967295
2180                    ; line_number = 335
2181                    ; argument character byte
2182 00000042 = character_put__character equ globals___0+34
2183                    ; line_number = 336
2184                    ;  returns_nothing
2185            
2186                    ; # This procedure will output {character} to the display
2187                    ; # and update the {line} and {position} global variables.
2188                    ; # If the cursor is in the column 15, it is either kept
2189                    ; # there (normal mode) or advanced to the next line in column
2190                    ; # 0 (debug mode).  This procedure enqueues a total of three
2191                    ; # commands onto the command queue.
2192            
2193                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
2194                    ; line_number = 345
2195                    ;  call cursor_enqueue()
2196                    ;info   345, 116
2197 0074 2085          call    cursor_enqueue
2198                    ; line_number = 346
2199                    ;  call enqueue(data_write, character)
2200                    ;info   346, 117
2201 0075 3010          movlw   16
2202 0076 00c8          movwf   enqueue__control
2203 0077 0842          movf    character_put__character,w
2204 0078 20d4          call    enqueue
2205                    ; line_number = 347
2206                    ;  if column = column_mask start
2207                    ;info   347, 121
2208                    ; Left minus Right
2209 0079 30f1          movlw   241
2210 007a 072b          addwf   column,w
2211                    ; =>bit_code_emit@symbol(): sym=__z
2212                    ; No 1TEST: true.size=4 false.size=1
2213                    ; No 2TEST: true.size=4 false.size=1
2214                    ; 2GOTO: Single test with two GOTO's
2215 007b 1d03          btfss   __z___byte, __z___bit
2216 007c 2882          goto    character_put__1
2217                    ; # Advance to next line:
2218                    ; line_number = 349
2219                    ;  column := 0
2220                    ;info   349, 125
2221 007d 01ab          clrf    column
2222                    ; line_number = 350
2223                    ;  line := (line + 1) & line_mask
2224                    ;info   350, 126
2225 007e 0a2c          incf    line,w
2226 007f 3903          andlw   3
2227 0080 00ac          movwf   line
2228 0081 2883          goto    character_put__2
2229                    ; 2GOTO: Starting code 2
2230   0082 :   character_put__1:
2231                    ; # Advance to next column:
2232                    ; line_number = 353
2233                    ;  column := column + 1
2234                    ;info   353, 130
2235 0082 0aab          incf    column,f
2236   0083 :   character_put__2:
2237                    ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
2238                    ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
2239                    ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
2240                    ; line_number = 347
2241                    ;  if column = column_mask done
2242                    ; line_number = 354
2243                    ; call cursor_enqueue()
2244                    ;info   354, 131
2245 0083 2085          call    cursor_enqueue
2246                    ; # A total of 3 commands are enqueued:
2247            
2248            
2249                    ; delay after procedure statements=non-uniform
2250                    ; Implied return
2251 0084 3400          retlw   0
2252            
2253            
2254            
2255            
2256                    ; line_number = 358
2257                    ;info   358, 133
2258                    ; procedure cursor_enqueue
2259   0085 :   cursor_enqueue:
2260                    ; arguments_none
2261                    ; line_number = 360
2262                    ;  returns_nothing
2263            
2264                    ; # This procedure will ensure that a command that forces the cursor
2265                    ; # to the correct location specified by the global variables {line}
2266                    ; # and {column}.
2267            
2268                    ; line_number = 366
2269                    ;  local command byte
2270 00000043 = cursor_enqueue__command equ globals___0+35
2271            
2272                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
2273                    ; line_number = 368
2274                    ;  command := 0x80
2275                    ;info   368, 133
2276 0085 3080          movlw   128
2277 0086 00c3          movwf   cursor_enqueue__command
2278                    ; line_number = 369
2279                    ;  if line@0 start
2280                    ;info   369, 135
2281 0000002c = cursor_enqueue__select__1___byte equ line
2282 00000000 = cursor_enqueue__select__1___bit equ 0
2283                    ; =>bit_code_emit@symbol(): sym=cursor_enqueue__select__1
2284                    ; 1TEST: Single test with code in skip slot
2285 0087 182c          btfsc   cursor_enqueue__select__1___byte, cursor_enqueue__select__1___bit
2286                    ; line_number = 370
2287                    ; command := command | 0x40
2288                    ;info   370, 136
2289 0088 1743          bsf     cursor_enqueue__command, 6
2290                    ; Recombine size1 = 0 || size2 = 0
2291                    ; line_number = 369
2292                    ;  if line@0 done
2293                    ; line_number = 371
2294                    ; if line@1 start
2295                    ;info   371, 137
2296 0000002c = cursor_enqueue__select__2___byte equ line
2297 00000001 = cursor_enqueue__select__2___bit equ 1
2298                    ; =>bit_code_emit@symbol(): sym=cursor_enqueue__select__2
2299                    ; 1TEST: Single test with code in skip slot
2300 0089 18ac          btfsc   cursor_enqueue__select__2___byte, cursor_enqueue__select__2___bit
2301                    ; line_number = 372
2302                    ; command := command | 0x10
2303                    ;info   372, 138
2304 008a 1643          bsf     cursor_enqueue__command, 4
2305                    ; Recombine size1 = 0 || size2 = 0
2306                    ; line_number = 371
2307                    ; if line@1 done
2308                    ; line_number = 373
2309                    ; call enqueue(command_write, command | column)
2310                    ;info   373, 139
2311 008b 01c8          clrf    enqueue__control
2312 008c 0843          movf    cursor_enqueue__command,w
2313 008d 042b          iorwf   column,w
2314 008e 20d4          call    enqueue
2315            
2316            
2317                    ; delay after procedure statements=non-uniform
2318                    ; Implied return
2319 008f 3400          retlw   0
2320            
2321            
2322            
2323            
2324                    ; line_number = 376
2325                    ;info   376, 144
2326                    ; procedure cursor_position
2327   0090 :   cursor_position:
2328                    ; arguments_none
2329                    ; line_number = 378
2330                    ;  returns_nothing
2331            
2332                    ; # This prodedure will force the cursor to the location specified
2333                    ; # by the globals variables {line} and {position}.
2334            
2335                    ; line_number = 383
2336                    ;  local command byte
2337 00000044 = cursor_position__command equ globals___0+36
2338            
2339                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
2340                    ; line_number = 385
2341                    ;  command := 0x80
2342                    ;info   385, 144
2343 0090 3080          movlw   128
2344 0091 00c4          movwf   cursor_position__command
2345                    ; line_number = 386
2346                    ;  if line@0 start
2347                    ;info   386, 146
2348 0000002c = cursor_position__select__1___byte equ line
2349 00000000 = cursor_position__select__1___bit equ 0
2350                    ; =>bit_code_emit@symbol(): sym=cursor_position__select__1
2351                    ; 1TEST: Single test with code in skip slot
2352 0092 182c          btfsc   cursor_position__select__1___byte, cursor_position__select__1___bit
2353                    ; line_number = 387
2354                    ; command := command | 0x40
2355                    ;info   387, 147
2356 0093 1744          bsf     cursor_position__command, 6
2357                    ; Recombine size1 = 0 || size2 = 0
2358                    ; line_number = 386
2359                    ;  if line@0 done
2360                    ; line_number = 388
2361                    ; if line@1 start
2362                    ;info   388, 148
2363 0000002c = cursor_position__select__2___byte equ line
2364 00000001 = cursor_position__select__2___bit equ 1
2365                    ; =>bit_code_emit@symbol(): sym=cursor_position__select__2
2366                    ; 1TEST: Single test with code in skip slot
2367 0094 18ac          btfsc   cursor_position__select__2___byte, cursor_position__select__2___bit
2368                    ; line_number = 389
2369                    ; command := command | 0x10
2370                    ;info   389, 149
2371 0095 1644          bsf     cursor_position__command, 4
2372                    ; Recombine size1 = 0 || size2 = 0
2373                    ; line_number = 388
2374                    ; if line@1 done
2375                    ; line_number = 390
2376                    ; command := command | column
2377                    ;info   390, 150
2378 0096 082b          movf    column,w
2379 0097 04c4          iorwf   cursor_position__command,f
2380                    ; line_number = 391
2381                    ;  call lcd_command(command)
2382                    ;info   391, 152
2383 0098 0844          movf    cursor_position__command,w
2384 0099 209b          call    lcd_command
2385            
2386            
2387                    ; delay after procedure statements=non-uniform
2388                    ; Implied return
2389 009a 3400          retlw   0
2390            
2391            
2392            
2393            
2394                    ; line_number = 394
2395                    ;info   394, 155
2396                    ; procedure lcd_command
2397   009b :   lcd_command:
2398                    ; Last argument is sitting in W; save into argument variable
2399 009b 00c5          movwf   lcd_command__command
2400                    ; delay=1
2401                    ; line_number = 395
2402                    ; argument command byte
2403 00000045 = lcd_command__command equ globals___0+37
2404                    ; line_number = 396
2405                    ;  returns_nothing
2406                    ; line_number = 397
2407                    ;  exact_delay 52 * microsecond
2408            
2409                    ; # This procedure will strobe {command} into the LCD controller
2410                    ; # as two 4-bit nibbles.  The procedure delays by 52uS to ensure
2411                    ; # the command has time to be digested by the LCD controller.
2412            
2413                    ; # Send high nibble (RW=0 & RS=0):
2414                    ; before procedure statements delay=1, bit states=(data:00=uu=>00 code:XX=cc=>XX)
2415                    ; line_number = 404
2416                    ;  call nibble_send(0, command >> 4)
2417                    ; Delay at call is 1
2418                    ;info   404, 156
2419 009c 12ef          bcf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
2420 00000051 = lcd_command__1 equ globals___0+49
2421 009d 0e45          swapf   lcd_command__command,w
2422 009e 390f          andlw   15
2423 009f 216c          call    nibble_send
2424            
2425                    ; # Send low nibble (RW=0 & RS=0):
2426                    ; line_number = 407
2427                    ;  call nibble_send(0, command)
2428                    ; Delay at call is 19
2429                    ;info   407, 160
2430 00a0 12ef          bcf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
2431 00a1 0845          movf    lcd_command__command,w
2432 00a2 216c          call    nibble_send
2433            
2434            
2435                    ; delay after procedure statements=36
2436                    ; Delay 170 cycles
2437                    ; Delay loop takes 42 * 4 = 168 cycles
2438 00a3 302a          movlw   42
2439   00a4 :   lcd_command__2:
2440 00a4 3eff          addlw   255
2441 00a5 1d03          btfss   __z___byte, __z___bit
2442 00a6 28a4          goto    lcd_command__2
2443 00a7 28a8          goto    lcd_command__3
2444   00a8 :   lcd_command__3:
2445                    ; Implied return
2446 00a8 3400          retlw   0
2447                    ; Final delay = 208
2448            
2449            
2450            
2451            
2452                    ; line_number = 410
2453                    ;info   410, 169
2454                    ; procedure lcd_character_put
2455   00a9 :   lcd_character_put:
2456                    ; Last argument is sitting in W; save into argument variable
2457 00a9 00c6          movwf   lcd_character_put__character
2458                    ; delay=1
2459                    ; line_number = 411
2460                    ; argument character byte
2461 00000046 = lcd_character_put__character equ globals___0+38
2462                    ; line_number = 412
2463                    ;  returns_nothing
2464                    ; line_number = 413
2465                    ;  exact_delay 52 * microsecond
2466            
2467                    ; # This procedure will output {character} to the LCD display
2468                    ; # and move the cursor right by one.
2469            
2470                    ; # Send high nibble (RW=0 & RS=1):
2471                    ; before procedure statements delay=1, bit states=(data:00=uu=>00 code:XX=cc=>XX)
2472                    ; line_number = 419
2473                    ;  call nibble_send(1, character >> 4)
2474                    ; Delay at call is 1
2475                    ;info   419, 170
2476 00aa 16ef          bsf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
2477 00000052 = lcd_character_put__1 equ globals___0+50
2478 00ab 0e46          swapf   lcd_character_put__character,w
2479 00ac 390f          andlw   15
2480 00ad 216c          call    nibble_send
2481            
2482                    ; # Send low nibble (RW=0 & RS=1):
2483                    ; line_number = 422
2484                    ;  call nibble_send(1, character)
2485                    ; Delay at call is 19
2486                    ;info   422, 174
2487 00ae 16ef          bsf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
2488 00af 0846          movf    lcd_character_put__character,w
2489 00b0 216c          call    nibble_send
2490            
2491            
2492                    ; delay after procedure statements=36
2493                    ; Delay 170 cycles
2494                    ; Delay loop takes 42 * 4 = 168 cycles
2495 00b1 302a          movlw   42
2496   00b2 :   lcd_character_put__2:
2497 00b2 3eff          addlw   255
2498 00b3 1d03          btfss   __z___byte, __z___bit
2499 00b4 28b2          goto    lcd_character_put__2
2500 00b5 28b6          goto    lcd_character_put__3
2501   00b6 :   lcd_character_put__3:
2502                    ; Implied return
2503 00b6 3400          retlw   0
2504                    ; Final delay = 208
2505            
2506            
2507            
2508            
2509                    ; line_number = 425
2510                    ;info   425, 183
2511                    ; procedure lcd_read
2512   00b7 :   lcd_read:
2513                    ; arguments_none
2514                    ; line_number = 427
2515                    ;  returns byte
2516            
2517                    ; # Generic routine to read a byte from the LCD controller.
2518            
2519                    ; line_number = 431
2520                    ;  local result byte
2521 00000047 = lcd_read__result equ globals___0+39
2522            
2523                    ; # First, turn DB4-7 into inputs:
2524                    ; #_trisb := db4_mask | db5_mask | db6_mask | db7_mask
2525                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
2526                    ; line_number = 435
2527                    ;  _trisb := trisb_mask | db47_mask
2528                    ;info   435, 183
2529 00b7 303f          movlw   63
2530 00b8 1683          bsf     __rp0___byte, __rp0___bit
2531 00b9 0086          movwf   _trisb
2532            
2533                    ; # Read high nibble:
2534                    ; #_portb := rs_mask | rw_mask
2535                    ; line_number = 439
2536                    ;  rs := _true
2537                    ;info   439, 186
2538 00ba 1283          bcf     __rp0___byte, __rp0___bit
2539 00bb 1406          bsf     rs___byte, rs___bit
2540                    ; line_number = 440
2541                    ;  rw := _true
2542                    ;info   440, 188
2543 00bc 1586          bsf     rw___byte, rw___bit
2544                    ; line_number = 441
2545                    ;  e := _true
2546                    ;info   441, 189
2547 00bd 1605          bsf     e___byte, e___bit
2548                    ; line_number = 442
2549                    ;  delay 43 * microsecond start
2550                    ;info   442, 190
2551                    ; Delay expression evaluates to 172
2552                    ; line_number = 443
2553                    ; do_nothing
2554                    ;info   443, 190
2555                    ; Delay 172 cycles
2556                    ; Delay loop takes 43 * 4 = 172 cycles
2557 00be 302b          movlw   43
2558   00bf :   lcd_read__1:
2559 00bf 3eff          addlw   255
2560 00c0 1d03          btfss   __z___byte, __z___bit
2561 00c1 28bf          goto    lcd_read__1
2562                    ; line_number = 442
2563                    ;  delay 43 * microsecond done
2564                    ; line_number = 444
2565                    ; result := _portb << 4
2566                    ;info   444, 194
2567 00c2 0e06          swapf   _portb,w
2568 00c3 00c7          movwf   lcd_read__result
2569 00c4 30f0          movlw   240
2570 00c5 05c7          andwf   lcd_read__result,f
2571                    ; line_number = 445
2572                    ;  e := _false
2573                    ;info   445, 198
2574 00c6 1205          bcf     e___byte, e___bit
2575            
2576                    ; # Read low nibble:
2577                    ; #_portb := rs_mask | rw_mask
2578                    ; line_number = 449
2579                    ;  rs := _true
2580                    ;info   449, 199
2581 00c7 1406          bsf     rs___byte, rs___bit
2582                    ; line_number = 450
2583                    ;  rw := _true
2584                    ;info   450, 200
2585 00c8 1586          bsf     rw___byte, rw___bit
2586                    ; line_number = 451
2587                    ;  e := _true
2588                    ;info   451, 201
2589 00c9 1605          bsf     e___byte, e___bit
2590                    ; line_number = 452
2591                    ;  result := result | (_portb & 0xf)
2592                    ;info   452, 202
2593 00ca 300f          movlw   15
2594 00cb 0506          andwf   _portb,w
2595 00cc 04c7          iorwf   lcd_read__result,f
2596                    ; line_number = 453
2597                    ;  e := _false
2598                    ;info   453, 205
2599 00cd 1205          bcf     e___byte, e___bit
2600            
2601                    ; # Return DB4-7 to outputs:
2602                    ; #_trisb := 0
2603                    ; line_number = 457
2604                    ;  _trisb := trisb_mask
2605                    ;info   457, 206
2606 00ce 3030          movlw   48
2607 00cf 1683          bsf     __rp0___byte, __rp0___bit
2608 00d0 0086          movwf   _trisb
2609            
2610                    ; line_number = 459
2611                    ;  return result start
2612                    ; line_number = 459
2613                    ;info   459, 209
2614 00d1 1283          bcf     __rp0___byte, __rp0___bit
2615 00d2 0847          movf    lcd_read__result,w
2616 00d3 0008          return  
2617                    ; line_number = 459
2618                    ;  return result done
2619            
2620            
2621                    ; delay after procedure statements=non-uniform
2622            
2623            
2624            
2625            
2626                    ; line_number = 462
2627                    ;info   462, 212
2628                    ; procedure enqueue
2629   00d4 :   enqueue:
2630                    ; Last argument is sitting in W; save into argument variable
2631 00d4 00c9          movwf   enqueue__data
2632                    ; delay=4294967295
2633                    ; line_number = 463
2634                    ; argument control byte
2635 00000048 = enqueue__control equ globals___0+40
2636                    ; line_number = 464
2637                    ; argument data byte
2638 00000049 = enqueue__data equ globals___0+41
2639                    ; line_number = 465
2640                    ;  returns_nothing
2641            
2642                    ; # This procedure will enqueue {control} and {data} onto the
2643                    ; # command queue.  It is your responsibility to ensure that
2644                    ; # the there is enough space in the queue.
2645            
2646                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
2647                    ; line_number = 471
2648                    ;  data_queue[available] := data
2649                    ;info   471, 213
2650                    ; index_fsr_first
2651 00d5 083c          movf    available,w
2652 00d6 3e33          addlw   data_queue
2653 00d7 0084          movwf   __fsr
2654 00d8 0849          movf    enqueue__data,w
2655 00d9 0080          movwf   __indf
2656                    ; line_number = 472
2657                    ;  control_queue[available] := control
2658                    ;info   472, 218
2659                    ; index_fsr_first
2660 00da 083c          movf    available,w
2661 00db 3e37          addlw   control_queue
2662 00dc 0084          movwf   __fsr
2663 00dd 0848          movf    enqueue__control,w
2664 00de 0080          movwf   __indf
2665                    ; line_number = 473
2666                    ;  available := available + 1
2667                    ;info   473, 223
2668 00df 0abc          incf    available,f
2669            
2670            
2671                    ; delay after procedure statements=non-uniform
2672                    ; Implied return
2673 00e0 3400          retlw   0
2674            
2675            
2676            
2677            
2678                    ; line_number = 476
2679                    ;info   476, 225
2680                    ; procedure lcd_delay
2681   00e1 :   lcd_delay:
2682                    ; Last argument is sitting in W; save into argument variable
2683 00e1 00ca          movwf   lcd_delay__amount
2684                    ; delay=4294967295
2685                    ; line_number = 477
2686                    ; argument amount byte
2687 0000004a = lcd_delay__amount equ globals___0+42
2688                    ; line_number = 478
2689                    ;  returns_nothing
2690            
2691                    ; # This procedure is designed to delay for 100uS times {amount}.
2692            
2693                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
2694                    ; line_number = 482
2695                    ;  loop_exactly amount start
2696                    ;info   482, 226
2697 00000053 = lcd_delay__1 equ globals___0+51
2698 00e2 084a          movf    lcd_delay__amount,w
2699 00e3 00d3          movwf   lcd_delay__1
2700   00e4 :   lcd_delay__2:
2701                    ; line_number = 483
2702                    ; delay (100 * microsecond) - 3 start
2703                    ;info   483, 228
2704                    ; Delay expression evaluates to 397
2705                    ; line_number = 484
2706                    ; do_nothing
2707                    ;info   484, 228
2708            
2709            
2710                    ; Delay 397 cycles
2711                    ; Delay loop takes 99 * 4 = 396 cycles
2712 00e4 3063          movlw   99
2713   00e5 :   lcd_delay__3:
2714 00e5 3eff          addlw   255
2715 00e6 1d03          btfss   __z___byte, __z___bit
2716 00e7 28e5          goto    lcd_delay__3
2717 00e8 0000          nop     
2718                    ; line_number = 483
2719                    ; delay (100 * microsecond) - 3 done
2720                    ; line_number = 482
2721                    ;  loop_exactly amount wrap-up
2722 00e9 0bd3          decfsz  lcd_delay__1,f
2723 00ea 28e4          goto    lcd_delay__2
2724                    ; line_number = 482
2725                    ;  loop_exactly amount done
2726                    ; delay after procedure statements=non-uniform
2727                    ; Implied return
2728 00eb 3400          retlw   0
2729            
2730            
2731            
2732            
2733                    ; line_number = 487
2734                    ;info   487, 236
2735                    ; procedure lcd_init
2736   00ec :   lcd_init:
2737                    ; arguments_none
2738                    ; line_number = 489
2739                    ;  returns_nothing
2740            
2741                    ; # The LCD needs to be initialized into 4 bit mode and then
2742                    ; # we can write letters to it. Note that the LCD is ALWAYS 
2743                    ; # in write mode, no need to check to see if its busy, I just
2744                    ; # wait and assume it isn't.
2745                    ; #
2746                    ; # According to the SAMSUNG data sheet, you first have to
2747                    ; # wait 30+ mS to insure the display is "stable" after Vcc is
2748                    ; # applied. Then the follow a specific sequence puts it into
2749                    ; # "4 bit" mode.  However, I've noticed they assume that the
2750                    ; # LCD is already in 8 bit mode, which it won't be following
2751                    ; # a warm restart (resetting the PIC).  Further, if you ever
2752                    ; # get "out of sync" and start sending the low nibble and then
2753                    ; # the high nibble all heck breaks loose. So the INIT function
2754                    ; # actually does three things:
2755                    ; #	1) It waits 40mS for the display to initialize just
2756                    ; #	   in case this was a power up event.
2757                    ; #	2) Next it programs the display into 8 bit mode on
2758                    ; #	   purpose. Even if it was in 4 bit mode already we
2759                    ; #	   put the display in a "known" state.
2760                    ; #	3) Finally, now that it knows what state the display
2761                    ; #	   is in, it configures it for two line, 4 bit operation.
2762                    ; #
2763                    ; # This is a routine that clocks out two nibbles using the E clock and
2764                    ; # then waits 100 uS.  The first commands we send it are 0x33 hex. We send
2765                    ; # 0x33 followed by 0x32.  This has the effect of clocking out 0x3 to the
2766                    ; # port at least 3 times, with the command bit (R/S) set.  This will ALWAYS
2767                    ; # set us to 8 bit mode eventually.
2768                    ; #
2769                    ; # *  On power up we're already in 8 bit mode and 0x3 doesn't change that.
2770                    ; # *  In 4 bit mode the first two nibbles will put you into 8 bit mode
2771                    ; # *  Out of sync 4-bit mode, the first nibble finishes the low nybble of
2772                    ; #    the previous command, and the next two put us into 8 bit mode.
2773                    ; #
2774                    ; # Once we are SURE we're in 4 bit mode, we can send commands through
2775                    ; # the 4 bit interface, to finish initialization we send:
2776                    ; # 	0x28 - Four bit mode, two line display, 5 x 8 font.
2777                    ; #	0x08 - Turn off the display
2778                    ; #	0x01 - Clear the display, reset the DDRAM pointer
2779                    ; #	0x0E - Turn on the display, cursor, blink it, and don't shift.
2780            
2781                    ; # Step 1: Wait for the LCD to initialize from Power on:
2782                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
2783                    ; line_number = 532
2784                    ;  loop_exactly 5 start
2785                    ;info   532, 236
2786 00000054 = lcd_init__1 equ globals___0+52
2787 00ec 3005          movlw   5
2788 00ed 00d4          movwf   lcd_init__1
2789   00ee :   lcd_init__2:
2790                    ; line_number = 533
2791                    ; call lcd_delay(100)
2792                    ;info   533, 238
2793 00ee 3064          movlw   100
2794 00ef 20e1          call    lcd_delay
2795            
2796                    ; line_number = 532
2797                    ;  loop_exactly 5 wrap-up
2798 00f0 0bd4          decfsz  lcd_init__1,f
2799 00f1 28ee          goto    lcd_init__2
2800                    ; line_number = 532
2801                    ;  loop_exactly 5 done
2802                    ; # Step 2: Put the LCD in a "known" mode.
2803            
2804                    ; # "8-bit mode"; R/W = 0, RS = 0, DB7 - DB4 = 0x03:
2805                    ; line_number = 538
2806                    ;  call nibble_send(0, 0x03)
2807                    ;info   538, 242
2808 00f2 12ef          bcf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
2809 00f3 3003          movlw   3
2810 00f4 216c          call    nibble_send
2811                    ; line_number = 539
2812                    ;  call lcd_delay(1)
2813                    ;info   539, 245
2814 00f5 3001          movlw   1
2815 00f6 20e1          call    lcd_delay
2816            
2817                    ; # If in 4 bit mode this is the "low nibble":
2818                    ; line_number = 542
2819                    ;  call nibble_send(0, 0x03)
2820                    ;info   542, 247
2821 00f7 12ef          bcf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
2822 00f8 3003          movlw   3
2823 00f9 216c          call    nibble_send
2824                    ; line_number = 543
2825                    ;  call lcd_delay(1)
2826                    ;info   543, 250
2827 00fa 3001          movlw   1
2828 00fb 20e1          call    lcd_delay
2829            
2830            
2831                    ; # If out of sync this is the low nybble in 4 bit mode:
2832                    ; line_number = 547
2833                    ;  call nibble_send(0, 0x03)
2834                    ;info   547, 252
2835 00fc 12ef          bcf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
2836 00fd 3003          movlw   3
2837 00fe 216c          call    nibble_send
2838                    ; line_number = 548
2839                    ;  call lcd_delay(1)
2840                    ;info   548, 255
2841 00ff 3001          movlw   1
2842 0100 20e1          call    lcd_delay
2843            
2844                    ; # Finally we can ask for 4 bit mode:
2845                    ; line_number = 551
2846                    ;  call nibble_send(0, 0x02)
2847                    ;info   551, 257
2848 0101 12ef          bcf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
2849 0102 3002          movlw   2
2850 0103 216c          call    nibble_send
2851                    ; line_number = 552
2852                    ;  call lcd_delay(1)
2853                    ;info   552, 260
2854 0104 3001          movlw   1
2855 0105 20e1          call    lcd_delay
2856            
2857                    ; # Now its in 4 bit mode and we have to send double nibbles each
2858                    ; # time. Fortunately we can use a subroutine for this.
2859            
2860                    ; # FUNCTION SET - 4-bit, 2 lines, 5x8 font:
2861                    ; line_number = 558
2862                    ;  call lcd_command(0x28)
2863                    ;info   558, 262
2864 0106 3028          movlw   40
2865 0107 209b          call    lcd_command
2866            
2867                    ; # AGAIN : FUNCTION SET - 4-bit, 2 lines, 5x8 font:
2868                    ; # Sending this command twice, *does* work.
2869                    ; line_number = 562
2870                    ;  call lcd_command(0x28)
2871                    ;info   562, 264
2872 0108 3028          movlw   40
2873 0109 209b          call    lcd_command
2874            
2875                    ; # Turn off the display temporarily:
2876                    ; line_number = 565
2877                    ;  call lcd_command(0x08)
2878                    ;info   565, 266
2879 010a 3008          movlw   8
2880 010b 209b          call    lcd_command
2881            
2882                    ; # Clear the display:
2883                    ; line_number = 568
2884                    ;  call lcd_command(0x01)
2885                    ;info   568, 268
2886 010c 3001          movlw   1
2887 010d 209b          call    lcd_command
2888                    ; line_number = 569
2889                    ;  call lcd_delay(20)
2890                    ;info   569, 270
2891 010e 3014          movlw   20
2892 010f 20e1          call    lcd_delay
2893            
2894                    ; # Turn the display back on with Cursor:
2895                    ; line_number = 572
2896                    ;  call lcd_command(0x0f)
2897                    ;info   572, 272
2898 0110 300f          movlw   15
2899 0111 209b          call    lcd_command
2900            
2901                    ; # Set shift mode:
2902                    ; line_number = 575
2903                    ;  call lcd_command(0x06)
2904                    ;info   575, 274
2905 0112 3006          movlw   6
2906 0113 209b          call    lcd_command
2907            
2908            
2909                    ; delay after procedure statements=non-uniform
2910                    ; Implied return
2911 0114 3400          retlw   0
2912            
2913            
2914            
2915            
2916                    ; line_number = 578
2917                    ;info   578, 277
2918                    ; procedure delay
2919   0115 :   delay:
2920                    ; arguments_none
2921                    ; line_number = 580
2922                    ;  returns_nothing
2923            
2924                    ; # This procedure delays by 1/3 of a bit time.
2925            
2926                    ; # This procedure processes the command queue commands that have
2927                    ; # been set up by the main() procedure.  If there are no more
2928                    ; # commands in the queue, we figure out whether or not the
2929                    ; # line switch requires any display shifting.
2930                    ; #
2931                    ; # The entire command queue from main() will be emptied before
2932                    ; # the next command comes in.  The reasoning for this is because
2933                    ; # most top level commands only take two or three LCD commands.
2934                    ; # A clear display command takes 1.53mS, a total of 12 calls to
2935                    ; #  delay() (12 * 138uS = 1.56mS).  A line clear takes a few
2936                    ; # overhead commands followed by 16 data writes.  Since a command
2937                    ; # byte requites 9-2/3 bits, 29 calls to delay will occur.  Thus,
2938                    ; # we are safe.  The display shifting stuff can take place last,
2939                    ; # since it has no time criticalities.
2940                    ; #
2941                    ; # What this all means is we can set up a simple queue of
2942                    ; # instructions to be executed by the delay() procedure.
2943                    ; # The main() procedure fills the queue and the delay()
2944                    ; # procedure empties it.  We do not have to be very sophisticated,
2945                    ; # the queue will be empty before the next time main()
2946                    ; # gets around to filling it.
2947            
2948                    ; line_number = 606
2949                    ;  local control byte
2950 0000004b = delay__control equ globals___0+43
2951                    ; line_number = 607
2952                    ;  local data byte
2953 0000004c = delay__data equ globals___0+44
2954                    ; line_number = 608
2955                    ;  local do_it bit
2956 0000006f = delay__do_it___byte equ globals___0+79
2957 00000004 = delay__do_it___bit equ 4
2958                    ; line_number = 609
2959                    ;  local count byte
2960 0000004d = delay__count equ globals___0+45
2961            
2962                    ; # Kick the dog:
2963                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
2964                    ; line_number = 612
2965                    ;  watch_dog_reset done
2966                    ;info   612, 277
2967 0115 0064          clrwdt  
2968            
2969                    ; line_number = 614
2970                    ;  do_it := _false
2971                    ;info   614, 278
2972 0116 126f          bcf     delay__do_it___byte, delay__do_it___bit
2973                    ; line_number = 615
2974                    ;  if processed < available start
2975                    ;info   615, 279
2976 0117 083c          movf    available,w
2977 0118 023b          subwf   processed,w
2978                    ; =>bit_code_emit@symbol(): sym=__c
2979                    ; No 1TEST: true.size=20 false.size=29
2980                    ; No 2TEST: true.size=20 false.size=29
2981                    ; 2GOTO: Single test with two GOTO's
2982 0119 1c03          btfss   __c___byte, __c___bit
2983 011a 2930          goto    delay__6
2984                    ; # Make sure that the proper lines are visible:
2985                    ; line_number = 632
2986                    ;  if lines34 start
2987                    ;info   632, 283
2988                    ; =>bit_code_emit@symbol(): sym=lines34
2989                    ; No 1TEST: true.size=9 false.size=8
2990                    ; No 2TEST: true.size=9 false.size=8
2991                    ; 2GOTO: Single test with two GOTO's
2992 011b 1e85          btfss   lines34___byte, lines34___bit
2993 011c 2927          goto    delay__3
2994                    ; # Make sure that lines 3-4 are displayed:
2995                    ; line_number = 634
2996                    ;  if shift < 16 start
2997                    ;info   634, 285
2998 011d 3010          movlw   16
2999 011e 022a          subwf   shift,w
3000                    ; =>bit_code_emit@symbol(): sym=__c
3001                    ; No 1TEST: true.size=0 false.size=5
3002                    ; No 2TEST: true.size=0 false.size=5
3003                    ; 1GOTO: Single test with GOTO
3004 011f 1803          btfsc   __c___byte, __c___bit
3005 0120 2926          goto    delay__2
3006                    ; # Lines 3-4 are not completely visible yet; shift left by 1:
3007                    ; line_number = 636
3008                    ;  data := 0x18
3009                    ;info   636, 289
3010 0121 3018          movlw   24
3011 0122 00cc          movwf   delay__data
3012                    ; line_number = 637
3013                    ;  control := command_write
3014                    ;info   637, 291
3015 0123 01cb          clrf    delay__control
3016                    ; line_number = 638
3017                    ;  shift := shift + 1
3018                    ;info   638, 292
3019 0124 0aaa          incf    shift,f
3020                    ; line_number = 639
3021                    ;  do_it := _true
3022                    ;info   639, 293
3023 0125 166f          bsf     delay__do_it___byte, delay__do_it___bit
3024   0126 :   delay__2:
3025                    ; Recombine size1 = 0 || size2 = 0
3026                    ; line_number = 634
3027                    ;  if shift < 16 done
3028 0126 292f          goto    delay__4
3029                    ; 2GOTO: Starting code 2
3030   0127 :   delay__3:
3031                    ; # Make sure that lines 1-2 are displayed:
3032                    ; line_number = 642
3033                    ;  if shift != 0 start
3034                    ;info   642, 295
3035                    ; Left minus Right
3036 0127 082a          movf    shift,w
3037                    ; =>bit_code_emit@symbol(): sym=__z
3038                    ; No 1TEST: true.size=0 false.size=5
3039                    ; No 2TEST: true.size=0 false.size=5
3040                    ; 1GOTO: Single test with GOTO
3041 0128 1903          btfsc   __z___byte, __z___bit
3042 0129 292f          goto    delay__1
3043                    ; # Lines 1-2 are not completely visible yet; shift right by 1:
3044                    ; line_number = 644
3045                    ;  data := 0x1c
3046                    ;info   644, 298
3047 012a 301c          movlw   28
3048 012b 00cc          movwf   delay__data
3049                    ; line_number = 645
3050                    ;  control := command_write
3051                    ;info   645, 300
3052 012c 01cb          clrf    delay__control
3053                    ; line_number = 646
3054                    ;  shift := shift - 1
3055                    ;info   646, 301
3056 012d 03aa          decf    shift,f
3057                    ; line_number = 647
3058                    ;  do_it := _true
3059                    ;info   647, 302
3060 012e 166f          bsf     delay__do_it___byte, delay__do_it___bit
3061            
3062   012f :   delay__1:
3063                    ; Recombine size1 = 0 || size2 = 0
3064                    ; line_number = 642
3065                    ;  if shift != 0 done
3066   012f :   delay__4:
3067                    ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
3068                    ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
3069                    ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
3070                    ; line_number = 632
3071                    ;  if lines34 done
3072 012f 294d          goto    delay__7
3073                    ; 2GOTO: Starting code 2
3074   0130 :   delay__6:
3075                    ; # We have commands in queue to execute:
3076                    ; line_number = 617
3077                    ;  control := control_queue[processed]
3078                    ;info   617, 304
3079 0130 083b          movf    processed,w
3080 0131 3e37          addlw   control_queue
3081 0132 0084          movwf   __fsr
3082 0133 0800          movf    __indf,w
3083 0134 00cb          movwf   delay__control
3084                    ; line_number = 618
3085                    ;  data := data_queue[processed]
3086                    ;info   618, 309
3087 0135 083b          movf    processed,w
3088 0136 3e33          addlw   data_queue
3089 0137 0084          movwf   __fsr
3090 0138 0800          movf    __indf,w
3091 0139 00cc          movwf   delay__data
3092            
3093                    ; # Figure out whether to actually process this command:
3094                    ; line_number = 621
3095                    ;  if control & nop_mask = 0 start
3096                    ;info   621, 314
3097                    ; Left minus Right
3098 013a 3020          movlw   32
3099 013b 054b          andwf   delay__control,w
3100                    ; =>bit_code_emit@symbol(): sym=__z
3101                    ; 1TEST: Single test with code in skip slot
3102 013c 1903          btfsc   __z___byte, __z___bit
3103                    ; line_number = 622
3104                    ; do_it := _true
3105                    ;info   622, 317
3106 013d 166f          bsf     delay__do_it___byte, delay__do_it___bit
3107            
3108                    ; Recombine size1 = 0 || size2 = 0
3109                    ; line_number = 621
3110                    ;  if control & nop_mask = 0 done
3111                    ; # Process count:
3112                    ; line_number = 625
3113                    ;  count := control & count_mask
3114                    ;info   625, 318
3115 013e 300f          movlw   15
3116 013f 054b          andwf   delay__control,w
3117 0140 00cd          movwf   delay__count
3118                    ; line_number = 626
3119                    ;  control_queue[processed] := control & 0xf0 | (count - 1)
3120                    ;info   626, 321
3121                    ; index_fsr_first
3122 0141 083b          movf    processed,w
3123 0142 3e37          addlw   control_queue
3124 0143 0084          movwf   __fsr
3125 00000055 = delay__5 equ globals___0+53
3126 0144 30f0          movlw   240
3127 0145 054b          andwf   delay__control,w
3128 0146 00d5          movwf   delay__5
3129 0147 034d          decf    delay__count,w
3130 0148 0455          iorwf   delay__5,w
3131 0149 0080          movwf   __indf
3132                    ; line_number = 627
3133                    ;  if count = 0 start
3134                    ;info   627, 330
3135                    ; Left minus Right
3136 014a 084d          movf    delay__count,w
3137                    ; =>bit_code_emit@symbol(): sym=__z
3138                    ; 1TEST: Single test with code in skip slot
3139 014b 1903          btfsc   __z___byte, __z___bit
3140                    ; # Advance to next command:
3141                    ; line_number = 629
3142                    ;  processed := processed + 1
3143                    ;info   629, 332
3144 014c 0abb          incf    processed,f
3145                    ; Recombine size1 = 0 || size2 = 0
3146                    ; line_number = 627
3147                    ;  if count = 0 done
3148   014d :   delay__7:
3149                    ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
3150                    ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
3151                    ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
3152                    ; line_number = 615
3153                    ;  if processed < available done
3154                    ; line_number = 649
3155                    ; if do_it start
3156                    ;info   649, 333
3157                    ; =>bit_code_emit@symbol(): sym=delay__do_it
3158                    ; No 1TEST: true.size=28 false.size=0
3159                    ; No 2TEST: true.size=28 false.size=0
3160                    ; 1GOTO: Single test with GOTO
3161 014d 1e6f          btfss   delay__do_it___byte, delay__do_it___bit
3162 014e 296b          goto    delay__8
3163                    ; # Note that {data_write} = {rs_mask}:
3164            
3165                    ; # Send high nibble (RW=0):
3166                    ; #_portb := control & rs_mask | data >> 4
3167                    ; #_portb := data >> 4
3168                    ; #call db47_set(data >> 4)
3169                    ; line_number = 656
3170                    ;  _portb := data & 0xf0
3171                    ;info   656, 335
3172 014f 30f0          movlw   240
3173 0150 054c          andwf   delay__data,w
3174 0151 0086          movwf   _portb
3175                    ; line_number = 657
3176                    ;  rw := _false
3177                    ;info   657, 338
3178 0152 1186          bcf     rw___byte, rw___bit
3179                    ; line_number = 658
3180                    ;  rs := _false
3181                    ;info   658, 339
3182 0153 1006          bcf     rs___byte, rs___bit
3183                    ; line_number = 659
3184                    ;  if control & data_write != 0 start
3185                    ;info   659, 340
3186                    ; Left minus Right
3187 0154 3010          movlw   16
3188 0155 054b          andwf   delay__control,w
3189                    ; =>bit_code_emit@symbol(): sym=__z
3190                    ; 1TEST: Single test with code in skip slot
3191 0156 1d03          btfss   __z___byte, __z___bit
3192                    ; line_number = 660
3193                    ; rs := _true
3194                    ;info   660, 343
3195 0157 1406          bsf     rs___byte, rs___bit
3196                    ; Recombine size1 = 0 || size2 = 0
3197                    ; line_number = 659
3198                    ;  if control & data_write != 0 done
3199                    ; line_number = 661
3200                    ; rs := _true
3201                    ;info   661, 344
3202 0158 1406          bsf     rs___byte, rs___bit
3203                    ; line_number = 662
3204                    ;  e := _true
3205                    ;info   662, 345
3206 0159 1605          bsf     e___byte, e___bit
3207                    ; line_number = 663
3208                    ;  e := _false
3209                    ;info   663, 346
3210 015a 1205          bcf     e___byte, e___bit
3211            
3212                    ; # Send low nibble (RW=0):
3213                    ; #_portb := control & rs_mask | data & 0xf
3214                    ; line_number = 667
3215                    ;  _portb := control | (data & 0xf)
3216                    ;info   667, 347
3217 015b 300f          movlw   15
3218 015c 054c          andwf   delay__data,w
3219 015d 044b          iorwf   delay__control,w
3220 015e 0086          movwf   _portb
3221                    ; #call db47_set(data)
3222                    ; line_number = 669
3223                    ;  _portb := data << 4
3224                    ;info   669, 351
3225 015f 0e4c          swapf   delay__data,w
3226 0160 0086          movwf   _portb
3227 0161 30f0          movlw   240
3228 0162 0586          andwf   _portb,f
3229                    ; line_number = 670
3230                    ;  rw := _false
3231                    ;info   670, 355
3232 0163 1186          bcf     rw___byte, rw___bit
3233                    ; line_number = 671
3234                    ;  rs := _false
3235                    ;info   671, 356
3236 0164 1006          bcf     rs___byte, rs___bit
3237                    ; line_number = 672
3238                    ;  if control & data_write != 0 start
3239                    ;info   672, 357
3240                    ; Left minus Right
3241 0165 3010          movlw   16
3242 0166 054b          andwf   delay__control,w
3243                    ; =>bit_code_emit@symbol(): sym=__z
3244                    ; 1TEST: Single test with code in skip slot
3245 0167 1d03          btfss   __z___byte, __z___bit
3246                    ; line_number = 673
3247                    ; rs := _true
3248                    ;info   673, 360
3249 0168 1406          bsf     rs___byte, rs___bit
3250                    ; Recombine size1 = 0 || size2 = 0
3251                    ; line_number = 672
3252                    ;  if control & data_write != 0 done
3253                    ; line_number = 674
3254                    ; e := _true
3255                    ;info   674, 361
3256 0169 1605          bsf     e___byte, e___bit
3257                    ; line_number = 675
3258                    ;  e := _false
3259                    ;info   675, 362
3260 016a 1205          bcf     e___byte, e___bit
3261            
3262                    ; # The delay() procedure is 138uS which is much greater than
3263                    ; # 39uS - 43uS that commands take.  We do not have to do any
3264                    ; # further action for command delay.
3265            
3266                    ; Recombine size1 = 0 || size2 = 0
3267   016b :   delay__8:
3268                    ; line_number = 649
3269                    ; if do_it done
3270                    ; # We are all done:
3271            
3272            
3273                    ; delay after procedure statements=non-uniform
3274                    ; Implied return
3275 016b 3400          retlw   0
3276            
3277            
3278            
3279            
3280                    ; line_number = 684
3281                    ;info   684, 364
3282                    ; procedure nibble_send
3283   016c :   nibble_send:
3284                    ; Last argument is sitting in W; save into argument variable
3285 016c 00ce          movwf   nibble_send__nibble
3286                    ; delay=1
3287                    ; line_number = 685
3288                    ; argument rs_mode bit
3289 0000006f = nibble_send__rs_mode___byte equ globals___0+79
3290 00000005 = nibble_send__rs_mode___bit equ 5
3291                    ; line_number = 686
3292                    ; argument nibble byte
3293 0000004e = nibble_send__nibble equ globals___0+46
3294                    ; line_number = 687
3295                    ;  returns_nothing
3296                    ; line_number = 688
3297                    ;  exact_delay 13
3298            
3299                    ; # This procedure will send the low order 4 bits of {nibble}
3300                    ; # to the LCD controller with RS set to {rs_mode} and RW set
3301                    ; # to 0.
3302            
3303                    ; # Get {db4}, {db5}, {db6}, and {db7} set up:
3304                    ; before procedure statements delay=1, bit states=(data:00=uu=>00 code:XX=cc=>XX)
3305                    ; line_number = 695
3306                    ;  _portb := nibble << 4
3307                    ; Delay at assignment is 1
3308                    ;info   695, 365
3309 016d 0e4e          swapf   nibble_send__nibble,w
3310 016e 0086          movwf   _portb
3311 016f 30f0          movlw   240
3312 0170 0586          andwf   _portb,f
3313            
3314                    ; # Set up the control lines:
3315                    ; line_number = 698
3316                    ;  rw := _false
3317                    ; Delay at assignment is 5
3318                    ;info   698, 369
3319 0171 1186          bcf     rw___byte, rw___bit
3320                    ; line_number = 699
3321                    ;  rs := _false
3322                    ; Delay at assignment is 6
3323                    ;info   699, 370
3324 0172 1006          bcf     rs___byte, rs___bit
3325                    ; line_number = 700
3326                    ;  if rs_mode start
3327                    ; Delay at if is 7
3328                    ;info   700, 371
3329                    ; =>bit_code_emit@symbol(): sym=nibble_send__rs_mode
3330                    ; 1TEST: Single test with code in skip slot
3331 0173 1aef          btfsc   nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
3332                    ; line_number = 701
3333                    ; rs := _true
3334                    ; Delay at assignment is 0
3335                    ;info   701, 372
3336 0174 1406          bsf     rs___byte, rs___bit
3337            
3338                    ; if final true delay=1 false delay=0 code delay=9
3339                    ; line_number = 700
3340                    ;  if rs_mode done
3341                    ; # Toggle {e} to clock the data into the LCD controller.
3342                    ; line_number = 704
3343                    ;  e := _true
3344                    ; Delay at assignment is 9
3345                    ;info   704, 373
3346 0175 1605          bsf     e___byte, e___bit
3347                    ; line_number = 705
3348                    ;  e := _false
3349                    ; Delay at assignment is 10
3350                    ;info   705, 374
3351 0176 1205          bcf     e___byte, e___bit
3352            
3353            
3354                    ; delay after procedure statements=11
3355                    ; Delay 0 cycles
3356                    ; Implied return
3357 0177 3400          retlw   0
3358                    ; Final delay = 13
3359            
3360            
3361            
3362            
3363                    ; line_number = 708
3364                    ;info   708, 376
3365                    ; procedure wait
3366   0178 :   wait:
3367                    ; arguments_none
3368                    ; line_number = 710
3369                    ;  returns_nothing
3370            
3371                    ; # This procedure will do any background processing.
3372            
3373                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
3374                    ; line_number = 714
3375                    ;  do_nothing
3376                    ;info   714, 376
3377            
3378            
3379                    ; delay after procedure statements=non-uniform
3380                    ; Implied return
3381 0178 3400          retlw   0
3382            
3383            
3384            
3385            
3386                    ; line_number = 717
3387                    ; string id = "\16,0,32,1,3,7\LCD32-A\7\Gramson" start
3388                    ; id = '\16,0\ \1,3,7\LCD32-A\7\Gramson'
3389   0179 :   id:
3390                    ; Temporarily save index into FSR
3391 0179 0084          movwf   __fsr
3392                    ; Initialize PCLATH to point to this code page
3393 017a 3001          movlw   id___base>>8
3394 017b 008a          movwf   __pclath
3395                    ; Restore index from FSR
3396 017c 0804          movf    __fsr,w
3397 017d 3e7f          addlw   id___base
3398                    ; Index to the correct return value
3399 017e 0082          movwf   __pcl
3400                    ; page_group 21
3401   017f :   id___base:
3402 017f 3410          retlw   16
3403 0180 3400          retlw   0
3404 0181 3420          retlw   32
3405 0182 3401          retlw   1
3406 0183 3403          retlw   3
3407 0184 3407          retlw   7
3408 0185 344c          retlw   76
3409 0186 3443          retlw   67
3410 0187 3444          retlw   68
3411 0188 3433          retlw   51
3412 0189 3432          retlw   50
3413 018a 342d          retlw   45
3414 018b 3441          retlw   65
3415 018c 3407          retlw   7
3416 018d 3447          retlw   71
3417 018e 3472          retlw   114
3418 018f 3461          retlw   97
3419 0190 346d          retlw   109
3420 0191 3473          retlw   115
3421 0192 346f          retlw   111
3422 0193 346e          retlw   110
3423                    ; line_number = 717
3424                    ; string id = "\16,0,32,1,3,7\LCD32-A\7\Gramson" start
3425            
3426            
3427                    ; Appending 8 delayed procedures to code bank 0
3428                    ; buffer = 'rb2bus'
3429                    ; line_number = 57
3430                    ;info   57, 404
3431                    ; procedure rb2bus_select_wait
3432   0194 :   rb2bus_select_wait:
3433                    ; arguments_none
3434                    ; line_number = 59
3435                    ;  returns_nothing
3436            
3437                    ; # This procedure will in an infinite loop until the select
3438                    ; # address matches {rb2bus_address}.  {rb2bus_address} is
3439                    ; # typically set in the {rb2bus_initialize} procedure.
3440                    ; #
3441                    ; # This module will repeatably call the {wait} procedure until
3442                    ; # it is properly selected.
3443            
3444                    ; line_number = 68
3445                    ;  local value byte
3446 00000022 = rb2bus_select_wait__value equ globals___0+2
3447                    ; line_number = 69
3448                    ;  local address_bit bit
3449 0000006f = rb2bus_select_wait__address_bit___byte equ globals___0+79
3450 00000002 = rb2bus_select_wait__address_bit___bit equ 2
3451            
3452                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
3453                    ; line_number = 71
3454                    ;  rb2bus_error := _false
3455                    ;info   71, 404
3456 0194 10ef          bcf     rb2bus_error___byte, rb2bus_error___bit
3457                    ; line_number = 72
3458                    ;  while !rb2bus_selected start
3459   0195 :   rb2bus_select_wait__1:
3460                    ;info   72, 405
3461                    ; =>bit_code_emit@symbol(): sym=rb2bus_selected
3462                    ; No 1TEST: true.size=0 false.size=25
3463                    ; No 2TEST: true.size=0 false.size=25
3464                    ; 1GOTO: Single test with GOTO
3465 0195 186f          btfsc   rb2bus_selected___byte, rb2bus_selected___bit
3466 0196 29b0          goto    rb2bus_select_wait__6
3467                    ; line_number = 73
3468                    ; _adden := _true
3469                    ;info   73, 407
3470 0197 1598          bsf     _adden___byte, _adden___bit
3471                    ; # Wait for a byte to arrive.
3472                    ; line_number = 75
3473                    ;  while !_rcif start
3474   0198 :   rb2bus_select_wait__2:
3475                    ;info   75, 408
3476                    ; =>bit_code_emit@symbol(): sym=_rcif
3477                    ; No 1TEST: true.size=0 false.size=2
3478                    ; No 2TEST: true.size=0 false.size=2
3479                    ; 1GOTO: Single test with GOTO
3480 0198 1a8c          btfsc   _rcif___byte, _rcif___bit
3481 0199 299c          goto    rb2bus_select_wait__3
3482                    ; line_number = 76
3483                    ; call wait()
3484                    ;info   76, 410
3485 019a 2178          call    wait
3486            
3487 019b 2998          goto    rb2bus_select_wait__2
3488   019c :   rb2bus_select_wait__3:
3489                    ; Recombine size1 = 0 || size2 = 0
3490                    ; line_number = 75
3491                    ;  while !_rcif done
3492                    ; # Capture the received value:
3493                    ; line_number = 79
3494                    ;  address_bit := _false
3495                    ;info   79, 412
3496 019c 116f          bcf     rb2bus_select_wait__address_bit___byte, rb2bus_select_wait__address_bit___bit
3497                    ; line_number = 80
3498                    ;  if _rx9d start
3499                    ;info   80, 413
3500                    ; =>bit_code_emit@symbol(): sym=_rx9d
3501                    ; 1TEST: Single test with code in skip slot
3502 019d 1818          btfsc   _rx9d___byte, _rx9d___bit
3503                    ; line_number = 81
3504                    ; address_bit := _true
3505                    ;info   81, 414
3506 019e 156f          bsf     rb2bus_select_wait__address_bit___byte, rb2bus_select_wait__address_bit___bit
3507                    ; Recombine size1 = 0 || size2 = 0
3508                    ; line_number = 80
3509                    ;  if _rx9d done
3510                    ; line_number = 82
3511                    ; value := _rcreg
3512                    ;info   82, 415
3513 019f 081a          movf    _rcreg,w
3514 01a0 00a2          movwf   rb2bus_select_wait__value
3515            
3516                    ; # Clear any UART errors by toggling {_cren}:
3517                    ; line_number = 85
3518                    ;  if _oerr start
3519                    ;info   85, 417
3520                    ; =>bit_code_emit@symbol(): sym=_oerr
3521                    ; 1TEST: Single test with code in skip slot
3522 01a1 1898          btfsc   _oerr___byte, _oerr___bit
3523                    ; line_number = 86
3524                    ; _cren := _false
3525                    ;info   86, 418
3526 01a2 1218          bcf     _cren___byte, _cren___bit
3527                    ; Recombine size1 = 0 || size2 = 0
3528                    ; line_number = 85
3529                    ;  if _oerr done
3530                    ; line_number = 87
3531                    ; if _ferr start
3532                    ;info   87, 419
3533                    ; =>bit_code_emit@symbol(): sym=_ferr
3534                    ; 1TEST: Single test with code in skip slot
3535 01a3 1918          btfsc   _ferr___byte, _ferr___bit
3536                    ; line_number = 88
3537                    ; _cren := _false
3538                    ;info   88, 420
3539 01a4 1218          bcf     _cren___byte, _cren___bit
3540                    ; Recombine size1 = 0 || size2 = 0
3541                    ; line_number = 87
3542                    ; if _ferr done
3543                    ; line_number = 89
3544                    ; _cren := _true
3545                    ;info   89, 421
3546 01a5 1618          bsf     _cren___byte, _cren___bit
3547            
3548                    ; line_number = 91
3549                    ;  if address_bit start
3550                    ;info   91, 422
3551                    ; =>bit_code_emit@symbol(): sym=rb2bus_select_wait__address_bit
3552                    ; No 1TEST: true.size=7 false.size=0
3553                    ; No 2TEST: true.size=7 false.size=0
3554                    ; 1GOTO: Single test with GOTO
3555 01a6 1d6f          btfss   rb2bus_select_wait__address_bit___byte, rb2bus_select_wait__address_bit___bit
3556 01a7 29af          goto    rb2bus_select_wait__5
3557                    ; line_number = 92
3558                    ; if value = rb2bus_address start
3559                    ;info   92, 424
3560                    ; Left minus Right
3561 01a8 0820          movf    rb2bus_address,w
3562 01a9 0222          subwf   rb2bus_select_wait__value,w
3563                    ; =>bit_code_emit@symbol(): sym=__z
3564                    ; No 1TEST: true.size=3 false.size=0
3565                    ; No 2TEST: true.size=3 false.size=0
3566                    ; 1GOTO: Single test with GOTO
3567 01aa 1d03          btfss   __z___byte, __z___bit
3568 01ab 29af          goto    rb2bus_select_wait__4
3569                    ; line_number = 93
3570                    ; rb2bus_selected := _true
3571                    ;info   93, 428
3572 01ac 146f          bsf     rb2bus_selected___byte, rb2bus_selected___bit
3573                    ; line_number = 94
3574                    ;  call rb2bus_byte_put(rb2_ok)
3575                    ;info   94, 429
3576 01ad 30a5          movlw   165
3577 01ae 21d5          call    rb2bus_byte_put
3578            
3579            
3580                    ; Recombine size1 = 0 || size2 = 0
3581   01af :   rb2bus_select_wait__4:
3582                    ; line_number = 92
3583                    ; if value = rb2bus_address done
3584                    ; Recombine size1 = 0 || size2 = 0
3585   01af :   rb2bus_select_wait__5:
3586                    ; line_number = 91
3587                    ;  if address_bit done
3588 01af 2995          goto    rb2bus_select_wait__1
3589   01b0 :   rb2bus_select_wait__6:
3590                    ; Recombine size1 = 0 || size2 = 0
3591                    ; line_number = 72
3592                    ;  while !rb2bus_selected done
3593                    ; delay after procedure statements=non-uniform
3594                    ; Implied return
3595 01b0 3400          retlw   0
3596            
3597            
3598            
3599            
3600                    ; line_number = 97
3601                    ;info   97, 433
3602                    ; procedure rb2bus_deselect
3603   01b1 :   rb2bus_deselect:
3604                    ; arguments_none
3605                    ; line_number = 99
3606                    ;  returns_nothing
3607            
3608                    ; # This procedure forces this module into the deselected state until
3609                    ; # it is reselected by some master module on the bus.
3610            
3611                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
3612                    ; line_number = 104
3613                    ;  rb2bus_selected := _false
3614                    ;info   104, 433
3615 01b1 106f          bcf     rb2bus_selected___byte, rb2bus_selected___bit
3616            
3617            
3618                    ; delay after procedure statements=non-uniform
3619                    ; Implied return
3620 01b2 3400          retlw   0
3621            
3622            
3623            
3624            
3625                    ; line_number = 107
3626                    ;info   107, 435
3627                    ; procedure rb2bus_byte_get
3628   01b3 :   rb2bus_byte_get:
3629                    ; arguments_none
3630                    ; line_number = 109
3631                    ;  returns byte
3632            
3633                    ; # This procedure will return the next byte received from the bus.
3634                    ; # The address (9th) bit is stored in the global {is_address}.
3635                    ; #
3636                    ; # If {rb2bus_error} is set, 0 is returned.  Otherwise, the {wait}
3637                    ; # procedure is repeatably called until a command byte is successfully
3638                    ; # received.  If an module select byte comes in, we enter a bus
3639                    ; # error condition by setting {rb2bus_error} and returning 0.
3640            
3641                    ; line_number = 119
3642                    ;  local value byte
3643 00000023 = rb2bus_byte_get__value equ globals___0+3
3644                    ; line_number = 120
3645                    ;  local address_bit bit
3646 0000006f = rb2bus_byte_get__address_bit___byte equ globals___0+79
3647 00000003 = rb2bus_byte_get__address_bit___bit equ 3
3648            
3649                    ; # Return 0 in a bus flush condition to get us back to {rb2bus_select_wait}:
3650                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
3651                    ; line_number = 123
3652                    ;  if rb2bus_error start
3653                    ;info   123, 435
3654                    ; =>bit_code_emit@symbol(): sym=rb2bus_error
3655                    ; 1TEST: Single test with code in skip slot
3656 01b3 18ef          btfsc   rb2bus_error___byte, rb2bus_error___bit
3657                    ; line_number = 124
3658                    ; return 0 start
3659                    ; line_number = 124
3660                    ;info   124, 436
3661 01b4 3400          retlw   0
3662                    ; line_number = 124
3663                    ; return 0 done
3664            
3665                    ; Recombine size1 = 0 || size2 = 0
3666                    ; line_number = 123
3667                    ;  if rb2bus_error done
3668                    ; # Wait for a byte to arrive.
3669                    ; line_number = 127
3670                    ;  _adden := _false
3671                    ;info   127, 437
3672 01b5 1198          bcf     _adden___byte, _adden___bit
3673                    ; line_number = 128
3674                    ;  while !_rcif start
3675   01b6 :   rb2bus_byte_get__1:
3676                    ;info   128, 438
3677                    ; =>bit_code_emit@symbol(): sym=_rcif
3678                    ; No 1TEST: true.size=0 false.size=2
3679                    ; No 2TEST: true.size=0 false.size=2
3680                    ; 1GOTO: Single test with GOTO
3681 01b6 1a8c          btfsc   _rcif___byte, _rcif___bit
3682 01b7 29ba          goto    rb2bus_byte_get__2
3683                    ; line_number = 129
3684                    ; call wait()
3685                    ;info   129, 440
3686 01b8 2178          call    wait
3687            
3688 01b9 29b6          goto    rb2bus_byte_get__1
3689   01ba :   rb2bus_byte_get__2:
3690                    ; Recombine size1 = 0 || size2 = 0
3691                    ; line_number = 128
3692                    ;  while !_rcif done
3693                    ; # Record the 9th bit in {address_bit}:
3694                    ; line_number = 132
3695                    ;  address_bit := _false
3696                    ;info   132, 442
3697 01ba 11ef          bcf     rb2bus_byte_get__address_bit___byte, rb2bus_byte_get__address_bit___bit
3698                    ; line_number = 133
3699                    ;  if _rx9d start
3700                    ;info   133, 443
3701                    ; =>bit_code_emit@symbol(): sym=_rx9d
3702                    ; 1TEST: Single test with code in skip slot
3703 01bb 1818          btfsc   _rx9d___byte, _rx9d___bit
3704                    ; line_number = 134
3705                    ; address_bit := _true
3706                    ;info   134, 444
3707 01bc 15ef          bsf     rb2bus_byte_get__address_bit___byte, rb2bus_byte_get__address_bit___bit
3708                    ; Recombine size1 = 0 || size2 = 0
3709                    ; line_number = 133
3710                    ;  if _rx9d done
3711                    ; line_number = 135
3712                    ; value := _rcreg
3713                    ;info   135, 445
3714 01bd 081a          movf    _rcreg,w
3715 01be 00a3          movwf   rb2bus_byte_get__value
3716            
3717                    ; # Clear any errors by toggling _{cren}:
3718                    ; # FIXME: All of this should be done *before* reading {_rcreg}!!!
3719                    ; line_number = 139
3720                    ;  if _oerr start
3721                    ;info   139, 447
3722                    ; =>bit_code_emit@symbol(): sym=_oerr
3723                    ; 1TEST: Single test with code in skip slot
3724 01bf 1898          btfsc   _oerr___byte, _oerr___bit
3725                    ; line_number = 140
3726                    ; _cren := _false
3727                    ;info   140, 448
3728 01c0 1218          bcf     _cren___byte, _cren___bit
3729                    ; Recombine size1 = 0 || size2 = 0
3730                    ; line_number = 139
3731                    ;  if _oerr done
3732                    ; line_number = 141
3733                    ; if _ferr start
3734                    ;info   141, 449
3735                    ; =>bit_code_emit@symbol(): sym=_ferr
3736                    ; 1TEST: Single test with code in skip slot
3737 01c1 1918          btfsc   _ferr___byte, _ferr___bit
3738                    ; line_number = 142
3739                    ; _cren := _false
3740                    ;info   142, 450
3741 01c2 1218          bcf     _cren___byte, _cren___bit
3742                    ; Recombine size1 = 0 || size2 = 0
3743                    ; line_number = 141
3744                    ; if _ferr done
3745                    ; line_number = 143
3746                    ; _cren := _true
3747                    ;info   143, 451
3748 01c3 1618          bsf     _cren___byte, _cren___bit
3749            
3750                    ; line_number = 145
3751                    ;  if address_bit start
3752                    ;info   145, 452
3753                    ; =>bit_code_emit@symbol(): sym=rb2bus_byte_get__address_bit
3754                    ; No 1TEST: true.size=13 false.size=0
3755                    ; No 2TEST: true.size=13 false.size=0
3756                    ; 1GOTO: Single test with GOTO
3757 01c4 1def          btfss   rb2bus_byte_get__address_bit___byte, rb2bus_byte_get__address_bit___bit
3758 01c5 29d3          goto    rb2bus_byte_get__5
3759                    ; # We have an unexpected address select coming in:
3760                    ; line_number = 147
3761                    ;  if value = rb2bus_address start
3762                    ;info   147, 454
3763                    ; Left minus Right
3764 01c6 0820          movf    rb2bus_address,w
3765 01c7 0223          subwf   rb2bus_byte_get__value,w
3766                    ; =>bit_code_emit@symbol(): sym=__z
3767                    ; No 1TEST: true.size=4 false.size=2
3768                    ; No 2TEST: true.size=4 false.size=2
3769                    ; 2GOTO: Single test with two GOTO's
3770 01c8 1d03          btfss   __z___byte, __z___bit
3771 01c9 29cf          goto    rb2bus_byte_get__3
3772                    ; # We are being selected again:
3773                    ; line_number = 149
3774                    ;  rb2bus_selected := _true
3775                    ;info   149, 458
3776 01ca 146f          bsf     rb2bus_selected___byte, rb2bus_selected___bit
3777                    ; line_number = 150
3778                    ;  _adden := _false
3779                    ;info   150, 459
3780 01cb 1198          bcf     _adden___byte, _adden___bit
3781            
3782                    ; line_number = 152
3783                    ;  call rb2bus_byte_put(rb2_ok)
3784                    ;info   152, 460
3785 01cc 30a5          movlw   165
3786 01cd 21d5          call    rb2bus_byte_put
3787 01ce 29d1          goto    rb2bus_byte_get__4
3788                    ; 2GOTO: Starting code 2
3789   01cf :   rb2bus_byte_get__3:
3790                    ; # Somebody else is being selected; we deselect:
3791                    ; line_number = 155
3792                    ;  rb2bus_selected := _false
3793                    ;info   155, 463
3794 01cf 106f          bcf     rb2bus_selected___byte, rb2bus_selected___bit
3795                    ; line_number = 156
3796                    ;  _adden := _true
3797                    ;info   156, 464
3798 01d0 1598          bsf     _adden___byte, _adden___bit
3799            
3800   01d1 :   rb2bus_byte_get__4:
3801                    ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
3802                    ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
3803                    ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
3804                    ; line_number = 147
3805                    ;  if value = rb2bus_address done
3806                    ; # We want to get back to the beginning of decode:
3807                    ; line_number = 159
3808                    ;  rb2bus_error := _true
3809                    ;info   159, 465
3810 01d1 14ef          bsf     rb2bus_error___byte, rb2bus_error___bit
3811                    ; line_number = 160
3812                    ;  value := 0
3813                    ;info   160, 466
3814 01d2 01a3          clrf    rb2bus_byte_get__value
3815            
3816                    ; Recombine size1 = 0 || size2 = 0
3817   01d3 :   rb2bus_byte_get__5:
3818                    ; line_number = 145
3819                    ;  if address_bit done
3820                    ; # Regular data byte:
3821                    ; line_number = 163
3822                    ;  return value start
3823                    ; line_number = 163
3824                    ;info   163, 467
3825 01d3 0823          movf    rb2bus_byte_get__value,w
3826 01d4 0008          return  
3827                    ; line_number = 163
3828                    ;  return value done
3829            
3830            
3831                    ; delay after procedure statements=non-uniform
3832            
3833            
3834            
3835            
3836                    ; line_number = 166
3837                    ;info   166, 469
3838                    ; procedure rb2bus_byte_put
3839   01d5 :   rb2bus_byte_put:
3840                    ; Last argument is sitting in W; save into argument variable
3841 01d5 00a4          movwf   rb2bus_byte_put__value
3842                    ; delay=4294967295
3843                    ; line_number = 167
3844                    ; argument value byte
3845 00000024 = rb2bus_byte_put__value equ globals___0+4
3846                    ; line_number = 168
3847                    ;  returns_nothing
3848            
3849                    ; # This procedure will send {value} to the bus.  It automatically
3850                    ; # consumes the echo that is on the bus.  If {rb2bus_error} is
3851                    ; # set, this procedure does nothing.
3852            
3853                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
3854                    ; line_number = 174
3855                    ;  if !rb2bus_error start
3856                    ;info   174, 470
3857                    ; =>bit_code_emit@symbol(): sym=rb2bus_error
3858                    ; No 1TEST: true.size=0 false.size=18
3859                    ; No 2TEST: true.size=0 false.size=18
3860                    ; 1GOTO: Single test with GOTO
3861 01d6 18ef          btfsc   rb2bus_error___byte, rb2bus_error___bit
3862 01d7 29ea          goto    rb2bus_byte_put__4
3863                    ; # Wait until {_txreg} is ready for a value:
3864                    ; line_number = 176
3865                    ;  while !_txif start
3866   01d8 :   rb2bus_byte_put__1:
3867                    ;info   176, 472
3868                    ; =>bit_code_emit@symbol(): sym=_txif
3869                    ; No 1TEST: true.size=0 false.size=2
3870                    ; No 2TEST: true.size=0 false.size=2
3871                    ; 1GOTO: Single test with GOTO
3872 01d8 1a0c          btfsc   _txif___byte, _txif___bit
3873 01d9 29dc          goto    rb2bus_byte_put__2
3874                    ; line_number = 177
3875                    ; call wait()
3876                    ;info   177, 474
3877 01da 2178          call    wait
3878            
3879 01db 29d8          goto    rb2bus_byte_put__1
3880   01dc :   rb2bus_byte_put__2:
3881                    ; Recombine size1 = 0 || size2 = 0
3882                    ; line_number = 176
3883                    ;  while !_txif done
3884                    ; # Ship {value} out to the bus with 9th bit turned off:
3885                    ; line_number = 180
3886                    ;  _adden := _false
3887                    ;info   180, 476
3888 01dc 1198          bcf     _adden___byte, _adden___bit
3889                    ; line_number = 181
3890                    ;  _tx9d := _false
3891                    ;info   181, 477
3892 01dd 1683          bsf     __rp0___byte, __rp0___bit
3893 01de 1018          bcf     _tx9d___byte, _tx9d___bit
3894                    ; line_number = 182
3895                    ;  _txreg := value
3896                    ;info   182, 479
3897 01df 1283          bcf     __rp0___byte, __rp0___bit
3898 01e0 0824          movf    rb2bus_byte_put__value,w
3899 01e1 0099          movwf   _txreg
3900            
3901                    ; # Wait for the echo to show up:
3902                    ; line_number = 185
3903                    ;  while !_rcif start
3904   01e2 :   rb2bus_byte_put__3:
3905                    ;info   185, 482
3906                    ; =>bit_code_emit@symbol(): sym=_rcif
3907                    ; 1TEST: Single test with code in skip slot
3908 01e2 1e8c          btfss   _rcif___byte, _rcif___bit
3909                    ; # Still waiting:
3910 01e3 29e2          goto    rb2bus_byte_put__3
3911                    ; Recombine size1 = 0 || size2 = 0
3912                    ; line_number = 185
3913                    ;  while !_rcif done
3914                    ; # Throw the received byte away (store into {_w}).
3915                    ; line_number = 188
3916                    ;  assemble
3917                    ;info   188, 484
3918                    ; line_number = 189
3919                    ;info   189, 484
3920 01e4 081a          movf    _rcreg,w
3921            
3922                    ; # Recover from any receive errors by toggling {_cren}:
3923                    ; line_number = 192
3924                    ;  if _oerr start
3925                    ;info   192, 485
3926                    ; =>bit_code_emit@symbol(): sym=_oerr
3927                    ; 1TEST: Single test with code in skip slot
3928 01e5 1898          btfsc   _oerr___byte, _oerr___bit
3929                    ; line_number = 193
3930                    ; _cren := _false
3931                    ;info   193, 486
3932 01e6 1218          bcf     _cren___byte, _cren___bit
3933                    ; Recombine size1 = 0 || size2 = 0
3934                    ; line_number = 192
3935                    ;  if _oerr done
3936                    ; line_number = 194
3937                    ; if _ferr start
3938                    ;info   194, 487
3939                    ; =>bit_code_emit@symbol(): sym=_ferr
3940                    ; 1TEST: Single test with code in skip slot
3941 01e7 1918          btfsc   _ferr___byte, _ferr___bit
3942                    ; line_number = 195
3943                    ; _cren := _false
3944                    ;info   195, 488
3945 01e8 1218          bcf     _cren___byte, _cren___bit
3946                    ; Recombine size1 = 0 || size2 = 0
3947                    ; line_number = 194
3948                    ; if _ferr done
3949                    ; line_number = 196
3950                    ; _cren := _true
3951                    ;info   196, 489
3952 01e9 1618          bsf     _cren___byte, _cren___bit
3953            
3954            
3955   01ea :   rb2bus_byte_put__4:
3956                    ; Recombine size1 = 0 || size2 = 0
3957                    ; line_number = 174
3958                    ;  if !rb2bus_error done
3959                    ; delay after procedure statements=non-uniform
3960                    ; Implied return
3961 01ea 3400          retlw   0
3962            
3963            
3964            
3965            
3966                    ; line_number = 199
3967                    ;info   199, 491
3968                    ; procedure rb2bus_command
3969   01eb :   rb2bus_command:
3970                    ; Last argument is sitting in W; save into argument variable
3971 01eb 00a7          movwf   rb2bus_command__command
3972                    ; delay=4294967295
3973                    ; line_number = 200
3974                    ; argument command byte
3975 00000027 = rb2bus_command__command equ globals___0+7
3976                    ; line_number = 201
3977                    ;  returns_nothing
3978            
3979                    ; # This procedure will process an shared {command}.  This procedure
3980                    ; # accesses the global string {id}.
3981            
3982                    ; line_number = 206
3983                    ;  local new_address byte
3984 00000025 = rb2bus_command__new_address equ globals___0+5
3985                    ; line_number = 207
3986                    ;  local temp byte
3987 00000026 = rb2bus_command__temp equ globals___0+6
3988            
3989                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
3990                    ; line_number = 209
3991                    ;  switch command & 7 start
3992                    ;info   209, 492
3993                    ; switch_before:(data:00=uu=>00 code:XX=cc=>XX) size=1
3994 01ec 3001          movlw   rb2bus_command__13>>8
3995 01ed 008a          movwf   __pclath
3996 01ee 3007          movlw   7
3997 01ef 0527          andwf   rb2bus_command__command,w
3998                    ; switch after expression:(data:00=uu=>00 code:XX=cc=>XX)
3999 01f0 3ef2          addlw   rb2bus_command__13
4000 01f1 0082          movwf   __pcl
4001                    ; page_group 8
4002   01f2 :   rb2bus_command__13:
4003 01f2 2a32          goto    rb2bus_command__14
4004 01f3 2a32          goto    rb2bus_command__14
4005 01f4 2a32          goto    rb2bus_command__14
4006 01f5 2a32          goto    rb2bus_command__14
4007 01f6 29fa          goto    rb2bus_command__9
4008 01f7 2a26          goto    rb2bus_command__10
4009 01f8 2a2f          goto    rb2bus_command__11
4010 01f9 2a31          goto    rb2bus_command__12
4011                    ; line_number = 210
4012                    ; case 4
4013   01fa :   rb2bus_command__9:
4014                    ; # 1111 1100 (Address_Set):
4015                    ; # Return old address:
4016                    ; line_number = 213
4017                    ;  call rb2bus_byte_put(rb2bus_address)
4018                    ;info   213, 506
4019 01fa 0820          movf    rb2bus_address,w
4020 01fb 21d5          call    rb2bus_byte_put
4021            
4022                    ; # Fetch new address:
4023                    ; line_number = 216
4024                    ;  new_address := rb2bus_byte_get()
4025                    ;info   216, 508
4026 01fc 21b3          call    rb2bus_byte_get
4027 01fd 00a5          movwf   rb2bus_command__new_address
4028                    ; line_number = 217
4029                    ;  if new_address = 0 || new_address = rb2bus_address start
4030                    ;info   217, 510
4031                    ; Left minus Right
4032 01fe 0825          movf    rb2bus_command__new_address,w
4033                    ; =>bit_code_emit@symbol(): sym=__z
4034                    ; No 1TEST: true.size=1 false.size=36
4035                    ; No 2TEST: true.size=1 false.size=36
4036                    ; 2GOTO: Single test with two GOTO's
4037 01ff 1903          btfsc   __z___byte, __z___bit
4038 0200 2a05          goto    rb2bus_command__5
4039                    ; Recombine code1_bit_states != code2_bit_states
4040                    ; &&||: index=1 true_delay=4294967295 false_delay=4294967295 goto_delay=4294967295
4041                    ; Left minus Right
4042 0201 0820          movf    rb2bus_address,w
4043 0202 0225          subwf   rb2bus_command__new_address,w
4044                    ; =>bit_code_emit@symbol(): sym=__z
4045                    ; No 1TEST: true.size=4 false.size=27
4046                    ; No 2TEST: true.size=4 false.size=27
4047                    ; 2GOTO: Single test with two GOTO's
4048 0203 1d03          btfss   __z___byte, __z___bit
4049 0204 2a0a          goto    rb2bus_command__6
4050   0205 :   rb2bus_command__5:
4051                    ; line_number = 218
4052                    ; call rb2bus_byte_put(0)
4053                    ;info   218, 517
4054 0205 3000          movlw   0
4055 0206 21d5          call    rb2bus_byte_put
4056                    ; line_number = 219
4057                    ;  rb2bus_error := _true
4058                    ;info   219, 519
4059 0207 14ef          bsf     rb2bus_error___byte, rb2bus_error___bit
4060                    ; line_number = 220
4061                    ;  rb2bus_selected := _false
4062                    ;info   220, 520
4063 0208 106f          bcf     rb2bus_selected___byte, rb2bus_selected___bit
4064 0209 2a25          goto    rb2bus_command__7
4065                    ; 2GOTO: Starting code 2
4066   020a :   rb2bus_command__6:
4067                    ; # Return new address:
4068                    ; line_number = 223
4069                    ;  call rb2bus_byte_put(new_address)
4070                    ;info   223, 522
4071 020a 0825          movf    rb2bus_command__new_address,w
4072 020b 21d5          call    rb2bus_byte_put
4073            
4074                    ; # Fetch new address again as a check:
4075                    ; line_number = 226
4076                    ;  temp := rb2bus_byte_get()
4077                    ;info   226, 524
4078 020c 21b3          call    rb2bus_byte_get
4079 020d 00a6          movwf   rb2bus_command__temp
4080                    ; line_number = 227
4081                    ;  if temp != new_address start
4082                    ;info   227, 526
4083                    ; Left minus Right
4084 020e 0825          movf    rb2bus_command__new_address,w
4085 020f 0226          subwf   rb2bus_command__temp,w
4086                    ; =>bit_code_emit@symbol(): sym=__z
4087                    ; No 1TEST: true.size=14 false.size=4
4088                    ; No 2TEST: true.size=14 false.size=4
4089                    ; 2GOTO: Single test with two GOTO's
4090 0210 1d03          btfss   __z___byte, __z___bit
4091 0211 2a21          goto    rb2bus_command__3
4092                    ; line_number = 232
4093                    ; call rb2bus_eedata_write(new_address)
4094                    ;info   232, 530
4095 0212 0825          movf    rb2bus_command__new_address,w
4096 0213 224c          call    rb2bus_eedata_write
4097                    ; line_number = 233
4098                    ;  temp := rb2bus_eedata_read()
4099                    ;info   233, 532
4100 0214 224b          call    rb2bus_eedata_read
4101 0215 00a6          movwf   rb2bus_command__temp
4102                    ; line_number = 234
4103                    ;  if temp = new_address start
4104                    ;info   234, 534
4105                    ; Left minus Right
4106 0216 0825          movf    rb2bus_command__new_address,w
4107 0217 0226          subwf   rb2bus_command__temp,w
4108                    ; =>bit_code_emit@symbol(): sym=__z
4109                    ; No 1TEST: true.size=3 false.size=1
4110                    ; No 2TEST: true.size=3 false.size=1
4111                    ; 2GOTO: Single test with two GOTO's
4112 0218 1d03          btfss   __z___byte, __z___bit
4113 0219 2a1e          goto    rb2bus_command__1
4114                    ; line_number = 235
4115                    ; rb2bus_address := new_address
4116                    ;info   235, 538
4117 021a 0825          movf    rb2bus_command__new_address,w
4118 021b 00a0          movwf   rb2bus_address
4119                    ; line_number = 236
4120                    ;  call rb2bus_byte_put(rb2_ok)
4121                    ;info   236, 540
4122 021c 30a5          movlw   165
4123 021d 2a1f          goto    rb2bus_command__2
4124                    ; 2GOTO: Starting code 2
4125   021e :   rb2bus_command__1:
4126                    ; line_number = 238
4127                    ; call rb2bus_byte_put(0)
4128                    ;info   238, 542
4129 021e 3000          movlw   0
4130   021f :   rb2bus_command__2:
4131                    ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
4132                    ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
4133                    ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
4134 021f 21d5          call    rb2bus_byte_put
4135                    ; line_number = 234
4136                    ;  if temp = new_address done
4137 0220 2a25          goto    rb2bus_command__4
4138                    ; 2GOTO: Starting code 2
4139   0221 :   rb2bus_command__3:
4140                    ; line_number = 228
4141                    ; call rb2bus_byte_put(0)
4142                    ;info   228, 545
4143 0221 3000          movlw   0
4144 0222 21d5          call    rb2bus_byte_put
4145                    ; line_number = 229
4146                    ;  rb2bus_error := _true
4147                    ;info   229, 547
4148 0223 14ef          bsf     rb2bus_error___byte, rb2bus_error___bit
4149                    ; line_number = 230
4150                    ;  rb2bus_selected := _false
4151                    ;info   230, 548
4152 0224 106f          bcf     rb2bus_selected___byte, rb2bus_selected___bit
4153   0225 :   rb2bus_command__4:
4154                    ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
4155                    ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
4156                    ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
4157                    ; line_number = 227
4158                    ;  if temp != new_address done
4159   0225 :   rb2bus_command__7:
4160                    ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
4161                    ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
4162                    ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
4163                    ; &&||: index=0 true_delay=4294967295 false_delay=4294967295 goto_delay=4294967295
4164                    ; &&||:: index=0 new_delay=4294967295 goto_delay=4294967295
4165                    ; 2GOTO: No goto needed; true=rb2bus_command__5 false= true_size=1 false_size=36
4166                    ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
4167                    ; 2GOTO: code2 final bitstates:(data:XX=cc=>XX code:XX=cc=>XX)
4168                    ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
4169                    ; line_number = 217
4170                    ;  if new_address = 0 || new_address = rb2bus_address done
4171 0225 2a32          goto    rb2bus_command__14
4172                    ; line_number = 239
4173                    ; case 5
4174   0226 :   rb2bus_command__10:
4175                    ; # 1111 1101 (Id_next):
4176                    ; line_number = 241
4177                    ;  if rb2bus_index < id.size start
4178                    ;info   241, 550
4179 0226 3015          movlw   21
4180 0227 0221          subwf   rb2bus_index,w
4181                    ; =>bit_code_emit@symbol(): sym=__c
4182                    ; No 1TEST: true.size=0 false.size=4
4183                    ; No 2TEST: true.size=0 false.size=4
4184                    ; 1GOTO: Single test with GOTO
4185 0228 1803          btfsc   __c___byte, __c___bit
4186 0229 2a2e          goto    rb2bus_command__8
4187                    ; line_number = 242
4188                    ; call rb2bus_byte_put(id[rb2bus_index])
4189                    ;info   242, 554
4190 022a 0821          movf    rb2bus_index,w
4191 022b 2179          call    id
4192 022c 21d5          call    rb2bus_byte_put
4193                    ; line_number = 243
4194                    ;  rb2bus_index := rb2bus_index + 1
4195                    ;info   243, 557
4196 022d 0aa1          incf    rb2bus_index,f
4197                    ; #if rb2bus_index >= id.size
4198                    ; #	rb2bus_index := rb2bus_index - 1
4199   022e :   rb2bus_command__8:
4200                    ; Recombine size1 = 0 || size2 = 0
4201                    ; line_number = 241
4202                    ;  if rb2bus_index < id.size done
4203 022e 2a32          goto    rb2bus_command__14
4204                    ; line_number = 246
4205                    ; case 6
4206   022f :   rb2bus_command__11:
4207                    ; # 1111 1110 (Id_start):
4208                    ; line_number = 248
4209                    ;  rb2bus_index := 0
4210                    ;info   248, 559
4211 022f 01a1          clrf    rb2bus_index
4212 0230 2a32          goto    rb2bus_command__14
4213                    ; line_number = 249
4214                    ; case 7
4215   0231 :   rb2bus_command__12:
4216                    ; # 1111 1111 (Deselect):
4217                    ; line_number = 251
4218                    ;  call rb2bus_deselect()
4219                    ;info   251, 561
4220 0231 21b1          call    rb2bus_deselect
4221            
4222            
4223   0232 :   rb2bus_command__14:
4224                    ; line_number = 209
4225                    ;  switch command & 7 done
4226                    ; delay after procedure statements=non-uniform
4227                    ; Implied return
4228 0232 3400          retlw   0
4229            
4230            
4231            
4232            
4233                    ; buffer = 'rb2bus_pic16f628'
4234                    ; line_number = 26
4235                    ;info   26, 563
4236                    ; procedure rb2bus_initialize
4237   0233 :   rb2bus_initialize:
4238                    ; Last argument is sitting in W; save into argument variable
4239 0233 00a8          movwf   rb2bus_initialize__address
4240                    ; delay=4294967295
4241                    ; line_number = 27
4242                    ; argument address byte
4243 00000028 = rb2bus_initialize__address equ globals___0+8
4244                    ; line_number = 28
4245                    ;  returns_nothing
4246            
4247                    ; # This procedure is responsibile for initializing the UART
4248                    ; # connected to the bus.  {address} is the address of this
4249                    ; # slave module.  This code is specific to the PIC16F688.
4250            
4251                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
4252                    ; line_number = 34
4253                    ;  rb2bus_address := address
4254                    ;info   34, 564
4255 0234 0828          movf    rb2bus_initialize__address,w
4256 0235 00a0          movwf   rb2bus_address
4257            
4258                    ; # Warm up the UART:
4259                    ; line_number = 37
4260                    ;  _trisb@1 := _true
4261                    ;info   37, 566
4262 00000086 = rb2bus_initialize__select__1___byte equ _trisb
4263 00000001 = rb2bus_initialize__select__1___bit equ 1
4264 0236 1683          bsf     __rp0___byte, __rp0___bit
4265 0237 1486          bsf     rb2bus_initialize__select__1___byte, rb2bus_initialize__select__1___bit
4266                    ; line_number = 38
4267                    ;  _trisb@2 := _true
4268                    ;info   38, 568
4269 00000086 = rb2bus_initialize__select__2___byte equ _trisb
4270 00000002 = rb2bus_initialize__select__2___bit equ 2
4271 0238 1506          bsf     rb2bus_initialize__select__2___byte, rb2bus_initialize__select__2___bit
4272            
4273                    ; # Initialize the {_txsta} register:
4274                    ; line_number = 41
4275                    ;  _txsta := 0
4276                    ;info   41, 569
4277 0239 0198          clrf    _txsta
4278                    ; line_number = 42
4279                    ;  _tx9 := _true
4280                    ;info   42, 570
4281 023a 1718          bsf     _tx9___byte, _tx9___bit
4282                    ; line_number = 43
4283                    ;  _txen := _true
4284                    ;info   43, 571
4285 023b 1698          bsf     _txen___byte, _txen___bit
4286                    ; line_number = 44
4287                    ;  _brgh := _true
4288                    ;info   44, 572
4289 023c 1518          bsf     _brgh___byte, _brgh___bit
4290            
4291                    ; # Initialize the {_rcsta} register:
4292                    ; line_number = 47
4293                    ;  _rcsta := 0
4294                    ;info   47, 573
4295 023d 1283          bcf     __rp0___byte, __rp0___bit
4296 023e 0198          clrf    _rcsta
4297                    ; line_number = 48
4298                    ;  _spen := _true
4299                    ;info   48, 575
4300 023f 1798          bsf     _spen___byte, _spen___bit
4301                    ; line_number = 49
4302                    ;  _rx9 := _true
4303                    ;info   49, 576
4304 0240 1718          bsf     _rx9___byte, _rx9___bit
4305                    ; line_number = 50
4306                    ;  _cren := _true
4307                    ;info   50, 577
4308 0241 1618          bsf     _cren___byte, _cren___bit
4309                    ; #_adden := _true
4310                    ; line_number = 52
4311                    ;  _adden := _false
4312                    ;info   52, 578
4313 0242 1198          bcf     _adden___byte, _adden___bit
4314            
4315                    ; # Set up the baud rate generator:
4316                    ; line_number = 55
4317                    ;  _spbrg := spbrg_500k
4318                    ;info   55, 579
4319 0243 3001          movlw   1
4320 0244 1683          bsf     __rp0___byte, __rp0___bit
4321 0245 0099          movwf   _spbrg
4322            
4323                    ; line_number = 57
4324                    ;  rb2bus_selected := _false
4325                    ;info   57, 582
4326 0246 1283          bcf     __rp0___byte, __rp0___bit
4327 0247 106f          bcf     rb2bus_selected___byte, rb2bus_selected___bit
4328                    ; line_number = 58
4329                    ;  rb2bus_error := _false
4330                    ;info   58, 584
4331 0248 10ef          bcf     rb2bus_error___byte, rb2bus_error___bit
4332                    ; line_number = 59
4333                    ;  rb2bus_index := 0
4334                    ;info   59, 585
4335 0249 01a1          clrf    rb2bus_index
4336            
4337                    ; delay after procedure statements=non-uniform
4338                    ; Implied return
4339 024a 3400          retlw   0
4340            
4341            
4342            
4343            
4344                    ; line_number = 61
4345                    ;info   61, 587
4346                    ; procedure rb2bus_eedata_read
4347   024b :   rb2bus_eedata_read:
4348                    ; arguments_none
4349                    ; line_number = 63
4350                    ;  returns byte
4351            
4352                    ; # This procedure will return the address stored in EEData.  If
4353                    ; # there is no data, 0 is returned.
4354            
4355                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
4356                    ; line_number = 68
4357                    ;  return 0 start
4358                    ; line_number = 68
4359                    ;info   68, 587
4360 024b 3400          retlw   0
4361                    ; line_number = 68
4362                    ;  return 0 done
4363            
4364            
4365                    ; delay after procedure statements=non-uniform
4366            
4367            
4368            
4369            
4370                    ; line_number = 71
4371                    ;info   71, 588
4372                    ; procedure rb2bus_eedata_write
4373   024c :   rb2bus_eedata_write:
4374                    ; Last argument is sitting in W; save into argument variable
4375 024c 00a9          movwf   rb2bus_eedata_write__address
4376                    ; delay=4294967295
4377                    ; line_number = 72
4378                    ; argument address byte
4379 00000029 = rb2bus_eedata_write__address equ globals___0+9
4380                    ; line_number = 73
4381                    ;  returns_nothing
4382            
4383                    ; # This procedure will write {address} into the EEData.  The
4384                    ; # microcontroll pauses while the EEData is written.
4385            
4386                    ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
4387                    ; line_number = 78
4388                    ;  do_nothing
4389                    ;info   78, 589
4390            
4391            
4392            
4393            
4394                    ; delay after procedure statements=non-uniform
4395                    ; Implied return
4396 024d 3400          retlw   0
4397            
4398            
4399            
4400            
4401                    ; Configuration bits
4402                    ; address = 0x2007, fill = 0x200
4403                    ; cp = off (0x3c00)
4404                    ; cpd = off (0x100)
4405                    ; lvp = off (0x0)
4406                    ; boden = off (0x0)
4407                    ; mclre = off (0x0)
4408                    ; pwrte = off (0x8)
4409                    ; wdte = off (0x0)
4410                    ; fosc = hs (0x2)
4411                    ; 16138 = 0x3f0a
4412   3f0a =           __config 16138
4413                    ; Define start addresses for data regions
4414                    ; Region="shared___globals" Address=112" Size=16 Bytes=0 Bits=0 Available=16
4415                    ; Region="globals___0" Address=32" Size=80 Bytes=54 Bits=6 Available=25
4416                    ; Region="globals___1" Address=160" Size=80 Bytes=0 Bits=0 Available=80
4417                    ; Region="globals___2" Address=288" Size=48 Bytes=0 Bits=0 Available=48
4418                    ; Region="shared___globals" Address=112" Size=16 Bytes=0 Bits=0 Available=16
4419                    end
