        radix dec
global__variables__bank0 equ 32
global__variables__bank1 equ 160
global__variables__bank2 equ 288
global__variables__bank3 equ 496
global__bit__variables__bank0 equ 103
global__bit__variables__bank1 equ 160
global__bit__variables__bank2 equ 288
global__bit__variables__bank3 equ 496
indf___register equ 0
pcl___register equ 2
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
trisa___register equ 0x85
trisb___register equ 0x86
fsr___register equ 4
pclath___register equ 10
        org 0
start:
        nop
        nop
        nop
        goto skip___interrupt
interrupt___vector:
        retfie
skip___interrupt:
        ; Initialize A/D system to allow digital I/O
        movlw 7
        movwf 31
        ; Switch from register bank 0 to register bank 1 (which contains 159)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        clrf 159
        ; Initialize TRIS registers
        movlw 224
        movwf trisa___register
        movlw 14
        movwf trisb___register
        clrf pclath___register
        ; Switch from register bank 1 to register bank 0
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        goto main
        ; comment #############################################################################
        ; comment {}
        ; comment {Copyright < c > 2002 by Wayne C . Gramlich .}
        ; comment {All rights reserved .}
        ; comment {}
        ; comment {Permission to use , copy , modify , distribute , and sell this software}
        ; comment {for any purpose is hereby granted without fee provided that the above}
        ; comment {copyright notice and this permission are retained . The author makes}
        ; comment {no representations about the suitability of this software for any purpose .}
        ; comment {It is provided { as is } without express or implied warranty .}
        ; comment {}
        ; comment {This is code for the SonarDT1 RoboBrick at :}
        ; comment {}
        ; comment {http : / / web . gramlich . net / projects / robobricks / sonardt1 / rev_c / index . html}
        ; comment {}
        ; comment {Some pin assignments :}
        ; comment {}
        ; comment {No Name Kind Description}
        ; comment {= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =}
        ; comment {1 RA2 / AN2 / VREF Digital Out N2 : 3 TRIG}
        ; comment {2 RA3 / AN3 / CMP1 Digital Out D5}
        ; comment {3 RA4 / TOCKI / CMP2 Digital Out D4}
        ; comment {4 RA5 / MCLR * / THV No Connection}
        ; comment {5 VSS Ground Ground}
        ; comment {6 RB0 / INT Digital Out D8}
        ; comment {7 RB1 / RX / DT Digital In N1 : 4 SIN}
        ; comment {8 RB2 / TX / CK Digital Out N1 : 5 SOUT}
        ; comment {9 RB3 / CCP1 Digital In N2 : 4 ECHO}
        ; comment {10 RB4 / PGM Digital Out N4 : 1 SRV}
        ; comment {11 RB5 Digital Out D1}
        ; comment {12 RB6 / T1OSO / TICK1 Digital Out D2}
        ; comment {13 RB7 / T1OSI Digital Out D3}
        ; comment {14 VDD Power + 5 Volts}
        ; comment {15 RA6 / OSC2 / CLKOUT Xtal Resonator}
        ; comment {16 RA7 / OSC1 / CLKIN Digital In Oscillator In}
        ; comment {17 RA0 / AN0 Digital Out D6}
        ; comment {18 RA1 / AN1 Digital Out D7}
        ; comment {}
        ; comment #############################################################################
        ;   processor pic16f628 cp = off cpd = off lvp = off bowden = off mclre = off pwrte = off wdte = off fosc = ec  
        ; 16139=0x3f0b 8199=0x2007
        __config 16139
configuration___address equ 8199
        ;   constant clock_rate 20000000  
clock_rate equ 20000000
        ; comment {Some register definitions :}
tmr0 equ 1
status equ 3
        ;   bind c status @ 0  
c equ status+0
c__byte equ status+0
c__bit equ 0
        ;   bind z status @ 2  
z equ status+0
z__byte equ status+0
z__bit equ 2
intcon equ 11
        ;   bind gie intcon @ 7  
gie equ intcon+0
gie__byte equ intcon+0
gie__bit equ 7
        ;   bind t0ie intcon @ 5  
t0ie equ intcon+0
t0ie__byte equ intcon+0
t0ie__bit equ 5
        ;   bind inte intcon @ 4  
inte equ intcon+0
inte__byte equ intcon+0
inte__bit equ 4
        ;   bind rbie intcon @ 3  
rbie equ intcon+0
rbie__byte equ intcon+0
rbie__bit equ 3
        ;   bind t0if intcon @ 2  
t0if equ intcon+0
t0if__byte equ intcon+0
t0if__bit equ 2
        ;   bind intf intcon @ 1  
intf equ intcon+0
intf__byte equ intcon+0
intf__bit equ 1
        ;   bind rbif intcon @ 0  
rbif equ intcon+0
rbif__byte equ intcon+0
rbif__bit equ 0
pir1 equ 12
        ;   bind eeif pir1 @ 7  
eeif equ pir1+0
eeif__byte equ pir1+0
eeif__bit equ 7
        ;   bind cmif pir1 @ 6  
cmif equ pir1+0
cmif__byte equ pir1+0
cmif__bit equ 6
        ;   bind rcif pir1 @ 5  
rcif equ pir1+0
rcif__byte equ pir1+0
rcif__bit equ 5
        ;   bind txif pir1 @ 4  
txif equ pir1+0
txif__byte equ pir1+0
txif__bit equ 4
        ;   bind ccp1if pir1 @ 2  
ccp1if equ pir1+0
ccp1if__byte equ pir1+0
ccp1if__bit equ 2
        ;   bind tmr2if pir1 @ 1  
tmr2if equ pir1+0
tmr2if__byte equ pir1+0
tmr2if__bit equ 1
        ;   bind tmr1if pir1 @ 0  
tmr1if equ pir1+0
tmr1if__byte equ pir1+0
tmr1if__bit equ 0
tmr1l equ 14
tmr1h equ 15
t1con equ 16
        ;   bind t1ckps1 t1con @ 5  
t1ckps1 equ t1con+0
t1ckps1__byte equ t1con+0
t1ckps1__bit equ 5
        ;   bind t1ckps0 t1con @ 4  
t1ckps0 equ t1con+0
t1ckps0__byte equ t1con+0
t1ckps0__bit equ 4
        ;   bind t1oscen t1con @ 3  
t1oscen equ t1con+0
t1oscen__byte equ t1con+0
t1oscen__bit equ 3
        ;   bind t1sync t1con @ 2  
t1sync equ t1con+0
t1sync__byte equ t1con+0
t1sync__bit equ 2
        ;   bind tmr1cs t1con @ 1  
tmr1cs equ t1con+0
tmr1cs__byte equ t1con+0
tmr1cs__bit equ 1
        ;   bind tmr1on t1con @ 0  
tmr1on equ t1con+0
tmr1on__byte equ t1con+0
tmr1on__bit equ 0
tmr2 equ 17
t2con equ 18
        ;   bind toutps3 t2con @ 6  
toutps3 equ t2con+0
toutps3__byte equ t2con+0
toutps3__bit equ 6
        ;   bind toutps2 t2con @ 5  
toutps2 equ t2con+0
toutps2__byte equ t2con+0
toutps2__bit equ 5
        ;   bind toutps1 t2con @ 4  
toutps1 equ t2con+0
toutps1__byte equ t2con+0
toutps1__bit equ 4
        ;   bind toutps0 t2con @ 3  
toutps0 equ t2con+0
toutps0__byte equ t2con+0
toutps0__bit equ 3
        ;   bind tmr2on t2con @ 2  
tmr2on equ t2con+0
tmr2on__byte equ t2con+0
tmr2on__bit equ 2
        ;   bind t2ckps1 t2con @ 1  
t2ckps1 equ t2con+0
t2ckps1__byte equ t2con+0
t2ckps1__bit equ 1
        ;   bind t2ckps0 t2con @ 0  
t2ckps0 equ t2con+0
t2ckps0__byte equ t2con+0
t2ckps0__bit equ 0
ccpr1l equ 21
ccpr1h equ 22
ccp1con equ 23
        ;   bind ccp1x ccp1con @ 5  
ccp1x equ ccp1con+0
ccp1x__byte equ ccp1con+0
ccp1x__bit equ 5
        ;   bind ccp1y ccp1con @ 4  
ccp1y equ ccp1con+0
ccp1y__byte equ ccp1con+0
ccp1y__bit equ 4
        ;   bind ccp1m3 ccp1con @ 3  
ccp1m3 equ ccp1con+0
ccp1m3__byte equ ccp1con+0
ccp1m3__bit equ 3
        ;   bind ccp1m2 ccp1con @ 2  
ccp1m2 equ ccp1con+0
ccp1m2__byte equ ccp1con+0
ccp1m2__bit equ 2
        ;   bind ccp1m1 ccp1con @ 1  
ccp1m1 equ ccp1con+0
ccp1m1__byte equ ccp1con+0
ccp1m1__bit equ 1
        ;   bind ccp1m0 ccp1con @ 0  
ccp1m0 equ ccp1con+0
ccp1m0__byte equ ccp1con+0
ccp1m0__bit equ 0
rcsta equ 24
        ;   bind spen rcsta @ 7  
spen equ rcsta+0
spen__byte equ rcsta+0
spen__bit equ 7
        ;   bind rx9 rcsta @ 6  
rx9 equ rcsta+0
rx9__byte equ rcsta+0
rx9__bit equ 6
        ;   bind sren rcsta @ 5  
sren equ rcsta+0
sren__byte equ rcsta+0
sren__bit equ 5
        ;   bind cren rcsta @ 4  
cren equ rcsta+0
cren__byte equ rcsta+0
cren__bit equ 4
        ;   bind aden rcsta @ 3  
aden equ rcsta+0
aden__byte equ rcsta+0
aden__bit equ 3
        ;   bind ferr rcsta @ 2  
ferr equ rcsta+0
ferr__byte equ rcsta+0
ferr__bit equ 2
        ;   bind oerr rcsta @ 1  
oerr equ rcsta+0
oerr__byte equ rcsta+0
oerr__bit equ 1
        ;   bind rx9d rcsta @ 0  
rx9d equ rcsta+0
rx9d__byte equ rcsta+0
rx9d__bit equ 0
txreg equ 25
rcreg equ 26
        ; comment {Comparator module control :}
cmcon equ 31
        ;   bind c2out cmcon @ 7  
c2out equ cmcon+0
c2out__byte equ cmcon+0
c2out__bit equ 7
        ;   bind c1out cmcon @ 6  
c1out equ cmcon+0
c1out__byte equ cmcon+0
c1out__bit equ 6
        ;   bind c2inv cmcon @ 5  
c2inv equ cmcon+0
c2inv__byte equ cmcon+0
c2inv__bit equ 5
        ;   bind c1inv cmcon @ 4  
c1inv equ cmcon+0
c1inv__byte equ cmcon+0
c1inv__bit equ 4
        ;   bind cis cmcon @ 3  
cis equ cmcon+0
cis__byte equ cmcon+0
cis__bit equ 3
        ;   bind cm2 cmcon @ 2  
cm2 equ cmcon+0
cm2__byte equ cmcon+0
cm2__bit equ 2
        ;   bind cm1 cmcon @ 1  
cm1 equ cmcon+0
cm1__byte equ cmcon+0
cm1__bit equ 1
        ;   bind cm0 cmcon @ 0  
cm0 equ cmcon+0
cm0__byte equ cmcon+0
cm0__bit equ 0
option equ 129
        ;   bind t0cs option @ 5  
t0cs equ option+0
t0cs__byte equ option+0
t0cs__bit equ 5
        ;   bind t0se option @ 4  
t0se equ option+0
t0se__byte equ option+0
t0se__bit equ 4
        ;   bind psa option @ 3  
psa equ option+0
psa__byte equ option+0
psa__bit equ 3
        ;   bind ps2 option @ 2  
ps2 equ option+0
ps2__byte equ option+0
ps2__bit equ 2
        ;   bind ps1 option @ 1  
ps1 equ option+0
ps1__byte equ option+0
ps1__bit equ 1
        ;   bind ps0 option @ 0  
ps0 equ option+0
ps0__byte equ option+0
ps0__bit equ 0
pie1 equ 140
        ;   bind eeie pie1 @ 7  
eeie equ pie1+0
eeie__byte equ pie1+0
eeie__bit equ 7
        ;   bind cmie pie1 @ 6  
cmie equ pie1+0
cmie__byte equ pie1+0
cmie__bit equ 6
        ;   bind rcie pie1 @ 5  
rcie equ pie1+0
rcie__byte equ pie1+0
rcie__bit equ 5
        ;   bind txie pie1 @ 4  
txie equ pie1+0
txie__byte equ pie1+0
txie__bit equ 4
        ;   bind ccp1ie pie1 @ 2  
ccp1ie equ pie1+0
ccp1ie__byte equ pie1+0
ccp1ie__bit equ 2
        ;   bind tmr2ie pie1 @ 1  
tmr2ie equ pie1+0
tmr2ie__byte equ pie1+0
tmr2ie__bit equ 1
        ;   bind tmr1ie pie1 @ 0  
tmr1ie equ pie1+0
tmr1ie__byte equ pie1+0
tmr1ie__bit equ 0
pr2 equ 146
txsta equ 152
        ;   bind tx9 txsta @ 6  
tx9 equ txsta+0
tx9__byte equ txsta+0
tx9__bit equ 6
        ;   bind txen txsta @ 5  
txen equ txsta+0
txen__byte equ txsta+0
txen__bit equ 5
        ;   bind sync txsta @ 4  
sync equ txsta+0
sync__byte equ txsta+0
sync__bit equ 4
        ;   bind brgh txsta @ 2  
brgh equ txsta+0
brgh__byte equ txsta+0
brgh__bit equ 2
        ;   bind trmt txsta @ 1  
trmt equ txsta+0
trmt__byte equ txsta+0
trmt__bit equ 1
        ;   bind tx9d txsta @ 0  
tx9d equ txsta+0
tx9d__byte equ txsta+0
tx9d__bit equ 0
spbrg equ 153
        ; comment {Some port , bit , and pin definitions :}
        ; comment {Port A pin assignments :}
        ; comment {RA0 : D6}
        ; comment {RA1 : D7}
        ; comment {RA2 : TRIG}
        ; comment {RA3 : D5}
        ; comment {RA4 : D4}
        ; comment {RA5 : No Connection}
        ; comment {RA6 : Resonator In}
        ; comment {RA7 : Oscillator In}
        ;   constant led6_bit 0  
led6_bit equ 0
        ;   constant led7_bit 1  
led7_bit equ 1
        ;   constant trigger_bit 2  
trigger_bit equ 2
        ;   constant led5_bit 3  
led5_bit equ 3
        ;   constant led4_bit 4  
led4_bit equ 4
        ;   constant nc1_bit 5  
nc1_bit equ 5
        ;   constant res_in_bit 6  
res_in_bit equ 6
        ;   constant osc_in_bit 7  
osc_in_bit equ 7
porta equ 5
led6__byte equ 5
led6__bit equ 0
led7__byte equ 5
led7__bit equ 1
trigger__byte equ 5
trigger__bit equ 2
led5__byte equ 5
led5__bit equ 3
led4__byte equ 5
led4__bit equ 4
nc1__byte equ 5
nc1__bit equ 5
res_in__byte equ 5
res_in__bit equ 6
osc_in__byte equ 5
osc_in__bit equ 7
        ; comment {Port B pin assignments :}
        ; comment {RB0 : D8}
        ; comment {RB1 : SIN < RX >}
        ; comment {RB2 : SOUT < TX >}
        ; comment {RB3 : ECHO}
        ; comment {RB4 : SRV}
        ; comment {RB5 : D1}
        ; comment {RB6 : D2}
        ; comment {RB7 : D3}
        ;   constant led8_bit 0  
led8_bit equ 0
        ;   constant rx_bit 1  
rx_bit equ 1
        ;   constant tx_bit 2  
tx_bit equ 2
        ;   constant echo_return_bit 3  
echo_return_bit equ 3
        ;   constant servo_out_bit 4  
servo_out_bit equ 4
        ;   constant led1_bit 5  
led1_bit equ 5
        ;   constant led2_bit 6  
led2_bit equ 6
        ;   constant led3_bit 7  
led3_bit equ 7
        ;   constant sweep_maximum 16  
sweep_maximum equ 16
portb equ 6
led8__byte equ 6
led8__bit equ 0
        ; comment {When using the USART , both the TX and RX pins must be set to input :}
tx_pin__byte equ 6
tx_pin__bit equ 2
rx_pin__byte equ 6
rx_pin__bit equ 1
echo_return__byte equ 6
echo_return__bit equ 3
servo_out__byte equ 6
servo_out__bit equ 4
led1__byte equ 6
led1__bit equ 5
led2__byte equ 6
led2__bit equ 6
led3__byte equ 6
led3__bit equ 7
send_in_index equ global__variables__bank0+0
send_out_index equ global__variables__bank0+1
        ;   constant send_buffer_size 10  
send_buffer_size equ 10
send_buffer equ global__variables__bank0+2
        ; comment {This code basically has to do 3 things :}
        ; comment {}
        ; comment {1 > It has to keep listening for commands from the serial input .}
        ; comment {2 > It has to be able to keep a servo pulse of length . 5 ms to 2 . 0 ms}
        ; comment {coming out every 20 ms or so .}
        ; comment {3 > It has to trigger an sonar pulse , and time the resultant period}
        ; comment {until the echo is heard < 100 uSec to 36 mSec > .}
        ; comment {}
        ; comment {Timer 0 is hooked up to the clock / 4 and then run through the 256}
        ; comment {prescaler . With the clock running at 20 MHz , divided by 4 and again}
        ; comment {by 256 leaves a clock frequency of 19531 Hz . 20 ms is a refresh rate}
        ; comment {of 50 Hz . So , 19531 / 50 is 390 . 62 , or 390 . 390 does not quite fit}
        ; comment {into 8 - bit , so we divide it by 2 to get 195 . So , we wait for the}
        ; comment {Timer 0 flag to count through 195 twice , before triggering servo}
        ; comment {pulse .}
glitch equ global__variables__bank0+12
id_index equ global__variables__bank0+13
        ; string_constants Start
string___fetch:
        movwf pcl___register
        ;   id = 1 , 0 , 29 , 2 , 0 , 0 , 0 , 0 , 0r'16' , 9 , 0s'SonarDT1C' , 29 , 0s'Gramlich&Benson'  
id___string equ 0
id:
        addwf pcl___register,f
        ; Length = 50
        retlw 50
        ; 1
        retlw 1
        ; 0
        retlw 0
        ; 29
        retlw 29
        ; 2
        retlw 2
        ; 0
        retlw 0
        ; 0
        retlw 0
        ; 0
        retlw 0
        ; 0
        retlw 0
        ; 0r'16'
        retlw 224 ; random number
        retlw 168 ; random number
        retlw 71 ; random number
        retlw 237 ; random number
        retlw 226 ; random number
        retlw 226 ; random number
        retlw 225 ; random number
        retlw 84 ; random number
        retlw 38 ; random number
        retlw 52 ; random number
        retlw 58 ; random number
        retlw 114 ; random number
        retlw 5 ; random number
        retlw 231 ; random number
        retlw 45 ; random number
        retlw 255 ; random number
        ; 9
        retlw 9
        ; `SonarDT1C'
        retlw 83
        retlw 111
        retlw 110
        retlw 97
        retlw 114
        retlw 68
        retlw 84
        retlw 49
        retlw 67
        ; 29
        retlw 29
        ; `Gramlich&Benson'
        retlw 71
        retlw 114
        retlw 97
        retlw 109
        retlw 108
        retlw 105
        retlw 99
        retlw 104
        retlw 38
        retlw 66
        retlw 101
        retlw 110
        retlw 115
        retlw 111
        retlw 110
        ; string__constants End

        ; procedure main start
main:
main__variables__base equ global__variables__bank0+14
main__bytes__base equ main__variables__base+0
main__bits__base equ main__variables__base+52
main__total__bytes equ 54
main__395byte0 equ main__bytes__base+51
main__471byte0 equ main__bytes__base+51
main__597byte0 equ main__bytes__base+51
main__663byte1 equ main__bytes__base+51
main__655byte1 equ main__bytes__base+51
main__475byte1 equ main__bytes__base+51
main__398byte0 equ main__bytes__base+51
main__614byte1 equ main__bytes__base+51
main__355byte0 equ main__bytes__base+51
main__614byte2 equ main__bytes__base+51
main__329byte0 equ main__bytes__base+51
main__330byte0 equ main__bytes__base+51
main__484byte0 equ main__bytes__base+51
        ;   arguments_none  
main__command equ main__bytes__base+0
main__command1 equ main__bytes__base+1
main__command2 equ main__bytes__base+2
main__command_need equ main__bytes__base+3
main__command_have equ main__bytes__base+4
main__continuous equ main__bits__base+0
main__continuous__byte equ main__bits__base+0
main__continuous__bit equ 0
main__counter equ main__bytes__base+5
main__distance_high equ main__bytes__base+6
main__distance_low equ main__bytes__base+7
main__leds equ main__bytes__base+8
main__temp equ main__bytes__base+9
main__phase equ main__bits__base+0
main__phase__byte equ main__bits__base+0
main__phase__bit equ 2
main__result equ main__bytes__base+10
main__servo equ main__bytes__base+11
main__servo_enable equ main__bits__base+0
main__servo_enable__byte equ main__bits__base+0
main__servo_enable__bit equ 4
main__sweep_highs equ main__bytes__base+12
main__sweep_lows equ main__bytes__base+28
main__sweep_initial equ main__bytes__base+44
main__sweep_increment equ main__bytes__base+45
main__sweep_count equ main__bytes__base+46
main__sweep_counter equ main__bytes__base+47
main__sweep_delay equ main__bytes__base+48
main__sweep_sleep equ main__bytes__base+49
main__sweep_index equ main__bytes__base+50
main__sweep_enable equ main__bits__base+0
main__sweep_enable__byte equ main__bits__base+0
main__sweep_enable__bit equ 6
main__sweep_direction equ main__bits__base+1
main__sweep_direction__byte equ main__bits__base+1
main__sweep_direction__bit equ 0
        ;   call initialize {{ }}  
        call initialize
        ; Initialize ring buffer :
        ;   sweep_enable := 0  
        bcf main__sweep_enable__byte,main__sweep_enable__bit
        ;   send_in_index := 0  
        clrf send_in_index
        ;   send_out_index := 0  
        clrf send_out_index
        ;   command_need := 1  
        movlw 1
        movwf main__command_need
        ;   command_have := 0  
        clrf main__command_have
        ;   continuous := 1  
        bsf main__continuous__byte,main__continuous__bit
        ;   servo := 0x80  
        movlw 128
        movwf main__servo
        ;   servo_enable := 0  
        bcf main__servo_enable__byte,main__servo_enable__bit
        ;   glitch := 0  
        clrf glitch
        ;   id_index := 0  
        clrf id_index
        ;   sweep_sleep := 0  
        clrf main__sweep_sleep
        ;   sweep_direction := 1  
        bsf main__sweep_direction__byte,main__sweep_direction__bit
        ;   sweep_index := 1  
        movlw 1
        movwf main__sweep_index
        ; Main loop
        ; loop_forever ... start
main__303loop__forever:
        ; Deal with timer 0 :
        ; if { t0if && servo_enable } start
        ; expression=`t0if' exp_delay=0 true_delay=-1  false_delay=2 true_size=71 false_size=1
        btfss t0if__byte,t0if__bit
        goto and305__0false
        ; expression=`servo_enable' exp_delay=0 true_delay=-1  false_delay=0 true_size=69 false_size=0
        btfss main__servo_enable__byte,main__servo_enable__bit
        goto label305__1end
and305__0true:
        ; if { t0if && servo_enable } body start
        ;   t0if := 0  
        bcf t0if__byte,t0if__bit
        ;   counter := counter - 1  
        decf main__counter,f
        ; if { c } start
        ; expression=`{ c }' exp_delay=0 true_delay=-1  false_delay=0 true_size=65 false_size=0
        btfss c__byte,c__bit
        goto label308__0end
        ; if { c } body start
        ; See discussion above to see where 195 comes from :
        ;   counter := 195  
        movlw 195
        movwf main__counter
        ; if { phase } start
        ; expression=`{ phase }' exp_delay=0 true_delay=1  false_delay=-1 true_size=1 false_size=59
        btfsc main__phase__byte,main__phase__bit
        goto label311__0true
label311__0false:
        ; else body start
        ;   phase := 1  
        bsf main__phase__byte,main__phase__bit
        ; Now it is time to squirt out a servo pulse :
        ;   servo_out := 1  
        bsf servo_out__byte,servo_out__bit
        ; Now use Timer2 to control pulse width :
        ;   pr2 := servo  
        movf main__servo,w
        ; Switch from register bank 0 to register bank 1 (which contains pr2)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        movwf pr2
        ;   tmr2 := 0  
        ; Switch from register bank 1 to register bank 0 (which contains tmr2)
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        clrf tmr2
        ;   tmr2on := 1  
        bsf tmr2on__byte,tmr2on__bit
        ; Now do any sweep processing :
        ; if { sweep_enable } start
        ; expression=`{ sweep_enable }' exp_delay=0 true_delay=-1  false_delay=0 true_size=51 false_size=0
        btfss main__sweep_enable__byte,main__sweep_enable__bit
        goto label325__0end
        ; if { sweep_enable } body start
        ;   sweep_sleep := sweep_sleep - 1  
        decf main__sweep_sleep,f
        ; if { z } start
        ; expression=`{ z }' exp_delay=0 true_delay=-1  false_delay=0 true_size=48 false_size=0
        btfss z__byte,z__bit
        goto label327__0end
        ; if { z } body start
        ;   sweep_sleep := sweep_delay  
        movf main__sweep_delay,w
        movwf main__sweep_sleep
        ;   sweep_highs ~~ {{ sweep_index }} := distance_high  
        movf main__distance_high,w
        movwf main__329byte0
        movlw LOW main__sweep_highs
        addwf main__sweep_index,w
        movwf fsr___register
        movf main__329byte0,w
        bcf irp___register,irp___bit
        movwf indf___register
        ;   sweep_lows ~~ {{ sweep_index }} := distance_low  
        movf main__distance_low,w
        movwf main__330byte0
        movlw LOW main__sweep_lows
        addwf main__sweep_index,w
        movwf fsr___register
        movf main__330byte0,w
        bcf irp___register,irp___bit
        movwf indf___register
        ; See if we need to change sweep direction :
        ; if { sweep_direction } start
        ; expression=`{ sweep_direction }' exp_delay=0 true_delay=-1  false_delay=-1 true_size=8 false_size=7
        btfss main__sweep_direction__byte,main__sweep_direction__bit
        goto label333__0false
label333__0true:
        ; if { sweep_direction } body start
        ; Going up :
        ; if { sweep_index + 1 >= sweep_count } start
        incf main__sweep_index,w
        subwf main__sweep_count,w
        btfsc z___byte,z___bit
        bcf c___byte,c___bit
        ; expression=`{ sweep_index + 1 >= sweep_count }' exp_delay=4 true_delay=2  false_delay=0 true_size=2 false_size=0
        btfsc c___byte,c___bit
        goto label335__0end
        ; if { sweep_index + 1 >= sweep_count } body start
        ;   sweep_direction := 0  
        bcf main__sweep_direction__byte,main__sweep_direction__bit
        ;   sweep_counter := sweep_counter + 1  
        incf main__sweep_counter,f
        ; if { sweep_index + 1 >= sweep_count } body end
label335__0end:
        ; if exp=` sweep_index + 1 >= sweep_count ' empty false
        ; Other expression=`{ sweep_index + 1 >= sweep_count }' delay=-1
        ; if { sweep_index + 1 >= sweep_count } end
        ; if { sweep_direction } body end
        goto label333__0end
label333__0false:
        ; else body start
        ; Going down :
        ; if { sweep_index = 0 } start
        movf main__sweep_index,w
        ; expression=`{ sweep_index = 0 }' exp_delay=1 true_delay=4  false_delay=0 true_size=4 false_size=0
        btfss z___byte,z___bit
        goto label341__0end
        ; if { sweep_index = 0 } body start
        ;   sweep_direction := 1  
        bsf main__sweep_direction__byte,main__sweep_direction__bit
        ;   servo := sweep_initial  
        movf main__sweep_initial,w
        movwf main__servo
        ;   sweep_counter := sweep_counter + 1  
        incf main__sweep_counter,f
        ; if { sweep_index = 0 } body end
label341__0end:
        ; if exp=` sweep_index = 0 ' empty false
        ; Other expression=`{ sweep_index = 0 }' delay=-1
        ; if { sweep_index = 0 } end
        ; else body end
        ; if exp=`sweep_direction' generic
label333__0end:
        ; Other expression=`{ sweep_direction }' delay=-1
        ; if { sweep_direction } end
        ; Update the sweep index and corresponding
        ; servo position :
        ; if { sweep_direction } start
        ; expression=`{ sweep_direction }' exp_delay=0 true_delay=3  false_delay=6 true_size=3 false_size=6
        btfss main__sweep_direction__byte,main__sweep_direction__bit
        goto label350__0false
label350__0true:
        ; if { sweep_direction } body start
        ;   sweep_index := sweep_index + 1  
        incf main__sweep_index,f
        ;   servo := servo + sweep_increment  
        movf main__sweep_increment,w
        addwf main__servo,f
        ; if { sweep_direction } body end
        goto label350__0end
label350__0false:
        ; else body start
        ;   sweep_index := sweep_index - 1  
        decf main__sweep_index,f
        ;   servo := servo - sweep_increment  
        movf main__servo,w
        movwf main__355byte0
        movf main__sweep_increment,w
        subwf main__355byte0,w
        movwf main__servo
        ; else body end
        ; if exp=`sweep_direction' generic
label350__0end:
        ; Other expression=`{ sweep_direction }' delay=-1
        ; if { sweep_direction } end
        ; if { z } body end
label327__0end:
        ; if exp=`z' empty false
        ; Other expression=`{ z }' delay=-1
        ; if { z } end
        ; if { sweep_enable } body end
label325__0end:
        ; if exp=`sweep_enable' empty false
        ; Other expression=`{ sweep_enable }' delay=-1
        ; if { sweep_enable } end
        ; else body end
        goto label311__0end
label311__0true:
        ; if { phase } body start
        ;   phase := 0  
        bcf main__phase__byte,main__phase__bit
        ; if { phase } body end
        ; if exp=`phase' generic
label311__0end:
        ; Other expression=`{ phase }' delay=-1
        ; if { phase } end
        ; if { c } body end
label308__0end:
        ; if exp=`c' empty false
        ; Other expression=`{ c }' delay=-1
        ; if { c } end
        ; if { t0if && servo_enable } body end
label305__1end:
        ; if exp=`servo_enable' empty false
        ; Other expression=`servo_enable' delay=-1
        ; if exp=`t0if' false goto
        ; Other expression=`t0if' delay=-1
and305__0false:
and305__0end:
        ; if { t0if && servo_enable } end
        ; Deal with turning off servo pulse :
        ; if { tmr2if } start
        ; expression=`{ tmr2if }' exp_delay=0 true_delay=3  false_delay=0 true_size=3 false_size=0
        btfss tmr2if__byte,tmr2if__bit
        goto label364__0end
        ; if { tmr2if } body start
        ;   tmr2if := 0  
        bcf tmr2if__byte,tmr2if__bit
        ;   servo_out := 0  
        bcf servo_out__byte,servo_out__bit
        ;   tmr2on := 0  
        bcf tmr2on__byte,tmr2on__bit
        ; if { tmr2if } body end
label364__0end:
        ; if exp=`tmr2if' empty false
        ; Other expression=`{ tmr2if }' delay=-1
        ; if { tmr2if } end
        ; See whether we can transmit a character :
        ; if { send_in_index != send_out_index && txif } start
        movf send_in_index,w
        subwf send_out_index,w
        ; expression=`send_in_index != send_out_index' exp_delay=2 true_delay=-1  false_delay=2 true_size=13 false_size=1
        btfsc z___byte,z___bit
        goto and371__0false
        ; expression=`txif' exp_delay=0 true_delay=11  false_delay=0 true_size=11 false_size=0
        btfss txif__byte,txif__bit
        goto label371__1end
and371__0true:
        ; if { send_in_index != send_out_index && txif } body start
        ;   txreg := send_buffer ~~ {{ send_out_index }}  
        movlw LOW send_buffer
        addwf send_out_index,w
        movwf fsr___register
        bcf irp___register,irp___bit
        movf indf___register,w
        movwf txreg
        ;   send_out_index := send_out_index + 1  
        incf send_out_index,f
        ; if { send_out_index >= send_buffer_size } start
        movlw 10
        subwf send_out_index,w
        ; expression=`{ send_out_index >= send_buffer_size }' exp_delay=2 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfsc c___byte,c___bit
        ; if { send_out_index >= send_buffer_size } body start
        ;   send_out_index := 0  
        clrf send_out_index
        ; if { send_out_index >= send_buffer_size } body end
        ; if exp=` send_out_index >= send_buffer_size ' false skip delay=4
        ; Other expression=`{ send_out_index >= send_buffer_size }' delay=4
        ; if { send_out_index >= send_buffer_size } end
        ; if { send_in_index != send_out_index && txif } body end
label371__1end:
        ; if exp=`txif' empty false
        ; Other expression=`txif' delay=-1
        ; if exp=`send_in_index != send_out_index' false goto
        ; Other expression=`send_in_index != send_out_index' delay=-1
and371__0false:
and371__0end:
        ; if { send_in_index != send_out_index && txif } end
        ; See whether we ' ve got a character :
        ; if { rcif } start
        ; expression=`{ rcif }' exp_delay=0 true_delay=178  false_delay=0 true_size=347 false_size=0
        btfss rcif__byte,rcif__bit
        goto label380__0end
        ; if { rcif } body start
        ; Read the command :
        ; switch { command_have }
        movlw HIGH switch__382block_start
        movwf pclath___register
        movf main__command_have,w
        ; case 0
        ; case 1
        ; case 2
switch__382block_start:
        addwf pcl___register,f
        goto switch__382block383
        goto switch__382block386
        goto switch__382block389
switch__382block_end:
        ; switch_check 382 switch__382block_start switch__382block_end
switch__382block383:
        ;   command := rcreg  
        movf rcreg,w
        movwf main__command
        goto switch__382end
switch__382block386:
        ;   command1 := rcreg  
        movf rcreg,w
        movwf main__command1
        goto switch__382end
switch__382block389:
        ;   command2 := rcreg  
        movf rcreg,w
        movwf main__command2
switch__382end:
        ;   command_have := command_have + 1  
        incf main__command_have,f
        ; switch { command >> 6 }
        movlw HIGH switch__395block_start
        movwf pclath___register
        swapf main__command,w
        movwf main__395byte0
        rrf main__395byte0,f
        rrf main__395byte0,w
        andlw 3
        ; case 0
        ; case 1
        ; case 2
        ; case 3
switch__395block_start:
        addwf pcl___register,f
        goto switch__395block396
        goto switch__395block482
        goto switch__395block609
        goto switch__395block612
switch__395block_end:
        ; switch_check 395 switch__395block_start switch__395block_end
switch__395block396:
        ; Do Nothing :
        ; switch { {{ command >> 3 }} & 7 }
        movlw HIGH switch__398block_start
        movwf pclath___register
        rrf main__command,w
        movwf main__398byte0
        rrf main__398byte0,f
        rrf main__398byte0,w
        andlw 7
        ; case 0
        ; case 1
        ; case 2 3
        ; case 4 5
switch__398block_start:
        addwf pcl___register,f
        goto switch__398block399
        goto switch__398block439
        goto switch__398block469
        goto switch__398block469
        goto switch__398block473
        goto switch__398block473
        goto switch__398default477
        goto switch__398default477
switch__398block_end:
        ; switch_check 398 switch__398block_start switch__398block_end
switch__398block399:
        ; Command = 0000 0 xxx
        ; switch { command & 7 }
        movlw HIGH switch__401block_start
        movwf pclath___register
        movlw 7
        andwf main__command,w
        ; case 0
        ; case 1
        ; case 2
        ; case 3
        ; case 4
        ; case 5
        ; case 6
        ; case 7
switch__401block_start:
        addwf pcl___register,f
        goto switch__401block402
        goto switch__401block406
        goto switch__401block410
        goto switch__401block415
        goto switch__401block419
        goto switch__401block423
        goto switch__401block427
        goto switch__401block432
switch__401block_end:
        ; switch_check 401 switch__401block_start switch__401block_end
switch__401block402:
        ; Read Distance Low < Command = 0000 0000 > :
        ;   call send_byte {{ distance_low }}  
        movf main__distance_low,w
        movwf send_byte__character
        call send_byte
        goto switch__401end
switch__401block406:
        ; Read Distance High < Command = 0000 0001 > :
        ;   call send_byte {{ distance_high }}  
        movf main__distance_high,w
        movwf send_byte__character
        call send_byte
        goto switch__401end
switch__401block410:
        ; Read Distance Low and High < Command = 0000 0010 > :
        ;   call send_byte {{ distance_low }}  
        movf main__distance_low,w
        movwf send_byte__character
        call send_byte
        ;   call send_byte {{ distance_high }}  
        movf main__distance_high,w
        movwf send_byte__character
        call send_byte
        goto switch__401end
switch__401block415:
        ; Trigger Distance Measurement < Command 0000 0011 > :
        ;   tmr1on := 1  
        bsf tmr1on__byte,tmr1on__bit
        goto switch__401end
switch__401block419:
        ; Disable Servo < Command 0000 0100 > :
        ;   servo_enable := 0  
        bcf main__servo_enable__byte,main__servo_enable__bit
        goto switch__401end
switch__401block423:
        ; Enable Servo < Command 0000 0101 > :
        ;   servo_enable := 1  
        bsf main__servo_enable__byte,main__servo_enable__bit
        goto switch__401end
switch__401block427:
        ; Disable Continuous Measurement < Command 0000 0110 > :
        ;   continuous := 0  
        bcf main__continuous__byte,main__continuous__bit
        ;   tmr1on := 0  
        bcf tmr1on__byte,tmr1on__bit
        goto switch__401end
switch__401block432:
        ; Enable Continuous Measurement < Command 0000 0111 > :
        ;   continuous := 1  
        bsf main__continuous__byte,main__continuous__bit
        ;   tmr1on := 1  
        bsf tmr1on__byte,tmr1on__bit
switch__401end:
        goto switch__398end
switch__398block439:
        ; switch { command & 7 }
        movlw HIGH switch__440block_start
        movwf pclath___register
        movlw 7
        andwf main__command,w
        ; case 0
        ; case 1
        ; case 2
        ; case 3
switch__440block_start:
        addwf pcl___register,f
        goto switch__440block441
        goto switch__440block445
        goto switch__440block449
        goto switch__440block453
        goto switch__440default464
        goto switch__440default464
        goto switch__440default464
        goto switch__440default464
switch__440block_end:
        ; switch_check 440 switch__440block_start switch__440block_end
switch__440block441:
        ; Increment Servo < Command 0000 1000 > :
        ;   servo := servo + 1  
        incf main__servo,f
        goto switch__440end
switch__440block445:
        ; Decrement Servo < Command 0000 1001 > :
        ;   servo := servo - 1  
        decf main__servo,f
        goto switch__440end
switch__440block449:
        ; Increment Servo < Command 0000 1010 > :
        ;   call send_byte {{ servo }}  
        movf main__servo,w
        movwf send_byte__character
        call send_byte
        goto switch__440end
switch__440block453:
        ; Decrement Servo < Command 0000 1011 > :
        ;   result := 0  
        clrf main__result
        ; if { servo_enable } start
        ; expression=`{ servo_enable }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfsc main__servo_enable__byte,main__servo_enable__bit
        ; if { servo_enable } body start
        ;   result @ 0 := 1  
        ; Select result @ 0
main__result__457select0 equ main__result+0
main__result__457select0__byte equ main__result+0
main__result__457select0__bit equ 0
        bsf main__result__457select0__byte,main__result__457select0__bit
        ; if { servo_enable } body end
        ; if exp=`servo_enable' false skip delay=2
        ; Other expression=`{ servo_enable }' delay=2
        ; if { servo_enable } end
        ; if { continuous } start
        ; expression=`{ continuous }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfsc main__continuous__byte,main__continuous__bit
        ; if { continuous } body start
        ;   result @ 1 := 1  
        ; Select result @ 1
main__result__460select0 equ main__result+0
main__result__460select0__byte equ main__result+0
main__result__460select0__bit equ 1
        bsf main__result__460select0__byte,main__result__460select0__bit
        ; if { continuous } body end
        ; if exp=`continuous' false skip delay=2
        ; Other expression=`{ continuous }' delay=2
        ; if { continuous } end
        ;   call send_byte {{ result }}  
        movf main__result,w
        movwf send_byte__character
        call send_byte
        goto switch__440end
switch__440default464:
        ; Do nothing
switch__440end:
        goto switch__398end
switch__398block469:
        ; Set Servo Low < Command 0001 llll > :
        ;   servo := servo & 0xf0 | command & 0xf  
        movlw 240
        andwf main__servo,w
        movwf main__471byte0
        movlw 15
        andwf main__command,w
        iorwf main__471byte0,w
        movwf main__servo
        goto switch__398end
switch__398block473:
        ; Set Servo High < Command 0010 hhhh > :
        ;   servo := servo & 0xf | command << 4  
        movlw 15
        andwf main__servo,w
        movwf main__475byte1
        swapf main__command,w
        andlw 240
        iorwf main__475byte1,w
        movwf main__servo
        goto switch__398end
switch__398default477:
        ; Do Nothing :
switch__398end:
        goto switch__395end
switch__395block482:
        ; Command = 01 xx xxxx :
        ; switch { {{ command >> 3 }} & 7 }
        movlw HIGH switch__484block_start
        movwf pclath___register
        rrf main__command,w
        movwf main__484byte0
        rrf main__484byte0,f
        rrf main__484byte0,w
        andlw 7
        ; case 0
        ; case 1
        ; case 2 3
        ; case 4 5
        ; case 6
switch__484block_start:
        addwf pcl___register,f
        goto switch__484block485
        goto switch__484block546
        goto switch__484block582
        goto switch__484block582
        goto switch__484block588
        goto switch__484block588
        goto switch__484block593
        goto switch__484default600
switch__484block_end:
        ; switch_check 484 switch__484block_start switch__484block_end
switch__484block485:
        ; Command = 0100 0 xxx :
        ; switch { command & 7 }
        movlw HIGH switch__487block_start
        movwf pclath___register
        movlw 7
        andwf main__command,w
        ; case 0
        ; case 1
        ; case 2
        ; case 3
        ; case 4
        ; case 5
        ; case 6 7
switch__487block_start:
        addwf pcl___register,f
        goto switch__487block488
        goto switch__487block495
        goto switch__487block502
        goto switch__487block512
        goto switch__487block519
        goto switch__487block526
        goto switch__487block529
        goto switch__487block529
switch__487block_end:
        ; switch_check 487 switch__487block_start switch__487block_end
switch__487block488:
        ; Set Sweep Initial Position < command 0100 0000 > :
        ;   command_need := 2  
        movlw 2
        movwf main__command_need
        ; if { command_have = command_need } start
        movf main__command_have,w
        subwf main__command_need,w
        ; expression=`{ command_have = command_need }' exp_delay=2 true_delay=2  false_delay=0 true_size=2 false_size=0
        btfss z___byte,z___bit
        goto label491__0end
        ; if { command_have = command_need } body start
        ;   sweep_initial := command1  
        movf main__command1,w
        movwf main__sweep_initial
        ; if { command_have = command_need } body end
label491__0end:
        ; if exp=` command_have = command_need ' empty false
        ; Other expression=`{ command_have = command_need }' delay=-1
        ; if { command_have = command_need } end
        goto switch__487end
switch__487block495:
        ; Set Sweep Increment < command 0100 0001 > :
        ;   command_need := 2  
        movlw 2
        movwf main__command_need
        ; if { command_have = command_need } start
        movf main__command_have,w
        subwf main__command_need,w
        ; expression=`{ command_have = command_need }' exp_delay=2 true_delay=2  false_delay=0 true_size=2 false_size=0
        btfss z___byte,z___bit
        goto label498__0end
        ; if { command_have = command_need } body start
        ;   sweep_increment := command1  
        movf main__command1,w
        movwf main__sweep_increment
        ; if { command_have = command_need } body end
label498__0end:
        ; if exp=` command_have = command_need ' empty false
        ; Other expression=`{ command_have = command_need }' delay=-1
        ; if { command_have = command_need } end
        goto switch__487end
switch__487block502:
        ; Set Sweep Count < command 0100 0010 > :
        ;   command_need := 2  
        movlw 2
        movwf main__command_need
        ; if { command_have = command_need } start
        movf main__command_have,w
        subwf main__command_need,w
        ; expression=`{ command_have = command_need }' exp_delay=2 true_delay=-1  false_delay=0 true_size=8 false_size=0
        btfss z___byte,z___bit
        goto label505__0end
        ; if { command_have = command_need } body start
        ;   sweep_count := command1  
        movf main__command1,w
        movwf main__sweep_count
        ; if { sweep_count > 16 } start
        movlw 17
        subwf main__sweep_count,w
        ; expression=`{ sweep_count > 16 }' exp_delay=2 true_delay=2  false_delay=0 true_size=2 false_size=0
        btfss c___byte,c___bit
        goto label507__0end
        ; if { sweep_count > 16 } body start
        ;   sweep_count := 16  
        movlw 16
        movwf main__sweep_count
        ; if { sweep_count > 16 } body end
label507__0end:
        ; if exp=` sweep_count > 16 ' empty false
        ; Other expression=`{ sweep_count > 16 }' delay=-1
        ; if { sweep_count > 16 } end
        ; if { command_have = command_need } body end
label505__0end:
        ; if exp=` command_have = command_need ' empty false
        ; Other expression=`{ command_have = command_need }' delay=-1
        ; if { command_have = command_need } end
        goto switch__487end
switch__487block512:
        ; Set Sweep Delay < command 0100 0011 > :
        ;   command_need := 2  
        movlw 2
        movwf main__command_need
        ; if { command_have = command_need } start
        movf main__command_have,w
        subwf main__command_need,w
        ; expression=`{ command_have = command_need }' exp_delay=2 true_delay=2  false_delay=0 true_size=2 false_size=0
        btfss z___byte,z___bit
        goto label515__0end
        ; if { command_have = command_need } body start
        ;   sweep_delay := command1  
        movf main__command1,w
        movwf main__sweep_delay
        ; if { command_have = command_need } body end
label515__0end:
        ; if exp=` command_have = command_need ' empty false
        ; Other expression=`{ command_have = command_need }' delay=-1
        ; if { command_have = command_need } end
        goto switch__487end
switch__487block519:
        ; Set Sweep Counter < command 0100 0100 > :
        ;   command_need := 2  
        movlw 2
        movwf main__command_need
        ; if { command_have = command_need } start
        movf main__command_have,w
        subwf main__command_need,w
        ; expression=`{ command_have = command_need }' exp_delay=2 true_delay=2  false_delay=0 true_size=2 false_size=0
        btfss z___byte,z___bit
        goto label522__0end
        ; if { command_have = command_need } body start
        ;   sweep_counter := command1  
        movf main__command1,w
        movwf main__sweep_counter
        ; if { command_have = command_need } body end
label522__0end:
        ; if exp=` command_have = command_need ' empty false
        ; Other expression=`{ command_have = command_need }' delay=-1
        ; if { command_have = command_need } end
        goto switch__487end
switch__487block526:
        ; Do_nothing < command 0100 0101 > :
        goto switch__487end
switch__487block529:
        ; Set Sweep Enable < command 0100 011 s > :
        ;   sweep_enable := 0  
        bcf main__sweep_enable__byte,main__sweep_enable__bit
        ; if { command @ 0 } start
        ; Alias variable for select command @ 0
main__command__532select0 equ main__command+0
main__command__532select0__byte equ main__command+0
main__command__532select0__bit equ 0
        ; expression=`{ command @ 0 }' exp_delay=0 true_delay=5  false_delay=2 true_size=5 false_size=2
        btfsc main__command__532select0__byte,main__command__532select0__bit
        goto label532__1true
label532__1false:
        ; else body start
        ;   sweep_enable := 0  
        bcf main__sweep_enable__byte,main__sweep_enable__bit
        ;   servo_enable := 0  
        bcf main__servo_enable__byte,main__servo_enable__bit
        ;   servo := sweep_initial  
        ; 2 instructions found for sharing
        goto label532__1end
label532__1true:
        ; if { command @ 0 } body start
        ;   sweep_sleep := 15  
        movlw 15
        movwf main__sweep_sleep
        ;   sweep_enable := 1  
        bsf main__sweep_enable__byte,main__sweep_enable__bit
        ;   sweep_index := 0  
        clrf main__sweep_index
        ;   servo_enable := 1  
        bsf main__servo_enable__byte,main__servo_enable__bit
        ;   servo := sweep_initial  
        ; 2 instructions found for sharing
        ; if exp=` command @ 0 ' generic
label532__1end:
        ; Other expression=`{ command @ 0 }' delay=-1
        ; 2 shared instructions follow
        movf main__sweep_initial,w
        movwf main__servo
        ; if { command @ 0 } end
switch__487end:
        goto switch__484end
switch__484block546:
        ; Command = 0100 1 xxx :
        ; switch { command & 7 }
        movlw HIGH switch__548block_start
        movwf pclath___register
        movlw 7
        andwf main__command,w
        ; case 0
        ; case 1
        ; case 2
        ; case 3
        ; case 4
        ; case 5
switch__548block_start:
        addwf pcl___register,f
        goto switch__548block549
        goto switch__548block553
        goto switch__548block557
        goto switch__548block561
        goto switch__548block565
        goto switch__548block569
        goto switch__548default577
        goto switch__548default577
switch__548block_end:
        ; switch_check 548 switch__548block_start switch__548block_end
switch__548block549:
        ; Read Sweep Initial Position < command 0100 1000 > :
        ;   call send_byte {{ sweep_initial }}  
        movf main__sweep_initial,w
        movwf send_byte__character
        call send_byte
        goto switch__548end
switch__548block553:
        ; Read Sweep Increment < command 0100 1001 > :
        ;   call send_byte {{ sweep_increment }}  
        movf main__sweep_increment,w
        movwf send_byte__character
        call send_byte
        goto switch__548end
switch__548block557:
        ; Read Sweep Count < command 0100 1010 > :
        ;   call send_byte {{ sweep_count }}  
        movf main__sweep_count,w
        movwf send_byte__character
        call send_byte
        goto switch__548end
switch__548block561:
        ; Read Sweep Delay < command 0100 1011 > :
        ;   call send_byte {{ sweep_delay }}  
        movf main__sweep_delay,w
        movwf send_byte__character
        call send_byte
        goto switch__548end
switch__548block565:
        ; Read Sweep Counter < command 0100 0100 > :
        ;   call send_byte {{ sweep_counter }}  
        movf main__sweep_counter,w
        movwf send_byte__character
        call send_byte
        goto switch__548end
switch__548block569:
        ; Read Sweep Enable < command 0100 0101 > :
        ;   result := 0  
        clrf main__result
        ; if { sweep_enable } start
        ; expression=`{ sweep_enable }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfsc main__sweep_enable__byte,main__sweep_enable__bit
        ; if { sweep_enable } body start
        ;   result @ 0 := 1  
        ; Select result @ 0
main__result__573select0 equ main__result+0
main__result__573select0__byte equ main__result+0
main__result__573select0__bit equ 0
        bsf main__result__573select0__byte,main__result__573select0__bit
        ; if { sweep_enable } body end
        ; if exp=`sweep_enable' false skip delay=2
        ; Other expression=`{ sweep_enable }' delay=2
        ; if { sweep_enable } end
        ;   call send_byte {{ result }}  
        movf main__result,w
        movwf send_byte__character
        call send_byte
        goto switch__548end
switch__548default577:
        ; Do nothing .
switch__548end:
        goto switch__484end
switch__484block582:
        ; Read Sweep Index High and Low < command 0101 iiii > :
        ;   result := command & 0xf  
        movlw 15
        andwf main__command,w
        movwf main__result
        ;   call send_byte {{ sweep_highs ~~ {{ result }} }}  
        movlw LOW main__sweep_highs
        addwf main__result,w
        movwf fsr___register
        bcf irp___register,irp___bit
        movf indf___register,w
        movwf send_byte__character
        call send_byte
        ;   call send_byte {{ sweep_lows ~~ {{ result }} }}  
        movlw LOW main__sweep_lows
        addwf main__result,w
        movwf fsr___register
        bcf irp___register,irp___bit
        movf indf___register,w
        movwf send_byte__character
        call send_byte
        goto switch__484end
switch__484block588:
        ; Read Sweep Index High Only < command 0101 iiii > :
        ;   result := command & 0xf  
        movlw 15
        andwf main__command,w
        movwf main__result
        ;   call send_byte {{ sweep_highs ~~ {{ result }} }}  
        movlw LOW main__sweep_highs
        addwf main__result,w
        movwf fsr___register
        bcf irp___register,irp___bit
        movf indf___register,w
        movwf send_byte__character
        call send_byte
        goto switch__484end
switch__484block593:
        ; Write into memory :
        ;   command_need := 3  
        movlw 3
        movwf main__command_need
        ; if { command_need = command_have } start
        subwf main__command_have,w
        ; expression=`{ command_need = command_have }' exp_delay=2 true_delay=8  false_delay=0 true_size=8 false_size=0
        btfss z___byte,z___bit
        goto label596__0end
        ; if { command_need = command_have } body start
        ;   sweep_highs ~~ {{ command1 }} := command2  
        movf main__command2,w
        movwf main__597byte0
        movlw LOW main__sweep_highs
        addwf main__command1,w
        movwf fsr___register
        movf main__597byte0,w
        bcf irp___register,irp___bit
        movwf indf___register
        ; if { command_need = command_have } body end
label596__0end:
        ; if exp=` command_need = command_have ' empty false
        ; Other expression=`{ command_need = command_have }' delay=-1
        ; if { command_need = command_have } end
        goto switch__484end
switch__484default600:
        ; Do nothing :
        ;   command_need := 2  
        movlw 2
        movwf main__command_need
        ; if { command_need = command_have } start
        subwf main__command_have,w
        ; expression=`{ command_need = command_have }' exp_delay=2 true_delay=5  false_delay=0 true_size=7 false_size=0
        btfss z___byte,z___bit
        goto label603__0end
        ; if { command_need = command_have } body start
        ;   call send_byte {{ sweep_highs ~~ {{ command1 }} }}  
        movlw LOW main__sweep_highs
        addwf main__command1,w
        movwf fsr___register
        bcf irp___register,irp___bit
        movf indf___register,w
        movwf send_byte__character
        call send_byte
        ; if { command_need = command_have } body end
label603__0end:
        ; if exp=` command_need = command_have ' empty false
        ; Other expression=`{ command_need = command_have }' delay=-1
        ; if { command_need = command_have } end
switch__484end:
        goto switch__395end
switch__395block609:
        ; Do Nothing :
        goto switch__395end
switch__395block612:
        ; Do shared commands :
        ; if { command >> 3 & 7 = 7 } start
        rrf main__command,w
        movwf main__614byte2
        rrf main__614byte2,f
        rrf main__614byte2,w
        andlw 7
        movwf main__614byte1
        movlw 7
        subwf main__614byte1,w
        ; expression=`{ command >> 3 & 7 = 7 }' exp_delay=9 true_delay=1  false_delay=0 true_size=3 false_size=0
        btfss z___byte,z___bit
        goto label614__3end
        ; if { command >> 3 & 7 = 7 } body start
        ;   call do_shared {{ command }}  
        movf main__command,w
        movwf do_shared__command
        call do_shared
        ; if { command >> 3 & 7 = 7 } body end
label614__3end:
        ; if exp=` command >> 3 & 7 = 7 ' empty false
        ; Other expression=`{ command >> 3 & 7 = 7 }' delay=-1
        ; if { command >> 3 & 7 = 7 } end
switch__395end:
        ; if { rcif } body end
label380__0end:
        ; if exp=`rcif' empty false
        ; Other expression=`{ rcif }' delay=-1
        ; if { rcif } end
        ; Reset command reader :
        ; if { command_have = command_need } start
        movf main__command_have,w
        subwf main__command_need,w
        ; expression=`{ command_have = command_need }' exp_delay=2 true_delay=3  false_delay=0 true_size=3 false_size=0
        btfss z___byte,z___bit
        goto label622__0end
        ; if { command_have = command_need } body start
        ;   command_need := 1  
        movlw 1
        movwf main__command_need
        ;   command_have := 0  
        clrf main__command_have
        ; if { command_have = command_need } body end
label622__0end:
        ; if exp=` command_have = command_need ' empty false
        ; Other expression=`{ command_have = command_need }' delay=-1
        ; if { command_have = command_need } end
        ; Read the captured distance :
        ; if { ccp1if } start
        ; expression=`{ ccp1if }' exp_delay=0 true_delay=42  false_delay=0 true_size=42 false_size=0
        btfss ccp1if__byte,ccp1if__bit
        goto label628__0end
        ; if { ccp1if } body start
        ;   ccp1if := 0  
        bcf ccp1if__byte,ccp1if__bit
        ;   distance_high := ccpr1h  
        movf ccpr1h,w
        movwf main__distance_high
        ;   distance_low := ccpr1l  
        movf ccpr1l,w
        movwf main__distance_low
        ; Make distance visible in LED ' s :
        ;   leds := 0xff ^ ccpr1h  
        movlw 255
        xorwf ccpr1h,w
        movwf main__leds
        ;   led1 := leds @ 0  
        ; Alias variable for select leds @ 0
main__leds__636select0 equ main__leds+0
main__leds__636select0__byte equ main__leds+0
main__leds__636select0__bit equ 0
        btfss main__leds__636select0__byte,main__leds__636select0__bit
        bcf led1__byte,led1__bit
        btfsc main__leds__636select0__byte,main__leds__636select0__bit
        bsf led1__byte,led1__bit
        ;   led2 := leds @ 1  
        ; Alias variable for select leds @ 1
main__leds__637select0 equ main__leds+0
main__leds__637select0__byte equ main__leds+0
main__leds__637select0__bit equ 1
        btfss main__leds__637select0__byte,main__leds__637select0__bit
        bcf led2__byte,led2__bit
        btfsc main__leds__637select0__byte,main__leds__637select0__bit
        bsf led2__byte,led2__bit
        ;   led3 := leds @ 2  
        ; Alias variable for select leds @ 2
main__leds__638select0 equ main__leds+0
main__leds__638select0__byte equ main__leds+0
main__leds__638select0__bit equ 2
        btfss main__leds__638select0__byte,main__leds__638select0__bit
        bcf led3__byte,led3__bit
        btfsc main__leds__638select0__byte,main__leds__638select0__bit
        bsf led3__byte,led3__bit
        ;   led4 := leds @ 3  
        ; Alias variable for select leds @ 3
main__leds__639select0 equ main__leds+0
main__leds__639select0__byte equ main__leds+0
main__leds__639select0__bit equ 3
        btfss main__leds__639select0__byte,main__leds__639select0__bit
        bcf led4__byte,led4__bit
        btfsc main__leds__639select0__byte,main__leds__639select0__bit
        bsf led4__byte,led4__bit
        ;   led5 := leds @ 4  
        ; Alias variable for select leds @ 4
main__leds__640select0 equ main__leds+0
main__leds__640select0__byte equ main__leds+0
main__leds__640select0__bit equ 4
        btfss main__leds__640select0__byte,main__leds__640select0__bit
        bcf led5__byte,led5__bit
        btfsc main__leds__640select0__byte,main__leds__640select0__bit
        bsf led5__byte,led5__bit
        ;   led6 := leds @ 5  
        ; Alias variable for select leds @ 5
main__leds__641select0 equ main__leds+0
main__leds__641select0__byte equ main__leds+0
main__leds__641select0__bit equ 5
        btfss main__leds__641select0__byte,main__leds__641select0__bit
        bcf led6__byte,led6__bit
        btfsc main__leds__641select0__byte,main__leds__641select0__bit
        bsf led6__byte,led6__bit
        ;   led7 := leds @ 6  
        ; Alias variable for select leds @ 6
main__leds__642select0 equ main__leds+0
main__leds__642select0__byte equ main__leds+0
main__leds__642select0__bit equ 6
        btfss main__leds__642select0__byte,main__leds__642select0__bit
        bcf led7__byte,led7__bit
        btfsc main__leds__642select0__byte,main__leds__642select0__bit
        bsf led7__byte,led7__bit
        ;   led8 := leds @ 7  
        ; Alias variable for select leds @ 7
main__leds__643select0 equ main__leds+0
main__leds__643select0__byte equ main__leds+0
main__leds__643select0__bit equ 7
        btfss main__leds__643select0__byte,main__leds__643select0__bit
        bcf led8__byte,led8__bit
        btfsc main__leds__643select0__byte,main__leds__643select0__bit
        bsf led8__byte,led8__bit
        ; if { ! continuous } start
        ; expression=`continuous' exp_delay=0 true_delay=0  false_delay=1 true_size=0 false_size=1
        btfss main__continuous__byte,main__continuous__bit
        ; if { ! continuous } body start
        ;   tmr1on := 0  
        bcf tmr1on__byte,tmr1on__bit
        ; if { ! continuous } body end
        ; if exp=`continuous' true skip delay=2
        ; Other expression=`continuous' delay=2
        ; if { ! continuous } end
        ; if { ccp1if } body end
label628__0end:
        ; if exp=`ccp1if' empty false
        ; Other expression=`{ ccp1if }' delay=-1
        ; if { ccp1if } end
        ; See whether we need to generate another trigger pulse :
        ; if { tmr1if } start
        ; expression=`{ tmr1if }' exp_delay=0 true_delay=54  false_delay=0 true_size=18 false_size=0
        btfss tmr1if__byte,tmr1if__bit
        goto label651__0end
        ; if { tmr1if } body start
        ; Make sure trigger is low for at least 10 uSec :
        ;   tmr1if := 0  
        bcf tmr1if__byte,tmr1if__bit
        ; delay 25 ... start
        ; optimize 0
        ; Uniform delay remaining = 25 Accumulated Delay = 0
        ;   tmr1on := 0  
        bcf tmr1on__byte,tmr1on__bit
        ; Uniform delay remaining = 24 Accumulated Delay = 1
        ;   tmr1l := 0  
        clrf tmr1l
        ; Uniform delay remaining = 23 Accumulated Delay = 2
        ;   tmr1h := 0  
        clrf tmr1h
        ; Uniform delay remaining = 22 Accumulated Delay = 3
        ; Uniform delay remaining = 22 Accumulated Delay = 3
        ; Delay 22 cycles
        movlw 7
        movwf main__655byte1
main__655delay0:
        decfsz main__655byte1,f
        goto main__655delay0
        ; optimize 1
        ; delay 25 ... end
        ; Fire trigger for 10 uSec :
        ;   trigger := 1  
        bsf trigger__byte,trigger__bit
        ; delay 25 ... start
        ; optimize 0
        ; Uniform delay remaining = 25 Accumulated Delay = 0
        ;   ccp1if := 0  
        bcf ccp1if__byte,ccp1if__bit
        ; Uniform delay remaining = 24 Accumulated Delay = 1
        ; Uniform delay remaining = 24 Accumulated Delay = 1
        ; Delay 24 cycles
        movlw 7
        movwf main__663byte1
main__663delay0:
        decfsz main__663byte1,f
        goto main__663delay0
        nop
        nop
        ; optimize 1
        ; delay 25 ... end
        ; Turn the timer on when trigger goes low :
        ;   trigger := 0  
        bcf trigger__byte,trigger__bit
        ;   tmr1on := 1  
        bsf tmr1on__byte,tmr1on__bit
        ; if { tmr1if } body end
label651__0end:
        ; if exp=`tmr1if' empty false
        ; Other expression=`{ tmr1if }' delay=-1
        ; if { tmr1if } end
        goto main__303loop__forever
        ; loop_forever ... end
        ; procedure main end

        ; procedure do_shared start
do_shared:
do_shared__variables__base equ global__variables__bank0+68
do_shared__bytes__base equ do_shared__variables__base+0
do_shared__bits__base equ do_shared__variables__base+1
do_shared__total__bytes equ 1
do_shared__command equ do_shared__bytes__base+0
        ; Command 1111 1 xxx :
        ; switch { command & 7 }
        movlw HIGH switch__680block_start
        movwf pclath___register
        movlw 7
        andwf do_shared__command,w
        ; case 0
        ; case 1
        ; case 2
        ; case 3
        ; case 4
        ; case 5
        ; case 6
        ; case 7
switch__680block_start:
        addwf pcl___register,f
        goto switch__680block681
        goto switch__680block684
        goto switch__680block687
        goto switch__680block691
        goto switch__680block695
        goto switch__680block703
        goto switch__680block707
        goto switch__680block712
switch__680block_end:
        ; switch_check 680 switch__680block_start switch__680block_end
switch__680block681:
        ; Clock Decrement < Command 1111 1 xxx > :
        goto switch__680end
switch__680block684:
        ; Clock Increment < Command 1111 1 xxx > :
        goto switch__680end
switch__680block687:
        ; Clock Read < Command 1111 1 xxx > :
        ;   call send_byte {{ 0 }}  
        clrf send_byte__character
        call send_byte
        goto switch__680end
switch__680block691:
        ; Clock Pulse < Command 1111 1 xxx > :
        ;   call send_byte {{ 0 }}  
        clrf send_byte__character
        call send_byte
        goto switch__680end
switch__680block695:
        ; Id Next < Command 1111 1 xxx > :
        ;   call send_byte {{ id ~~ {{ id_index }} }}  
        incf id_index,w
        clrf pclath___register
        call id
        movwf send_byte__character
        call send_byte
        ;   id_index := id_index + 1  
        incf id_index,f
        ; if { id_index >= id . size } start
        movlw 50
        subwf id_index,w
        ; expression=`{ id_index >= id . size }' exp_delay=2 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfsc c___byte,c___bit
        ; if { id_index >= id . size } body start
        ;   id_index := 0  
        clrf id_index
        ; if { id_index >= id . size } body end
        ; if exp=` id_index >= id . size ' false skip delay=4
        ; Other expression=`{ id_index >= id . size }' delay=4
        ; if { id_index >= id . size } end
        goto switch__680end
switch__680block703:
        ; Id Reset < Command 1111 1 xxx > :
        ;   id_index := 0  
        clrf id_index
        goto switch__680end
switch__680block707:
        ; Glitch Read < Command 1111 1110 > :
        ;   call send_byte {{ glitch }}  
        movf glitch,w
        movwf send_byte__character
        call send_byte
        ;   glitch := 0  
        clrf glitch
        goto switch__680end
switch__680block712:
        ; Glitch < Command 1111 1111 > :
        ;   glitch := glitch + 1  
        incf glitch,f
switch__680end:
        ; procedure do_shared end
        retlw 0

        ; procedure initialize start
initialize:
initialize__variables__base equ global__variables__bank0+69
initialize__bytes__base equ initialize__variables__base+0
initialize__bits__base equ initialize__variables__base+0
initialize__total__bytes equ 0
        ;   arguments_none  
        ; Get all interrupts turned off :
        ;   intcon := 0  
        clrf intcon
        ;   pie1 := 0  
        ; Switch from register bank 0 to register bank 1 (which contains pie1)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        clrf pie1
        ;   pir1 := 0  
        ; Switch from register bank 1 to register bank 0 (which contains pir1)
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        clrf pir1
        ; Initialize UART :
        ; Prescaler = low :
        ;   brgh := 0  
        ; Switch from register bank 0 to register bank 1 (which contains brgh__byte)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        bcf brgh__byte,brgh__bit
        ; Baud rate = 2400 baud :
        ;   spbrg := 129  
        movlw 129
        movwf spbrg
        ; Asynchronous mode :
        ;   sync := 0  
        bcf sync__byte,sync__bit
        ; 8 - bit mode :
        ;   tx9 := 0  
        bcf tx9__byte,tx9__bit
        ; Serial Port Enable :
        ;   spen := 1  
        ; Switch from register bank 1 to register bank 0 (which contains spen__byte)
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        bsf spen__byte,spen__bit
        ; Keep interrupts off :
        ;   txie := 0  
        ; Switch from register bank 0 to register bank 1 (which contains txie__byte)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        bcf txie__byte,txie__bit
        ; Clear out an previous character .
        ;   txif := 0  
        ; Switch from register bank 1 to register bank 0 (which contains txif__byte)
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        bcf txif__byte,txif__bit
        ; Enable the transmitter :
        ;   txen := 1  
        ; Switch from register bank 0 to register bank 1 (which contains txen__byte)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        bsf txen__byte,txen__bit
        ; Enable the receiver :
        ; Keep inerrupts off :
        ;   rcie := 0  
        bcf rcie__byte,rcie__bit
        ; Enable continuous reception :
        ;   cren := 1  
        ; Switch from register bank 1 to register bank 0 (which contains cren__byte)
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        bsf cren__byte,cren__bit
        ; Enable single receptions :
        ;   sren := 1  
        bsf sren__byte,sren__bit
        ; Disable address
        ;   aden := 0  
        bcf aden__byte,aden__bit
        ; Initialize the timer 0 module :
        ;   t0cs := 0  
        ; Switch from register bank 0 to register bank 1 (which contains t0cs__byte)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        bcf t0cs__byte,t0cs__bit
        ;   psa := 0  
        bcf psa__byte,psa__bit
        ;   ps2 := 1  
        bsf ps2__byte,ps2__bit
        ;   ps1 := 1  
        bsf ps1__byte,ps1__bit
        ;   ps0 := 1  
        bsf ps0__byte,ps0__bit
        ; Initialize the timer 1 module :
        ; Prescale = 1 : 2
        ;   t1ckps1 := 0  
        ; Switch from register bank 1 to register bank 0 (which contains t1ckps1__byte)
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        bcf t1ckps1__byte,t1ckps1__bit
        ;   t1ckps0 := 1  
        bsf t1ckps0__byte,t1ckps0__bit
        ; Disable oscillator :
        ;   t1oscen := 0  
        bcf t1oscen__byte,t1oscen__bit
        ; T1SYNC not used when TMR1CS = 0 :
        ; t1sync := 0
        ; Internal clock :
        ;   tmr1cs := 0  
        bcf tmr1cs__byte,tmr1cs__bit
        ; Turn timer off :
        ;   tmr1on := 1  
        bsf tmr1on__byte,tmr1on__bit
        ; Clear interrupt flags :
        ;   tmr1ie := 0  
        ; Switch from register bank 0 to register bank 1 (which contains tmr1ie__byte)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        bcf tmr1ie__byte,tmr1ie__bit
        ;   tmr1if := 0  
        ; Switch from register bank 1 to register bank 0 (which contains tmr1if__byte)
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        bcf tmr1if__byte,tmr1if__bit
        ; Initialize the timer 2 module :
        ;   tmr2ie := 0  
        ; Switch from register bank 0 to register bank 1 (which contains tmr2ie__byte)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        bcf tmr2ie__byte,tmr2ie__bit
        ;   tmr2on := 0  
        ; Switch from register bank 1 to register bank 0 (which contains tmr2on__byte)
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        bcf tmr2on__byte,tmr2on__bit
        ; Postscale is 1 : 14
        ;   toutps3 := 1  
        bsf toutps3__byte,toutps3__bit
        ;   toutps2 := 1  
        bsf toutps2__byte,toutps2__bit
        ;   toutps1 := 0  
        bcf toutps1__byte,toutps1__bit
        ;   toutps0 := 1  
        bsf toutps0__byte,toutps0__bit
        ; Prescale is 1 : 4
        ;   t2ckps1 := 0  
        bcf t2ckps1__byte,t2ckps1__bit
        ;   t2ckps0 := 1  
        bsf t2ckps0__byte,t2ckps0__bit
        ; Initialize the Capture / Compare / PWM < CCP > module :
        ; CCP1X and CCP1Y are unused :
        ; Capture mode every falling edge :
        ;   ccp1m3 := 0  
        bcf ccp1m3__byte,ccp1m3__bit
        ;   ccp1m2 := 1  
        bsf ccp1m2__byte,ccp1m2__bit
        ;   ccp1m1 := 0  
        bcf ccp1m1__byte,ccp1m1__bit
        ;   ccp1m0 := 0  
        bcf ccp1m0__byte,ccp1m0__bit
        ; Turn off CCP module :
        ;   ccp1ie := 0  
        ; Switch from register bank 0 to register bank 1 (which contains ccp1ie__byte)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        bcf ccp1ie__byte,ccp1ie__bit
        ;   ccp1if := 0  
        ; Switch from register bank 1 to register bank 0 (which contains ccp1if__byte)
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        bcf ccp1if__byte,ccp1if__bit
        ; Initialize the comparator module :
        ;   c2out := 0  
        bcf c2out__byte,c2out__bit
        ;   c1out := 0  
        bcf c1out__byte,c1out__bit
        ;   c2inv := 0  
        bcf c2inv__byte,c2inv__bit
        ;   c1inv := 0  
        bcf c1inv__byte,c1inv__bit
        ;   cis := 0  
        bcf cis__byte,cis__bit
        ;   cm2 := 1  
        bsf cm2__byte,cm2__bit
        ;   cm1 := 1  
        bsf cm1__byte,cm1__bit
        ;   cm0 := 1  
        bsf cm0__byte,cm0__bit
        ; procedure initialize end
        retlw 0
        ; comment {The following procedures are used to send data back to the master :}

        ; procedure send_byte start
send_byte:
send_byte__variables__base equ global__variables__bank0+69
send_byte__bytes__base equ send_byte__variables__base+0
send_byte__bits__base equ send_byte__variables__base+2
send_byte__total__bytes equ 2
send_byte__826byte0 equ send_byte__bytes__base+1
send_byte__character equ send_byte__bytes__base+0
        ; This procedure will cause < character > to placed into
        ; a ring buffer for transmission .
        ;   send_buffer ~~ {{ send_in_index }} := character  
        movf send_byte__character,w
        movwf send_byte__826byte0
        movlw LOW send_buffer
        addwf send_in_index,w
        movwf fsr___register
        movf send_byte__826byte0,w
        bcf irp___register,irp___bit
        movwf indf___register
        ;   send_in_index := send_in_index + 1  
        incf send_in_index,f
        ; if { send_in_index >= send_buffer_size } start
        movlw 10
        subwf send_in_index,w
        ; expression=`{ send_in_index >= send_buffer_size }' exp_delay=2 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfsc c___byte,c___bit
        ; if { send_in_index >= send_buffer_size } body start
        ;   send_in_index := 0  
        clrf send_in_index
        ; if { send_in_index >= send_buffer_size } body end
        ; if exp=` send_in_index >= send_buffer_size ' false skip delay=4
        ; Other expression=`{ send_in_index >= send_buffer_size }' delay=4
        ; if { send_in_index >= send_buffer_size } end
        ; procedure send_byte end
        retlw 0

        ; Register bank 0 used 71 bytes of 96 available bytes
        ; Register bank 1 used 0 bytes of 80 available bytes
        ; Register bank 2 used 0 bytes of 48 available bytes
        ; Register bank 3 used 0 bytes of 0 available bytes

        end

