        radix dec
global__variables__bank0 equ 32
global__variables__bank1 equ 224
global__bit__variables__bank0 equ 66
global__bit__variables__bank1 equ 224
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:
        ; Use oscillator calibration stored in high memory
        call 1023
        ; Switch from register bank 0 to register bank 1 (which contains 144)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        movwf 144
        ; Initialize A/D system to allow digital I/O
        clrf 145
        movlw 7
        ; Switch from register bank 1 to register bank 0 (which contains 25)
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        movwf 25
        clrf 31
        ; Initialize TRIS registers
        movlw 232
        tris 5
        movlw 241
        tris 7
        clrf pclath___register
        goto main
        ; comment #############################################################################
        ; comment {}
        ; comment {Copyright < c > 2000 - 2003 by Wayne C . Gramlich & William T . Benson .}
        ; 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 the code that implements the Motor2 RoboBrick . Basically}
        ; comment {it just waits for commands that come in at 2400 baud and responds}
        ; comment {to them . See :}
        ; comment {}
        ; comment {http : / / gramlich . net / projects / robobricks / motor2 / index . html}
        ; comment {}
        ; comment {for more details .}
        ; comment {}
        ; comment #############################################################################
        ;   processor pic16f676 bg = bg00 cpd = off cp = off boden = off mclre = off pwrte = off wdte = off fosc = intrc  
        ; 404=0x194 8199=0x2007
        __config 404
configuration___address equ 8199
        ; comment {Define processor constants :}
        ;   constant clock_rate 4000000  
clock_rate equ 4000000
        ;   constant clocks_per_instruction 4  
clocks_per_instruction equ 4
        ;   constant instruction_rate clock_rate / clocks_per_instruction  
instruction_rate equ 1000000
        ; comment {Define serial communication control constants :}
        ;   constant baud_rate 2400  
baud_rate equ 2400
        ;   constant instructions_per_bit instruction_rate / baud_rate  
instructions_per_bit equ 416
        ;   constant delays_per_bit 3  
delays_per_bit equ 3
        ;   constant instructions_per_delay instructions_per_bit / delays_per_bit  
instructions_per_delay equ 138
        ;   constant extra_instructions_per_bit 9  
extra_instructions_per_bit equ 9
        ;   constant extra_instructions_per_delay extra_instructions_per_bit / delays_per_bit  
extra_instructions_per_delay equ 3
        ;   constant delay_instructions instructions_per_delay - extra_instructions_per_delay  
delay_instructions equ 135
        ; comment {Register definitions :}
        ; comment {TMR0 register :}
tmr0 equ 1
        ; comment {STATUS register :}
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
        ; comment {OSCCAL register :}
osccal equ 144
        ;   constant osccal_unit 4  
osccal_unit equ 4
        ; comment {On the 630 / 676 , the OPTION register has the following bits :}
option equ 129
        ;   constant rapu_bit 7  
rapu_bit equ 7
        ;   constant intedg_bit 6  
intedg_bit equ 6
        ;   constant t0cs_bit 5  
t0cs_bit equ 5
        ;   constant t0se_bit 4  
t0se_bit equ 4
        ;   constant psa_bit 3  
psa_bit equ 3
        ;   constant ps2_bit 2  
ps2_bit equ 2
        ;   constant ps1_bit 1  
ps1_bit equ 1
        ;   constant ps0_bit 0  
ps0_bit equ 0
        ;   constant rapu_mask {{ 1 << rapu_bit }}  
rapu_mask equ 128
        ;   constant intedg_mask {{ 1 << intedg_bit }}  
intedg_mask equ 64
        ;   constant t0cs_mask {{ 1 << t0cs_bit }}  
t0cs_mask equ 32
        ;   constant t0se_mask {{ 1 << t0se_bit }}  
t0se_mask equ 16
        ;   constant psa_mask {{ 1 << psa_bit }}  
psa_mask equ 8
        ; comment {Disable Wake - up and pull - ups {;} set timer to internal {;} edge_source to raising :}
        ;   constant option_mask rapu_mask  
option_mask equ 128
        ; comment {INTCON :}
intcon equ 11
        ;   constant gie_bit 0  
gie_bit equ 0
        ;   constant peie_bit 0  
peie_bit equ 0
        ;   constant t0ie_bit 0  
t0ie_bit equ 0
        ;   constant inte_bit 0  
inte_bit equ 0
        ;   constant raie_bit 0  
raie_bit equ 0
        ;   constant t0if_bit 0  
t0if_bit equ 0
        ;   constant intf_bit 0  
intf_bit equ 0
        ;   constant raif_bit 0  
raif_bit equ 0
        ; comment {WPUA :}
wpua equ 149
        ; comment {Define port A bit assignments :}
        ;   constant motor0a_bit 0  
motor0a_bit equ 0
        ;   constant motor0b_bit 1  
motor0b_bit equ 1
        ;   constant motor1b_bit 2  
motor1b_bit equ 2
        ;   constant unused1_bit 3  
unused1_bit equ 3
        ;   constant motor1a_bit 4  
motor1a_bit equ 4
        ;   constant unused0_bit 5  
unused0_bit equ 5
porta equ 5
motor0a__byte equ 5
motor0a__bit equ 0
motor0b__byte equ 5
motor0b__bit equ 1
motor1b__byte equ 5
motor1b__bit equ 2
unused0__byte equ 5
unused0__bit equ 5
motor1a__byte equ 5
motor1a__bit equ 4
unsued1__byte equ 5
unsued1__bit equ 3
        ; comment {Define port C bit assignments :}
        ;   constant serial_in_bit 0  
serial_in_bit equ 0
        ;   constant serial_out_bit 1  
serial_out_bit equ 1
        ;   constant motor0e_bit 2  
motor0e_bit equ 2
        ;   constant motor1e_bit 3  
motor1e_bit equ 3
        ;   constant unused2_bit 4  
unused2_bit equ 4
        ;   constant unused3_bit 5  
unused3_bit equ 5
portc equ 7
serial_in__byte equ 7
serial_in__bit equ 0
serial_out__byte equ 7
serial_out__bit equ 1
motor0e__byte equ 7
motor0e__bit equ 2
motor1e__byte equ 7
motor1e__bit equ 3
unused2__byte equ 7
unused2__bit equ 4
unsued3__byte equ 7
unsued3__bit equ 4
        ; comment {Define some masks :}
        ;   constant motor0a_mask {{ 1 << motor0a_bit }}  
motor0a_mask equ 1
        ;   constant motor0e_mask {{ 1 << motor0e_bit }}  
motor0e_mask equ 4
        ;   constant motor0b_mask {{ 1 << motor0b_bit }}  
motor0b_mask equ 2
        ;   constant motor1a_mask {{ 1 << motor1a_bit }}  
motor1a_mask equ 16
        ;   constant motor1e_mask {{ 1 << motor1e_bit }}  
motor1e_mask equ 8
        ;   constant motor1b_mask {{ 1 << motor1b_bit }}  
motor1b_mask equ 4
        ;   constant serial_in_mask {{ 1 << serial_in_bit }}  
serial_in_mask equ 1
        ;   constant serial_out_mask {{ 1 << serial_out_bit }}  
serial_out_mask equ 2
        ; comment {Define duty cycle and motor on / off masks :}
actual_speed0 equ global__variables__bank0+0
actual_speed1 equ global__variables__bank0+1
motor0_off equ global__variables__bank0+2
motor0_on equ global__variables__bank0+3
motor1_off equ global__variables__bank0+4
motor1_on equ global__variables__bank0+5
        ; comment {Ramp variables :}
desired_speed0 equ global__variables__bank0+6
desired_speed1 equ global__variables__bank0+7
ramp0 equ global__variables__bank0+8
ramp1 equ global__variables__bank0+9
ramp0_delay equ global__variables__bank0+10
ramp1_delay equ global__variables__bank0+11
ramp0_offset equ global__variables__bank0+12
ramp1_offset equ global__variables__bank0+13
        ; comment {Fail safe variables :}
fail_safe equ global__variables__bank0+14
fail_safe_errors equ global__variables__bank0+15
fail_safe_high_counter equ global__variables__bank0+16
fail_safe_low_counter equ global__variables__bank0+17
motor0 equ global__variables__bank0+18
motor1 equ global__variables__bank0+19
        ; comment {Mode < pulsed vs . continuous > bits :}
motor0_mode equ global__bit__variables__bank0+0
motor0_mode__byte equ global__bit__variables__bank0+0
motor0_mode__bit equ 0
motor1_mode equ global__bit__variables__bank0+0
motor1_mode__byte equ global__bit__variables__bank0+0
motor1_mode__bit equ 1
motor0_direction equ global__bit__variables__bank0+0
motor0_direction__byte equ global__bit__variables__bank0+0
motor0_direction__bit equ 2
motor1_direction equ global__bit__variables__bank0+0
motor1_direction__byte equ global__bit__variables__bank0+0
motor1_direction__bit equ 3
        ; comment {Shared command registers and option :}
glitch equ global__variables__bank0+20
id_index equ global__variables__bank0+21
spare equ global__variables__bank0+22
        ; string_constants Start
string___fetch:
        movwf pcl___register
        ;   id = 1 , 0 , 14 , 2 , 0 , 0 , 0 , 0 , 0r'16' , 7 , 0s'Motor2D' , 15 , 0s'Gramlich&Benson'  
id___string equ 0
id:
        addwf pcl___register,f
        ; Length = 48
        retlw 48
        ; 1
        retlw 1
        ; 0
        retlw 0
        ; 14
        retlw 14
        ; 2
        retlw 2
        ; 0
        retlw 0
        ; 0
        retlw 0
        ; 0
        retlw 0
        ; 0
        retlw 0
        ; 0r'16'
        retlw 140 ; random number
        retlw 206 ; random number
        retlw 11 ; random number
        retlw 230 ; random number
        retlw 185 ; random number
        retlw 159 ; random number
        retlw 89 ; random number
        retlw 59 ; random number
        retlw 25 ; random number
        retlw 251 ; random number
        retlw 118 ; random number
        retlw 17 ; random number
        retlw 251 ; random number
        retlw 247 ; random number
        retlw 49 ; random number
        retlw 151 ; random number
        ; 7
        retlw 7
        ; `Motor2D'
        retlw 77
        retlw 111
        retlw 116
        retlw 111
        retlw 114
        retlw 50
        retlw 68
        ; 15
        retlw 15
        ; `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
        ; comment {Globals :}
receiving equ global__bit__variables__bank0+0
receiving__byte equ global__bit__variables__bank0+0
receiving__bit equ 4

        ; procedure get_byte start
get_byte:
get_byte__variables__base equ global__variables__bank0+23
get_byte__bytes__base equ get_byte__variables__base+0
get_byte__bits__base equ get_byte__variables__base+3
get_byte__total__bytes equ 4
        ;   arguments_none  
get_byte__0return__byte equ get_byte__bytes__base+0
        ; Wait for a character and return it .
        ; The get_byte < > procedure only waits for 9 - 2 / 3 bits . That
        ; way the next call to get_byte < > will sychronize on the start
        ; bit instead of possibly starting a little later .
get_byte__count equ get_byte__bytes__base+1
get_byte__char equ get_byte__bytes__base+2
        ; Wait for start bit :
        ;   receiving := 1  
        bsf receiving__byte,receiving__bit
        ; `while serial_in ...' start
get_byte__185while__continue:
        ; expression=`serial_in' exp_delay=0 true_delay=1  false_delay=2 true_size=2 false_size=1
        btfss serial_in__byte,serial_in__bit
        goto get_byte__185while__break
        ;   call delay {{ }}  
        call delay
        goto get_byte__185while__continue
        ; if exp=`serial_in' false goto
        ; Other expression=`serial_in' delay=-1
get_byte__185while__break:
        ; `while serial_in ...' end
        ; Clear any interrupt being sent :
        ;   serial_out := 1  
        bsf serial_out__byte,serial_out__bit
        ; Skip over start bit :
        ;   call delay {{ }}  
        call delay
        ;   call delay {{ }}  
        call delay
        ;   call delay {{ }}  
        call delay
        ; Sample in the middle third of each data bit :
        ;   char := 0  
        clrf get_byte__char
        ; `count_down count 8 ...' start
        movlw 8
        movwf get_byte__count
get_byte__199_loop:
        ;   call delay {{ }}  
        call delay
        ; 2 cycles :
        ;   char := char >> 1  
        bcf c___byte,c___bit
        rrf get_byte__char,f
        ; 2 cycles :
        ; if { serial_in } start
        ; expression=`{ serial_in }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfsc serial_in__byte,serial_in__bit
        ; if { serial_in } body start
        ;   char @ 7 := 1  
        ; Select char @ 7
get_byte__char__205select0 equ get_byte__char+0
get_byte__char__205select0__byte equ get_byte__char+0
get_byte__char__205select0__bit equ 7
        bsf get_byte__char__205select0__byte,get_byte__char__205select0__bit
        ; if { serial_in } body end
        ; if exp=`serial_in' false skip delay=2
        ; Other expression=`{ serial_in }' delay=2
        ; if { serial_in } end
        ;   call delay {{ }}  
        call delay
        ;   call delay {{ }}  
        call delay
        ; 3 cycles at end of loop for test and branch :
        ; 2 + 2 + 3 = 7
        ; nop extra_instructions_per_bit - 7
        ; Delay 2 cycles
        nop
        nop
        decfsz get_byte__count,f
        goto get_byte__199_loop
get_byte__199_done:
        ; `count_down count 8 ...' end
        ; Skip over 2 / 3 ' s of stop bit :
        ;   call delay {{ }}  
        call delay
        ;   call delay {{ }}  
        call delay
        ;   return char  
        movf get_byte__char,w
        movwf get_byte__0return__byte
        retlw 0
        ; procedure get_byte end

        ; procedure send_byte start
send_byte:
send_byte__variables__base equ global__variables__bank0+27
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__char equ send_byte__bytes__base+0
        ; Send < char > to < tx > :
send_byte__count equ send_byte__bytes__base+1
        ; < receiving > will be 1 if the last get / put routine was a get .
        ; Before we start transmitting a response back , we want to ensure
        ; that there has been enough time to turn the line line around .
        ; We delay the first 1 / 3 of a bit to pad out the 9 - 2 / 3 bits from
        ; for get_byte to 10 bits . We delay another 1 / 3 of a bit just
        ; for good measure . Technically , the second call to delay < >
        ; is not really needed .
        ; if { receiving } start
        ; expression=`{ receiving }' exp_delay=0 true_delay=-1  false_delay=0 true_size=3 false_size=0
        btfss receiving__byte,receiving__bit
        goto label236__0end
        ; if { receiving } body start
        ;   receiving := 0  
        bcf receiving__byte,receiving__bit
        ;   call delay {{ }}  
        call delay
        ;   call delay {{ }}  
        call delay
        ; if { receiving } body end
label236__0end:
        ; if exp=`receiving' empty false
        ; Other expression=`{ receiving }' delay=-1
        ; if { receiving } end
        ; Send the start bit :
        ;   serial_out := 0  
        bcf serial_out__byte,serial_out__bit
        ;   call delay {{ }}  
        call delay
        ;   call delay {{ }}  
        call delay
        ;   call delay {{ }}  
        call delay
        ; Send the data :
        ; `count_down count 8 ...' start
        movlw 8
        movwf send_byte__count
send_byte__249_loop:
        ; 4 cycles :
        ;   serial_out := char @ 0  
        ; Alias variable for select char @ 0
send_byte__char__251select0 equ send_byte__char+0
send_byte__char__251select0__byte equ send_byte__char+0
send_byte__char__251select0__bit equ 0
        btfss send_byte__char__251select0__byte,send_byte__char__251select0__bit
        bcf serial_out__byte,serial_out__bit
        btfsc send_byte__char__251select0__byte,send_byte__char__251select0__bit
        bsf serial_out__byte,serial_out__bit
        ; 2 cycles :
        ;   char := char >> 1  
        bcf c___byte,c___bit
        rrf send_byte__char,f
        ;   call delay {{ }}  
        call delay
        ;   call delay {{ }}  
        call delay
        ;   call delay {{ }}  
        call delay
        ; Test and jump at end of loop takes 3 cycles :
        ; 4 + 2 + 3 = 9 = no NOP ' s needed
        decfsz send_byte__count,f
        goto send_byte__249_loop
send_byte__249_done:
        ; `count_down count 8 ...' end
        ; Send the stop bit :
        ;   serial_out := 1  
        bsf serial_out__byte,serial_out__bit
        ;   call delay {{ }}  
        call delay
        ;   call delay {{ }}  
        call delay
        ;   call delay {{ }}  
        call delay
        ; procedure send_byte end
        retlw 0

        ; procedure set_up start
set_up:
set_up__variables__base equ global__variables__bank0+29
set_up__bytes__base equ set_up__variables__base+0
set_up__bits__base equ set_up__variables__base+0
set_up__total__bytes equ 0
        ;   arguments_none  
        ; This procedure will set the speed of motor to speed .
        ; Reset failsafe :
        ;   fail_safe_low_counter := 0  
        clrf fail_safe_low_counter
        ;   fail_safe_high_counter := fail_safe  
        movf fail_safe,w
        movwf fail_safe_high_counter
        ; Mode Dir On Off
        ; = = = = = = = = = = = = = = = = = =
        ; 0 0 A 0
        ; 0 1 B 0
        ; 1 0 A B
        ; 1 1 B A
        ; Motor 0 :
        ; if { ramp0 = 0 } start
        movf ramp0,w
        ; expression=`{ ramp0 = 0 }' exp_delay=1 true_delay=4  false_delay=7 true_size=4 false_size=7
        btfss z___byte,z___bit
        goto label286__0false
label286__0true:
        ; if { ramp0 = 0 } body start
        ; No ramping :
        ;   actual_speed0 := desired_speed0  
        movf desired_speed0,w
        movwf actual_speed0
        ;   ramp0_delay := 0  
        clrf ramp0_delay
        ;   ramp0_offset := 0  
        clrf ramp0_offset
        ; if { ramp0 = 0 } body end
        goto label286__0end
label286__0false:
        ; else body start
        ; Ramping :
        ; if { desired_speed0 < actual_speed0 } start
        movf actual_speed0,w
        subwf desired_speed0,w
        ; expression=`{ desired_speed0 < actual_speed0 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss c___byte,c___bit
        ; if { desired_speed0 < actual_speed0 } body start
        ;   ramp0_offset := 0xff  
        movlw 255
        ; 1 instructions found for sharing
        btfsc c___byte,c___bit
        ; else body start
        ;   ramp0_offset := 1  
        movlw 1
        ; 1 instructions found for sharing
        ; if exp=` desired_speed0 < actual_speed0 ' single true and false skip delay=6
        ; Other expression=`{ desired_speed0 < actual_speed0 }' delay=6
        ; 1 shared instructions follow
        movwf ramp0_offset
        ; if { desired_speed0 < actual_speed0 } end
        ; else body end
        ; if exp=` ramp0 = 0 ' generic
label286__0end:
        ; Other expression=`{ ramp0 = 0 }' delay=-1
        ; if { ramp0 = 0 } end
        ; FIXME : do a motor0_off := 0 and delete the appropriate statements below ;
        ; if { motor0_direction } start
        ; expression=`{ motor0_direction }' exp_delay=0 true_delay=-2  false_delay=-2 true_size=7 false_size=7
        btfss motor0_direction__byte,motor0_direction__bit
        goto label300__0false
label300__0true:
        ; if { motor0_direction } body start
        ; Direction = 1 < Backward > :
        ; if { motor0_mode } start
        ; expression=`{ motor0_mode }' exp_delay=0 true_delay=2  false_delay=1 true_size=2 false_size=1
        btfsc motor0_mode__byte,motor0_mode__bit
        goto label302__0true
label302__0false:
        ; else body start
        ; Mode = 0 < Pulsed >
        ;   motor0_off := 0  
        clrf motor0_off
        ; else body end
        goto label302__0end
label302__0true:
        ; if { motor0_mode } body start
        ; Mode = 1 < Continuous > :
        ;   motor0_off := motor0a_mask  
        movlw 1
        movwf motor0_off
        ; if { motor0_mode } body end
        ; if exp=`motor0_mode' generic
label302__0end:
        ; Other expression=`{ motor0_mode }' delay=-1
        ; if { motor0_mode } end
        ;   motor0_on := motor0b_mask  
        movlw 2
        ; 1 instructions found for sharing
        goto label300__0end
label300__0false:
        ; else body start
        ; Direction = 0 < Forward > :
        ; if { motor0_mode } start
        ; expression=`{ motor0_mode }' exp_delay=0 true_delay=2  false_delay=1 true_size=2 false_size=1
        btfsc motor0_mode__byte,motor0_mode__bit
        goto label312__0true
label312__0false:
        ; else body start
        ; Mode = 0 < Pulsed > :
        ;   motor0_off := 0  
        clrf motor0_off
        ; else body end
        goto label312__0end
label312__0true:
        ; if { motor0_mode } body start
        ; Mode = 1 < Continuous > :
        ;   motor0_off := motor0b_mask  
        movlw 2
        movwf motor0_off
        ; if { motor0_mode } body end
        ; if exp=`motor0_mode' generic
label312__0end:
        ; Other expression=`{ motor0_mode }' delay=-1
        ; if { motor0_mode } end
        ;   motor0_on := motor0a_mask  
        movlw 1
        ; 1 instructions found for sharing
        ; if exp=`motor0_direction' generic
label300__0end:
        ; Other expression=`{ motor0_direction }' delay=-1
        ; 1 shared instructions follow
        movwf motor0_on
        ; if { motor0_direction } end
        ; Motor1 :
        ; if { ramp1 = 0 } start
        movf ramp1,w
        ; expression=`{ ramp1 = 0 }' exp_delay=1 true_delay=4  false_delay=7 true_size=4 false_size=7
        btfss z___byte,z___bit
        goto label323__0false
label323__0true:
        ; if { ramp1 = 0 } body start
        ; No ramping :
        ;   actual_speed1 := desired_speed1  
        movf desired_speed1,w
        movwf actual_speed1
        ;   ramp1_delay := 0  
        clrf ramp1_delay
        ;   ramp1_offset := 0  
        clrf ramp1_offset
        ; if { ramp1 = 0 } body end
        goto label323__0end
label323__0false:
        ; else body start
        ; Ramping :
        ; if { desired_speed1 < actual_speed1 } start
        movf actual_speed1,w
        subwf desired_speed1,w
        ; expression=`{ desired_speed1 < actual_speed1 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss c___byte,c___bit
        ; if { desired_speed1 < actual_speed1 } body start
        ;   ramp1_offset := 0xff  
        movlw 255
        ; 1 instructions found for sharing
        btfsc c___byte,c___bit
        ; else body start
        ;   ramp1_offset := 1  
        movlw 1
        ; 1 instructions found for sharing
        ; if exp=` desired_speed1 < actual_speed1 ' single true and false skip delay=6
        ; Other expression=`{ desired_speed1 < actual_speed1 }' delay=6
        ; 1 shared instructions follow
        movwf ramp1_offset
        ; if { desired_speed1 < actual_speed1 } end
        ; else body end
        ; if exp=` ramp1 = 0 ' generic
label323__0end:
        ; Other expression=`{ ramp1 = 0 }' delay=-1
        ; if { ramp1 = 0 } end
        ; FIXME : do a motor1 := 0 here and delete the appropriate statements below :
        ; if { motor1_direction } start
        ; expression=`{ motor1_direction }' exp_delay=0 true_delay=-2  false_delay=-2 true_size=7 false_size=7
        btfss motor1_direction__byte,motor1_direction__bit
        goto label337__0false
label337__0true:
        ; if { motor1_direction } body start
        ; Direction = 1 < Backward > :
        ; if { motor1_mode } start
        ; expression=`{ motor1_mode }' exp_delay=0 true_delay=2  false_delay=1 true_size=2 false_size=1
        btfsc motor1_mode__byte,motor1_mode__bit
        goto label339__0true
label339__0false:
        ; else body start
        ; Mode = 1 < Pulsed >
        ;   motor1_off := 0  
        clrf motor1_off
        ; else body end
        goto label339__0end
label339__0true:
        ; if { motor1_mode } body start
        ; Mode = 1 < Continuous > :
        ;   motor1_off := motor1a_mask  
        movlw 16
        movwf motor1_off
        ; if { motor1_mode } body end
        ; if exp=`motor1_mode' generic
label339__0end:
        ; Other expression=`{ motor1_mode }' delay=-1
        ; if { motor1_mode } end
        ;   motor1_on := motor1b_mask  
        movlw 4
        ; 1 instructions found for sharing
        goto label337__0end
label337__0false:
        ; else body start
        ; Direction = 0 < Forward > :
        ; if { motor1_mode } start
        ; expression=`{ motor1_mode }' exp_delay=0 true_delay=2  false_delay=1 true_size=2 false_size=1
        btfsc motor1_mode__byte,motor1_mode__bit
        goto label349__0true
label349__0false:
        ; else body start
        ; Mode = 0 < Pulsed > :
        ;   motor1_off := 0  
        clrf motor1_off
        ; else body end
        goto label349__0end
label349__0true:
        ; if { motor1_mode } body start
        ; Mode = 1 < Continuous > :
        ;   motor1_off := motor1b_mask  
        movlw 4
        movwf motor1_off
        ; if { motor1_mode } body end
        ; if exp=`motor1_mode' generic
label349__0end:
        ; Other expression=`{ motor1_mode }' delay=-1
        ; if { motor1_mode } end
        ;   motor1_on := motor1a_mask  
        movlw 16
        ; 1 instructions found for sharing
        ; if exp=`motor1_direction' generic
label337__0end:
        ; Other expression=`{ motor1_direction }' delay=-1
        ; 1 shared instructions follow
        movwf motor1_on
        ; if { motor1_direction } end
        ; procedure set_up end
        retlw 0

        ; procedure reset start
reset:
reset__variables__base equ global__variables__bank0+29
reset__bytes__base equ reset__variables__base+0
reset__bits__base equ reset__variables__base+0
reset__total__bytes equ 0
        ;   arguments_none  
        ; Initialize everything else :
        ;   motor0e := 1  
        bsf motor0e__byte,motor0e__bit
        ;   motor1e := 1  
        bsf motor1e__byte,motor1e__bit
        ;   intcon := 0  
        clrf intcon
        ;   option := option_mask  
        movlw 128
        ; Switch from register bank 0 to register bank 1 (which contains option)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        movwf option
        ;   wpua := 0  
        clrf wpua
        ;   actual_speed0 := 0  
        clrf actual_speed0
        ;   actual_speed1 := 0  
        clrf actual_speed1
        ;   motor0_off := 0  
        clrf motor0_off
        ;   motor0_on := 0  
        clrf motor0_on
        ;   motor1_off := 0  
        clrf motor1_off
        ;   motor1_on := 0  
        clrf motor1_on
        ;   desired_speed0 := 0  
        clrf desired_speed0
        ;   desired_speed1 := 0  
        clrf desired_speed1
        ;   ramp0 := 0  
        clrf ramp0
        ;   ramp1 := 0  
        clrf ramp1
        ;   ramp0_delay := 0  
        clrf ramp0_delay
        ;   ramp1_delay := 0  
        clrf ramp1_delay
        ;   ramp0_offset := 0  
        clrf ramp0_offset
        ;   ramp1_offset := 0  
        clrf ramp1_offset
        ;   motor0_direction := 0  
        bcf motor0_direction__byte,motor0_direction__bit
        ;   motor1_direction := 0  
        bcf motor1_direction__byte,motor1_direction__bit
        ;   motor0_mode := 0  
        bcf motor0_mode__byte,motor0_mode__bit
        ;   motor1_mode := 0  
        bcf motor1_mode__byte,motor1_mode__bit
        ;   fail_safe := 0  
        clrf fail_safe
        ;   fail_safe_errors := 0  
        clrf fail_safe_errors
        ;   fail_safe_high_counter := 0  
        clrf fail_safe_high_counter
        ;   fail_safe_low_counter := 0  
        clrf fail_safe_low_counter
        ;   glitch := 0  
        clrf glitch
        ;   id_index := 0  
        clrf id_index
        ; procedure reset end
        ; Switch from register bank 1 to register bank 0
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        retlw 0

        ; procedure delay start
        ; optimize 0
delay:
delay__variables__base equ global__variables__bank0+29
delay__bytes__base equ delay__variables__base+0
delay__bits__base equ delay__variables__base+1
delay__total__bytes equ 1
delay__396byte1 equ delay__bytes__base+0
delay__476byte2 equ delay__bytes__base+0
delay__454byte2 equ delay__bytes__base+0
delay__423byte2 equ delay__bytes__base+0
delay__424byte2 equ delay__bytes__base+0
delay__421byte2 equ delay__bytes__base+0
        ;   arguments_none  
        ;   uniform_delay delay_instructions  
        ; Uniform delay remaining = 131 Accumulated Delay = 0
        ; Uniform delay remaining = 131 Accumulated Delay = 0
        ; Delay for 1 / 3 of a bit time .
        ; Uniform delay remaining = 131 Accumulated Delay = 0
        ; Uniform delay remaining = 131 Accumulated Delay = 0
        ; Kick the dog :
        ; Uniform delay remaining = 131 Accumulated Delay = 0
        ;   watch_dog_reset  
        clrwdt
        ; Uniform delay remaining = 130 Accumulated Delay = 1
        ; Uniform delay remaining = 130 Accumulated Delay = 1
        ; This is the first probe of TMR0 :
        ; Uniform delay remaining = 130 Accumulated Delay = 1
        ; if { tmr0 < actual_speed0 } start
        movf actual_speed0,w
        subwf tmr0,w
        ; expression=`{ tmr0 < actual_speed0 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss c___byte,c___bit
        ; if { tmr0 < actual_speed0 } body start
        ; Uniform delay remaining = 130 Accumulated Delay = 0
        ;   motor0 := motor0_on  
        movf motor0_on,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 128 Accumulated Delay = 2
        ; if { tmr0 < actual_speed0 } body end
        btfsc c___byte,c___bit
        ; else body start
        ; Uniform delay remaining = 130 Accumulated Delay = 0
        ;   motor0 := motor0_off  
        movf motor0_off,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 128 Accumulated Delay = 2
        ; else body end
        ; if exp=` tmr0 < actual_speed0 ' single true and false skip delay=6
        ; Other expression=`{ tmr0 < actual_speed0 }' delay=6
        ; 1 shared instructions follow
        movwf motor0
        ; if { tmr0 < actual_speed0 } end
        ; Uniform delay remaining = 123 Accumulated Delay = 8
        ; if { tmr0 < actual_speed1 } start
        movf actual_speed1,w
        subwf tmr0,w
        ; expression=`{ tmr0 < actual_speed1 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss c___byte,c___bit
        ; if { tmr0 < actual_speed1 } body start
        ; Uniform delay remaining = 123 Accumulated Delay = 0
        ;   motor1 := motor1_on  
        movf motor1_on,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 121 Accumulated Delay = 2
        ; if { tmr0 < actual_speed1 } body end
        btfsc c___byte,c___bit
        ; else body start
        ; Uniform delay remaining = 123 Accumulated Delay = 0
        ;   motor1 := motor1_off  
        movf motor1_off,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 121 Accumulated Delay = 2
        ; else body end
        ; if exp=` tmr0 < actual_speed1 ' single true and false skip delay=6
        ; Other expression=`{ tmr0 < actual_speed1 }' delay=6
        ; 1 shared instructions follow
        movwf motor1
        ; if { tmr0 < actual_speed1 } end
        ; Uniform delay remaining = 116 Accumulated Delay = 15
        ;   porta := motor0 | motor1  
        movf motor0,w
        iorwf motor1,w
        movwf porta
        ; Uniform delay remaining = 113 Accumulated Delay = 18
        ; Uniform delay remaining = 113 Accumulated Delay = 18
        ; First check out < fail_safe_counter > :
        ; Uniform delay remaining = 113 Accumulated Delay = 18
        ;   fail_safe_low_counter := fail_safe_low_counter - 1  
        decf fail_safe_low_counter,f
        ; Uniform delay remaining = 112 Accumulated Delay = 19
        ; if { z } start
        ; expression=`{ z }' exp_delay=0 true_delay=17  false_delay=0 true_size=28 false_size=0
        btfsc z__byte,z__bit
        goto label421__0true
label421__0false:
        ; Delay 16 cycles
        movlw 5
        movwf delay__421byte2
delay__421delay1:
        decfsz delay__421byte2,f
        goto delay__421delay1
        goto label421__0end
label421__0true:
        ; if { z } body start
        ; Uniform delay remaining = 112 Accumulated Delay = 0
        ;   fail_safe_high_counter := fail_safe_high_counter - 1  
        decf fail_safe_high_counter,f
        ; Uniform delay remaining = 111 Accumulated Delay = 1
        ; if { z } start
        ; expression=`{ z }' exp_delay=0 true_delay=13  false_delay=0 true_size=18 false_size=0
        btfsc z__byte,z__bit
        goto label423__0true
label423__0false:
        ; Delay 12 cycles
        movlw 3
        movwf delay__423byte2
delay__423delay1:
        decfsz delay__423byte2,f
        goto delay__423delay1
        nop
        nop
        goto label423__0end
label423__0true:
        ; if { z } body start
        ; Uniform delay remaining = 111 Accumulated Delay = 0
        ; if { fail_safe != 0 } start
        movf fail_safe,w
        ; expression=`{ fail_safe != 0 }' exp_delay=1 true_delay=9  false_delay=0 true_size=9 false_size=0
        btfss z___byte,z___bit
        goto label424__0true
label424__0false:
        ; Delay 8 cycles
        movlw 2
        movwf delay__424byte2
delay__424delay1:
        decfsz delay__424byte2,f
        goto delay__424delay1
        nop
        goto label424__0end
label424__0true:
        ; if { fail_safe != 0 } body start
        ; Uniform delay remaining = 111 Accumulated Delay = 0
        ; Turn the motors off :
        ; Uniform delay remaining = 111 Accumulated Delay = 0
        ;   motor0_on := 0  
        clrf motor0_on
        ; Uniform delay remaining = 110 Accumulated Delay = 1
        ;   motor0_off := 0  
        clrf motor0_off
        ; Uniform delay remaining = 109 Accumulated Delay = 2
        ;   motor1_on := 0  
        clrf motor1_on
        ; Uniform delay remaining = 108 Accumulated Delay = 3
        ;   motor1_off := 0  
        clrf motor1_off
        ; Uniform delay remaining = 107 Accumulated Delay = 4
        ;   desired_speed0 := 0  
        clrf desired_speed0
        ; Uniform delay remaining = 106 Accumulated Delay = 5
        ;   desired_speed1 := 0  
        clrf desired_speed1
        ; Uniform delay remaining = 105 Accumulated Delay = 6
        ;   actual_speed0 := 0  
        clrf actual_speed0
        ; Uniform delay remaining = 104 Accumulated Delay = 7
        ;   actual_speed0 := 0  
        clrf actual_speed0
        ; Uniform delay remaining = 103 Accumulated Delay = 8
        ;   fail_safe_errors := fail_safe_errors + 1  
        incf fail_safe_errors,f
        ; Uniform delay remaining = 102 Accumulated Delay = 9
        ; Uniform delay remaining = 102 Accumulated Delay = 9
        ; if { fail_safe != 0 } body end
        ; if exp=` fail_safe != 0 ' total delay=13
        ; if exp=` fail_safe != 0 ' generic
label424__0end:
        ; Other expression=`{ fail_safe != 0 }' delay=13
        ; if { fail_safe != 0 } end
        ; Uniform delay remaining = 98 Accumulated Delay = 13
        ; Uniform delay remaining = 98 Accumulated Delay = 13
        ; if { z } body end
        ; if exp=`z' total delay=16
        ; if exp=`z' generic
label423__0end:
        ; Other expression=`{ z }' delay=16
        ; if { z } end
        ; Uniform delay remaining = 95 Accumulated Delay = 17
        ; Uniform delay remaining = 95 Accumulated Delay = 17
        ; if { z } body end
        ; if exp=`z' total delay=20
        ; if exp=`z' generic
label421__0end:
        ; Other expression=`{ z }' delay=20
        ; if { z } end
        ; Uniform delay remaining = 92 Accumulated Delay = 39
        ; Uniform delay remaining = 92 Accumulated Delay = 39
        ; This is the second probe of TMR0 :
        ; Uniform delay remaining = 92 Accumulated Delay = 39
        ; if { tmr0 < actual_speed0 } start
        movf actual_speed0,w
        subwf tmr0,w
        ; expression=`{ tmr0 < actual_speed0 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss c___byte,c___bit
        ; if { tmr0 < actual_speed0 } body start
        ; Uniform delay remaining = 92 Accumulated Delay = 0
        ;   motor0 := motor0_on  
        movf motor0_on,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 90 Accumulated Delay = 2
        ; if { tmr0 < actual_speed0 } body end
        btfsc c___byte,c___bit
        ; else body start
        ; Uniform delay remaining = 92 Accumulated Delay = 0
        ;   motor0 := motor0_off  
        movf motor0_off,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 90 Accumulated Delay = 2
        ; else body end
        ; if exp=` tmr0 < actual_speed0 ' single true and false skip delay=6
        ; Other expression=`{ tmr0 < actual_speed0 }' delay=6
        ; 1 shared instructions follow
        movwf motor0
        ; if { tmr0 < actual_speed0 } end
        ; Uniform delay remaining = 85 Accumulated Delay = 46
        ; if { tmr0 < actual_speed1 } start
        movf actual_speed1,w
        subwf tmr0,w
        ; expression=`{ tmr0 < actual_speed1 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss c___byte,c___bit
        ; if { tmr0 < actual_speed1 } body start
        ; Uniform delay remaining = 85 Accumulated Delay = 0
        ;   motor1 := motor1_on  
        movf motor1_on,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 83 Accumulated Delay = 2
        ; if { tmr0 < actual_speed1 } body end
        btfsc c___byte,c___bit
        ; else body start
        ; Uniform delay remaining = 85 Accumulated Delay = 0
        ;   motor1 := motor1_off  
        movf motor1_off,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 83 Accumulated Delay = 2
        ; else body end
        ; if exp=` tmr0 < actual_speed1 ' single true and false skip delay=6
        ; Other expression=`{ tmr0 < actual_speed1 }' delay=6
        ; 1 shared instructions follow
        movwf motor1
        ; if { tmr0 < actual_speed1 } end
        ; Uniform delay remaining = 78 Accumulated Delay = 53
        ;   porta := motor0 | motor1  
        movf motor0,w
        iorwf motor1,w
        movwf porta
        ; Uniform delay remaining = 75 Accumulated Delay = 56
        ; Uniform delay remaining = 75 Accumulated Delay = 56
        ; Do < ramp0 > management :
        ; Uniform delay remaining = 75 Accumulated Delay = 56
        ;   ramp0_delay := ramp0_delay - 1  
        decf ramp0_delay,f
        ; Uniform delay remaining = 74 Accumulated Delay = 57
        ; if { z } start
        ; expression=`{ z }' exp_delay=0 true_delay=9  false_delay=0 true_size=10 false_size=0
        btfsc z__byte,z__bit
        goto label454__0true
label454__0false:
        ; Delay 8 cycles
        movlw 2
        movwf delay__454byte2
delay__454delay1:
        decfsz delay__454byte2,f
        goto delay__454delay1
        nop
        goto label454__0end
label454__0true:
        ; if { z } body start
        ; Uniform delay remaining = 74 Accumulated Delay = 0
        ;   ramp0_delay := ramp0  
        movf ramp0,w
        movwf ramp0_delay
        ; Uniform delay remaining = 72 Accumulated Delay = 2
        ; if { actual_speed0 != desired_speed0 } start
        movf actual_speed0,w
        subwf desired_speed0,w
        ; expression=`{ actual_speed0 != desired_speed0 }' exp_delay=2 true_delay=2  false_delay=0 true_size=2 false_size=0
        btfss z___byte,z___bit
        goto label456__0true
label456__0false:
        ; Delay 1 cycles
        nop
        goto label456__0end
label456__0true:
        ; if { actual_speed0 != desired_speed0 } body start
        ; Uniform delay remaining = 72 Accumulated Delay = 0
        ;   actual_speed0 := actual_speed0 + ramp0_offset  
        movf ramp0_offset,w
        addwf actual_speed0,f
        ; Uniform delay remaining = 70 Accumulated Delay = 2
        ; Uniform delay remaining = 70 Accumulated Delay = 2
        ; if { actual_speed0 != desired_speed0 } body end
        ; if exp=` actual_speed0 != desired_speed0 ' total delay=7
        ; if exp=` actual_speed0 != desired_speed0 ' generic
label456__0end:
        ; Other expression=`{ actual_speed0 != desired_speed0 }' delay=7
        ; if { actual_speed0 != desired_speed0 } end
        ; Uniform delay remaining = 65 Accumulated Delay = 9
        ; Uniform delay remaining = 65 Accumulated Delay = 9
        ; if { z } body end
        ; if exp=`z' total delay=12
        ; if exp=`z' generic
label454__0end:
        ; Other expression=`{ z }' delay=12
        ; if { z } end
        ; Uniform delay remaining = 62 Accumulated Delay = 69
        ; Uniform delay remaining = 62 Accumulated Delay = 69
        ; This is the third probe of TMR0 :
        ; Uniform delay remaining = 62 Accumulated Delay = 69
        ; if { tmr0 < actual_speed0 } start
        movf actual_speed0,w
        subwf tmr0,w
        ; expression=`{ tmr0 < actual_speed0 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss c___byte,c___bit
        ; if { tmr0 < actual_speed0 } body start
        ; Uniform delay remaining = 62 Accumulated Delay = 0
        ;   motor0 := motor0_on  
        movf motor0_on,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 60 Accumulated Delay = 2
        ; if { tmr0 < actual_speed0 } body end
        btfsc c___byte,c___bit
        ; else body start
        ; Uniform delay remaining = 62 Accumulated Delay = 0
        ;   motor0 := motor0_off  
        movf motor0_off,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 60 Accumulated Delay = 2
        ; else body end
        ; if exp=` tmr0 < actual_speed0 ' single true and false skip delay=6
        ; Other expression=`{ tmr0 < actual_speed0 }' delay=6
        ; 1 shared instructions follow
        movwf motor0
        ; if { tmr0 < actual_speed0 } end
        ; Uniform delay remaining = 55 Accumulated Delay = 76
        ; if { tmr0 < actual_speed1 } start
        movf actual_speed1,w
        subwf tmr0,w
        ; expression=`{ tmr0 < actual_speed1 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss c___byte,c___bit
        ; if { tmr0 < actual_speed1 } body start
        ; Uniform delay remaining = 55 Accumulated Delay = 0
        ;   motor1 := motor1_on  
        movf motor1_on,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 53 Accumulated Delay = 2
        ; if { tmr0 < actual_speed1 } body end
        btfsc c___byte,c___bit
        ; else body start
        ; Uniform delay remaining = 55 Accumulated Delay = 0
        ;   motor1 := motor1_off  
        movf motor1_off,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 53 Accumulated Delay = 2
        ; else body end
        ; if exp=` tmr0 < actual_speed1 ' single true and false skip delay=6
        ; Other expression=`{ tmr0 < actual_speed1 }' delay=6
        ; 1 shared instructions follow
        movwf motor1
        ; if { tmr0 < actual_speed1 } end
        ; Uniform delay remaining = 48 Accumulated Delay = 83
        ;   porta := motor0 | motor1  
        movf motor0,w
        iorwf motor1,w
        movwf porta
        ; Uniform delay remaining = 45 Accumulated Delay = 86
        ; Uniform delay remaining = 45 Accumulated Delay = 86
        ; Do < ramp1 > management :
        ; Uniform delay remaining = 45 Accumulated Delay = 86
        ;   ramp1_delay := ramp1_delay - 1  
        decf ramp1_delay,f
        ; Uniform delay remaining = 44 Accumulated Delay = 87
        ; if { z } start
        ; expression=`{ z }' exp_delay=0 true_delay=9  false_delay=0 true_size=10 false_size=0
        btfsc z__byte,z__bit
        goto label476__0true
label476__0false:
        ; Delay 8 cycles
        movlw 2
        movwf delay__476byte2
delay__476delay1:
        decfsz delay__476byte2,f
        goto delay__476delay1
        nop
        goto label476__0end
label476__0true:
        ; if { z } body start
        ; Uniform delay remaining = 44 Accumulated Delay = 0
        ;   ramp1_delay := ramp1  
        movf ramp1,w
        movwf ramp1_delay
        ; Uniform delay remaining = 42 Accumulated Delay = 2
        ; if { actual_speed1 != desired_speed1 } start
        movf actual_speed1,w
        subwf desired_speed1,w
        ; expression=`{ actual_speed1 != desired_speed1 }' exp_delay=2 true_delay=2  false_delay=0 true_size=2 false_size=0
        btfss z___byte,z___bit
        goto label478__0true
label478__0false:
        ; Delay 1 cycles
        nop
        goto label478__0end
label478__0true:
        ; if { actual_speed1 != desired_speed1 } body start
        ; Uniform delay remaining = 42 Accumulated Delay = 0
        ;   actual_speed1 := actual_speed1 + ramp1_offset  
        movf ramp1_offset,w
        addwf actual_speed1,f
        ; Uniform delay remaining = 40 Accumulated Delay = 2
        ; Uniform delay remaining = 40 Accumulated Delay = 2
        ; if { actual_speed1 != desired_speed1 } body end
        ; if exp=` actual_speed1 != desired_speed1 ' total delay=7
        ; if exp=` actual_speed1 != desired_speed1 ' generic
label478__0end:
        ; Other expression=`{ actual_speed1 != desired_speed1 }' delay=7
        ; if { actual_speed1 != desired_speed1 } end
        ; Uniform delay remaining = 35 Accumulated Delay = 9
        ; Uniform delay remaining = 35 Accumulated Delay = 9
        ; if { z } body end
        ; if exp=`z' total delay=12
        ; if exp=`z' generic
label476__0end:
        ; Other expression=`{ z }' delay=12
        ; if { z } end
        ; Uniform delay remaining = 32 Accumulated Delay = 99
        ; Uniform delay remaining = 32 Accumulated Delay = 99
        ; This is the forth probe of TMR0 :
        ; Uniform delay remaining = 32 Accumulated Delay = 99
        ; if { tmr0 < actual_speed0 } start
        movf actual_speed0,w
        subwf tmr0,w
        ; expression=`{ tmr0 < actual_speed0 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss c___byte,c___bit
        ; if { tmr0 < actual_speed0 } body start
        ; Uniform delay remaining = 32 Accumulated Delay = 0
        ;   motor0 := motor0_on  
        movf motor0_on,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 30 Accumulated Delay = 2
        ; if { tmr0 < actual_speed0 } body end
        btfsc c___byte,c___bit
        ; else body start
        ; Uniform delay remaining = 32 Accumulated Delay = 0
        ;   motor0 := motor0_off  
        movf motor0_off,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 30 Accumulated Delay = 2
        ; else body end
        ; if exp=` tmr0 < actual_speed0 ' single true and false skip delay=6
        ; Other expression=`{ tmr0 < actual_speed0 }' delay=6
        ; 1 shared instructions follow
        movwf motor0
        ; if { tmr0 < actual_speed0 } end
        ; Uniform delay remaining = 25 Accumulated Delay = 106
        ; if { tmr0 < actual_speed1 } start
        movf actual_speed1,w
        subwf tmr0,w
        ; expression=`{ tmr0 < actual_speed1 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss c___byte,c___bit
        ; if { tmr0 < actual_speed1 } body start
        ; Uniform delay remaining = 25 Accumulated Delay = 0
        ;   motor1 := motor1_on  
        movf motor1_on,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 23 Accumulated Delay = 2
        ; if { tmr0 < actual_speed1 } body end
        btfsc c___byte,c___bit
        ; else body start
        ; Uniform delay remaining = 25 Accumulated Delay = 0
        ;   motor1 := motor1_off  
        movf motor1_off,w
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 23 Accumulated Delay = 2
        ; else body end
        ; if exp=` tmr0 < actual_speed1 ' single true and false skip delay=6
        ; Other expression=`{ tmr0 < actual_speed1 }' delay=6
        ; 1 shared instructions follow
        movwf motor1
        ; if { tmr0 < actual_speed1 } end
        ; Uniform delay remaining = 18 Accumulated Delay = 113
        ;   porta := motor0 | motor1  
        movf motor0,w
        iorwf motor1,w
        movwf porta
        ; Uniform delay remaining = 15 Accumulated Delay = 116
        ; Uniform delay remaining = 15 Accumulated Delay = 116
        ; Soak up remaining 15 cycles
        ; Delay 15 cycles
        movlw 4
        movwf delay__396byte1
delay__396delay0:
        decfsz delay__396byte1,f
        goto delay__396delay0
        nop
        nop
        ; procedure delay end
        retlw 0
        ; optimize 1

        ; procedure main start
main:
main__variables__base equ global__variables__bank0+30
main__bytes__base equ main__variables__base+0
main__bits__base equ main__variables__base+4
main__total__bytes equ 4
main__715byte0 equ main__bytes__base+2
main__515byte2 equ main__bytes__base+2
main__515byte3 equ main__bytes__base+2
main__542byte0 equ main__bytes__base+2
main__528byte0 equ main__bytes__base+2
main__512byte0 equ main__bytes__base+2
main__515byte1 equ main__bytes__base+3
        ;   arguments_none  
main__command equ main__bytes__base+0
main__temp equ main__bytes__base+1
        ;   call reset {{ }}  
        call reset
        ; Loop waiting for commands :
        ; loop_forever ... start
main__507loop__forever:
        ; Get a command byte :
        ;   command := get_byte {{ }}  
        call get_byte
        movf get_byte__0return__byte,w
        movwf main__command
        ; Dispatch on command :
        ; switch { command >> 6 }
        movlw HIGH switch__512block_start
        movwf pclath___register
        swapf main__command,w
        movwf main__512byte0
        rrf main__512byte0,f
        rrf main__512byte0,w
        andlw 3
        ; case 0
        ; case 1
        ; case 2
        ; case 3
switch__512block_start:
        addwf pcl___register,f
        goto switch__512block513
        goto switch__512block526
        goto switch__512block540
        goto switch__512block713
switch__512block_end:
        ; switch_check 512 switch__512block_start switch__512block_end
switch__512block513:
        ; Set Quick < Command = 00 hh hhdm > :
        ;   temp := {{ {{ command << 2 }} & 0xf0 }} | {{ command >> 2 }}  
        rlf main__command,w
        movwf main__515byte3
        rlf main__515byte3,w
        andlw 240
        movwf main__515byte2
        rrf main__command,w
        movwf main__515byte1
        rrf main__515byte1,w
        andlw 63
        iorwf main__515byte2,w
        movwf main__temp
        ; if { command @ 0 } start
        ; Alias variable for select command @ 0
main__command__516select0 equ main__command+0
main__command__516select0__byte equ main__command+0
main__command__516select0__bit equ 0
        ; expression=`{ command @ 0 }' exp_delay=0 true_delay=5  false_delay=5 true_size=5 false_size=5
        btfss main__command__516select0__byte,main__command__516select0__bit
        goto label516__1false
label516__1true:
        ; if { command @ 0 } body start
        ; Motor :
        ;   desired_speed1 := temp  
        movf main__temp,w
        movwf desired_speed1
        ;   motor1_direction := command @ 1  
        ; Alias variable for select command @ 1
main__command__519select0 equ main__command+0
main__command__519select0__byte equ main__command+0
main__command__519select0__bit equ 1
        bcf motor1_direction__byte,motor1_direction__bit
        btfsc main__command__519select0__byte,main__command__519select0__bit
        bsf motor1_direction__byte,motor1_direction__bit
        ; if { command @ 0 } body end
        goto label516__1end
label516__1false:
        ; else body start
        ;   desired_speed0 := temp  
        movf main__temp,w
        movwf desired_speed0
        ;   motor0_direction := command @ 1  
        ; Alias variable for select command @ 1
main__command__522select0 equ main__command+0
main__command__522select0__byte equ main__command+0
main__command__522select0__bit equ 1
        bcf motor0_direction__byte,motor0_direction__bit
        btfsc main__command__522select0__byte,main__command__522select0__bit
        bsf motor0_direction__byte,motor0_direction__bit
        ; else body end
        ; if exp=` command @ 0 ' generic
label516__1end:
        ; Other expression=`{ command @ 0 }' delay=-1
        ; if { command @ 0 } end
        ;   call set_up {{ }}  
        call set_up
        goto switch__512end
switch__512block526:
        ; Set Low < Command = 01 ll lldm > :
        ;   temp := {{ command >> 2 }} & 0xf  
        rrf main__command,w
        movwf main__528byte0
        rrf main__528byte0,w
        andlw 15
        movwf main__temp
        ; if { command @ 0 } start
        ; Alias variable for select command @ 0
main__command__529select0 equ main__command+0
main__command__529select0__byte equ main__command+0
main__command__529select0__bit equ 0
        ; expression=`{ command @ 0 }' exp_delay=0 true_delay=7  false_delay=7 true_size=7 false_size=7
        btfss main__command__529select0__byte,main__command__529select0__bit
        goto label529__1false
label529__1true:
        ; if { command @ 0 } body start
        ; Motor 1 :
        ;   desired_speed1 := desired_speed1 & 0xf0 | temp  
        movlw 240
        andwf desired_speed1,w
        iorwf main__temp,w
        movwf desired_speed1
        ;   motor1_direction := command @ 1  
        ; Alias variable for select command @ 1
main__command__532select0 equ main__command+0
main__command__532select0__byte equ main__command+0
main__command__532select0__bit equ 1
        bcf motor1_direction__byte,motor1_direction__bit
        btfsc main__command__532select0__byte,main__command__532select0__bit
        bsf motor1_direction__byte,motor1_direction__bit
        ; if { command @ 0 } body end
        goto label529__1end
label529__1false:
        ; else body start
        ; Motor 0 :
        ;   desired_speed0 := desired_speed0 & 0xf0 | temp  
        movlw 240
        andwf desired_speed0,w
        iorwf main__temp,w
        movwf desired_speed0
        ;   motor0_direction := command @ 1  
        ; Alias variable for select command @ 1
main__command__536select0 equ main__command+0
main__command__536select0__byte equ main__command+0
main__command__536select0__bit equ 1
        bcf motor0_direction__byte,motor0_direction__bit
        btfsc main__command__536select0__byte,main__command__536select0__bit
        bsf motor0_direction__byte,motor0_direction__bit
        ; else body end
        ; if exp=` command @ 0 ' generic
label529__1end:
        ; Other expression=`{ command @ 0 }' delay=-1
        ; if { command @ 0 } end
        ;   call set_up {{ }}  
        call set_up
        goto switch__512end
switch__512block540:
        ; Command = 10 xx xxxx :
        ; switch { {{ command >> 3 }} & 7 }
        movlw HIGH switch__542block_start
        movwf pclath___register
        rrf main__command,w
        movwf main__542byte0
        rrf main__542byte0,f
        rrf main__542byte0,w
        andlw 7
        ; case 0
        ; case 1
        ; case 2
        ; case 3
        ; case 4
        ; case 5
switch__542block_start:
        addwf pcl___register,f
        goto switch__542block543
        goto switch__542block583
        goto switch__542block606
        goto switch__542block610
        goto switch__542block662
        goto switch__542block700
        goto switch__542default708
        goto switch__542default708
switch__542block_end:
        ; switch_check 542 switch__542block_start switch__542block_end
switch__542block543:
        ; Command = 1000 0 xxx :
        ; switch { command & 7 }
        movlw HIGH switch__545block_start
        movwf pclath___register
        movlw 7
        andwf main__command,w
        ; case 0 1
        ; case 2
        ; case 3
        ; case 4 5 6 7
switch__545block_start:
        addwf pcl___register,f
        goto switch__545block546
        goto switch__545block546
        goto switch__545block556
        goto switch__545block562
        goto switch__545block567
        goto switch__545block567
        goto switch__545block567
        goto switch__545block567
switch__545block_end:
        ; switch_check 545 switch__545block_start switch__545block_end
switch__545block546:
        ; Set Ramp < Command = 1000 000 m > :
        ;   temp := get_byte {{ }}  
        call get_byte
        movf get_byte__0return__byte,w
        movwf main__temp
        ; if { command @ 0 } start
        ; Alias variable for select command @ 0
main__command__549select0 equ main__command+0
main__command__549select0__byte equ main__command+0
main__command__549select0__bit equ 0
        ; expression=`{ command @ 0 }' exp_delay=0 true_delay=2  false_delay=2 true_size=2 false_size=2
        btfss main__command__549select0__byte,main__command__549select0__bit
        goto label549__1false
label549__1true:
        ; if { command @ 0 } body start
        ;   ramp1 := temp  
        movf main__temp,w
        movwf ramp1
        ; if { command @ 0 } body end
        goto label549__1end
label549__1false:
        ; else body start
        ;   ramp0 := temp  
        movf main__temp,w
        movwf ramp0
        ; else body end
        ; if exp=` command @ 0 ' generic
label549__1end:
        ; Other expression=`{ command @ 0 }' delay=-1
        ; if { command @ 0 } end
        ;   call set_up {{ }}  
        call set_up
        goto switch__545end
switch__545block556:
        ; Set Failsafe < Command = 1000 0010 > :
        ;   fail_safe := get_byte {{ }}  
        call get_byte
        movf get_byte__0return__byte,w
        movwf fail_safe
        ;   fail_safe_high_counter := fail_safe  
        movwf fail_safe_high_counter
        ;   fail_safe_low_counter := 0  
        clrf fail_safe_low_counter
        goto switch__545end
switch__545block562:
        ; Reset Failsafe < Command = 1000 0011 > :
        ;   fail_safe_high_counter := fail_safe  
        movf fail_safe,w
        movwf fail_safe_high_counter
        ;   fail_safe_low_counter := 0  
        clrf fail_safe_low_counter
        goto switch__545end
switch__545block567:
        ; Set Speed < Command = 1000 01 dm > :
        ;   temp := get_byte {{ }}  
        call get_byte
        movf get_byte__0return__byte,w
        movwf main__temp
        ; if { command @ 0 } start
        ; Alias variable for select command @ 0
main__command__570select0 equ main__command+0
main__command__570select0__byte equ main__command+0
main__command__570select0__bit equ 0
        ; expression=`{ command @ 0 }' exp_delay=0 true_delay=5  false_delay=5 true_size=5 false_size=5
        btfss main__command__570select0__byte,main__command__570select0__bit
        goto label570__1false
label570__1true:
        ; if { command @ 0 } body start
        ; Motor 1 :
        ;   desired_speed1 := temp  
        movf main__temp,w
        movwf desired_speed1
        ;   motor1_direction := command @ 1  
        ; Alias variable for select command @ 1
main__command__573select0 equ main__command+0
main__command__573select0__byte equ main__command+0
main__command__573select0__bit equ 1
        bcf motor1_direction__byte,motor1_direction__bit
        btfsc main__command__573select0__byte,main__command__573select0__bit
        bsf motor1_direction__byte,motor1_direction__bit
        ; if { command @ 0 } body end
        goto label570__1end
label570__1false:
        ; else body start
        ; Motor 0 :
        ;   desired_speed0 := temp  
        movf main__temp,w
        movwf desired_speed0
        ;   motor0_direction := command @ 1  
        ; Alias variable for select command @ 1
main__command__577select0 equ main__command+0
main__command__577select0__byte equ main__command+0
main__command__577select0__bit equ 1
        bcf motor0_direction__byte,motor0_direction__bit
        btfsc main__command__577select0__byte,main__command__577select0__bit
        bsf motor0_direction__byte,motor0_direction__bit
        ; else body end
        ; if exp=` command @ 0 ' generic
label570__1end:
        ; Other expression=`{ command @ 0 }' delay=-1
        ; if { command @ 0 } end
        ;   call set_up {{ }}  
        call set_up
switch__545end:
        goto switch__542end
switch__542block583:
        ; Command = 1000 1 xxx :
        ; if { command @ 2 } start
        ; Alias variable for select command @ 2
main__command__585select0 equ main__command+0
main__command__585select0__byte equ main__command+0
main__command__585select0__bit equ 2
        ; expression=`{ command @ 2 }' exp_delay=0 true_delay=-1  false_delay=-1 true_size=9 false_size=9
        btfss main__command__585select0__byte,main__command__585select0__bit
        goto label585__1false
label585__1true:
        ; if { command @ 2 } body start
        ; Set direction < Command = 1000 11 dm > :
        ; if { command @ 0 } start
        ; Alias variable for select command @ 0
main__command__587select0 equ main__command+0
main__command__587select0__byte equ main__command+0
main__command__587select0__bit equ 0
        ; expression=`{ command @ 0 }' exp_delay=0 true_delay=3  false_delay=3 true_size=3 false_size=3
        btfss main__command__587select0__byte,main__command__587select0__bit
        goto label587__1false
label587__1true:
        ; if { command @ 0 } body start
        ; Motor 1 :
        ;   motor1_direction := command @ 1  
        ; Alias variable for select command @ 1
main__command__589select0 equ main__command+0
main__command__589select0__byte equ main__command+0
main__command__589select0__bit equ 1
        bcf motor1_direction__byte,motor1_direction__bit
        btfsc main__command__589select0__byte,main__command__589select0__bit
        bsf motor1_direction__byte,motor1_direction__bit
        ; if { command @ 0 } body end
        goto label587__1end
label587__1false:
        ; else body start
        ; Motor 0 :
        ;   motor0_direction := command @ 1  
        ; Alias variable for select command @ 1
main__command__592select0 equ main__command+0
main__command__592select0__byte equ main__command+0
main__command__592select0__bit equ 1
        bcf motor0_direction__byte,motor0_direction__bit
        btfsc main__command__592select0__byte,main__command__592select0__bit
        bsf motor0_direction__byte,motor0_direction__bit
        ; else body end
        ; if exp=` command @ 0 ' generic
label587__1end:
        ; Other expression=`{ command @ 0 }' delay=-1
        ; if { command @ 0 } end
        ; if { command @ 2 } body end
        goto label585__1end
label585__1false:
        ; else body start
        ; Set mode < Command = 1000 10 xm > :
        ; if { command @ 0 } start
        ; Alias variable for select command @ 0
main__command__596select0 equ main__command+0
main__command__596select0__byte equ main__command+0
main__command__596select0__bit equ 0
        ; expression=`{ command @ 0 }' exp_delay=0 true_delay=3  false_delay=3 true_size=3 false_size=3
        btfss main__command__596select0__byte,main__command__596select0__bit
        goto label596__1false
label596__1true:
        ; if { command @ 0 } body start
        ; Motor 1 :
        ;   motor1_mode := command @ 1  
        ; Alias variable for select command @ 1
main__command__598select0 equ main__command+0
main__command__598select0__byte equ main__command+0
main__command__598select0__bit equ 1
        bcf motor1_mode__byte,motor1_mode__bit
        btfsc main__command__598select0__byte,main__command__598select0__bit
        bsf motor1_mode__byte,motor1_mode__bit
        ; if { command @ 0 } body end
        goto label596__1end
label596__1false:
        ; else body start
        ; Motor 0 :
        ;   motor0_mode := command @ 1  
        ; Alias variable for select command @ 1
main__command__601select0 equ main__command+0
main__command__601select0__byte equ main__command+0
main__command__601select0__bit equ 1
        bcf motor0_mode__byte,motor0_mode__bit
        btfsc main__command__601select0__byte,main__command__601select0__bit
        bsf motor0_mode__byte,motor0_mode__bit
        ; else body end
        ; if exp=` command @ 0 ' generic
label596__1end:
        ; Other expression=`{ command @ 0 }' delay=-1
        ; if { command @ 0 } end
        ; else body end
        ; if exp=` command @ 2 ' generic
label585__1end:
        ; Other expression=`{ command @ 2 }' delay=-1
        ; if { command @ 2 } end
        ;   call set_up {{ }}  
        call set_up
        goto switch__542end
switch__542block606:
        ; Set Prescaler < Command = 1001 0 ppp > :
        ;   option := option_mask | {{ command & 7 }}  
        movlw 7
        andwf main__command,w
        iorlw 128
        ; Switch from register bank 0 to register bank 1 (which contains option)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        movwf option
        ; Switch from register bank 1 to register bank 0
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        goto switch__542end
switch__542block610:
        ; Command = 1001 1 xxx :
        ; switch { command & 7 }
        movlw HIGH switch__612block_start
        movwf pclath___register
        movlw 7
        andwf main__command,w
        ; case 0
        ; case 1
        ; case 2 3
        ; case 4 5
        ; case 6 7
switch__612block_start:
        addwf pcl___register,f
        goto switch__612block613
        goto switch__612block617
        goto switch__612block621
        goto switch__612block621
        goto switch__612block629
        goto switch__612block629
        goto switch__612block651
        goto switch__612block651
switch__612block_end:
        ; switch_check 612 switch__612block_start switch__612block_end
switch__612block613:
        ; Read Failsafe < Command = 1001 1000 > :
        ;   call send_byte {{ fail_safe }}  
        movf fail_safe,w
        movwf send_byte__char
        call send_byte
        goto switch__612end
switch__612block617:
        ; Read Prescaler < Command = 1001 1001 > :
        ;   call send_byte {{ option & 7 }}  
        movlw 7
        ; Switch from register bank 0 to register bank 1 (which contains option)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        andwf option,w
        movwf send_byte__char
        ; Switch from register bank 1 to register bank 0
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        call send_byte
        goto switch__612end
switch__612block621:
        ; Read Speed < Command = 1001 101 m > :
        ; if { command @ 0 } start
        ; Alias variable for select command @ 0
main__command__623select0 equ main__command+0
main__command__623select0__byte equ main__command+0
main__command__623select0__bit equ 0
        ; expression=`{ command @ 0 }' exp_delay=0 true_delay=-1  false_delay=-1 true_size=1 false_size=1
        btfsc main__command__623select0__byte,main__command__623select0__bit
        ; if { command @ 0 } body start
        ;   call send_byte {{ actual_speed1 }}  
        movf actual_speed1,w
        ; 2 instructions found for sharing
        btfss main__command__623select0__byte,main__command__623select0__bit
        ; else body start
        ;   call send_byte {{ actual_speed0 }}  
        movf actual_speed0,w
        ; 2 instructions found for sharing
        ; if exp=` command @ 0 ' single true and false skip delay=4
        ; Other expression=`{ command @ 0 }' delay=4
        ; 2 shared instructions follow
        movwf send_byte__char
        call send_byte
        ; if { command @ 0 } end
        goto switch__612end
switch__612block629:
        ; Read Mode / Direction < Command = 1001 110 m > :
        ;   temp := 0  
        clrf main__temp
        ; if { command @ 0 } start
        ; Alias variable for select command @ 0
main__command__632select0 equ main__command+0
main__command__632select0__byte equ main__command+0
main__command__632select0__bit equ 0
        ; expression=`{ command @ 0 }' exp_delay=0 true_delay=4  false_delay=4 true_size=4 false_size=4
        btfss main__command__632select0__byte,main__command__632select0__bit
        goto label632__1false
label632__1true:
        ; if { command @ 0 } body start
        ; Motor 1 :
        ; if { motor1_direction } start
        ; expression=`{ motor1_direction }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfsc motor1_direction__byte,motor1_direction__bit
        ; if { motor1_direction } body start
        ;   temp @ 1 := 1  
        ; Select temp @ 1
main__temp__635select0 equ main__temp+0
main__temp__635select0__byte equ main__temp+0
main__temp__635select0__bit equ 1
        bsf main__temp__635select0__byte,main__temp__635select0__bit
        ; if { motor1_direction } body end
        ; if exp=`motor1_direction' false skip delay=2
        ; Other expression=`{ motor1_direction }' delay=2
        ; if { motor1_direction } end
        ; if { motor1_mode } start
        ; expression=`{ motor1_mode }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfsc motor1_mode__byte,motor1_mode__bit
        ; if { motor1_mode } body start
        ;   temp @ 0 := 1  
        ; Select temp @ 0
main__temp__638select0 equ main__temp+0
main__temp__638select0__byte equ main__temp+0
main__temp__638select0__bit equ 0
        bsf main__temp__638select0__byte,main__temp__638select0__bit
        ; if { motor1_mode } body end
        ; if exp=`motor1_mode' false skip delay=2
        ; Other expression=`{ motor1_mode }' delay=2
        ; if { motor1_mode } end
        ; if { command @ 0 } body end
        goto label632__1end
label632__1false:
        ; else body start
        ; Motor 0 :
        ; if { motor0_direction } start
        ; expression=`{ motor0_direction }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfsc motor0_direction__byte,motor0_direction__bit
        ; if { motor0_direction } body start
        ;   temp @ 1 := 1  
        ; Select temp @ 1
main__temp__643select0 equ main__temp+0
main__temp__643select0__byte equ main__temp+0
main__temp__643select0__bit equ 1
        bsf main__temp__643select0__byte,main__temp__643select0__bit
        ; if { motor0_direction } body end
        ; if exp=`motor0_direction' false skip delay=2
        ; Other expression=`{ motor0_direction }' delay=2
        ; if { motor0_direction } end
        ; if { motor0_mode } start
        ; expression=`{ motor0_mode }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfsc motor0_mode__byte,motor0_mode__bit
        ; if { motor0_mode } body start
        ;   temp @ 0 := 1  
        ; Select temp @ 0
main__temp__646select0 equ main__temp+0
main__temp__646select0__byte equ main__temp+0
main__temp__646select0__bit equ 0
        bsf main__temp__646select0__byte,main__temp__646select0__bit
        ; if { motor0_mode } body end
        ; if exp=`motor0_mode' false skip delay=2
        ; Other expression=`{ motor0_mode }' delay=2
        ; if { motor0_mode } end
        ; else body end
        ; if exp=` command @ 0 ' generic
label632__1end:
        ; Other expression=`{ command @ 0 }' delay=-1
        ; if { command @ 0 } end
        ;   call send_byte {{ temp }}  
        movf main__temp,w
        movwf send_byte__char
        call send_byte
        goto switch__612end
switch__612block651:
        ; Read Ramp < Command = 1001 101 m > :
        ; if { command @ 0 } start
        ; Alias variable for select command @ 0
main__command__653select0 equ main__command+0
main__command__653select0__byte equ main__command+0
main__command__653select0__bit equ 0
        ; expression=`{ command @ 0 }' exp_delay=0 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfsc main__command__653select0__byte,main__command__653select0__bit
        ; if { command @ 0 } body start
        ;   temp := ramp1  
        movf ramp1,w
        ; 1 instructions found for sharing
        btfss main__command__653select0__byte,main__command__653select0__bit
        ; else body start
        ;   temp := ramp0  
        movf ramp0,w
        ; 1 instructions found for sharing
        ; if exp=` command @ 0 ' single true and false skip delay=4
        ; Other expression=`{ command @ 0 }' delay=4
        ; 1 shared instructions follow
        movwf main__temp
        ; if { command @ 0 } end
        ;   call send_byte {{ temp }}  
        movwf send_byte__char
        call send_byte
switch__612end:
        goto switch__542end
switch__542block662:
        ; Command = 0110 0 xxx :
        ; switch { command & 7 }
        movlw HIGH switch__664block_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__664block_start:
        addwf pcl___register,f
        goto switch__664block665
        goto switch__664block670
        goto switch__664block674
        goto switch__664block678
        goto switch__664block682
        goto switch__664block686
        goto switch__664block690
        goto switch__664block694
switch__664block_end:
        ; switch_check 664 switch__664block_start switch__664block_end
switch__664block665:
        ; Read Failsafe Errors < Command = 1010 0000 > :
        ;   call send_byte {{ fail_safe_errors }}  
        movf fail_safe_errors,w
        movwf send_byte__char
        call send_byte
        ;   fail_safe_errors := 0  
        clrf fail_safe_errors
        goto switch__664end
switch__664block670:
        ; Read Failsafe Counter < Command = 1010 0001 > :
        ;   call send_byte {{ fail_safe_high_counter }}  
        movf fail_safe_high_counter,w
        movwf send_byte__char
        call send_byte
        goto switch__664end
switch__664block674:
        ; Read Actual Speed 0 < Command = 1010 0010 > :
        ;   call send_byte {{ actual_speed0 }}  
        movf actual_speed0,w
        movwf send_byte__char
        call send_byte
        goto switch__664end
switch__664block678:
        ; Read Actual Speed 1 < Command = 1010 0011 > :
        ;   call send_byte {{ actual_speed1 }}  
        movf actual_speed1,w
        movwf send_byte__char
        call send_byte
        goto switch__664end
switch__664block682:
        ; Set Motor 0 off < Command = 1010 0100 > :
        ;   motor0e := 0  
        bcf motor0e__byte,motor0e__bit
        goto switch__664end
switch__664block686:
        ; Set Motor 0 on < Command = 1010 0101 > :
        ;   motor0e := 1  
        bsf motor0e__byte,motor0e__bit
        goto switch__664end
switch__664block690:
        ; Set Motor 1 off < Command = 1010 0110 > :
        ;   motor1e := 0  
        bcf motor1e__byte,motor1e__bit
        goto switch__664end
switch__664block694:
        ; Set Motor 1 on < Command = 1010 0111 > :
        ;   motor1e := 1  
        bsf motor1e__byte,motor1e__bit
switch__664end:
        goto switch__542end
switch__542block700:
        ; if { command & 3 = 0 } start
        movlw 3
        andwf main__command,w
        ; expression=`{ command & 3 = 0 }' exp_delay=2 true_delay=-1  false_delay=0 true_size=2 false_size=0
        btfss z___byte,z___bit
        goto label701__0end
        ; if { command & 3 = 0 } body start
        ; FIXME : Code generator chokes on single call instruction
        ; in the then clause . Add ' ramp0 := 0 ' to work around ! ! !
        ;   ramp0 := 0  
        clrf ramp0
        ;   call reset {{ }}  
        call reset
        ; if { command & 3 = 0 } body end
label701__0end:
        ; if exp=` command & 3 = 0 ' empty false
        ; Other expression=`{ command & 3 = 0 }' delay=-1
        ; if { command & 3 = 0 } end
        goto switch__542end
switch__542default708:
        ; Do nothing :
switch__542end:
        goto switch__512end
switch__512block713:
        ; Command = 11 xx xxxx :
        ; switch { {{ command >> 3 }} & 7 }
        movlw HIGH switch__715block_start
        movwf pclath___register
        rrf main__command,w
        movwf main__715byte0
        rrf main__715byte0,f
        rrf main__715byte0,w
        andlw 7
        ; case 7
switch__715block_start:
        addwf pcl___register,f
        goto switch__715end
        goto switch__715end
        goto switch__715end
        goto switch__715end
        goto switch__715end
        goto switch__715end
        goto switch__715end
        goto switch__715block716
switch__715block_end:
        ; switch_check 715 switch__715block_start switch__715block_end
switch__715block716:
        ; Shared commands < Command = 1111 1 ccc > :
        ; switch { command & 7 }
        movlw HIGH switch__718block_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__718block_start:
        addwf pcl___register,f
        goto switch__718block719
        goto switch__718block723
        goto switch__718block727
        goto switch__718block731
        goto switch__718block735
        goto switch__718block746
        goto switch__718block750
        goto switch__718block755
switch__718block_end:
        ; switch_check 718 switch__718block_start switch__718block_end
switch__718block719:
        ; Clock Decrement < Command = 1111 1000 > :
        ;   osccal := osccal - osccal_unit  
        movlw 252
        ; Switch from register bank 0 to register bank 1 (which contains osccal)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        addwf osccal,f
        ; Switch from register bank 1 to register bank 0
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        goto switch__718end
switch__718block723:
        ; Clock Increment < Command = 1111 1001 > :
        ;   osccal := osccal + osccal_unit  
        movlw 4
        ; Switch from register bank 0 to register bank 1 (which contains osccal)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        addwf osccal,f
        ; Switch from register bank 1 to register bank 0
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        goto switch__718end
switch__718block727:
        ; Clock Read < Command = 1111 1010 > :
        ;   call send_byte {{ osccal }}  
        ; Switch from register bank 0 to register bank 1 (which contains osccal)
        bsf rp0___byte,rp0___bit
        ; Register bank is now 1
        movf osccal,w
        movwf send_byte__char
        ; Switch from register bank 1 to register bank 0
        bcf rp0___byte,rp0___bit
        ; Register bank is now 0
        call send_byte
        goto switch__718end
switch__718block731:
        ; Clock Pulse < Command = 1111 1011 > :
        ;   call send_byte {{ 0 }}  
        clrf send_byte__char
        call send_byte
        goto switch__718end
switch__718block735:
        ; ID Next < Command = 1111 1100 > :
        ; if { id_index >= id . size } start
        movlw 48
        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
        ;   call send_byte {{ id ~~ {{ id_index }} }}  
        incf id_index,w
        clrf pclath___register
        call id
        movwf send_byte__char
        call send_byte
        ;   id_index := id_index + 1  
        incf id_index,f
        ; if { id_index >= id . size } start
        movlw 48
        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__718end
switch__718block746:
        ; ID Reset < Command = 1111 1101 > :
        ;   id_index := 0  
        clrf id_index
        goto switch__718end
switch__718block750:
        ; Glitch Read < Command = 1111 1110 > :
        ;   call send_byte {{ glitch }}  
        movf glitch,w
        movwf send_byte__char
        call send_byte
        ;   glitch := 0  
        clrf glitch
        goto switch__718end
switch__718block755:
        ; Glitch < Command = 1111 1111 > :
        ; if { glitch != 0xff } start
        incf glitch,w
        ; expression=`{ glitch != 0xff }' exp_delay=1 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfss z___byte,z___bit
        ; if { glitch != 0xff } body start
        ;   glitch := glitch + 1  
        incf glitch,f
        ; if { glitch != 0xff } body end
        ; if exp=` glitch != 0xff ' false skip delay=3
        ; Other expression=`{ glitch != 0xff }' delay=3
        ; if { glitch != 0xff } end
switch__718end:
switch__715end:
switch__512end:
        goto main__507loop__forever
        ; loop_forever ... end
        ; procedure main end

        ; Register bank 0 used 34 bytes of 64 available bytes
        ; Register bank 1 used 0 bytes of 0 available bytes

        end

