        radix   dec
        ; Code bank 0; Start address: 0; End address: 2047
        org     0

        ; Define start addresses for data regions
shared___globals equ 112
globals___0 equ 32
globals___1 equ 160
globals___2 equ 288
__indf equ 0
__pcl equ 2
__status equ 3
__fsr equ 4
__c___byte equ 3
__c___bit equ 0
__z___byte equ 3
__z___bit equ 2
__rp0___byte equ 3
__rp0___bit equ 5
__rp1___byte equ 3
__rp1___bit equ 6
__irp___byte equ 3
__irp___bit equ 7
__pclath equ 10
__cb0___byte equ 10
__cb0___bit equ 3
__cb1___byte equ 10
__cb1___bit equ 4

        ; # Copyright (c) 2002-2006 by Wayne C. Gramlich.
        ; # All rights reserved.

        ; # This code started out as some assembly code that was written by
        ; # Chuck McManis.  It has been modified basically beyond recognition.
        ; # None-the-less, I would like to thank Chuck for his contribution
        ; # to the effort.

        ; # The Lumix(r) LCM-S01602DTR/M 2 line by 16 character LCD panel uses the
        ; # Samsung(r) S6A0069 LCD controller.  The S6A0069 LCD controller has
        ; # 80 bytes of internal memory available for displaying characters.
        ; # The byte addresses for these data bytes are 0x00 through 0x4f(=79).
        ; # The controller will display the 16 characters of data starting at
        ; # 0x00 + N on the first line, and 0x20 + N on the second line, where
        ; # N is a number between 0 and 0x18(=24).

        ; # The LCD32 module provides the user with 4 lines of 16 characters
        ; # each.  These are arranged as follows:
        ; #
        ; #   Line  Addresses Shift(N)
        ; #     0    00 - 0f    00
        ; #     1    20 - 2f    00
        ; #     2    10 - 1f    10
        ; #     3    30 - 3f    10
        ; #
        ; # In order to display lines 0 and 1, the shift amount (N) is set to 0.
        ; # In order to display lines 2 and 3, the shift amount is set to 0x10(=16).
        ; # The Samsung chip can only change the shift amount in increments of
        ; # +/- 1 per shift command.  However, since the command only requires
        ; # ~40uS, 16 shifts can take place so fast that it appears to be
        ; # instantenous to the end user.

        ; # The operations to access the LCD controller take 39uS
        ; # to write a command or data and 43uS to read some data.
        ; # What this means is that for commands that do not return
        ; # any data, we only have time to perform two LCD access
        ; # commands.   There is one command, clear display, that
        ; # that takes 1.53mS.  In addition, some commands, like
        ; # line feed, that needs to clear the entire contents
        ; # of the next line.  This takes 16+ commands.
        ; #
        ; # The solution to all of these problems is to have all of
        ; # the LCD access commands take place from the delay()
        ; # procedure.  As long as everything important is performed
        ; # there and in the right sequence, we won't violate the
        ; # "do everything in 1/3 of a bit time" rule in this procedure.
        ; #
        ; # For more details on the architecture of the delay procedure,
        ; # see the delay procedure comments further below.


        ; # This module uses a PIC16F628A
        ; buffer = 'lcd32'
        ; line_number = 55
        ; library _pic16f628 entered

        ; # Copyright (c) 2006 by Wayne C. Gramlich
        ; # All rights reserved.

        ; buffer = '_pic16f628'
        ; line_number = 6
        ; processor pic16f628
        ; line_number = 7
        ; configure_address 0x2007
        ; line_number = 8
        ;  configure_fill 0x0200
        ; line_number = 9
        ;  configure_option cp: off = 0x3c00
        ; line_number = 10
        ;  configure_option cp: after400 = 0x2800
        ; line_number = 11
        ;  configure_option cp: after200 = 0x1400
        ; line_number = 12
        ;  configure_option cp: on = 0x0000
        ; line_number = 13
        ;  configure_option cpd: off = 0x100
        ; line_number = 14
        ;  configure_option cpd: on = 0x000
        ; line_number = 15
        ;  configure_option lvp: on = 0x80
        ; line_number = 16
        ;  configure_option lvp: off = 0x00
        ; line_number = 17
        ;  configure_option boden: on = 0x40
        ; line_number = 18
        ;  configure_option boden: off = 0x00
        ; line_number = 19
        ;  configure_option mclre: on = 0x20
        ; line_number = 20
        ;  configure_option mclre: off = 0x00
        ; line_number = 21
        ;  configure_option pwrte: on = 0
        ; line_number = 22
        ;  configure_option pwrte: off = 8
        ; line_number = 23
        ;  configure_option wdte: on = 4
        ; line_number = 24
        ;  configure_option wdte: off = 0
        ; line_number = 25
        ;  configure_option fosc: er_clk = 0x13
        ; line_number = 26
        ;  configure_option fosc: er_no_clk = 0x12
        ; line_number = 27
        ;  configure_option fosc: intrc_clk = 0x11
        ; line_number = 28
        ;  configure_option fosc: intrc_no_clk = 0x10
        ; line_number = 29
        ;  configure_option fosc: ec = 3
        ; line_number = 30
        ;  configure_option fosc: hs = 2
        ; line_number = 31
        ;  configure_option fosc: xt = 1
        ; line_number = 32
        ;  configure_option fosc: lp = 0
        ; line_number = 33
        ;  code_bank 0x0 : 0x7ff
        ; line_number = 34
        ;  data_bank 0x0 : 0x7f
        ; line_number = 35
        ;  data_bank 0x80 : 0xff
        ; line_number = 36
        ;  data_bank 0x100 : 0x17f
        ; line_number = 37
        ;  data_bank 0x180 : 0x1ff
        ; line_number = 38
        ;  global_region 0x20 : 0x6f
        ; line_number = 39
        ;  global_region 0xa0 : 0xef
        ; line_number = 40
        ;  global_region 0x120 : 0x14f
        ; line_number = 41
        ;  shared_region 0x70 : 0x7f
        ; line_number = 42
        ;  packages dip=18, soic=18, ssop=20
        ; line_number = 43
        ;  pin ra2_in, ra2_out, ra2_unused
        ; line_number = 44
        ; pin_bindings dip=1, soic=1, ssop=1
        ; line_number = 45
        ;  bind_to _porta@2
        ; line_number = 46
        ;  or_if ra2_in _trisa 4
        ; line_number = 47
        ;  or_if ra2_out _trisa 0
        ; line_number = 48
        ;  or_if ra2_in _cmcon 7
        ; line_number = 49
        ;  or_if ra2_out _cmcon 7
        ; line_number = 50
        ; pin ra3_in, ra3_out, cmp1, ra3_unused
        ; line_number = 51
        ; pin_bindings dip=2, soic=2, ssop=2
        ; line_number = 52
        ;  bind_to _porta@3
        ; line_number = 53
        ;  or_if ra3_in _trisa 8
        ; line_number = 54
        ;  or_if ra3_out _trisa 0
        ; line_number = 55
        ;  or_if ra3_in _cmcon 7
        ; line_number = 56
        ;  or_if ra3_out _cmcon 7
        ; line_number = 57
        ; pin ra4_in, ra4_open_collector, tocki, cmp2, ra4_unused
        ; line_number = 58
        ; pin_bindings dip=3, soic=3, ssop=3
        ; line_number = 59
        ;  bind_to _porta@4
        ; line_number = 60
        ;  or_if ra4_in _trisa 16
        ; line_number = 61
        ;  or_if ra4_open_collector _trisa 0
        ; line_number = 62
        ; pin ra5_in, mclr, thv, ra5_unused
        ; line_number = 63
        ; pin_bindings dip=4, soic=4, ssop=4
        ; line_number = 64
        ;  bind_to _porta@5
        ; line_number = 65
        ;  or_if ra5_in _trisa 32
        ; line_number = 66
        ; pin vss, ground
        ; line_number = 67
        ; pin_bindings dip=5, soic=5, ssop=5
        ; line_number = 68
        ; pin vss2, ground2
        ; line_number = 69
        ; pin_bindings ssop=6
        ; line_number = 70
        ; pin rb0_in, rb0_out, int, rb0_unused
        ; line_number = 71
        ; pin_bindings dip=6, soic=6, ssop=7
        ; line_number = 72
        ;  bind_to _portb@0
        ; line_number = 73
        ;  or_if rb0_in _trisb 1
        ; line_number = 74
        ;  or_if rb0_out _trisb 0
        ; line_number = 75
        ;  or_if int _trisb 1
        ; line_number = 76
        ; pin rb1_in, rb1_out, rx, dt, rb1_unused
        ; line_number = 77
        ; pin_bindings dip=7, soic=7, ssop=8
        ; line_number = 78
        ;  bind_to _portb@1
        ; line_number = 79
        ;  or_if rb1_in _trisb 2
        ; line_number = 80
        ;  or_if rb1_out _trisb 0
        ; line_number = 81
        ;  or_if rx _trisb 2
        ; line_number = 82
        ; pin rb2_in, rb2_out, tx, ck, rb2_unused
        ; line_number = 83
        ; pin_bindings dip=8, soic=8, ssop=9
        ; line_number = 84
        ;  bind_to _portb@2
        ; line_number = 85
        ;  or_if rb2_in _trisb 4
        ; line_number = 86
        ;  or_if rb2_out _trisb 0
        ; line_number = 87
        ;  or_if tx _trisb 4
        ; line_number = 88
        ;  or_if ck _trisb 0
        ; line_number = 89
        ; pin rb3_in, rb3_out, ccp1, rb3unused
        ; line_number = 90
        ; pin_bindings dip=9, soic=9, ssop=10
        ; line_number = 91
        ;  bind_to _portb@3
        ; line_number = 92
        ;  or_if rb3_in _trisb 8
        ; line_number = 93
        ;  or_if rb3_out _trisb 0
        ; line_number = 94
        ;  or_if ccp1 _trisb 8
        ; line_number = 95
        ; pin rb4_in, rb4_out, pgm, rb4_unused
        ; line_number = 96
        ; pin_bindings dip=10, soic=10, ssop=11
        ; line_number = 97
        ;  bind_to _portb@4
        ; line_number = 98
        ;  or_if rb4_in _trisb 16
        ; line_number = 99
        ;  or_if rb4_out _trisb 0
        ; line_number = 100
        ;  or_if pgm _trisb 16
        ; line_number = 101
        ; pin rb5_in, rb5_out, rb5_unused
        ; line_number = 102
        ; pin_bindings dip=11, soic=11, ssop=12
        ; line_number = 103
        ;  bind_to _portb@5
        ; line_number = 104
        ;  or_if rb5_in _trisb 32
        ; line_number = 105
        ;  or_if rb5_out _trisb 0
        ; line_number = 106
        ; pin rb6_in, rb6_out, t1oso, t1cki, rb6_unused
        ; line_number = 107
        ; pin_bindings dip=12, soic=12, ssop=13
        ; line_number = 108
        ;  bind_to _portb@6
        ; line_number = 109
        ;  or_if rb6_in _trisb 64
        ; line_number = 110
        ;  or_if rb6_out _trisb 0
        ; line_number = 111
        ;  or_if t1oso _trisb 0
        ; line_number = 112
        ;  or_if t1cki _trisb 64
        ; line_number = 113
        ; pin rb7_in, rb7_out, t1osi, rb7_unused
        ; line_number = 114
        ; pin_bindings dip=13, soic=13, ssop=14
        ; line_number = 115
        ;  bind_to _portb@6
        ; line_number = 116
        ;  or_if rb7_in _trisb 128
        ; line_number = 117
        ;  or_if rb7_out _trisb 0
        ; line_number = 118
        ;  or_if t1osi _trisb 128
        ; line_number = 119
        ; pin vdd, power_supply
        ; line_number = 120
        ; pin_bindings dip=14, soic=14, ssop=15
        ; line_number = 121
        ; pin vdd2, power_spply2
        ; line_number = 122
        ; pin_bindings ssop=16
        ; line_number = 123
        ; pin ra6_in, ra6_out, osc2, clkout, ra6_unused
        ; line_number = 124
        ; pin_bindings dip=15, soic=15, ssop=17
        ; line_number = 125
        ;  bind_to _porta@6
        ; line_number = 126
        ;  or_if ra6_in _trisa 64
        ; line_number = 127
        ;  or_if ra6_out _trisa 0
        ; line_number = 128
        ;  or_if clkout _trisa 0
        ; line_number = 129
        ; pin ra7_in, ra7_out, osc1, clkin, ra7_unused
        ; line_number = 130
        ; pin_bindings dip=16, soic=16, ssop=18
        ; line_number = 131
        ;  bind_to _porta@7
        ; line_number = 132
        ;  or_if ra7_in _trisa 128
        ; line_number = 133
        ;  or_if ra7_out _trisa 0
        ; line_number = 134
        ;  or_if clkin _trisa 128
        ; line_number = 135
        ; pin ra0_in, ra0_out, ra0_unused
        ; line_number = 136
        ; pin_bindings dip=17, soic=17, ssop=19
        ; line_number = 137
        ;  bind_to _porta@0
        ; line_number = 138
        ;  or_if ra0_in _trisa 1
        ; line_number = 139
        ;  or_if ra0_in _cmcon 7
        ; line_number = 140
        ;  or_if ra0_out _cmcon 7
        ; line_number = 141
        ;  or_if ra0_out _trisa 0
        ; line_number = 142
        ; pin ra1_in, ra1_out, ra1_unused
        ; line_number = 143
        ; pin_bindings dip=18, soic=18, ssop=20
        ; line_number = 144
        ;  bind_to _porta@1
        ; line_number = 145
        ;  or_if ra1_in _trisa 2
        ; line_number = 146
        ;  or_if ra1_out _trisa 0
        ; line_number = 147
        ;  or_if ra1_in _cmcon 7
        ; line_number = 148
        ;  or_if ra1_out _cmcon 7



        ; line_number = 153
        ; library _standard entered

        ; # Copyright (c) 2006 by Wayne C. Gramlich
        ; # All rights reserved.

        ; # Standard definition for uCL:

        ; buffer = '_standard'
        ; line_number = 8
        ; constant _true = (1 = 1)
_true equ 1
        ; line_number = 9
        ; constant _false = (0 != 0)
_false equ 0


        ; buffer = '_pic16f628'
        ; line_number = 153
        ; library _standard exited

        ; # Data bank 0:

        ; line_number = 157
        ; register _indf = 
_indf equ 0

        ; line_number = 159
        ; register _tmr0 = 
_tmr0 equ 1

        ; line_number = 161
        ; register _pcl = 
_pcl equ 2

        ; line_number = 163
        ; register _status = 
_status equ 3
        ; line_number = 164
        ; bind _irp = _status@7
_irp___byte equ _status
_irp___bit equ 7
        ; line_number = 165
        ; bind _rp1 = _status@6
_rp1___byte equ _status
_rp1___bit equ 6
        ; line_number = 166
        ; bind _rp0 = _status@5
_rp0___byte equ _status
_rp0___bit equ 5
        ; line_number = 167
        ; bind _to = _status@4
_to___byte equ _status
_to___bit equ 4
        ; line_number = 168
        ; bind _pd = _status@3
_pd___byte equ _status
_pd___bit equ 3
        ; line_number = 169
        ; bind _z = _status@2
_z___byte equ _status
_z___bit equ 2
        ; line_number = 170
        ; bind _dc = _status@1
_dc___byte equ _status
_dc___bit equ 1
        ; line_number = 171
        ; bind _c = _status@0
_c___byte equ _status
_c___bit equ 0

        ; line_number = 173
        ; register _fsr = 
_fsr equ 4

        ; line_number = 175
        ; register _porta = 
_porta equ 5
        ; line_number = 176
        ; bind _ra7 = _porta@7
_ra7___byte equ _porta
_ra7___bit equ 7
        ; line_number = 177
        ; bind _ra6 = _porta@6
_ra6___byte equ _porta
_ra6___bit equ 6
        ; line_number = 178
        ; bind _ra5 = _porta@5
_ra5___byte equ _porta
_ra5___bit equ 5
        ; line_number = 179
        ; bind _ra4 = _porta@4
_ra4___byte equ _porta
_ra4___bit equ 4
        ; line_number = 180
        ; bind _ra3 = _porta@3
_ra3___byte equ _porta
_ra3___bit equ 3
        ; line_number = 181
        ; bind _ra2 = _porta@2
_ra2___byte equ _porta
_ra2___bit equ 2
        ; line_number = 182
        ; bind _ra1 = _porta@1
_ra1___byte equ _porta
_ra1___bit equ 1
        ; line_number = 183
        ; bind _ra0 = _porta@0
_ra0___byte equ _porta
_ra0___bit equ 0

        ; line_number = 185
        ; register _portb = 
_portb equ 6
        ; line_number = 186
        ; bind _rb7 = _portb@7
_rb7___byte equ _portb
_rb7___bit equ 7
        ; line_number = 187
        ; bind _rb6 = _portb@6
_rb6___byte equ _portb
_rb6___bit equ 6
        ; line_number = 188
        ; bind _rb5 = _portb@5
_rb5___byte equ _portb
_rb5___bit equ 5
        ; line_number = 189
        ; bind _rb4 = _portb@4
_rb4___byte equ _portb
_rb4___bit equ 4
        ; line_number = 190
        ; bind _rb3 = _portb@3
_rb3___byte equ _portb
_rb3___bit equ 3
        ; line_number = 191
        ; bind _rb2 = _portb@2
_rb2___byte equ _portb
_rb2___bit equ 2
        ; line_number = 192
        ; bind _rb1 = _portb@1
_rb1___byte equ _portb
_rb1___bit equ 1
        ; line_number = 193
        ; bind _rb0 = _portb@0
_rb0___byte equ _portb
_rb0___bit equ 0

        ; line_number = 195
        ; register _pclath = 
_pclath equ 10

        ; line_number = 197
        ; register _intcon = 
_intcon equ 11
        ; line_number = 198
        ; bind _gie = _intcon@7
_gie___byte equ _intcon
_gie___bit equ 7
        ; line_number = 199
        ; bind _peie = _intcon@6
_peie___byte equ _intcon
_peie___bit equ 6
        ; line_number = 200
        ; bind _t0ie = _intcon@5
_t0ie___byte equ _intcon
_t0ie___bit equ 5
        ; line_number = 201
        ; bind _inte = _intcon@4
_inte___byte equ _intcon
_inte___bit equ 4
        ; line_number = 202
        ; bind _rbie = _intcon@3
_rbie___byte equ _intcon
_rbie___bit equ 3
        ; line_number = 203
        ; bind _t0if = _intcon@2
_t0if___byte equ _intcon
_t0if___bit equ 2
        ; line_number = 204
        ; bind _intf = _intcon@1
_intf___byte equ _intcon
_intf___bit equ 1
        ; line_number = 205
        ; bind _rbif = _intcon@0
_rbif___byte equ _intcon
_rbif___bit equ 0

        ; line_number = 207
        ; register _pir1 = 
_pir1 equ 12
        ; line_number = 208
        ; bind _eeif = _pir1@7
_eeif___byte equ _pir1
_eeif___bit equ 7
        ; line_number = 209
        ; bind _cmif = _pir1@6
_cmif___byte equ _pir1
_cmif___bit equ 6
        ; line_number = 210
        ; bind _rcif = _pir1@5
_rcif___byte equ _pir1
_rcif___bit equ 5
        ; line_number = 211
        ; bind _txif = _pir1@4
_txif___byte equ _pir1
_txif___bit equ 4
        ; line_number = 212
        ; bind _ccp1if = _pir1@2
_ccp1if___byte equ _pir1
_ccp1if___bit equ 2
        ; line_number = 213
        ; bind _tmr2if = _pir1@1
_tmr2if___byte equ _pir1
_tmr2if___bit equ 1
        ; line_number = 214
        ; bind _tmr1if = _pir1@0
_tmr1if___byte equ _pir1
_tmr1if___bit equ 0

        ; line_number = 216
        ; register _tmr1l = 
_tmr1l equ 14

        ; line_number = 218
        ; register _tmr1h = 
_tmr1h equ 15

        ; line_number = 220
        ; register _t1con = 
_t1con equ 16
        ; line_number = 221
        ; bind _t1ckps1 = _t1con@5
_t1ckps1___byte equ _t1con
_t1ckps1___bit equ 5
        ; line_number = 222
        ; bind _t1ckps0 = _t1con@4
_t1ckps0___byte equ _t1con
_t1ckps0___bit equ 4
        ; line_number = 223
        ; bind _t1oscen = _t1con@3
_t1oscen___byte equ _t1con
_t1oscen___bit equ 3
        ; line_number = 224
        ; bind _t1sync = _t1con@2
_t1sync___byte equ _t1con
_t1sync___bit equ 2
        ; line_number = 225
        ; bind _tmr1cs = _t1con@1
_tmr1cs___byte equ _t1con
_tmr1cs___bit equ 1
        ; line_number = 226
        ; bind _tmr1on = _t1con@0
_tmr1on___byte equ _t1con
_tmr1on___bit equ 0

        ; line_number = 228
        ; register _tmr2 = 
_tmr2 equ 17

        ; line_number = 230
        ; register _t2con = 
_t2con equ 18
        ; line_number = 231
        ; bind _toutps3 = _t2con@6
_toutps3___byte equ _t2con
_toutps3___bit equ 6
        ; line_number = 232
        ; bind _toutps2 = _t2con@5
_toutps2___byte equ _t2con
_toutps2___bit equ 5
        ; line_number = 233
        ; bind _toutps1 = _t2con@4
_toutps1___byte equ _t2con
_toutps1___bit equ 4
        ; line_number = 234
        ; bind _toutps0 = _t2con@3
_toutps0___byte equ _t2con
_toutps0___bit equ 3
        ; line_number = 235
        ; bind _trm2on = _t2con@2
_trm2on___byte equ _t2con
_trm2on___bit equ 2
        ; line_number = 236
        ; bind _t2ckps1 = _t2con@1
_t2ckps1___byte equ _t2con
_t2ckps1___bit equ 1
        ; line_number = 237
        ; bind _t2ckps0 = _t2con@0
_t2ckps0___byte equ _t2con
_t2ckps0___bit equ 0

        ; line_number = 239
        ; register _ccpr1l = 
_ccpr1l equ 21

        ; line_number = 241
        ; register _ccpr1h = 
_ccpr1h equ 22

        ; line_number = 243
        ; register _ccp1con = 
_ccp1con equ 23
        ; line_number = 244
        ; bind _ccp1x = _ccp1con@5
_ccp1x___byte equ _ccp1con
_ccp1x___bit equ 5
        ; line_number = 245
        ; bind _ccp1y = _ccp1con@4
_ccp1y___byte equ _ccp1con
_ccp1y___bit equ 4
        ; line_number = 246
        ; bind _ccp1m3 = _ccp1con@3
_ccp1m3___byte equ _ccp1con
_ccp1m3___bit equ 3
        ; line_number = 247
        ; bind _ccp1m2 = _ccp1con@2
_ccp1m2___byte equ _ccp1con
_ccp1m2___bit equ 2
        ; line_number = 248
        ; bind _ccp1m1 = _ccp1con@1
_ccp1m1___byte equ _ccp1con
_ccp1m1___bit equ 1
        ; line_number = 249
        ; bind _ccp1m0 = _ccp1con@0
_ccp1m0___byte equ _ccp1con
_ccp1m0___bit equ 0

        ; line_number = 251
        ; register _rcsta = 
_rcsta equ 24
        ; line_number = 252
        ; bind _spen = _rcsta@7
_spen___byte equ _rcsta
_spen___bit equ 7
        ; line_number = 253
        ; bind _rx9 = _rcsta@6
_rx9___byte equ _rcsta
_rx9___bit equ 6
        ; line_number = 254
        ; bind _sren = _rcsta@5
_sren___byte equ _rcsta
_sren___bit equ 5
        ; line_number = 255
        ; bind _cren = _rcsta@4
_cren___byte equ _rcsta
_cren___bit equ 4
        ; line_number = 256
        ; bind _aden = _rcsta@3
_aden___byte equ _rcsta
_aden___bit equ 3
        ; # Some other modules use _adden instead of _aden:
        ; line_number = 258
        ; bind _adden = _rcsta@3
_adden___byte equ _rcsta
_adden___bit equ 3
        ; line_number = 259
        ; bind _ferr = _rcsta@2
_ferr___byte equ _rcsta
_ferr___bit equ 2
        ; line_number = 260
        ; bind _oerr = _rcsta@1
_oerr___byte equ _rcsta
_oerr___bit equ 1
        ; line_number = 261
        ; bind _rx9d = _rcsta@0
_rx9d___byte equ _rcsta
_rx9d___bit equ 0

        ; line_number = 263
        ; register _txreg = 
_txreg equ 25

        ; line_number = 265
        ; register _rcreg = 
_rcreg equ 26

        ; line_number = 267
        ; register _cmcon = 
_cmcon equ 31
        ; line_number = 268
        ; bind _c2out = _cmcon@7
_c2out___byte equ _cmcon
_c2out___bit equ 7
        ; line_number = 269
        ; bind _c1out = _cmcon@6
_c1out___byte equ _cmcon
_c1out___bit equ 6
        ; line_number = 270
        ; bind _c2inv = _cmcon@5
_c2inv___byte equ _cmcon
_c2inv___bit equ 5
        ; line_number = 271
        ; bind _c1inv = _cmcon@4
_c1inv___byte equ _cmcon
_c1inv___bit equ 4
        ; line_number = 272
        ; bind _cis = _cmcon@3
_cis___byte equ _cmcon
_cis___bit equ 3
        ; line_number = 273
        ; bind _cm2 = _cmcon@2
_cm2___byte equ _cmcon
_cm2___bit equ 2
        ; line_number = 274
        ; bind _cm1 = _cmcon@1
_cm1___byte equ _cmcon
_cm1___bit equ 1
        ; line_number = 275
        ; bind _cm0 = _cmcon@0
_cm0___byte equ _cmcon
_cm0___bit equ 0

        ; # Data bank 1:

        ; line_number = 279
        ; register _option = 
_option equ 129
        ; line_number = 280
        ; bind _rbpu = _option@7
_rbpu___byte equ _option
_rbpu___bit equ 7
        ; line_number = 281
        ; bind _intedg = _option@6
_intedg___byte equ _option
_intedg___bit equ 6
        ; line_number = 282
        ; bind _t0cs = _option@5
_t0cs___byte equ _option
_t0cs___bit equ 5
        ; line_number = 283
        ; bind _t0se = _option@4
_t0se___byte equ _option
_t0se___bit equ 4
        ; line_number = 284
        ; bind _psa = _option@3
_psa___byte equ _option
_psa___bit equ 3
        ; line_number = 285
        ; bind _ps2 = _option@2
_ps2___byte equ _option
_ps2___bit equ 2
        ; line_number = 286
        ; bind _ps1 = _option@1
_ps1___byte equ _option
_ps1___bit equ 1
        ; line_number = 287
        ; bind _ps0 = _option@0
_ps0___byte equ _option
_ps0___bit equ 0

        ; line_number = 289
        ; register _trisa = 
_trisa equ 133
        ; line_number = 290
        ; bind _trisa7 = _trisa@7
_trisa7___byte equ _trisa
_trisa7___bit equ 7
        ; line_number = 291
        ; bind _trisa6 = _trisa@6
_trisa6___byte equ _trisa
_trisa6___bit equ 6
        ; # No _trisa5:
        ; line_number = 293
        ; bind _trisa4 = _trisa@4
_trisa4___byte equ _trisa
_trisa4___bit equ 4
        ; line_number = 294
        ; bind _trisa3 = _trisa@3
_trisa3___byte equ _trisa
_trisa3___bit equ 3
        ; line_number = 295
        ; bind _trisa2 = _trisa@2
_trisa2___byte equ _trisa
_trisa2___bit equ 2
        ; line_number = 296
        ; bind _trisa1 = _trisa@1
_trisa1___byte equ _trisa
_trisa1___bit equ 1
        ; line_number = 297
        ; bind _trisa0 = _trisa@0
_trisa0___byte equ _trisa
_trisa0___bit equ 0

        ; line_number = 299
        ; register _trisb = 
_trisb equ 134
        ; line_number = 300
        ; bind _trisb7 = _trisb@7
_trisb7___byte equ _trisb
_trisb7___bit equ 7
        ; line_number = 301
        ; bind _trisb6 = _trisb@6
_trisb6___byte equ _trisb
_trisb6___bit equ 6
        ; line_number = 302
        ; bind _trisb5 = _trisb@5
_trisb5___byte equ _trisb
_trisb5___bit equ 5
        ; line_number = 303
        ; bind _trisb4 = _trisb@4
_trisb4___byte equ _trisb
_trisb4___bit equ 4
        ; line_number = 304
        ; bind _trisb3 = _trisb@3
_trisb3___byte equ _trisb
_trisb3___bit equ 3
        ; line_number = 305
        ; bind _trisb2 = _trisb@2
_trisb2___byte equ _trisb
_trisb2___bit equ 2
        ; line_number = 306
        ; bind _trisb1 = _trisb@1
_trisb1___byte equ _trisb
_trisb1___bit equ 1
        ; line_number = 307
        ; bind _trisb0 = _trisb@0
_trisb0___byte equ _trisb
_trisb0___bit equ 0

        ; line_number = 309
        ; register _pie1 = 
_pie1 equ 140
        ; line_number = 310
        ; bind _eeie7 = _pie1@7
_eeie7___byte equ _pie1
_eeie7___bit equ 7
        ; line_number = 311
        ; bind _cmie = _pie1@6
_cmie___byte equ _pie1
_cmie___bit equ 6
        ; line_number = 312
        ; bind _rcie = _pie1@5
_rcie___byte equ _pie1
_rcie___bit equ 5
        ; line_number = 313
        ; bind _txie = _pie1@4
_txie___byte equ _pie1
_txie___bit equ 4
        ; line_number = 314
        ; bind _ccp1ie = _pie1@2
_ccp1ie___byte equ _pie1
_ccp1ie___bit equ 2
        ; line_number = 315
        ; bind _tmr2ie = _pie1@1
_tmr2ie___byte equ _pie1
_tmr2ie___bit equ 1
        ; line_number = 316
        ; bind _tmr1ie = _pie1@0
_tmr1ie___byte equ _pie1
_tmr1ie___bit equ 0

        ; line_number = 318
        ; register _pcon = 
_pcon equ 142
        ; line_number = 319
        ; bind _oscf = _pcon@3
_oscf___byte equ _pcon
_oscf___bit equ 3
        ; line_number = 320
        ; bind _por = _pcon@1
_por___byte equ _pcon
_por___bit equ 1
        ; line_number = 321
        ; bind _bod = _pcon@0
_bod___byte equ _pcon
_bod___bit equ 0

        ; line_number = 323
        ; register _pr2 = 
_pr2 equ 146

        ; line_number = 325
        ; register _txsta = 
_txsta equ 152
        ; line_number = 326
        ; bind _csrc = _txsta@7
_csrc___byte equ _txsta
_csrc___bit equ 7
        ; line_number = 327
        ; bind _tx9 = _txsta@6
_tx9___byte equ _txsta
_tx9___bit equ 6
        ; line_number = 328
        ; bind _txen = _txsta@5
_txen___byte equ _txsta
_txen___bit equ 5
        ; line_number = 329
        ; bind _sync = _txsta@4
_sync___byte equ _txsta
_sync___bit equ 4
        ; line_number = 330
        ; bind _brgh = _txsta@2
_brgh___byte equ _txsta
_brgh___bit equ 2
        ; line_number = 331
        ; bind _trmt = _txsta@1
_trmt___byte equ _txsta
_trmt___bit equ 1
        ; line_number = 332
        ; bind _tx9d = _txsta@0
_tx9d___byte equ _txsta
_tx9d___bit equ 0

        ; line_number = 334
        ; register _spbrg = 
_spbrg equ 153

        ; line_number = 336
        ; register _eedat = 
_eedat equ 154

        ; line_number = 338
        ; register _eeadr = 
_eeadr equ 155

        ; line_number = 340
        ; register _eecon1 = 
_eecon1 equ 156
        ; line_number = 341
        ; bind _wrerr = _eecon1@3
_wrerr___byte equ _eecon1
_wrerr___bit equ 3
        ; line_number = 342
        ; bind _wren = _eecon1@2
_wren___byte equ _eecon1
_wren___bit equ 2
        ; line_number = 343
        ; bind _wr = _eecon1@1
_wr___byte equ _eecon1
_wr___bit equ 1
        ; line_number = 344
        ; bind _rd = _eecon1@0
_rd___byte equ _eecon1
_rd___bit equ 0

        ; line_number = 346
        ; register _eecon2 = 
_eecon2 equ 157

        ; line_number = 348
        ; register _vrcon = 
_vrcon equ 159
        ; line_number = 349
        ; bind _vren = _vrcon@7
_vren___byte equ _vrcon
_vren___bit equ 7
        ; line_number = 350
        ; bind _vroe = _vrcon@6
_vroe___byte equ _vrcon
_vroe___bit equ 6
        ; line_number = 351
        ; bind _vrr = _vrcon@5
_vrr___byte equ _vrcon
_vrr___bit equ 5
        ; line_number = 352
        ; bind _vr3 = _vrcon@3
_vr3___byte equ _vrcon
_vr3___bit equ 3
        ; line_number = 353
        ; bind _vr2 = _vrcon@2
_vr2___byte equ _vrcon
_vr2___bit equ 2
        ; line_number = 354
        ; bind _vr1 = _vrcon@1
_vr1___byte equ _vrcon
_vr1___bit equ 1
        ; line_number = 355
        ; bind _vr0 = _vrcon@0
_vr0___byte equ _vrcon
_vr0___bit equ 0



        ; buffer = 'lcd32'
        ; line_number = 55
        ; library _pic16f628 exited

        ; # The system is running at 16MHz:
        ; line_number = 58
        ; library clock16mhz entered
        ; # Copyright (c) 2006 by Wayne C. Gramlich
        ; # All rights reserved.

        ; # This library defines the contstants {clock_rate}, {instruction_rate},
        ; # and {clocks_per_instruction}.

        ; # Define processor constants:
        ; buffer = 'clock16mhz'
        ; line_number = 9
        ; constant clock_rate = 16000000
clock_rate equ 16000000
        ; line_number = 10
        ; constant clocks_per_instruction = 4
clocks_per_instruction equ 4
        ; line_number = 11
        ; constant instruction_rate = clock_rate / clocks_per_instruction
instruction_rate equ 4000000


        ; buffer = 'lcd32'
        ; line_number = 58
        ; library clock16mhz exited
        ; # A microsecond takes 4 cycles at 16MHz:
        ; line_number = 60
        ; constant microsecond = 4
microsecond equ 4

        ; # The library of bus access routines for use by the PIC16F628.
        ; line_number = 63
        ; library rb2bus_pic16f628 entered

        ; # Copyright (c) 2006-2007 by Wayne C. Gramlich
        ; # All rights reserved.

        ; # This module provides some procedures for accessing a RoboBricks2
        ; # bus via a UART.  It is speicialized for the PIC16F688.
        ; #
        ; # It defines the following procedure:
        ; #
        ; # {rb2bus_initialize}({address}) The procedure that initializes the UART
        ; #                                for bus access.

        ; # All other bus access procedures are defined in the {rb2bus} library
        ; # which is accessed below:
        ; buffer = 'rb2bus_pic16f628'
        ; line_number = 16
        ; library rb2bus entered

        ; # Copyright (c) 2006-2007 by Wayne C. Gramlich
        ; # All rights reserved.

        ; # This module provides some procedures for accessing a RoboBricks2
        ; # bus via a UART.
        ; #
        ; # This procedure defines the following procedures:
        ; #
        ; # {rb2bus_select_wait}  This procedure waits for the module to become selected
        ; # {rb2bus_deselect}     This procedure causes this module to be deselected.
        ; # {rb2bus_byte_get}     This procedure will get a byte form the bus.
        ; # {rb2bus_byte_put}     This procedure will send a byte to the bus.
        ; #
        ; # The global variable {rb2bus_error} is set to 1 whenever the procedures
        ; # feel like there is a command decoding error.
        ; #
        ; # The way to use these procedures is quite as follows:
        ; #
        ; #    # Comamnd byte variable:
        ; #    local command byte
        ; #
        ; #    # Other initialize code goes here:
        ; #
        ; #    # Process commands from bus master:
        ; #    loop_forever
        ; #        rb2bus_error := _true
        ; #	 while rb2bus_error
        ; #	     call rb2bus_select_wait()
        ; #	     command := rb2bus_byte_get()
        ; #
        ; #        # Decode command:
        ; #	 switch command >> 6
        ; #	   ...
        ; #             case 5:
        ; #	        # 0000 0101 (Foo command):
        ; #	          if !rb2bus_error
        ; #		      # Do foo command:
        ; #
        ; # The key concept behind these procedures is to make command
        ; # decoding for the slave module easy.  If the slave module
        ; # is in the middle of command decoding and the master suddenly
        ; # sends out a module select command, we need to gracefully recover
        ; # from the problem.  A command should only be executed if
        ; # {rb2bus_error} is not set.  If {rb2bus_error} is set, we want
        ; # to gracefully get back to the beginning of the loop without
        ; # doing any damage.  Once {rb2bus_error} is set, all calls to
        ; # {rb2bus_byte_get} return 0 and all calls to {rb2bus_byte_put}
        ; # do nothing.  At the beginning of the loop, {rb2bus_error} is
        ; # cleared by the {rb2bus_select_wait}() procedure and we have
        ; # recovered from the situation.

        ; buffer = 'rb2bus'
        ; line_number = 54
        ; library rb2_constants entered

        ; # Copyright (c) 2006-2007 by Wayne C. Gramlich.
        ; # All rights reserved.

        ; buffer = 'rb2_constants'
        ; line_number = 6
        ; constant rb2_ok = 0xa5
rb2_ok equ 165

        ; line_number = 8
        ; constant rb2_common_address_set = 0xfc
rb2_common_address_set equ 252
        ; line_number = 9
        ; constant rb2_common_id_next = 0xfd
rb2_common_id_next equ 253
        ; line_number = 10
        ; constant rb2_common_id_start = 0xfe
rb2_common_id_start equ 254
        ; line_number = 11
        ; constant rb2_common_deselect = 0xff
rb2_common_deselect equ 255

        ; line_number = 13
        ; constant rb2_laser1_address = 1
rb2_laser1_address equ 1

        ; line_number = 15
        ; constant rb2_minimotor2_address = 2
rb2_minimotor2_address equ 2
        ; line_number = 16
        ; constant rb2_midimotor2_address = 3
rb2_midimotor2_address equ 3
        ; line_number = 17
        ; constant rb2_motor0_speed_get = 0
rb2_motor0_speed_get equ 0
        ; line_number = 18
        ; constant rb2_motor0_speed_set = 1
rb2_motor0_speed_set equ 1
        ; line_number = 19
        ; constant rb2_motor1_speed_get = 2
rb2_motor1_speed_get equ 2
        ; line_number = 20
        ; constant rb2_motor1_speed_set = 3
rb2_motor1_speed_set equ 3
        ; line_number = 21
        ; constant rb2_duty_cycle_get = 4
rb2_duty_cycle_get equ 4
        ; line_number = 22
        ; constant rb2_duty_cycle_set = 8
rb2_duty_cycle_set equ 8

        ; line_number = 24
        ; constant rb2_irdistance2_address = 4
rb2_irdistance2_address equ 4
        ; line_number = 25
        ; constant rb2_irdistance2_raw0_get = 0
rb2_irdistance2_raw0_get equ 0
        ; line_number = 26
        ; constant rb2_irdistance2_raw1_get = 1
rb2_irdistance2_raw1_get equ 1
        ; line_number = 27
        ; constant rb2_irdistance2_smooth0_get = 2
rb2_irdistance2_smooth0_get equ 2
        ; line_number = 28
        ; constant rb2_irdistance2_smooth1_get = 3
rb2_irdistance2_smooth1_get equ 3
        ; line_number = 29
        ; constant rb2_irdistance2_linear0_get = 4
rb2_irdistance2_linear0_get equ 4
        ; line_number = 30
        ; constant rb2_irdistance2_linear1_get = 6
rb2_irdistance2_linear1_get equ 6

        ; line_number = 32
        ; constant rb2_shaft2_address = 5
rb2_shaft2_address equ 5
        ; line_number = 33
        ; constant rb2_shaft2_count_latch = 0
rb2_shaft2_count_latch equ 0
        ; line_number = 34
        ; constant rb2_shaft2_count_clear = 1
rb2_shaft2_count_clear equ 1
        ; line_number = 35
        ; constant rb2_shaft2_shaft0_high_get = 2
rb2_shaft2_shaft0_high_get equ 2
        ; line_number = 36
        ; constant rb2_shaft2_shaft1_high_get = 3
rb2_shaft2_shaft1_high_get equ 3
        ; line_number = 37
        ; constant rb2_shaft2_continue_get = 4
rb2_shaft2_continue_get equ 4
        ; line_number = 38
        ; constant rb2_shaft2_shaft0_low_get = rb2_shaft2_continue_get
rb2_shaft2_shaft0_low_get equ 4
        ; line_number = 39
        ; constant rb2_shaft2_shaft1_low_get = rb2_shaft2_continue_get
rb2_shaft2_shaft1_low_get equ 4
        ; line_number = 40
        ; constant rb2_shaft2_x_get = 0x10
rb2_shaft2_x_get equ 16
        ; line_number = 41
        ; constant rb2_shaft2_y_get = 0x11
rb2_shaft2_y_get equ 17
        ; line_number = 42
        ; constant rb2_shaft2_bearing16_get = 0x12
rb2_shaft2_bearing16_get equ 18
        ; line_number = 43
        ; constant rb2_shaft2_bearing8_get = 0x13
rb2_shaft2_bearing8_get equ 19
        ; line_number = 44
        ; constant rb2_shaft2_target_x_get = 0x14
rb2_shaft2_target_x_get equ 20
        ; line_number = 45
        ; constant rb2_shaft2_target_y_get = 0x15
rb2_shaft2_target_y_get equ 21
        ; line_number = 46
        ; constant rb2_shaft2_target_bearing16_get = 0x16
rb2_shaft2_target_bearing16_get equ 22
        ; line_number = 47
        ; constant rb2_shaft2_target_bearing8_get = 0x17
rb2_shaft2_target_bearing8_get equ 23
        ; line_number = 48
        ; constant rb2_shaft2_target_distance_get = 0x18
rb2_shaft2_target_distance_get equ 24
        ; line_number = 49
        ; constant rb2_shaft2_wheel_spacing_get = 0x19
rb2_shaft2_wheel_spacing_get equ 25
        ; line_number = 50
        ; constant rb2_shaft2_wheel_ticks_get = 0x1a
rb2_shaft2_wheel_ticks_get equ 26
        ; line_number = 51
        ; constant rb2_shaft2_wheel_diameter_get = 0x1b
rb2_shaft2_wheel_diameter_get equ 27
        ; line_number = 52
        ; constant rb2_shaft2_x_set = 0x20
rb2_shaft2_x_set equ 32
        ; line_number = 53
        ; constant rb2_shaft2_y_set = 0x21
rb2_shaft2_y_set equ 33
        ; line_number = 54
        ; constant rb2_shaft2_bearing16_set = 0x22
rb2_shaft2_bearing16_set equ 34
        ; line_number = 55
        ; constant rb2_shaft2_navigation_latch = 0x23
rb2_shaft2_navigation_latch equ 35
        ; line_number = 56
        ; constant rb2_shaft2_target_x_set = 0x24
rb2_shaft2_target_x_set equ 36
        ; line_number = 57
        ; constant rb2_shaft2_target_y_set = 0x25
rb2_shaft2_target_y_set equ 37
        ; line_number = 58
        ; constant rb2_shaft2_wheel_spacing_set = 0x29
rb2_shaft2_wheel_spacing_set equ 41
        ; line_number = 59
        ; constant rb2_shaft2_wheel_ticks_set = 0x2a
rb2_shaft2_wheel_ticks_set equ 42
        ; line_number = 60
        ; constant rb2_shaft2_wheel_diameter_set = 0x2b
rb2_shaft2_wheel_diameter_set equ 43


        ; line_number = 63
        ; constant rb2_orient5_address = 6
rb2_orient5_address equ 6

        ; line_number = 65
        ; constant rb2_compass8_address = 7
rb2_compass8_address equ 7

        ; line_number = 67
        ; constant rb2_io8_address = 8
rb2_io8_address equ 8
        ; line_number = 68
        ; constant rb2_io8_digital8_get = 0
rb2_io8_digital8_get equ 0
        ; line_number = 69
        ; constant rb2_io8_digital8_set = 1
rb2_io8_digital8_set equ 1
        ; line_number = 70
        ; constant rb2_io8_direction_get = 2
rb2_io8_direction_get equ 2
        ; line_number = 71
        ; constant rb2_io8_direction_set = 3
rb2_io8_direction_set equ 3
        ; line_number = 72
        ; constant rb2_io8_analog_mask_get = 4
rb2_io8_analog_mask_get equ 4
        ; line_number = 73
        ; constant rb2_io8_analog_mask_set = 5
rb2_io8_analog_mask_set equ 5
        ; line_number = 74
        ; constant rb2_io8_analog8_get = 0x10
rb2_io8_analog8_get equ 16
        ; line_number = 75
        ; constant rb2_io8_analog10_get = 0x18
rb2_io8_analog10_get equ 24
        ; line_number = 76
        ; constant rb2_low_set = 0x20
rb2_low_set equ 32
        ; line_number = 77
        ; constant rb2_high_set = 0x30
rb2_high_set equ 48

        ; line_number = 79
        ; constant rb2_sonar2_address = 9
rb2_sonar2_address equ 9

        ; line_number = 81
        ; constant rb2_voice1_address = 10
rb2_voice1_address equ 10

        ; line_number = 83
        ; constant rb2_servo4_address = 11
rb2_servo4_address equ 11
        ; line_number = 84
        ; constant rb2_servo4_servo0 = 0
rb2_servo4_servo0 equ 0
        ; line_number = 85
        ; constant rb2_servo4_servo1 = 1
rb2_servo4_servo1 equ 1
        ; line_number = 86
        ; constant rb2_servo4_servo2 = 2
rb2_servo4_servo2 equ 2
        ; line_number = 87
        ; constant rb2_servo4_servo3 = 3
rb2_servo4_servo3 equ 3
        ; line_number = 88
        ; constant rb2_servo4_quick_set = 0
rb2_servo4_quick_set equ 0
        ; line_number = 89
        ; constant rb2_servo4_quick_low = 0
rb2_servo4_quick_low equ 0
        ; line_number = 90
        ; constant rb2_servo4_quick_center = 40
rb2_servo4_quick_center equ 40
        ; line_number = 91
        ; constant rb2_servo4_quick_high = 0x7c
rb2_servo4_quick_high equ 124
        ; line_number = 92
        ; constant rb2_servo4_high_low_set = 0x80
rb2_servo4_high_low_set equ 128
        ; line_number = 93
        ; constant rb2_servo4_short_high_low_set = 0x84
rb2_servo4_short_high_low_set equ 132
        ; line_number = 94
        ; constant rb2_servo4_high_set = 0x88
rb2_servo4_high_set equ 136
        ; line_number = 95
        ; constant rb2_servo4_low_set = 0x8c
rb2_servo4_low_set equ 140
        ; line_number = 96
        ; constant rb2_servo4_enables_set = 0x90
rb2_servo4_enables_set equ 144
        ; line_number = 97
        ; constant rb2_servo4_enable0 = 1
rb2_servo4_enable0 equ 1
        ; line_number = 98
        ; constant rb2_servo4_enable1 = 2
rb2_servo4_enable1 equ 2
        ; line_number = 99
        ; constant rb2_servo4_enable2 = 4
rb2_servo4_enable2 equ 4
        ; line_number = 100
        ; constant rb2_servo4_enable3 = 8
rb2_servo4_enable3 equ 8
        ; line_number = 101
        ; constant rb2_servo4_enable_all = 0xf
rb2_servo4_enable_all equ 15
        ; line_number = 102
        ; constant rb2_servo4_enable_none = 0
rb2_servo4_enable_none equ 0
        ; line_number = 103
        ; constant rb2_servo4_high_get = 0xa0
rb2_servo4_high_get equ 160
        ; line_number = 104
        ; constant rb2_servo4_low_get = 0xa4
rb2_servo4_low_get equ 164
        ; line_number = 105
        ; constant rb2_servo4_enables_get = 0xa8
rb2_servo4_enables_get equ 168

        ; line_number = 107
        ; constant rb2_controller28_address = 28
rb2_controller28_address equ 28

        ; line_number = 109
        ; constant rb2_lcd32_address = 32
rb2_lcd32_address equ 32
        ; line_number = 110
        ; constant rb2_lcd32_new_line = 0xa
rb2_lcd32_new_line equ 10
        ; line_number = 111
        ; constant rb2_lcd32_form_feed = 0xc
rb2_lcd32_form_feed equ 12
        ; line_number = 112
        ; constant rb2_lcd32_carriage_return = 0xd
rb2_lcd32_carriage_return equ 13
        ; line_number = 113
        ; constant rb2_lcd32_column_set = 0x20
rb2_lcd32_column_set equ 32


        ; buffer = 'rb2bus'
        ; line_number = 54
        ; library rb2_constants exited
        ; line_number = 55
        ; library rb2bus_globals entered

        ; # Copyright (c) 2006-2007 by Wayne C. Gramlich
        ; # All rights reserved.

        ; # These are the global variables used by both the {rb2bus} and
        ; # the various {rb2bus_picXXXX} libraries.  Poll based firmware
        ; # uses both libraries, whereas interrupt driven software only
        ; # uses the {rb2bus_picXXX} libraries.

        ; buffer = 'rb2bus_globals'
        ; line_number = 11
        ; global rb2bus_selected bit	# 
rb2bus_selected___byte equ globals___0+79
rb2bus_selected___bit equ 0
        ; line_number = 12
        ; global rb2bus_error bit		# Global error bit
rb2bus_error___byte equ globals___0+79
rb2bus_error___bit equ 1
        ; line_number = 13
        ; global rb2bus_address byte	# Bus address to respond to
rb2bus_address equ globals___0
        ; line_number = 14
        ; global rb2bus_index byte	# Index into id information
rb2bus_index equ globals___0+1


        ; buffer = 'rb2bus'
        ; line_number = 55
        ; library rb2bus_globals exited

        ; Delaying code generation for procedure  rb2bus_select_wait
        ; Delaying code generation for procedure  rb2bus_deselect
        ; Delaying code generation for procedure  rb2bus_byte_get
        ; Delaying code generation for procedure  rb2bus_byte_put
        ; Delaying code generation for procedure  rb2bus_command

        ; buffer = 'rb2bus_pic16f628'
        ; line_number = 16
        ; library rb2bus exited

        ; # Baud_Rate = Fosc / (16(X+1))
        ; # 16 * (X+1) = Fosc/Baud_Rate
        ; # X+1 = Fosc/(16*Baud_Rate)
        ; # X = Fosc/(16*Baud_rate) - 1

        ; line_number = 23
        ; constant baud_rate_500k = 500000
baud_rate_500k equ 500000
        ; line_number = 24
        ; constant spbrg_500k = clock_rate / (16 * baud_rate_500k) - 1
spbrg_500k equ 1

        ; Delaying code generation for procedure  rb2bus_initialize
        ; Delaying code generation for procedure  rb2bus_eedata_read
        ; Delaying code generation for procedure  rb2bus_eedata_write

        ; buffer = 'lcd32'
        ; line_number = 63
        ; library rb2bus_pic16f628 exited

        ; # This module uses a 16MHz ceramic resonator; hence fosc = hs:

        ; # Port stuff:

        ; line_number = 70
        ; constant trisb_mask = 0x30
trisb_mask equ 48
        ; line_number = 71
        ; constant db47_mask = 0xf
db47_mask equ 15

        ; line_number = 73
        ; package dip
        ; line_number = 74
        ; pin 1 = ra2_out, name = db2
db2___byte equ _porta
db2___bit equ 2
        ; line_number = 75
        ;  pin 2 = ra3_out, name = db3
db3___byte equ _porta
db3___bit equ 3
        ; line_number = 76
        ;  pin 3 = ra4_open_collector, name = e
e___byte equ _porta
e___bit equ 4
        ; line_number = 77
        ;  pin 4 = ra5_in, name = lines34
lines34___byte equ _porta
lines34___bit equ 5
        ; line_number = 78
        ;  pin 5 = ground
        ; line_number = 79
        ;  pin 6 = rb0_out, name = rs
rs___byte equ _portb
rs___bit equ 0
        ; line_number = 80
        ;  pin 7 = rx
        ; line_number = 81
        ;  pin 8 = tx
        ; line_number = 82
        ;  pin 9 = rb3_out, name = rw
rw___byte equ _portb
rw___bit equ 3
        ; line_number = 83
        ;  pin 10 = rb4_out, name = db4
db4___byte equ _portb
db4___bit equ 4
        ; line_number = 84
        ;  pin 11 = rb5_out, name = db5
db5___byte equ _portb
db5___bit equ 5
        ; line_number = 85
        ;  pin 12 = rb6_out, name = db6
db6___byte equ _portb
db6___bit equ 6
        ; line_number = 86
        ;  pin 13 = rb7_out, name = db7
db7___byte equ _portb
db7___bit equ 6
        ; line_number = 87
        ;  pin 14 = power_supply
        ; line_number = 88
        ;  pin 15 = osc2
        ; line_number = 89
        ;  pin 16 = osc1
        ; line_number = 90
        ;  pin 17 = ra0_out, name = db0
db0___byte equ _porta
db0___bit equ 0
        ; line_number = 91
        ;  pin 18 = ra1_out, name = db1
db1___byte equ _porta
db1___bit equ 1

        ; line_number = 93
        ; constant line_mask = 3
line_mask equ 3
        ; line_number = 94
        ; constant column_mask = 0xf
column_mask equ 15
        ; line_number = 95
        ; constant cursor_mode_mask = 3
cursor_mode_mask equ 3

        ; line_number = 97
        ; global shift byte
shift equ globals___0+10
        ; line_number = 98
        ; global column byte
column equ globals___0+11
        ; line_number = 99
        ; global line byte
line equ globals___0+12
        ; line_number = 100
        ; global cursor_mode byte
cursor_mode equ globals___0+13
        ; line_number = 101
        ; global font_address byte
font_address equ globals___0+14

        ; line_number = 103
        ; global command_previous byte
command_previous equ globals___0+15
        ; line_number = 104
        ; global command_last byte
command_last equ globals___0+16
        ; line_number = 105
        ; global sent_previous byte
sent_previous equ globals___0+17
        ; line_number = 106
        ; global sent_last byte
sent_last equ globals___0+18

        ; line_number = 108
        ; constant queue_size = 4
queue_size equ 4
        ; line_number = 109
        ; global data_queue[queue_size] array[byte]
data_queue equ globals___0+19
        ; line_number = 110
        ; global control_queue[queue_size] array[byte]
control_queue equ globals___0+23
        ; line_number = 111
        ; global processed byte
processed equ globals___0+27
        ; line_number = 112
        ; global available byte
available equ globals___0+28

        ; # The field layout of a control mask byte is:
        ; #
        ; #  Bits   Name        Description
        ; #  0-3    Count       Execute command count - 1 times (i.e. 0 => execute once)
        ; #  4      Data Write  0 => Command Write(RS=0); 1=> Data Write(RS=1)
        ; #  5      NOP         No Operation 1=>ignore command; 0=>do command

        ; line_number = 121
        ; constant count_mask = 0x0f
count_mask equ 15
        ; line_number = 122
        ; constant data_write = 0x10
data_write equ 16
        ; line_number = 123
        ; constant command_write = 0
command_write equ 0
        ; line_number = 124
        ; constant nop_mask = 0x20
nop_mask equ 32

        ; line_number = 126
        ;info   126, 0
        ; procedure main
main:
        ; Initialize some registers
        movlw   7
        movwf   _cmcon
        movlw   32
        bsf     __rp0___byte, __rp0___bit
        movwf   _trisa
        movlw   6
        movwf   _trisb
        ; arguments_none
        ; line_number = 128
        ;  returns_nothing

        ; line_number = 130
        ;  local command byte
main__command equ globals___0+29
        ; line_number = 131
        ;  local temporary byte
main__temporary equ globals___0+30
        ; line_number = 132
        ;  local id_index byte
main__id_index equ globals___0+31

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>01 code:XX=cc=>XX)
        ; line_number = 134
        ;  call rb2bus_initialize(32)
        ;info   134, 7
        movlw   32
        bcf     __rp0___byte, __rp0___bit
        call    rb2bus_initialize

        ; line_number = 136
        ;  column := 0
        ;info   136, 10
        clrf    column
        ; line_number = 137
        ;  line := 0
        ;info   137, 11
        clrf    line
        ; line_number = 138
        ;  cursor_mode := 3
        ;info   138, 12
        movlw   3
        movwf   cursor_mode
        ; line_number = 139
        ;  shift := 0
        ;info   139, 14
        clrf    shift
        ; line_number = 140
        ;  processed := 0
        ;info   140, 15
        clrf    processed
        ; line_number = 141
        ;  available := 0
        ;info   141, 16
        clrf    available
        ; line_number = 142
        ;  font_address := 0
        ;info   142, 17
        clrf    font_address

        ; line_number = 144
        ;  id_index := 0
        ;info   144, 18
        clrf    main__id_index

        ; # Initialize the LCD:
        ; line_number = 147
        ;  call lcd_init()
        ;info   147, 19
        call    lcd_init

        ; # Output the message:
        ; line_number = 150
        ;  call line_put(0, '1')
        ;info   150, 20
        clrf    line_put__new_line
        movlw   49
        call    line_put
        ; line_number = 151
        ;  call line_put(1, '2')
        ;info   151, 23
        movlw   1
        movwf   line_put__new_line
        movlw   50
        call    line_put
        ; line_number = 152
        ;  call line_put(2, '3')
        ;info   152, 27
        movlw   2
        movwf   line_put__new_line
        movlw   51
        call    line_put
        ; line_number = 153
        ;  call line_put(3, '4')
        ;info   153, 31
        movlw   3
        movwf   line_put__new_line
        movlw   52
        call    line_put
        ; line_number = 154
        ;  line := 0
        ;info   154, 35
        clrf    line

        ; #call lcd_command(0x80)

        ; line_number = 158
        ;  loop_forever start
main__1:
        ; #call delay()
        ; line_number = 160
        ;  do_nothing
        ;info   160, 36

        ; line_number = 158
        ;  loop_forever wrap-up
        goto    main__1
        ; line_number = 158
        ;  loop_forever done
        ; line_number = 162
        ; loop_forever start
main__2:
        ; # Make sure that we have been selected:
        ; line_number = 164
        ;  rb2bus_error := _true
        ;info   164, 37
        bsf     rb2bus_error___byte, rb2bus_error___bit
        ; line_number = 165
        ;  while rb2bus_error start
main__3:
        ;info   165, 38
        ; =>bit_code_emit@symbol(): sym=rb2bus_error
        ; No 1TEST: true.size=4 false.size=0
        ; No 2TEST: true.size=4 false.size=0
        ; 1GOTO: Single test with GOTO
        btfss   rb2bus_error___byte, rb2bus_error___bit
        goto    main__4
        ; line_number = 166
        ; call rb2bus_select_wait()
        ;info   166, 40
        call    rb2bus_select_wait
        ; line_number = 167
        ;  command := rb2bus_byte_get()
        ;info   167, 41
        call    rb2bus_byte_get
        movwf   main__command

        goto    main__3
        ; Recombine size1 = 0 || size2 = 0
main__4:
        ; line_number = 165
        ;  while rb2bus_error done
        ; # Zero the command queue:
        ; line_number = 170
        ;  available := 0
        ;info   170, 44
        clrf    available
        ; line_number = 171
        ;  processed := 0
        ;info   171, 45
        clrf    processed

        ; # Dispatch on the command:
        ; line_number = 174
        ;  switch command >> 6 start
        ;info   174, 46
        ; switch_before:(data:00=uu=>00 code:XX=cc=>XX) size=9
        movlw   main__16>>8
        movwf   __pclath
main__17 equ globals___0+47
        swapf   main__command,w
        movwf   main__17
        rrf     main__17,f
        rrf     main__17,w
        andlw   3
        ; switch after expression:(data:00=uu=>00 code:XX=cc=>XX)
        addlw   main__16
        movwf   __pcl
        ; page_group 4
main__16:
        goto    main__18
        goto    main__18
        goto    main__18
        goto    main__15
        ; line_number = 175
        ; case 3
main__15:
        ; line_number = 176
        ; switch (command >> 3) & 7 start
        ;info   176, 59
        ; switch_before:(data:XX=cc=>XX code:XX=cc=>XX) size=0
        movlw   main__12>>8
        movwf   __pclath
main__13 equ globals___0+47
        rrf     main__command,w
        movwf   main__13
        rrf     main__13,f
        rrf     main__13,w
        andlw   7
        ; switch after expression:(data:00=uu=>00 code:XX=cc=>XX)
        addlw   main__12
        movwf   __pcl
        ; page_group 8
main__12:
        goto    main__14
        goto    main__14
        goto    main__14
        goto    main__14
        goto    main__14
        goto    main__14
        goto    main__14
        goto    main__11
        ; line_number = 177
        ; case 7
main__11:
        ; line_number = 178
        ; switch command & 7 start
        ;info   178, 76
        ; switch_before:(data:XX=cc=>XX code:XX=cc=>XX) size=0
        movlw   main__9>>8
        movwf   __pclath
        movlw   7
        andwf   main__command,w
        ; switch after expression:(data:00=uu=>00 code:XX=cc=>XX)
        addlw   main__9
        movwf   __pcl
        ; page_group 8
main__9:
        goto    main__10
        goto    main__10
        goto    main__10
        goto    main__10
        goto    main__10
        goto    main__6
        goto    main__7
        goto    main__8
        ; line_number = 179
        ; case 5
main__6:
        ; # 1111 1101 (Id_next):
        ; line_number = 181
        ;  if id_index < id.size start
        ;info   181, 90
        movlw   21
        subwf   main__id_index,w
        ; =>bit_code_emit@symbol(): sym=__c
        ; No 1TEST: true.size=0 false.size=4
        ; No 2TEST: true.size=0 false.size=4
        ; 1GOTO: Single test with GOTO
        btfsc   __c___byte, __c___bit
        goto    main__5
        ; line_number = 182
        ; call rb2bus_byte_put(id[id_index])
        ;info   182, 94
        movf    main__id_index,w
        call    id
        call    rb2bus_byte_put
        ; line_number = 183
        ;  id_index := id_index + 1
        ;info   183, 97
        incf    main__id_index,f
main__5:
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 181
        ;  if id_index < id.size done
        goto    main__10
        ; line_number = 184
        ; case 6
main__7:
        ; # 1111 1110 (Id_start):
        ; line_number = 186
        ;  id_index := 0
        ;info   186, 99
        clrf    main__id_index
        goto    main__10
        ; line_number = 187
        ; case 7
main__8:
        ; # 1111 1111 (Deselect):
        ; line_number = 189
        ;  call rb2bus_deselect()
        ;info   189, 101
        call    rb2bus_deselect


main__10:
        ; line_number = 178
        ; switch command & 7 done
main__14:
        ; line_number = 176
        ; switch (command >> 3) & 7 done
main__18:
        ; line_number = 174
        ;  switch command >> 6 done
        ; line_number = 162
        ; loop_forever wrap-up
        goto    main__2
        ; line_number = 162
        ; loop_forever done
        ; delay after procedure statements=non-uniform




        ; #	  case 0
        ; #	    # 00xx xxxx:
        ; #	    switch (command >> 3) & 7
        ; #	      case 1
        ; #		# 0000 1xxx:
        ; #		switch command & 7
        ; #		  case_maximum 7
        ; #		  case 0
        ; #		    # 0000 1000 (Back Space):
        ; #		    if column != 0
        ; #			column := column - 1
        ; #		  case 2
        ; #		    # 0000 1010 (Line Feed):
        ; #		    line := (line + 1) & line_mask
        ; #		    column := 0
        ; #		    # Force cursor to correct location:
        ; #		    call cursor_enqueue()
        ; #
        ; #		    # Write out 16 spaces:
        ; #		    call enqueue(data_write | (16 - 1), ' ')
        ; #		    # There are now 2 commands in queue:
        ; #		  case 4
        ; #		    # 0000 1100 (Form Feed):
        ; #
        ; #		    # Clear the display:
        ; #		    call enqueue(command_write, 0)
        ; #		    # The clear display command takes 1.53mS;
        ; #		    # 12 * .138 = 1.656mS.
        ; #		    call enqueue(nop_mask | (12 - 1), 0)
        ; #		    line := 0
        ; #		    column := 0
        ; #		    shift := 0
        ; #		  case 5
        ; #		    # 0000 1101 (Carriage Return):
        ; #		    column := 0
        ; #		    line := 0
        ; #		call cursor_enqueue()
        ; #	      case 0, 4, 5, 6, 7
        ; #		# 0000 0xxx or 001x xxxx:
        ; #		call character_put(command)
        ; #	  case 1
        ; #	    # 01xx xxxx:
        ; #	    call character_put(command)
        ; #	  case 2
        ; #	    # 10xx xxxx:
        ; #	    switch (command >> 3) & 7
        ; #	      case_maximum 7
        ; #	      case 0
        ; #		# 1000 0xxx:
        ; #		line := command & line_mask
        ; #		column := 0
        ; #		if command@2
        ; #		    # Clear the line:
        ; #		    call cursor_enqueue()
        ; #		    call enqueue(data_write | (16 - 1), ' ')
        ; #		    do_nothing
        ; #		call cursor_enqueue()
        ; #	      case 1
        ; #		# 1000 1xxx:
        ; #		switch command & 7
        ; #		  case 0, 1, 2, 3
        ; #		    # 1000 10vb (Cursor Mode Set):
        ; #		    cursor_mode := command & cursor_mode_mask
        ; #		    call enqueue(command_write, 0xc | cursor_mode)
        ; #		  case 4
        ; #		    # 1000 1100 (Cursor Mode Read):
        ; #		    temporary := cursor_mode
        ; #		    temporary@2 := 1
        ; #		    if lines34
        ; #			temporary@3 := 1
        ; #		    call byte_put(temporary)
        ; #		  case 5
        ; #		    # 1000 1101 (Character Read):
        ; #		    temporary := lcd_read()
        ; #		    call byte_put(temporary)
        ; #		    if column = 15
        ; #			line := (line + 1) & line_mask
        ; #			column := 0
        ; #		    else
        ; #		        column := column + 1
        ; #		    call cursor_enqueue()
        ; #		  case 6
        ; #		    # 1000 1110 (Line Read):
        ; #		    call byte_put(line)
        ; #		  case 7
        ; #		    # 1000 1111 (Column Read):
        ; #		    call byte_put(column)
        ; #	      case 2, 3
        ; #		# 1001 xxxx (Column Set):
        ; #		column := command & column_mask
        ; #		call cursor_enqueue()
        ; #	      case 4, 5
        ; #		# 1010 xxxx (Column Set and Clear):
        ; #		column := column & column_mask
        ; #		call cursor_enqueue()
        ; #		call enqueue(data_write | (16 - column), ' ')
        ; #		call cursor_enqueue()
        ; #	      case 6
        ; #		# 1011 0xxx:
        ; #		switch command & 7
        ; #		  case_maximum 7
        ; #		  case 0
        ; #		    # 1011 0000 (Set Font Address):
        ; #		    font_address := byte_get() & 0x1f
        ; #		  case 1
        ; #		    # 1011 0001 (Read Font Address):
        ; #		    call byte_put(font_address)
        ; #		  case 2
        ; #		    # 1011 0010 (Read Font Line):
        ; #		    # Set the font address, and access font memory:
        ; #		    call lcd_command(0x40 | font_address)
        ; #		    # Read the data:
        ; #		    temporary := lcd_read()
        ; #		    # Force back to display memory:
        ; #		    call cursor_position()
        ; #		    font_address := font_address + 1
        ; #		    # Ship the data back:
        ; #		    call byte_put(temporary)

        ; #	      case 0, 1, 2, 3
        ; #		# 110p pppp (Write Font Line):
        ; #		# Set font address and access font memory:
        ; #		call enqueue(command_write, 0x40 | font_address)
        ; #		# Write one line of font memory:
        ; #		call enqueue(data_write, command & 0x1f)
        ; #		# Force back to display memory:
        ; #		call cursor_enqueue()
        ; #		font_address := font_address + 1


        ; line_number = 322
        ;info   322, 103
        ; procedure line_put
line_put:
        ; Last argument is sitting in W; save into argument variable
        movwf   line_put__character
        ; delay=4294967295
        ; line_number = 323
        ; argument new_line byte
line_put__new_line equ globals___0+32
        ; line_number = 324
        ; argument character byte
line_put__character equ globals___0+33
        ; line_number = 325
        ;  returns_nothing

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 327
        ;  line := new_line
        ;info   327, 104
        movf    line_put__new_line,w
        movwf   line
        ; line_number = 328
        ;  column := 0
        ;info   328, 106
        clrf    column
        ; line_number = 329
        ;  call cursor_position()
        ;info   329, 107
        call    cursor_position
        ; line_number = 330
        ;  loop_exactly 16 start
        ;info   330, 108
line_put__1 equ globals___0+48
        movlw   16
        movwf   line_put__1
line_put__2:
        ; line_number = 331
        ; call lcd_character_put(character)
        ;info   331, 110
        movf    line_put__character,w
        call    lcd_character_put


        ; line_number = 330
        ;  loop_exactly 16 wrap-up
        decfsz  line_put__1,f
        goto    line_put__2
        ; line_number = 330
        ;  loop_exactly 16 done
        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 334
        ;info   334, 115
        ; procedure character_put
character_put:
        ; Last argument is sitting in W; save into argument variable
        movwf   character_put__character
        ; delay=4294967295
        ; line_number = 335
        ; argument character byte
character_put__character equ globals___0+34
        ; line_number = 336
        ;  returns_nothing

        ; # This procedure will output {character} to the display
        ; # and update the {line} and {position} global variables.
        ; # If the cursor is in the column 15, it is either kept
        ; # there (normal mode) or advanced to the next line in column
        ; # 0 (debug mode).  This procedure enqueues a total of three
        ; # commands onto the command queue.

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 345
        ;  call cursor_enqueue()
        ;info   345, 116
        call    cursor_enqueue
        ; line_number = 346
        ;  call enqueue(data_write, character)
        ;info   346, 117
        movlw   16
        movwf   enqueue__control
        movf    character_put__character,w
        call    enqueue
        ; line_number = 347
        ;  if column = column_mask start
        ;info   347, 121
        ; Left minus Right
        movlw   241
        addwf   column,w
        ; =>bit_code_emit@symbol(): sym=__z
        ; No 1TEST: true.size=4 false.size=1
        ; No 2TEST: true.size=4 false.size=1
        ; 2GOTO: Single test with two GOTO's
        btfss   __z___byte, __z___bit
        goto    character_put__1
        ; # Advance to next line:
        ; line_number = 349
        ;  column := 0
        ;info   349, 125
        clrf    column
        ; line_number = 350
        ;  line := (line + 1) & line_mask
        ;info   350, 126
        incf    line,w
        andlw   3
        movwf   line
        goto    character_put__2
        ; 2GOTO: Starting code 2
character_put__1:
        ; # Advance to next column:
        ; line_number = 353
        ;  column := column + 1
        ;info   353, 130
        incf    column,f
character_put__2:
        ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 347
        ;  if column = column_mask done
        ; line_number = 354
        ; call cursor_enqueue()
        ;info   354, 131
        call    cursor_enqueue
        ; # A total of 3 commands are enqueued:


        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 358
        ;info   358, 133
        ; procedure cursor_enqueue
cursor_enqueue:
        ; arguments_none
        ; line_number = 360
        ;  returns_nothing

        ; # This procedure will ensure that a command that forces the cursor
        ; # to the correct location specified by the global variables {line}
        ; # and {column}.

        ; line_number = 366
        ;  local command byte
cursor_enqueue__command equ globals___0+35

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 368
        ;  command := 0x80
        ;info   368, 133
        movlw   128
        movwf   cursor_enqueue__command
        ; line_number = 369
        ;  if line@0 start
        ;info   369, 135
cursor_enqueue__select__1___byte equ line
cursor_enqueue__select__1___bit equ 0
        ; =>bit_code_emit@symbol(): sym=cursor_enqueue__select__1
        ; 1TEST: Single test with code in skip slot
        btfsc   cursor_enqueue__select__1___byte, cursor_enqueue__select__1___bit
        ; line_number = 370
        ; command := command | 0x40
        ;info   370, 136
        bsf     cursor_enqueue__command, 6
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 369
        ;  if line@0 done
        ; line_number = 371
        ; if line@1 start
        ;info   371, 137
cursor_enqueue__select__2___byte equ line
cursor_enqueue__select__2___bit equ 1
        ; =>bit_code_emit@symbol(): sym=cursor_enqueue__select__2
        ; 1TEST: Single test with code in skip slot
        btfsc   cursor_enqueue__select__2___byte, cursor_enqueue__select__2___bit
        ; line_number = 372
        ; command := command | 0x10
        ;info   372, 138
        bsf     cursor_enqueue__command, 4
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 371
        ; if line@1 done
        ; line_number = 373
        ; call enqueue(command_write, command | column)
        ;info   373, 139
        clrf    enqueue__control
        movf    cursor_enqueue__command,w
        iorwf   column,w
        call    enqueue


        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 376
        ;info   376, 144
        ; procedure cursor_position
cursor_position:
        ; arguments_none
        ; line_number = 378
        ;  returns_nothing

        ; # This prodedure will force the cursor to the location specified
        ; # by the globals variables {line} and {position}.

        ; line_number = 383
        ;  local command byte
cursor_position__command equ globals___0+36

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 385
        ;  command := 0x80
        ;info   385, 144
        movlw   128
        movwf   cursor_position__command
        ; line_number = 386
        ;  if line@0 start
        ;info   386, 146
cursor_position__select__1___byte equ line
cursor_position__select__1___bit equ 0
        ; =>bit_code_emit@symbol(): sym=cursor_position__select__1
        ; 1TEST: Single test with code in skip slot
        btfsc   cursor_position__select__1___byte, cursor_position__select__1___bit
        ; line_number = 387
        ; command := command | 0x40
        ;info   387, 147
        bsf     cursor_position__command, 6
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 386
        ;  if line@0 done
        ; line_number = 388
        ; if line@1 start
        ;info   388, 148
cursor_position__select__2___byte equ line
cursor_position__select__2___bit equ 1
        ; =>bit_code_emit@symbol(): sym=cursor_position__select__2
        ; 1TEST: Single test with code in skip slot
        btfsc   cursor_position__select__2___byte, cursor_position__select__2___bit
        ; line_number = 389
        ; command := command | 0x10
        ;info   389, 149
        bsf     cursor_position__command, 4
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 388
        ; if line@1 done
        ; line_number = 390
        ; command := command | column
        ;info   390, 150
        movf    column,w
        iorwf   cursor_position__command,f
        ; line_number = 391
        ;  call lcd_command(command)
        ;info   391, 152
        movf    cursor_position__command,w
        call    lcd_command


        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 394
        ;info   394, 155
        ; procedure lcd_command
lcd_command:
        ; Last argument is sitting in W; save into argument variable
        movwf   lcd_command__command
        ; delay=1
        ; line_number = 395
        ; argument command byte
lcd_command__command equ globals___0+37
        ; line_number = 396
        ;  returns_nothing
        ; line_number = 397
        ;  exact_delay 52 * microsecond

        ; # This procedure will strobe {command} into the LCD controller
        ; # as two 4-bit nibbles.  The procedure delays by 52uS to ensure
        ; # the command has time to be digested by the LCD controller.

        ; # Send high nibble (RW=0 & RS=0):
        ; before procedure statements delay=1, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 404
        ;  call nibble_send(0, command >> 4)
        ; Delay at call is 1
        ;info   404, 156
        bcf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
lcd_command__1 equ globals___0+49
        swapf   lcd_command__command,w
        andlw   15
        call    nibble_send

        ; # Send low nibble (RW=0 & RS=0):
        ; line_number = 407
        ;  call nibble_send(0, command)
        ; Delay at call is 19
        ;info   407, 160
        bcf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
        movf    lcd_command__command,w
        call    nibble_send


        ; delay after procedure statements=36
        ; Delay 170 cycles
        ; Delay loop takes 42 * 4 = 168 cycles
        movlw   42
lcd_command__2:
        addlw   255
        btfss   __z___byte, __z___bit
        goto    lcd_command__2
        goto    lcd_command__3
lcd_command__3:
        ; Implied return
        retlw   0
        ; Final delay = 208




        ; line_number = 410
        ;info   410, 169
        ; procedure lcd_character_put
lcd_character_put:
        ; Last argument is sitting in W; save into argument variable
        movwf   lcd_character_put__character
        ; delay=1
        ; line_number = 411
        ; argument character byte
lcd_character_put__character equ globals___0+38
        ; line_number = 412
        ;  returns_nothing
        ; line_number = 413
        ;  exact_delay 52 * microsecond

        ; # This procedure will output {character} to the LCD display
        ; # and move the cursor right by one.

        ; # Send high nibble (RW=0 & RS=1):
        ; before procedure statements delay=1, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 419
        ;  call nibble_send(1, character >> 4)
        ; Delay at call is 1
        ;info   419, 170
        bsf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
lcd_character_put__1 equ globals___0+50
        swapf   lcd_character_put__character,w
        andlw   15
        call    nibble_send

        ; # Send low nibble (RW=0 & RS=1):
        ; line_number = 422
        ;  call nibble_send(1, character)
        ; Delay at call is 19
        ;info   422, 174
        bsf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
        movf    lcd_character_put__character,w
        call    nibble_send


        ; delay after procedure statements=36
        ; Delay 170 cycles
        ; Delay loop takes 42 * 4 = 168 cycles
        movlw   42
lcd_character_put__2:
        addlw   255
        btfss   __z___byte, __z___bit
        goto    lcd_character_put__2
        goto    lcd_character_put__3
lcd_character_put__3:
        ; Implied return
        retlw   0
        ; Final delay = 208




        ; line_number = 425
        ;info   425, 183
        ; procedure lcd_read
lcd_read:
        ; arguments_none
        ; line_number = 427
        ;  returns byte

        ; # Generic routine to read a byte from the LCD controller.

        ; line_number = 431
        ;  local result byte
lcd_read__result equ globals___0+39

        ; # First, turn DB4-7 into inputs:
        ; #_trisb := db4_mask | db5_mask | db6_mask | db7_mask
        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 435
        ;  _trisb := trisb_mask | db47_mask
        ;info   435, 183
        movlw   63
        bsf     __rp0___byte, __rp0___bit
        movwf   _trisb

        ; # Read high nibble:
        ; #_portb := rs_mask | rw_mask
        ; line_number = 439
        ;  rs := _true
        ;info   439, 186
        bcf     __rp0___byte, __rp0___bit
        bsf     rs___byte, rs___bit
        ; line_number = 440
        ;  rw := _true
        ;info   440, 188
        bsf     rw___byte, rw___bit
        ; line_number = 441
        ;  e := _true
        ;info   441, 189
        bsf     e___byte, e___bit
        ; line_number = 442
        ;  delay 43 * microsecond start
        ;info   442, 190
        ; Delay expression evaluates to 172
        ; line_number = 443
        ; do_nothing
        ;info   443, 190
        ; Delay 172 cycles
        ; Delay loop takes 43 * 4 = 172 cycles
        movlw   43
lcd_read__1:
        addlw   255
        btfss   __z___byte, __z___bit
        goto    lcd_read__1
        ; line_number = 442
        ;  delay 43 * microsecond done
        ; line_number = 444
        ; result := _portb << 4
        ;info   444, 194
        swapf   _portb,w
        movwf   lcd_read__result
        movlw   240
        andwf   lcd_read__result,f
        ; line_number = 445
        ;  e := _false
        ;info   445, 198
        bcf     e___byte, e___bit

        ; # Read low nibble:
        ; #_portb := rs_mask | rw_mask
        ; line_number = 449
        ;  rs := _true
        ;info   449, 199
        bsf     rs___byte, rs___bit
        ; line_number = 450
        ;  rw := _true
        ;info   450, 200
        bsf     rw___byte, rw___bit
        ; line_number = 451
        ;  e := _true
        ;info   451, 201
        bsf     e___byte, e___bit
        ; line_number = 452
        ;  result := result | (_portb & 0xf)
        ;info   452, 202
        movlw   15
        andwf   _portb,w
        iorwf   lcd_read__result,f
        ; line_number = 453
        ;  e := _false
        ;info   453, 205
        bcf     e___byte, e___bit

        ; # Return DB4-7 to outputs:
        ; #_trisb := 0
        ; line_number = 457
        ;  _trisb := trisb_mask
        ;info   457, 206
        movlw   48
        bsf     __rp0___byte, __rp0___bit
        movwf   _trisb

        ; line_number = 459
        ;  return result start
        ; line_number = 459
        ;info   459, 209
        bcf     __rp0___byte, __rp0___bit
        movf    lcd_read__result,w
        return  
        ; line_number = 459
        ;  return result done


        ; delay after procedure statements=non-uniform




        ; line_number = 462
        ;info   462, 212
        ; procedure enqueue
enqueue:
        ; Last argument is sitting in W; save into argument variable
        movwf   enqueue__data
        ; delay=4294967295
        ; line_number = 463
        ; argument control byte
enqueue__control equ globals___0+40
        ; line_number = 464
        ; argument data byte
enqueue__data equ globals___0+41
        ; line_number = 465
        ;  returns_nothing

        ; # This procedure will enqueue {control} and {data} onto the
        ; # command queue.  It is your responsibility to ensure that
        ; # the there is enough space in the queue.

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 471
        ;  data_queue[available] := data
        ;info   471, 213
        ; index_fsr_first
        movf    available,w
        addlw   data_queue
        movwf   __fsr
        movf    enqueue__data,w
        movwf   __indf
        ; line_number = 472
        ;  control_queue[available] := control
        ;info   472, 218
        ; index_fsr_first
        movf    available,w
        addlw   control_queue
        movwf   __fsr
        movf    enqueue__control,w
        movwf   __indf
        ; line_number = 473
        ;  available := available + 1
        ;info   473, 223
        incf    available,f


        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 476
        ;info   476, 225
        ; procedure lcd_delay
lcd_delay:
        ; Last argument is sitting in W; save into argument variable
        movwf   lcd_delay__amount
        ; delay=4294967295
        ; line_number = 477
        ; argument amount byte
lcd_delay__amount equ globals___0+42
        ; line_number = 478
        ;  returns_nothing

        ; # This procedure is designed to delay for 100uS times {amount}.

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 482
        ;  loop_exactly amount start
        ;info   482, 226
lcd_delay__1 equ globals___0+51
        movf    lcd_delay__amount,w
        movwf   lcd_delay__1
lcd_delay__2:
        ; line_number = 483
        ; delay (100 * microsecond) - 3 start
        ;info   483, 228
        ; Delay expression evaluates to 397
        ; line_number = 484
        ; do_nothing
        ;info   484, 228


        ; Delay 397 cycles
        ; Delay loop takes 99 * 4 = 396 cycles
        movlw   99
lcd_delay__3:
        addlw   255
        btfss   __z___byte, __z___bit
        goto    lcd_delay__3
        nop     
        ; line_number = 483
        ; delay (100 * microsecond) - 3 done
        ; line_number = 482
        ;  loop_exactly amount wrap-up
        decfsz  lcd_delay__1,f
        goto    lcd_delay__2
        ; line_number = 482
        ;  loop_exactly amount done
        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 487
        ;info   487, 236
        ; procedure lcd_init
lcd_init:
        ; arguments_none
        ; line_number = 489
        ;  returns_nothing

        ; # The LCD needs to be initialized into 4 bit mode and then
        ; # we can write letters to it. Note that the LCD is ALWAYS 
        ; # in write mode, no need to check to see if its busy, I just
        ; # wait and assume it isn't.
        ; #
        ; # According to the SAMSUNG data sheet, you first have to
        ; # wait 30+ mS to insure the display is "stable" after Vcc is
        ; # applied. Then the follow a specific sequence puts it into
        ; # "4 bit" mode.  However, I've noticed they assume that the
        ; # LCD is already in 8 bit mode, which it won't be following
        ; # a warm restart (resetting the PIC).  Further, if you ever
        ; # get "out of sync" and start sending the low nibble and then
        ; # the high nibble all heck breaks loose. So the INIT function
        ; # actually does three things:
        ; #	1) It waits 40mS for the display to initialize just
        ; #	   in case this was a power up event.
        ; #	2) Next it programs the display into 8 bit mode on
        ; #	   purpose. Even if it was in 4 bit mode already we
        ; #	   put the display in a "known" state.
        ; #	3) Finally, now that it knows what state the display
        ; #	   is in, it configures it for two line, 4 bit operation.
        ; #
        ; # This is a routine that clocks out two nibbles using the E clock and
        ; # then waits 100 uS.  The first commands we send it are 0x33 hex. We send
        ; # 0x33 followed by 0x32.  This has the effect of clocking out 0x3 to the
        ; # port at least 3 times, with the command bit (R/S) set.  This will ALWAYS
        ; # set us to 8 bit mode eventually.
        ; #
        ; # *  On power up we're already in 8 bit mode and 0x3 doesn't change that.
        ; # *  In 4 bit mode the first two nibbles will put you into 8 bit mode
        ; # *  Out of sync 4-bit mode, the first nibble finishes the low nybble of
        ; #    the previous command, and the next two put us into 8 bit mode.
        ; #
        ; # Once we are SURE we're in 4 bit mode, we can send commands through
        ; # the 4 bit interface, to finish initialization we send:
        ; # 	0x28 - Four bit mode, two line display, 5 x 8 font.
        ; #	0x08 - Turn off the display
        ; #	0x01 - Clear the display, reset the DDRAM pointer
        ; #	0x0E - Turn on the display, cursor, blink it, and don't shift.

        ; # Step 1: Wait for the LCD to initialize from Power on:
        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 532
        ;  loop_exactly 5 start
        ;info   532, 236
lcd_init__1 equ globals___0+52
        movlw   5
        movwf   lcd_init__1
lcd_init__2:
        ; line_number = 533
        ; call lcd_delay(100)
        ;info   533, 238
        movlw   100
        call    lcd_delay

        ; line_number = 532
        ;  loop_exactly 5 wrap-up
        decfsz  lcd_init__1,f
        goto    lcd_init__2
        ; line_number = 532
        ;  loop_exactly 5 done
        ; # Step 2: Put the LCD in a "known" mode.

        ; # "8-bit mode"; R/W = 0, RS = 0, DB7 - DB4 = 0x03:
        ; line_number = 538
        ;  call nibble_send(0, 0x03)
        ;info   538, 242
        bcf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
        movlw   3
        call    nibble_send
        ; line_number = 539
        ;  call lcd_delay(1)
        ;info   539, 245
        movlw   1
        call    lcd_delay

        ; # If in 4 bit mode this is the "low nibble":
        ; line_number = 542
        ;  call nibble_send(0, 0x03)
        ;info   542, 247
        bcf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
        movlw   3
        call    nibble_send
        ; line_number = 543
        ;  call lcd_delay(1)
        ;info   543, 250
        movlw   1
        call    lcd_delay


        ; # If out of sync this is the low nybble in 4 bit mode:
        ; line_number = 547
        ;  call nibble_send(0, 0x03)
        ;info   547, 252
        bcf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
        movlw   3
        call    nibble_send
        ; line_number = 548
        ;  call lcd_delay(1)
        ;info   548, 255
        movlw   1
        call    lcd_delay

        ; # Finally we can ask for 4 bit mode:
        ; line_number = 551
        ;  call nibble_send(0, 0x02)
        ;info   551, 257
        bcf     nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
        movlw   2
        call    nibble_send
        ; line_number = 552
        ;  call lcd_delay(1)
        ;info   552, 260
        movlw   1
        call    lcd_delay

        ; # Now its in 4 bit mode and we have to send double nibbles each
        ; # time. Fortunately we can use a subroutine for this.

        ; # FUNCTION SET - 4-bit, 2 lines, 5x8 font:
        ; line_number = 558
        ;  call lcd_command(0x28)
        ;info   558, 262
        movlw   40
        call    lcd_command

        ; # AGAIN : FUNCTION SET - 4-bit, 2 lines, 5x8 font:
        ; # Sending this command twice, *does* work.
        ; line_number = 562
        ;  call lcd_command(0x28)
        ;info   562, 264
        movlw   40
        call    lcd_command

        ; # Turn off the display temporarily:
        ; line_number = 565
        ;  call lcd_command(0x08)
        ;info   565, 266
        movlw   8
        call    lcd_command

        ; # Clear the display:
        ; line_number = 568
        ;  call lcd_command(0x01)
        ;info   568, 268
        movlw   1
        call    lcd_command
        ; line_number = 569
        ;  call lcd_delay(20)
        ;info   569, 270
        movlw   20
        call    lcd_delay

        ; # Turn the display back on with Cursor:
        ; line_number = 572
        ;  call lcd_command(0x0f)
        ;info   572, 272
        movlw   15
        call    lcd_command

        ; # Set shift mode:
        ; line_number = 575
        ;  call lcd_command(0x06)
        ;info   575, 274
        movlw   6
        call    lcd_command


        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 578
        ;info   578, 277
        ; procedure delay
delay:
        ; arguments_none
        ; line_number = 580
        ;  returns_nothing

        ; # This procedure delays by 1/3 of a bit time.

        ; # This procedure processes the command queue commands that have
        ; # been set up by the main() procedure.  If there are no more
        ; # commands in the queue, we figure out whether or not the
        ; # line switch requires any display shifting.
        ; #
        ; # The entire command queue from main() will be emptied before
        ; # the next command comes in.  The reasoning for this is because
        ; # most top level commands only take two or three LCD commands.
        ; # A clear display command takes 1.53mS, a total of 12 calls to
        ; #  delay() (12 * 138uS = 1.56mS).  A line clear takes a few
        ; # overhead commands followed by 16 data writes.  Since a command
        ; # byte requites 9-2/3 bits, 29 calls to delay will occur.  Thus,
        ; # we are safe.  The display shifting stuff can take place last,
        ; # since it has no time criticalities.
        ; #
        ; # What this all means is we can set up a simple queue of
        ; # instructions to be executed by the delay() procedure.
        ; # The main() procedure fills the queue and the delay()
        ; # procedure empties it.  We do not have to be very sophisticated,
        ; # the queue will be empty before the next time main()
        ; # gets around to filling it.

        ; line_number = 606
        ;  local control byte
delay__control equ globals___0+43
        ; line_number = 607
        ;  local data byte
delay__data equ globals___0+44
        ; line_number = 608
        ;  local do_it bit
delay__do_it___byte equ globals___0+79
delay__do_it___bit equ 4
        ; line_number = 609
        ;  local count byte
delay__count equ globals___0+45

        ; # Kick the dog:
        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 612
        ;  watch_dog_reset done
        ;info   612, 277
        clrwdt  

        ; line_number = 614
        ;  do_it := _false
        ;info   614, 278
        bcf     delay__do_it___byte, delay__do_it___bit
        ; line_number = 615
        ;  if processed < available start
        ;info   615, 279
        movf    available,w
        subwf   processed,w
        ; =>bit_code_emit@symbol(): sym=__c
        ; No 1TEST: true.size=20 false.size=29
        ; No 2TEST: true.size=20 false.size=29
        ; 2GOTO: Single test with two GOTO's
        btfss   __c___byte, __c___bit
        goto    delay__6
        ; # Make sure that the proper lines are visible:
        ; line_number = 632
        ;  if lines34 start
        ;info   632, 283
        ; =>bit_code_emit@symbol(): sym=lines34
        ; No 1TEST: true.size=9 false.size=8
        ; No 2TEST: true.size=9 false.size=8
        ; 2GOTO: Single test with two GOTO's
        btfss   lines34___byte, lines34___bit
        goto    delay__3
        ; # Make sure that lines 3-4 are displayed:
        ; line_number = 634
        ;  if shift < 16 start
        ;info   634, 285
        movlw   16
        subwf   shift,w
        ; =>bit_code_emit@symbol(): sym=__c
        ; No 1TEST: true.size=0 false.size=5
        ; No 2TEST: true.size=0 false.size=5
        ; 1GOTO: Single test with GOTO
        btfsc   __c___byte, __c___bit
        goto    delay__2
        ; # Lines 3-4 are not completely visible yet; shift left by 1:
        ; line_number = 636
        ;  data := 0x18
        ;info   636, 289
        movlw   24
        movwf   delay__data
        ; line_number = 637
        ;  control := command_write
        ;info   637, 291
        clrf    delay__control
        ; line_number = 638
        ;  shift := shift + 1
        ;info   638, 292
        incf    shift,f
        ; line_number = 639
        ;  do_it := _true
        ;info   639, 293
        bsf     delay__do_it___byte, delay__do_it___bit
delay__2:
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 634
        ;  if shift < 16 done
        goto    delay__4
        ; 2GOTO: Starting code 2
delay__3:
        ; # Make sure that lines 1-2 are displayed:
        ; line_number = 642
        ;  if shift != 0 start
        ;info   642, 295
        ; Left minus Right
        movf    shift,w
        ; =>bit_code_emit@symbol(): sym=__z
        ; No 1TEST: true.size=0 false.size=5
        ; No 2TEST: true.size=0 false.size=5
        ; 1GOTO: Single test with GOTO
        btfsc   __z___byte, __z___bit
        goto    delay__1
        ; # Lines 1-2 are not completely visible yet; shift right by 1:
        ; line_number = 644
        ;  data := 0x1c
        ;info   644, 298
        movlw   28
        movwf   delay__data
        ; line_number = 645
        ;  control := command_write
        ;info   645, 300
        clrf    delay__control
        ; line_number = 646
        ;  shift := shift - 1
        ;info   646, 301
        decf    shift,f
        ; line_number = 647
        ;  do_it := _true
        ;info   647, 302
        bsf     delay__do_it___byte, delay__do_it___bit

delay__1:
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 642
        ;  if shift != 0 done
delay__4:
        ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 632
        ;  if lines34 done
        goto    delay__7
        ; 2GOTO: Starting code 2
delay__6:
        ; # We have commands in queue to execute:
        ; line_number = 617
        ;  control := control_queue[processed]
        ;info   617, 304
        movf    processed,w
        addlw   control_queue
        movwf   __fsr
        movf    __indf,w
        movwf   delay__control
        ; line_number = 618
        ;  data := data_queue[processed]
        ;info   618, 309
        movf    processed,w
        addlw   data_queue
        movwf   __fsr
        movf    __indf,w
        movwf   delay__data

        ; # Figure out whether to actually process this command:
        ; line_number = 621
        ;  if control & nop_mask = 0 start
        ;info   621, 314
        ; Left minus Right
        movlw   32
        andwf   delay__control,w
        ; =>bit_code_emit@symbol(): sym=__z
        ; 1TEST: Single test with code in skip slot
        btfsc   __z___byte, __z___bit
        ; line_number = 622
        ; do_it := _true
        ;info   622, 317
        bsf     delay__do_it___byte, delay__do_it___bit

        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 621
        ;  if control & nop_mask = 0 done
        ; # Process count:
        ; line_number = 625
        ;  count := control & count_mask
        ;info   625, 318
        movlw   15
        andwf   delay__control,w
        movwf   delay__count
        ; line_number = 626
        ;  control_queue[processed] := control & 0xf0 | (count - 1)
        ;info   626, 321
        ; index_fsr_first
        movf    processed,w
        addlw   control_queue
        movwf   __fsr
delay__5 equ globals___0+53
        movlw   240
        andwf   delay__control,w
        movwf   delay__5
        decf    delay__count,w
        iorwf   delay__5,w
        movwf   __indf
        ; line_number = 627
        ;  if count = 0 start
        ;info   627, 330
        ; Left minus Right
        movf    delay__count,w
        ; =>bit_code_emit@symbol(): sym=__z
        ; 1TEST: Single test with code in skip slot
        btfsc   __z___byte, __z___bit
        ; # Advance to next command:
        ; line_number = 629
        ;  processed := processed + 1
        ;info   629, 332
        incf    processed,f
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 627
        ;  if count = 0 done
delay__7:
        ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 615
        ;  if processed < available done
        ; line_number = 649
        ; if do_it start
        ;info   649, 333
        ; =>bit_code_emit@symbol(): sym=delay__do_it
        ; No 1TEST: true.size=28 false.size=0
        ; No 2TEST: true.size=28 false.size=0
        ; 1GOTO: Single test with GOTO
        btfss   delay__do_it___byte, delay__do_it___bit
        goto    delay__8
        ; # Note that {data_write} = {rs_mask}:

        ; # Send high nibble (RW=0):
        ; #_portb := control & rs_mask | data >> 4
        ; #_portb := data >> 4
        ; #call db47_set(data >> 4)
        ; line_number = 656
        ;  _portb := data & 0xf0
        ;info   656, 335
        movlw   240
        andwf   delay__data,w
        movwf   _portb
        ; line_number = 657
        ;  rw := _false
        ;info   657, 338
        bcf     rw___byte, rw___bit
        ; line_number = 658
        ;  rs := _false
        ;info   658, 339
        bcf     rs___byte, rs___bit
        ; line_number = 659
        ;  if control & data_write != 0 start
        ;info   659, 340
        ; Left minus Right
        movlw   16
        andwf   delay__control,w
        ; =>bit_code_emit@symbol(): sym=__z
        ; 1TEST: Single test with code in skip slot
        btfss   __z___byte, __z___bit
        ; line_number = 660
        ; rs := _true
        ;info   660, 343
        bsf     rs___byte, rs___bit
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 659
        ;  if control & data_write != 0 done
        ; line_number = 661
        ; rs := _true
        ;info   661, 344
        bsf     rs___byte, rs___bit
        ; line_number = 662
        ;  e := _true
        ;info   662, 345
        bsf     e___byte, e___bit
        ; line_number = 663
        ;  e := _false
        ;info   663, 346
        bcf     e___byte, e___bit

        ; # Send low nibble (RW=0):
        ; #_portb := control & rs_mask | data & 0xf
        ; line_number = 667
        ;  _portb := control | (data & 0xf)
        ;info   667, 347
        movlw   15
        andwf   delay__data,w
        iorwf   delay__control,w
        movwf   _portb
        ; #call db47_set(data)
        ; line_number = 669
        ;  _portb := data << 4
        ;info   669, 351
        swapf   delay__data,w
        movwf   _portb
        movlw   240
        andwf   _portb,f
        ; line_number = 670
        ;  rw := _false
        ;info   670, 355
        bcf     rw___byte, rw___bit
        ; line_number = 671
        ;  rs := _false
        ;info   671, 356
        bcf     rs___byte, rs___bit
        ; line_number = 672
        ;  if control & data_write != 0 start
        ;info   672, 357
        ; Left minus Right
        movlw   16
        andwf   delay__control,w
        ; =>bit_code_emit@symbol(): sym=__z
        ; 1TEST: Single test with code in skip slot
        btfss   __z___byte, __z___bit
        ; line_number = 673
        ; rs := _true
        ;info   673, 360
        bsf     rs___byte, rs___bit
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 672
        ;  if control & data_write != 0 done
        ; line_number = 674
        ; e := _true
        ;info   674, 361
        bsf     e___byte, e___bit
        ; line_number = 675
        ;  e := _false
        ;info   675, 362
        bcf     e___byte, e___bit

        ; # The delay() procedure is 138uS which is much greater than
        ; # 39uS - 43uS that commands take.  We do not have to do any
        ; # further action for command delay.

        ; Recombine size1 = 0 || size2 = 0
delay__8:
        ; line_number = 649
        ; if do_it done
        ; # We are all done:


        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 684
        ;info   684, 364
        ; procedure nibble_send
nibble_send:
        ; Last argument is sitting in W; save into argument variable
        movwf   nibble_send__nibble
        ; delay=1
        ; line_number = 685
        ; argument rs_mode bit
nibble_send__rs_mode___byte equ globals___0+79
nibble_send__rs_mode___bit equ 5
        ; line_number = 686
        ; argument nibble byte
nibble_send__nibble equ globals___0+46
        ; line_number = 687
        ;  returns_nothing
        ; line_number = 688
        ;  exact_delay 13

        ; # This procedure will send the low order 4 bits of {nibble}
        ; # to the LCD controller with RS set to {rs_mode} and RW set
        ; # to 0.

        ; # Get {db4}, {db5}, {db6}, and {db7} set up:
        ; before procedure statements delay=1, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 695
        ;  _portb := nibble << 4
        ; Delay at assignment is 1
        ;info   695, 365
        swapf   nibble_send__nibble,w
        movwf   _portb
        movlw   240
        andwf   _portb,f

        ; # Set up the control lines:
        ; line_number = 698
        ;  rw := _false
        ; Delay at assignment is 5
        ;info   698, 369
        bcf     rw___byte, rw___bit
        ; line_number = 699
        ;  rs := _false
        ; Delay at assignment is 6
        ;info   699, 370
        bcf     rs___byte, rs___bit
        ; line_number = 700
        ;  if rs_mode start
        ; Delay at if is 7
        ;info   700, 371
        ; =>bit_code_emit@symbol(): sym=nibble_send__rs_mode
        ; 1TEST: Single test with code in skip slot
        btfsc   nibble_send__rs_mode___byte, nibble_send__rs_mode___bit
        ; line_number = 701
        ; rs := _true
        ; Delay at assignment is 0
        ;info   701, 372
        bsf     rs___byte, rs___bit

        ; if final true delay=1 false delay=0 code delay=9
        ; line_number = 700
        ;  if rs_mode done
        ; # Toggle {e} to clock the data into the LCD controller.
        ; line_number = 704
        ;  e := _true
        ; Delay at assignment is 9
        ;info   704, 373
        bsf     e___byte, e___bit
        ; line_number = 705
        ;  e := _false
        ; Delay at assignment is 10
        ;info   705, 374
        bcf     e___byte, e___bit


        ; delay after procedure statements=11
        ; Delay 0 cycles
        ; Implied return
        retlw   0
        ; Final delay = 13




        ; line_number = 708
        ;info   708, 376
        ; procedure wait
wait:
        ; arguments_none
        ; line_number = 710
        ;  returns_nothing

        ; # This procedure will do any background processing.

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 714
        ;  do_nothing
        ;info   714, 376


        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 717
        ; string id = "\16,0,32,1,3,7\LCD32-A\7\Gramson" start
        ; id = '\16,0\ \1,3,7\LCD32-A\7\Gramson'
id:
        ; Temporarily save index into FSR
        movwf   __fsr
        ; Initialize PCLATH to point to this code page
        movlw   id___base>>8
        movwf   __pclath
        ; Restore index from FSR
        movf    __fsr,w
        addlw   id___base
        ; Index to the correct return value
        movwf   __pcl
        ; page_group 21
id___base:
        retlw   16
        retlw   0
        retlw   32
        retlw   1
        retlw   3
        retlw   7
        retlw   76
        retlw   67
        retlw   68
        retlw   51
        retlw   50
        retlw   45
        retlw   65
        retlw   7
        retlw   71
        retlw   114
        retlw   97
        retlw   109
        retlw   115
        retlw   111
        retlw   110
        ; line_number = 717
        ; string id = "\16,0,32,1,3,7\LCD32-A\7\Gramson" start


        ; Appending 8 delayed procedures to code bank 0
        ; buffer = 'rb2bus'
        ; line_number = 57
        ;info   57, 404
        ; procedure rb2bus_select_wait
rb2bus_select_wait:
        ; arguments_none
        ; line_number = 59
        ;  returns_nothing

        ; # This procedure will in an infinite loop until the select
        ; # address matches {rb2bus_address}.  {rb2bus_address} is
        ; # typically set in the {rb2bus_initialize} procedure.
        ; #
        ; # This module will repeatably call the {wait} procedure until
        ; # it is properly selected.

        ; line_number = 68
        ;  local value byte
rb2bus_select_wait__value equ globals___0+2
        ; line_number = 69
        ;  local address_bit bit
rb2bus_select_wait__address_bit___byte equ globals___0+79
rb2bus_select_wait__address_bit___bit equ 2

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 71
        ;  rb2bus_error := _false
        ;info   71, 404
        bcf     rb2bus_error___byte, rb2bus_error___bit
        ; line_number = 72
        ;  while !rb2bus_selected start
rb2bus_select_wait__1:
        ;info   72, 405
        ; =>bit_code_emit@symbol(): sym=rb2bus_selected
        ; No 1TEST: true.size=0 false.size=25
        ; No 2TEST: true.size=0 false.size=25
        ; 1GOTO: Single test with GOTO
        btfsc   rb2bus_selected___byte, rb2bus_selected___bit
        goto    rb2bus_select_wait__6
        ; line_number = 73
        ; _adden := _true
        ;info   73, 407
        bsf     _adden___byte, _adden___bit
        ; # Wait for a byte to arrive.
        ; line_number = 75
        ;  while !_rcif start
rb2bus_select_wait__2:
        ;info   75, 408
        ; =>bit_code_emit@symbol(): sym=_rcif
        ; No 1TEST: true.size=0 false.size=2
        ; No 2TEST: true.size=0 false.size=2
        ; 1GOTO: Single test with GOTO
        btfsc   _rcif___byte, _rcif___bit
        goto    rb2bus_select_wait__3
        ; line_number = 76
        ; call wait()
        ;info   76, 410
        call    wait

        goto    rb2bus_select_wait__2
rb2bus_select_wait__3:
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 75
        ;  while !_rcif done
        ; # Capture the received value:
        ; line_number = 79
        ;  address_bit := _false
        ;info   79, 412
        bcf     rb2bus_select_wait__address_bit___byte, rb2bus_select_wait__address_bit___bit
        ; line_number = 80
        ;  if _rx9d start
        ;info   80, 413
        ; =>bit_code_emit@symbol(): sym=_rx9d
        ; 1TEST: Single test with code in skip slot
        btfsc   _rx9d___byte, _rx9d___bit
        ; line_number = 81
        ; address_bit := _true
        ;info   81, 414
        bsf     rb2bus_select_wait__address_bit___byte, rb2bus_select_wait__address_bit___bit
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 80
        ;  if _rx9d done
        ; line_number = 82
        ; value := _rcreg
        ;info   82, 415
        movf    _rcreg,w
        movwf   rb2bus_select_wait__value

        ; # Clear any UART errors by toggling {_cren}:
        ; line_number = 85
        ;  if _oerr start
        ;info   85, 417
        ; =>bit_code_emit@symbol(): sym=_oerr
        ; 1TEST: Single test with code in skip slot
        btfsc   _oerr___byte, _oerr___bit
        ; line_number = 86
        ; _cren := _false
        ;info   86, 418
        bcf     _cren___byte, _cren___bit
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 85
        ;  if _oerr done
        ; line_number = 87
        ; if _ferr start
        ;info   87, 419
        ; =>bit_code_emit@symbol(): sym=_ferr
        ; 1TEST: Single test with code in skip slot
        btfsc   _ferr___byte, _ferr___bit
        ; line_number = 88
        ; _cren := _false
        ;info   88, 420
        bcf     _cren___byte, _cren___bit
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 87
        ; if _ferr done
        ; line_number = 89
        ; _cren := _true
        ;info   89, 421
        bsf     _cren___byte, _cren___bit

        ; line_number = 91
        ;  if address_bit start
        ;info   91, 422
        ; =>bit_code_emit@symbol(): sym=rb2bus_select_wait__address_bit
        ; No 1TEST: true.size=7 false.size=0
        ; No 2TEST: true.size=7 false.size=0
        ; 1GOTO: Single test with GOTO
        btfss   rb2bus_select_wait__address_bit___byte, rb2bus_select_wait__address_bit___bit
        goto    rb2bus_select_wait__5
        ; line_number = 92
        ; if value = rb2bus_address start
        ;info   92, 424
        ; Left minus Right
        movf    rb2bus_address,w
        subwf   rb2bus_select_wait__value,w
        ; =>bit_code_emit@symbol(): sym=__z
        ; No 1TEST: true.size=3 false.size=0
        ; No 2TEST: true.size=3 false.size=0
        ; 1GOTO: Single test with GOTO
        btfss   __z___byte, __z___bit
        goto    rb2bus_select_wait__4
        ; line_number = 93
        ; rb2bus_selected := _true
        ;info   93, 428
        bsf     rb2bus_selected___byte, rb2bus_selected___bit
        ; line_number = 94
        ;  call rb2bus_byte_put(rb2_ok)
        ;info   94, 429
        movlw   165
        call    rb2bus_byte_put


        ; Recombine size1 = 0 || size2 = 0
rb2bus_select_wait__4:
        ; line_number = 92
        ; if value = rb2bus_address done
        ; Recombine size1 = 0 || size2 = 0
rb2bus_select_wait__5:
        ; line_number = 91
        ;  if address_bit done
        goto    rb2bus_select_wait__1
rb2bus_select_wait__6:
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 72
        ;  while !rb2bus_selected done
        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 97
        ;info   97, 433
        ; procedure rb2bus_deselect
rb2bus_deselect:
        ; arguments_none
        ; line_number = 99
        ;  returns_nothing

        ; # This procedure forces this module into the deselected state until
        ; # it is reselected by some master module on the bus.

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 104
        ;  rb2bus_selected := _false
        ;info   104, 433
        bcf     rb2bus_selected___byte, rb2bus_selected___bit


        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 107
        ;info   107, 435
        ; procedure rb2bus_byte_get
rb2bus_byte_get:
        ; arguments_none
        ; line_number = 109
        ;  returns byte

        ; # This procedure will return the next byte received from the bus.
        ; # The address (9th) bit is stored in the global {is_address}.
        ; #
        ; # If {rb2bus_error} is set, 0 is returned.  Otherwise, the {wait}
        ; # procedure is repeatably called until a command byte is successfully
        ; # received.  If an module select byte comes in, we enter a bus
        ; # error condition by setting {rb2bus_error} and returning 0.

        ; line_number = 119
        ;  local value byte
rb2bus_byte_get__value equ globals___0+3
        ; line_number = 120
        ;  local address_bit bit
rb2bus_byte_get__address_bit___byte equ globals___0+79
rb2bus_byte_get__address_bit___bit equ 3

        ; # Return 0 in a bus flush condition to get us back to {rb2bus_select_wait}:
        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 123
        ;  if rb2bus_error start
        ;info   123, 435
        ; =>bit_code_emit@symbol(): sym=rb2bus_error
        ; 1TEST: Single test with code in skip slot
        btfsc   rb2bus_error___byte, rb2bus_error___bit
        ; line_number = 124
        ; return 0 start
        ; line_number = 124
        ;info   124, 436
        retlw   0
        ; line_number = 124
        ; return 0 done

        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 123
        ;  if rb2bus_error done
        ; # Wait for a byte to arrive.
        ; line_number = 127
        ;  _adden := _false
        ;info   127, 437
        bcf     _adden___byte, _adden___bit
        ; line_number = 128
        ;  while !_rcif start
rb2bus_byte_get__1:
        ;info   128, 438
        ; =>bit_code_emit@symbol(): sym=_rcif
        ; No 1TEST: true.size=0 false.size=2
        ; No 2TEST: true.size=0 false.size=2
        ; 1GOTO: Single test with GOTO
        btfsc   _rcif___byte, _rcif___bit
        goto    rb2bus_byte_get__2
        ; line_number = 129
        ; call wait()
        ;info   129, 440
        call    wait

        goto    rb2bus_byte_get__1
rb2bus_byte_get__2:
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 128
        ;  while !_rcif done
        ; # Record the 9th bit in {address_bit}:
        ; line_number = 132
        ;  address_bit := _false
        ;info   132, 442
        bcf     rb2bus_byte_get__address_bit___byte, rb2bus_byte_get__address_bit___bit
        ; line_number = 133
        ;  if _rx9d start
        ;info   133, 443
        ; =>bit_code_emit@symbol(): sym=_rx9d
        ; 1TEST: Single test with code in skip slot
        btfsc   _rx9d___byte, _rx9d___bit
        ; line_number = 134
        ; address_bit := _true
        ;info   134, 444
        bsf     rb2bus_byte_get__address_bit___byte, rb2bus_byte_get__address_bit___bit
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 133
        ;  if _rx9d done
        ; line_number = 135
        ; value := _rcreg
        ;info   135, 445
        movf    _rcreg,w
        movwf   rb2bus_byte_get__value

        ; # Clear any errors by toggling _{cren}:
        ; # FIXME: All of this should be done *before* reading {_rcreg}!!!
        ; line_number = 139
        ;  if _oerr start
        ;info   139, 447
        ; =>bit_code_emit@symbol(): sym=_oerr
        ; 1TEST: Single test with code in skip slot
        btfsc   _oerr___byte, _oerr___bit
        ; line_number = 140
        ; _cren := _false
        ;info   140, 448
        bcf     _cren___byte, _cren___bit
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 139
        ;  if _oerr done
        ; line_number = 141
        ; if _ferr start
        ;info   141, 449
        ; =>bit_code_emit@symbol(): sym=_ferr
        ; 1TEST: Single test with code in skip slot
        btfsc   _ferr___byte, _ferr___bit
        ; line_number = 142
        ; _cren := _false
        ;info   142, 450
        bcf     _cren___byte, _cren___bit
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 141
        ; if _ferr done
        ; line_number = 143
        ; _cren := _true
        ;info   143, 451
        bsf     _cren___byte, _cren___bit

        ; line_number = 145
        ;  if address_bit start
        ;info   145, 452
        ; =>bit_code_emit@symbol(): sym=rb2bus_byte_get__address_bit
        ; No 1TEST: true.size=13 false.size=0
        ; No 2TEST: true.size=13 false.size=0
        ; 1GOTO: Single test with GOTO
        btfss   rb2bus_byte_get__address_bit___byte, rb2bus_byte_get__address_bit___bit
        goto    rb2bus_byte_get__5
        ; # We have an unexpected address select coming in:
        ; line_number = 147
        ;  if value = rb2bus_address start
        ;info   147, 454
        ; Left minus Right
        movf    rb2bus_address,w
        subwf   rb2bus_byte_get__value,w
        ; =>bit_code_emit@symbol(): sym=__z
        ; No 1TEST: true.size=4 false.size=2
        ; No 2TEST: true.size=4 false.size=2
        ; 2GOTO: Single test with two GOTO's
        btfss   __z___byte, __z___bit
        goto    rb2bus_byte_get__3
        ; # We are being selected again:
        ; line_number = 149
        ;  rb2bus_selected := _true
        ;info   149, 458
        bsf     rb2bus_selected___byte, rb2bus_selected___bit
        ; line_number = 150
        ;  _adden := _false
        ;info   150, 459
        bcf     _adden___byte, _adden___bit

        ; line_number = 152
        ;  call rb2bus_byte_put(rb2_ok)
        ;info   152, 460
        movlw   165
        call    rb2bus_byte_put
        goto    rb2bus_byte_get__4
        ; 2GOTO: Starting code 2
rb2bus_byte_get__3:
        ; # Somebody else is being selected; we deselect:
        ; line_number = 155
        ;  rb2bus_selected := _false
        ;info   155, 463
        bcf     rb2bus_selected___byte, rb2bus_selected___bit
        ; line_number = 156
        ;  _adden := _true
        ;info   156, 464
        bsf     _adden___byte, _adden___bit

rb2bus_byte_get__4:
        ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 147
        ;  if value = rb2bus_address done
        ; # We want to get back to the beginning of decode:
        ; line_number = 159
        ;  rb2bus_error := _true
        ;info   159, 465
        bsf     rb2bus_error___byte, rb2bus_error___bit
        ; line_number = 160
        ;  value := 0
        ;info   160, 466
        clrf    rb2bus_byte_get__value

        ; Recombine size1 = 0 || size2 = 0
rb2bus_byte_get__5:
        ; line_number = 145
        ;  if address_bit done
        ; # Regular data byte:
        ; line_number = 163
        ;  return value start
        ; line_number = 163
        ;info   163, 467
        movf    rb2bus_byte_get__value,w
        return  
        ; line_number = 163
        ;  return value done


        ; delay after procedure statements=non-uniform




        ; line_number = 166
        ;info   166, 469
        ; procedure rb2bus_byte_put
rb2bus_byte_put:
        ; Last argument is sitting in W; save into argument variable
        movwf   rb2bus_byte_put__value
        ; delay=4294967295
        ; line_number = 167
        ; argument value byte
rb2bus_byte_put__value equ globals___0+4
        ; line_number = 168
        ;  returns_nothing

        ; # This procedure will send {value} to the bus.  It automatically
        ; # consumes the echo that is on the bus.  If {rb2bus_error} is
        ; # set, this procedure does nothing.

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 174
        ;  if !rb2bus_error start
        ;info   174, 470
        ; =>bit_code_emit@symbol(): sym=rb2bus_error
        ; No 1TEST: true.size=0 false.size=18
        ; No 2TEST: true.size=0 false.size=18
        ; 1GOTO: Single test with GOTO
        btfsc   rb2bus_error___byte, rb2bus_error___bit
        goto    rb2bus_byte_put__4
        ; # Wait until {_txreg} is ready for a value:
        ; line_number = 176
        ;  while !_txif start
rb2bus_byte_put__1:
        ;info   176, 472
        ; =>bit_code_emit@symbol(): sym=_txif
        ; No 1TEST: true.size=0 false.size=2
        ; No 2TEST: true.size=0 false.size=2
        ; 1GOTO: Single test with GOTO
        btfsc   _txif___byte, _txif___bit
        goto    rb2bus_byte_put__2
        ; line_number = 177
        ; call wait()
        ;info   177, 474
        call    wait

        goto    rb2bus_byte_put__1
rb2bus_byte_put__2:
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 176
        ;  while !_txif done
        ; # Ship {value} out to the bus with 9th bit turned off:
        ; line_number = 180
        ;  _adden := _false
        ;info   180, 476
        bcf     _adden___byte, _adden___bit
        ; line_number = 181
        ;  _tx9d := _false
        ;info   181, 477
        bsf     __rp0___byte, __rp0___bit
        bcf     _tx9d___byte, _tx9d___bit
        ; line_number = 182
        ;  _txreg := value
        ;info   182, 479
        bcf     __rp0___byte, __rp0___bit
        movf    rb2bus_byte_put__value,w
        movwf   _txreg

        ; # Wait for the echo to show up:
        ; line_number = 185
        ;  while !_rcif start
rb2bus_byte_put__3:
        ;info   185, 482
        ; =>bit_code_emit@symbol(): sym=_rcif
        ; 1TEST: Single test with code in skip slot
        btfss   _rcif___byte, _rcif___bit
        ; # Still waiting:
        goto    rb2bus_byte_put__3
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 185
        ;  while !_rcif done
        ; # Throw the received byte away (store into {_w}).
        ; line_number = 188
        ;  assemble
        ;info   188, 484
        ; line_number = 189
        ;info   189, 484
        movf    _rcreg,w

        ; # Recover from any receive errors by toggling {_cren}:
        ; line_number = 192
        ;  if _oerr start
        ;info   192, 485
        ; =>bit_code_emit@symbol(): sym=_oerr
        ; 1TEST: Single test with code in skip slot
        btfsc   _oerr___byte, _oerr___bit
        ; line_number = 193
        ; _cren := _false
        ;info   193, 486
        bcf     _cren___byte, _cren___bit
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 192
        ;  if _oerr done
        ; line_number = 194
        ; if _ferr start
        ;info   194, 487
        ; =>bit_code_emit@symbol(): sym=_ferr
        ; 1TEST: Single test with code in skip slot
        btfsc   _ferr___byte, _ferr___bit
        ; line_number = 195
        ; _cren := _false
        ;info   195, 488
        bcf     _cren___byte, _cren___bit
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 194
        ; if _ferr done
        ; line_number = 196
        ; _cren := _true
        ;info   196, 489
        bsf     _cren___byte, _cren___bit


rb2bus_byte_put__4:
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 174
        ;  if !rb2bus_error done
        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 199
        ;info   199, 491
        ; procedure rb2bus_command
rb2bus_command:
        ; Last argument is sitting in W; save into argument variable
        movwf   rb2bus_command__command
        ; delay=4294967295
        ; line_number = 200
        ; argument command byte
rb2bus_command__command equ globals___0+7
        ; line_number = 201
        ;  returns_nothing

        ; # This procedure will process an shared {command}.  This procedure
        ; # accesses the global string {id}.

        ; line_number = 206
        ;  local new_address byte
rb2bus_command__new_address equ globals___0+5
        ; line_number = 207
        ;  local temp byte
rb2bus_command__temp equ globals___0+6

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 209
        ;  switch command & 7 start
        ;info   209, 492
        ; switch_before:(data:00=uu=>00 code:XX=cc=>XX) size=1
        movlw   rb2bus_command__13>>8
        movwf   __pclath
        movlw   7
        andwf   rb2bus_command__command,w
        ; switch after expression:(data:00=uu=>00 code:XX=cc=>XX)
        addlw   rb2bus_command__13
        movwf   __pcl
        ; page_group 8
rb2bus_command__13:
        goto    rb2bus_command__14
        goto    rb2bus_command__14
        goto    rb2bus_command__14
        goto    rb2bus_command__14
        goto    rb2bus_command__9
        goto    rb2bus_command__10
        goto    rb2bus_command__11
        goto    rb2bus_command__12
        ; line_number = 210
        ; case 4
rb2bus_command__9:
        ; # 1111 1100 (Address_Set):
        ; # Return old address:
        ; line_number = 213
        ;  call rb2bus_byte_put(rb2bus_address)
        ;info   213, 506
        movf    rb2bus_address,w
        call    rb2bus_byte_put

        ; # Fetch new address:
        ; line_number = 216
        ;  new_address := rb2bus_byte_get()
        ;info   216, 508
        call    rb2bus_byte_get
        movwf   rb2bus_command__new_address
        ; line_number = 217
        ;  if new_address = 0 || new_address = rb2bus_address start
        ;info   217, 510
        ; Left minus Right
        movf    rb2bus_command__new_address,w
        ; =>bit_code_emit@symbol(): sym=__z
        ; No 1TEST: true.size=1 false.size=36
        ; No 2TEST: true.size=1 false.size=36
        ; 2GOTO: Single test with two GOTO's
        btfsc   __z___byte, __z___bit
        goto    rb2bus_command__5
        ; Recombine code1_bit_states != code2_bit_states
        ; &&||: index=1 true_delay=4294967295 false_delay=4294967295 goto_delay=4294967295
        ; Left minus Right
        movf    rb2bus_address,w
        subwf   rb2bus_command__new_address,w
        ; =>bit_code_emit@symbol(): sym=__z
        ; No 1TEST: true.size=4 false.size=27
        ; No 2TEST: true.size=4 false.size=27
        ; 2GOTO: Single test with two GOTO's
        btfss   __z___byte, __z___bit
        goto    rb2bus_command__6
rb2bus_command__5:
        ; line_number = 218
        ; call rb2bus_byte_put(0)
        ;info   218, 517
        movlw   0
        call    rb2bus_byte_put
        ; line_number = 219
        ;  rb2bus_error := _true
        ;info   219, 519
        bsf     rb2bus_error___byte, rb2bus_error___bit
        ; line_number = 220
        ;  rb2bus_selected := _false
        ;info   220, 520
        bcf     rb2bus_selected___byte, rb2bus_selected___bit
        goto    rb2bus_command__7
        ; 2GOTO: Starting code 2
rb2bus_command__6:
        ; # Return new address:
        ; line_number = 223
        ;  call rb2bus_byte_put(new_address)
        ;info   223, 522
        movf    rb2bus_command__new_address,w
        call    rb2bus_byte_put

        ; # Fetch new address again as a check:
        ; line_number = 226
        ;  temp := rb2bus_byte_get()
        ;info   226, 524
        call    rb2bus_byte_get
        movwf   rb2bus_command__temp
        ; line_number = 227
        ;  if temp != new_address start
        ;info   227, 526
        ; Left minus Right
        movf    rb2bus_command__new_address,w
        subwf   rb2bus_command__temp,w
        ; =>bit_code_emit@symbol(): sym=__z
        ; No 1TEST: true.size=14 false.size=4
        ; No 2TEST: true.size=14 false.size=4
        ; 2GOTO: Single test with two GOTO's
        btfss   __z___byte, __z___bit
        goto    rb2bus_command__3
        ; line_number = 232
        ; call rb2bus_eedata_write(new_address)
        ;info   232, 530
        movf    rb2bus_command__new_address,w
        call    rb2bus_eedata_write
        ; line_number = 233
        ;  temp := rb2bus_eedata_read()
        ;info   233, 532
        call    rb2bus_eedata_read
        movwf   rb2bus_command__temp
        ; line_number = 234
        ;  if temp = new_address start
        ;info   234, 534
        ; Left minus Right
        movf    rb2bus_command__new_address,w
        subwf   rb2bus_command__temp,w
        ; =>bit_code_emit@symbol(): sym=__z
        ; No 1TEST: true.size=3 false.size=1
        ; No 2TEST: true.size=3 false.size=1
        ; 2GOTO: Single test with two GOTO's
        btfss   __z___byte, __z___bit
        goto    rb2bus_command__1
        ; line_number = 235
        ; rb2bus_address := new_address
        ;info   235, 538
        movf    rb2bus_command__new_address,w
        movwf   rb2bus_address
        ; line_number = 236
        ;  call rb2bus_byte_put(rb2_ok)
        ;info   236, 540
        movlw   165
        goto    rb2bus_command__2
        ; 2GOTO: Starting code 2
rb2bus_command__1:
        ; line_number = 238
        ; call rb2bus_byte_put(0)
        ;info   238, 542
        movlw   0
rb2bus_command__2:
        ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        call    rb2bus_byte_put
        ; line_number = 234
        ;  if temp = new_address done
        goto    rb2bus_command__4
        ; 2GOTO: Starting code 2
rb2bus_command__3:
        ; line_number = 228
        ; call rb2bus_byte_put(0)
        ;info   228, 545
        movlw   0
        call    rb2bus_byte_put
        ; line_number = 229
        ;  rb2bus_error := _true
        ;info   229, 547
        bsf     rb2bus_error___byte, rb2bus_error___bit
        ; line_number = 230
        ;  rb2bus_selected := _false
        ;info   230, 548
        bcf     rb2bus_selected___byte, rb2bus_selected___bit
rb2bus_command__4:
        ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 227
        ;  if temp != new_address done
rb2bus_command__7:
        ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code2 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; &&||: index=0 true_delay=4294967295 false_delay=4294967295 goto_delay=4294967295
        ; &&||:: index=0 new_delay=4294967295 goto_delay=4294967295
        ; 2GOTO: No goto needed; true=rb2bus_command__5 false= true_size=1 false_size=36
        ; 2GOTO: code1 final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; 2GOTO: code2 final bitstates:(data:XX=cc=>XX code:XX=cc=>XX)
        ; 2GOTO: code final bitstates:(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 217
        ;  if new_address = 0 || new_address = rb2bus_address done
        goto    rb2bus_command__14
        ; line_number = 239
        ; case 5
rb2bus_command__10:
        ; # 1111 1101 (Id_next):
        ; line_number = 241
        ;  if rb2bus_index < id.size start
        ;info   241, 550
        movlw   21
        subwf   rb2bus_index,w
        ; =>bit_code_emit@symbol(): sym=__c
        ; No 1TEST: true.size=0 false.size=4
        ; No 2TEST: true.size=0 false.size=4
        ; 1GOTO: Single test with GOTO
        btfsc   __c___byte, __c___bit
        goto    rb2bus_command__8
        ; line_number = 242
        ; call rb2bus_byte_put(id[rb2bus_index])
        ;info   242, 554
        movf    rb2bus_index,w
        call    id
        call    rb2bus_byte_put
        ; line_number = 243
        ;  rb2bus_index := rb2bus_index + 1
        ;info   243, 557
        incf    rb2bus_index,f
        ; #if rb2bus_index >= id.size
        ; #	rb2bus_index := rb2bus_index - 1
rb2bus_command__8:
        ; Recombine size1 = 0 || size2 = 0
        ; line_number = 241
        ;  if rb2bus_index < id.size done
        goto    rb2bus_command__14
        ; line_number = 246
        ; case 6
rb2bus_command__11:
        ; # 1111 1110 (Id_start):
        ; line_number = 248
        ;  rb2bus_index := 0
        ;info   248, 559
        clrf    rb2bus_index
        goto    rb2bus_command__14
        ; line_number = 249
        ; case 7
rb2bus_command__12:
        ; # 1111 1111 (Deselect):
        ; line_number = 251
        ;  call rb2bus_deselect()
        ;info   251, 561
        call    rb2bus_deselect


rb2bus_command__14:
        ; line_number = 209
        ;  switch command & 7 done
        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; buffer = 'rb2bus_pic16f628'
        ; line_number = 26
        ;info   26, 563
        ; procedure rb2bus_initialize
rb2bus_initialize:
        ; Last argument is sitting in W; save into argument variable
        movwf   rb2bus_initialize__address
        ; delay=4294967295
        ; line_number = 27
        ; argument address byte
rb2bus_initialize__address equ globals___0+8
        ; line_number = 28
        ;  returns_nothing

        ; # This procedure is responsibile for initializing the UART
        ; # connected to the bus.  {address} is the address of this
        ; # slave module.  This code is specific to the PIC16F688.

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 34
        ;  rb2bus_address := address
        ;info   34, 564
        movf    rb2bus_initialize__address,w
        movwf   rb2bus_address

        ; # Warm up the UART:
        ; line_number = 37
        ;  _trisb@1 := _true
        ;info   37, 566
rb2bus_initialize__select__1___byte equ _trisb
rb2bus_initialize__select__1___bit equ 1
        bsf     __rp0___byte, __rp0___bit
        bsf     rb2bus_initialize__select__1___byte, rb2bus_initialize__select__1___bit
        ; line_number = 38
        ;  _trisb@2 := _true
        ;info   38, 568
rb2bus_initialize__select__2___byte equ _trisb
rb2bus_initialize__select__2___bit equ 2
        bsf     rb2bus_initialize__select__2___byte, rb2bus_initialize__select__2___bit

        ; # Initialize the {_txsta} register:
        ; line_number = 41
        ;  _txsta := 0
        ;info   41, 569
        clrf    _txsta
        ; line_number = 42
        ;  _tx9 := _true
        ;info   42, 570
        bsf     _tx9___byte, _tx9___bit
        ; line_number = 43
        ;  _txen := _true
        ;info   43, 571
        bsf     _txen___byte, _txen___bit
        ; line_number = 44
        ;  _brgh := _true
        ;info   44, 572
        bsf     _brgh___byte, _brgh___bit

        ; # Initialize the {_rcsta} register:
        ; line_number = 47
        ;  _rcsta := 0
        ;info   47, 573
        bcf     __rp0___byte, __rp0___bit
        clrf    _rcsta
        ; line_number = 48
        ;  _spen := _true
        ;info   48, 575
        bsf     _spen___byte, _spen___bit
        ; line_number = 49
        ;  _rx9 := _true
        ;info   49, 576
        bsf     _rx9___byte, _rx9___bit
        ; line_number = 50
        ;  _cren := _true
        ;info   50, 577
        bsf     _cren___byte, _cren___bit
        ; #_adden := _true
        ; line_number = 52
        ;  _adden := _false
        ;info   52, 578
        bcf     _adden___byte, _adden___bit

        ; # Set up the baud rate generator:
        ; line_number = 55
        ;  _spbrg := spbrg_500k
        ;info   55, 579
        movlw   1
        bsf     __rp0___byte, __rp0___bit
        movwf   _spbrg

        ; line_number = 57
        ;  rb2bus_selected := _false
        ;info   57, 582
        bcf     __rp0___byte, __rp0___bit
        bcf     rb2bus_selected___byte, rb2bus_selected___bit
        ; line_number = 58
        ;  rb2bus_error := _false
        ;info   58, 584
        bcf     rb2bus_error___byte, rb2bus_error___bit
        ; line_number = 59
        ;  rb2bus_index := 0
        ;info   59, 585
        clrf    rb2bus_index

        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; line_number = 61
        ;info   61, 587
        ; procedure rb2bus_eedata_read
rb2bus_eedata_read:
        ; arguments_none
        ; line_number = 63
        ;  returns byte

        ; # This procedure will return the address stored in EEData.  If
        ; # there is no data, 0 is returned.

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 68
        ;  return 0 start
        ; line_number = 68
        ;info   68, 587
        retlw   0
        ; line_number = 68
        ;  return 0 done


        ; delay after procedure statements=non-uniform




        ; line_number = 71
        ;info   71, 588
        ; procedure rb2bus_eedata_write
rb2bus_eedata_write:
        ; Last argument is sitting in W; save into argument variable
        movwf   rb2bus_eedata_write__address
        ; delay=4294967295
        ; line_number = 72
        ; argument address byte
rb2bus_eedata_write__address equ globals___0+9
        ; line_number = 73
        ;  returns_nothing

        ; # This procedure will write {address} into the EEData.  The
        ; # microcontroll pauses while the EEData is written.

        ; before procedure statements delay=non-uniform, bit states=(data:00=uu=>00 code:XX=cc=>XX)
        ; line_number = 78
        ;  do_nothing
        ;info   78, 589




        ; delay after procedure statements=non-uniform
        ; Implied return
        retlw   0




        ; Configuration bits
        ; address = 0x2007, fill = 0x200
        ; cp = off (0x3c00)
        ; cpd = off (0x100)
        ; lvp = off (0x0)
        ; boden = off (0x0)
        ; mclre = off (0x0)
        ; pwrte = off (0x8)
        ; wdte = off (0x0)
        ; fosc = hs (0x2)
        ; 16138 = 0x3f0a
        __config 16138
        ; Define start addresses for data regions
        ; Region="shared___globals" Address=112" Size=16 Bytes=0 Bits=0 Available=16
        ; Region="globals___0" Address=32" Size=80 Bytes=54 Bits=6 Available=25
        ; Region="globals___1" Address=160" Size=80 Bytes=0 Bits=0 Available=80
        ; Region="globals___2" Address=288" Size=48 Bytes=0 Bits=0 Available=48
        ; Region="shared___globals" Address=112" Size=16 Bytes=0 Bits=0 Available=16
        end
