        radix dec
global__variables__bank0 equ 7
global__variables__bank1 equ 48
global__bit__variables__bank0 equ 29
global__bit__variables__bank1 equ 48
indf___register equ 0
pcl___register equ 2
c___byte equ 3
c___bit equ 0
z___byte equ 3
z___bit equ 2
        ; On 12-bit PIC's, RP0 is actually bit 5 in FSR (=4)
rp0___byte equ 4
rp0___bit equ 5
        ; On 12-bit PIC's, RP1 is actually bit 6 in FSR (=4)
rp1___byte equ 4
rp1___bit equ 6
        ; On 12-bit PIC's, PA0 is actually bit 5 in STATUS (=3)
pa0___byte equ 3
pa0___bit equ 5
fsr___register equ 4
        org 0
start:
        ; Use oscillator calibration value already in register W
        movwf 5
        ; Initialize TRIS registers
        movlw 200
        tris 6
        ; Initialize OPTION register
        movlw 192
        option
        ; Switch from code bank 0 to code bank 1 before possible transfer (goto)
        bsf pa0___byte,pa0___bit
        goto main
        ; comment #############################################################################
        ; comment {}
        ; comment {Copyright < c > 2000 - 2001 by Wayne C . Gramlich and Bill 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 LED4 RoboBrick . Basically}
        ; comment {it just waits for commands that come in at 2400 baud and responds}
        ; comment {to them . See :}
        ; comment {}
        ; comment {http : / / web . gramlich . net / projects / robobricks / led4 / index . html}
        ; comment {}
        ; comment {for more details .}
        ; comment {}
        ; comment #############################################################################
        ;   processor pic12c509 cp = off wdte = on mclre = off fosc = intrc  
        ; 14=0xe 4095=0xfff
        __config 14
configuration___address equ 4095
        ; 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
        ; comment {Register definitions :}
        ; 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 5
        ; comment {The 509 has 4 bits of OSCCAL and the 509 A has 6 bits .}
        ;   constant osccal_lsb 0x10  
osccal_lsb equ 16
        ; comment {constant osccal_lsb 0x4}
        ; comment {Define pin assignments and directions :}
porta equ 6
led3__byte equ 6
led3__bit equ 0
led2__byte equ 6
led2__bit equ 1
led1__byte equ 6
led1__bit equ 2
serial_in__byte equ 6
serial_in__bit equ 3
led0__byte equ 6
led0__bit equ 4
serial_out__byte equ 6
serial_out__bit equ 5
        ; string_constants Start
        ; Switch from code bank 1 to code bank 0 before possible transfer (label)
        bcf pa0___byte,pa0___bit
string___fetch:
        movwf pcl___register
        ;   id = 1 , 0 , 8 , 0 , 0 , 0 , 0 , 0 , 0r'16' , 5 , 0s'LED4A' , 15 , 0s'Gramlich&Benson'  
id___string equ 0
id:
        addwf pcl___register,f
        ; Length = 46
        retlw 46
        ; 1
        retlw 1
        ; 0
        retlw 0
        ; 8
        retlw 8
        ; 0
        retlw 0
        ; 0
        retlw 0
        ; 0
        retlw 0
        ; 0
        retlw 0
        ; 0
        retlw 0
        ; 0r'16'
        retlw 211 ; random number
        retlw 11 ; random number
        retlw 254 ; random number
        retlw 106 ; random number
        retlw 84 ; random number
        retlw 164 ; random number
        retlw 19 ; random number
        retlw 113 ; random number
        retlw 62 ; random number
        retlw 38 ; random number
        retlw 124 ; random number
        retlw 240 ; random number
        retlw 190 ; random number
        retlw 225 ; random number
        retlw 61 ; random number
        retlw 43 ; random number
        ; 5
        retlw 5
        ; `LED4A'
        retlw 76
        retlw 69
        retlw 68
        retlw 52
        retlw 65
        ; 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
        ;   rate_to_mask = 0xff , 0x80 , 0x40 , 0x20 , 0x10 , 8 , 4 , 2 , 1  
rate_to_mask___string equ 48
rate_to_mask:
        addwf pcl___register,f
        ; Length = 9
        retlw 9
        ; 0xff
        retlw 255
        ; 0x80
        retlw 128
        ; 0x40
        retlw 64
        ; 0x20
        retlw 32
        ; 0x10
        retlw 16
        ; 8
        retlw 8
        ; 4
        retlw 4
        ; 2
        retlw 2
        ; 1
        retlw 1
        ;   bit_to_mask = 1 , 2 , 4 , 8  
bit_to_mask___string equ 59
bit_to_mask:
        addwf pcl___register,f
        ; Length = 4
        retlw 4
        ; 1
        retlw 1
        ; 2
        retlw 2
        ; 4
        retlw 4
        ; 8
        retlw 8
        ; string__constants End
leds_mask equ global__variables__bank0+0
blink_masks equ global__variables__bank0+1
        ; comment {Note that the 12 - bit PIC ' s only have a 2 - level deep stack .}
        ; comment {The code starts in the main procedure < located at the end of this code >}
        ; comment {The next level of procedure call is either get_byte or send_byte .}
        ; comment {Lastly , the lowest level of procedure call is delay . It all fits ,}
        ; comment {but just barely .}

        ; procedure get_byte start
get_byte:
        ; Procedure must be called with PCLATH set to code bank 0
get_byte__variables__base equ global__variables__bank0+5
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 3
        ;   arguments_none  
get_byte__0return__byte equ get_byte__bytes__base+0
        ; This procedure will wait for a byte to be received from
        ; serial_in_bit . It calls the delay procedure for all delays .
get_byte__count equ get_byte__bytes__base+1
get_byte__char equ get_byte__bytes__base+2
        ; Why does the delay procedure wait for a third of bit ? Well , it
        ; has to do with the loop immediately below . If we catch the
        ; start bit at the beginning of a 1 / 3 bit time , we will be
        ; sampling data at approximately 1 / 3 of the way into each bit .
        ; Conversely , if we catch the start near the end of a 1 / 3 bit
        ; bit time , we will be sampling data at approximately 2 / 3 of the
        ; way into each bit . So , what this means is that our bit sample
        ; times will be somewhere between 1 / 3 and 2 / 3 of bit < i . e . in
        ; the middle of the bit .
        ; It would be nice to tweak the code to shorter delay times
        ; < 1 / 4 bit , 1 / 5 bite , etc . > but then it gets too hard to get
        ; the bookeeping done in the delay routine . A 12 - bit PIC
        ; running at 4 MHz <= 1 MIPS > , only has 138 instructions available
        ; for the delay routine when at 1 / 3 of bit .
        ; Wait for a start bit :
        ; `while serial_in ...' start
get_byte__100while__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__100while__break
        ;   call delay {{ }}  
        call delay
        goto get_byte__100while__continue
        ; if exp=`serial_in' false goto
        ; Other expression=`serial_in' delay=-1
get_byte__100while__break:
        ; `while serial_in ...' end
        ; 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__111_loop:
        ;   call delay {{ }}  
        call delay
        ;   char := char >> 1  
        bcf c___byte,c___bit
        rrf get_byte__char,f
        ; 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__115select0 equ get_byte__char+0
get_byte__char__115select0__byte equ get_byte__char+0
get_byte__char__115select0__bit equ 7
        bsf get_byte__char__115select0__byte,get_byte__char__115select0__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
        decfsz get_byte__count,f
        goto get_byte__111_loop
get_byte__111_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:
        ; Procedure must be called with PCLATH set to code bank 0
send_byte__variables__base equ global__variables__bank0+8
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
        ; 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__142_loop:
        ;   serial_out := char @ 0  
        ; Alias variable for select char @ 0
send_byte__char__143select0 equ send_byte__char+0
send_byte__char__143select0__byte equ send_byte__char+0
send_byte__char__143select0__bit equ 0
        btfss send_byte__char__143select0__byte,send_byte__char__143select0__bit
        bcf serial_out__byte,serial_out__bit
        btfsc send_byte__char__143select0__byte,send_byte__char__143select0__bit
        bsf serial_out__byte,serial_out__bit
        ;   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
        decfsz send_byte__count,f
        goto send_byte__142_loop
send_byte__142_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 delay start
        ; optimize 0
delay:
        ; Procedure must be called with PCLATH set to code bank 0
delay__variables__base equ global__variables__bank0+10
delay__bytes__base equ delay__variables__base+0
delay__bits__base equ delay__variables__base+4
delay__total__bytes equ 4
delay__177byte2 equ delay__bytes__base+3
delay__157byte1 equ delay__bytes__base+3
        ;   arguments_none  
        ;   uniform_delay instructions_per_delay  
        ; Uniform delay remaining = 134 Accumulated Delay = 0
        ; Uniform delay remaining = 134 Accumulated Delay = 0
        ; This procedure delays 1 / 3 of a bit .
        ; Uniform delay remaining = 134 Accumulated Delay = 0
        ; Uniform delay remaining = 134 Accumulated Delay = 0
delay__blink equ delay__bytes__base+0
        ; Uniform delay remaining = 134 Accumulated Delay = 0
delay__high equ delay__bytes__base+1
        ; Uniform delay remaining = 134 Accumulated Delay = 0
delay__low equ delay__bytes__base+2
        ; Uniform delay remaining = 134 Accumulated Delay = 0
        ; Uniform delay remaining = 134 Accumulated Delay = 0
        ; This procedure is called 7200 times a second . We want to
        ; Uniform delay remaining = 134 Accumulated Delay = 0
        ; slow the fastest blink rate down to something more manageable ,
        ; Uniform delay remaining = 134 Accumulated Delay = 0
        ; like 4 times a second .
        ; Uniform delay remaining = 134 Accumulated Delay = 0
        ; Uniform delay remaining = 134 Accumulated Delay = 0
        ; Kick the dog :
        ; Uniform delay remaining = 134 Accumulated Delay = 0
        ;   watch_dog_reset  
        clrwdt
        ; Uniform delay remaining = 133 Accumulated Delay = 1
        ; Uniform delay remaining = 133 Accumulated Delay = 1
        ; Slow the blink rate down :
        ; Uniform delay remaining = 133 Accumulated Delay = 1
        ;   low := low + 1  
        incf delay__low,f
        ; Uniform delay remaining = 132 Accumulated Delay = 2
        ; if { z } start
        ; expression=`{ z }' exp_delay=0 true_delay=10  false_delay=0 true_size=13 false_size=0
        btfsc z__byte,z__bit
        goto label177__0true
label177__0false:
        ; Delay 9 cycles
        movlw 2
        movwf delay__177byte2
delay__177delay1:
        decfsz delay__177byte2,f
        goto delay__177delay1
        nop
        nop
        goto label177__0end
label177__0true:
        ; if { z } body start
        ; Uniform delay remaining = 132 Accumulated Delay = 0
        ;   high := high + 1  
        incf delay__high,f
        ; Uniform delay remaining = 131 Accumulated Delay = 1
        ; 7200 / 256 ~ = 28 ; 28 / 4 = 7 = > 4 blinks a second for fastest blink rate :
        ; Uniform delay remaining = 131 Accumulated Delay = 1
        ; if { high > 2 } start
        movlw 3
        subwf delay__high,w
        ; expression=`{ high > 2 }' exp_delay=2 true_delay=4  false_delay=0 true_size=4 false_size=0
        btfsc c___byte,c___bit
        goto label180__0true
label180__0false:
        ; Delay 3 cycles
        nop
        nop
        nop
        goto label180__0end
label180__0true:
        ; if { high > 2 } body start
        ; Uniform delay remaining = 131 Accumulated Delay = 0
        ;   high := 0  
        clrf delay__high
        ; Uniform delay remaining = 130 Accumulated Delay = 1
        ;   blink := blink + 1  
        incf delay__blink,f
        ; Uniform delay remaining = 129 Accumulated Delay = 2
        ; Uniform delay remaining = 129 Accumulated Delay = 2
        ; We never let the blink mask go to all zeros because the way
        ; Uniform delay remaining = 129 Accumulated Delay = 2
        ; we indicate that an LED is to stay on alwayas is that we set
        ; Uniform delay remaining = 129 Accumulated Delay = 2
        ; its blink mask to all one ' s . If the blink variable ever goes
        ; Uniform delay remaining = 129 Accumulated Delay = 2
        ; to all zeros , there would be a small glitch for LED ' s that
        ; Uniform delay remaining = 129 Accumulated Delay = 2
        ; are supposed to be always on . Hence we skip over a value of 0 .
        ; Uniform delay remaining = 129 Accumulated Delay = 2
        ; if { z } start
        ; expression=`{ z }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
        btfsc z__byte,z__bit
        ; if { z } body start
        ; Uniform delay remaining = 129 Accumulated Delay = 0
        ;   blink := blink + 1  
        incf delay__blink,f
        ; Uniform delay remaining = 128 Accumulated Delay = 1
        ; Uniform delay remaining = 128 Accumulated Delay = 1
        ; if { z } body end
        ; if exp=`z' false skip delay=2
        ; Other expression=`{ z }' delay=2
        ; if { z } end
        ; Uniform delay remaining = 127 Accumulated Delay = 4
        ; Uniform delay remaining = 127 Accumulated Delay = 4
        ; if { high > 2 } body end
        ; if exp=` high > 2 ' total delay=9
        ; if exp=` high > 2 ' generic
label180__0end:
        ; Other expression=`{ high > 2 }' delay=9
        ; if { high > 2 } end
        ; Uniform delay remaining = 122 Accumulated Delay = 10
        ; Uniform delay remaining = 122 Accumulated Delay = 10
        ; if { z } body end
        ; if exp=`z' total delay=13
        ; if exp=`z' generic
label177__0end:
        ; Other expression=`{ z }' delay=13
        ; if { z } end
        ; Uniform delay remaining = 119 Accumulated Delay = 15
        ; Uniform delay remaining = 119 Accumulated Delay = 15
        ; if { leds_mask @ 0 } start
        ; Alias variable for select leds_mask @ 0
leds_mask__195select0 equ leds_mask+0
leds_mask__195select0__byte equ leds_mask+0
leds_mask__195select0__bit equ 0
        ; expression=`{ leds_mask @ 0 }' exp_delay=0 true_delay=5  false_delay=0 true_size=5 false_size=0
        btfsc leds_mask__195select0__byte,leds_mask__195select0__bit
        goto label195__1true
label195__1false:
        ; else body start
        ; Uniform delay remaining = 119 Accumulated Delay = 0
        ;   led0 := 1  
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 118 Accumulated Delay = 1
        ; else body end
        ; Delay 4 cycles
        nop
        nop
        nop
        nop
        goto label195__1end
label195__1true:
        ; if { leds_mask @ 0 } body start
        ; Uniform delay remaining = 119 Accumulated Delay = 0
        ; if { blink & blink_masks ~~ {{ 0 }} != 0 } start
        movf blink_masks+0,w
        andwf delay__blink,w
        ; expression=`{ blink & blink_masks ~~ {{ 0 }} != 0 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss z___byte,z___bit
        ; if { blink & blink_masks ~~ {{ 0 }} != 0 } body start
        ; Uniform delay remaining = 119 Accumulated Delay = 0
        ;   led0 := 0  
        bcf led0__byte,led0__bit
        ; Uniform delay remaining = 118 Accumulated Delay = 1
        ; Uniform delay remaining = 118 Accumulated Delay = 1
        ; if { blink & blink_masks ~~ {{ 0 }} != 0 } body end
        btfsc z___byte,z___bit
        ; else body start
        ; Uniform delay remaining = 119 Accumulated Delay = 0
        ;   led0 := 1  
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 118 Accumulated Delay = 1
        ; else body end
        ; if exp=` blink & blink_masks ~~ {{ 0 }} != 0 ' single true and false skip delay=6
        ; Other expression=`{ blink & blink_masks ~~ {{ 0 }} != 0 }' delay=6
        ; if { blink & blink_masks ~~ {{ 0 }} != 0 } end
        ; Uniform delay remaining = 113 Accumulated Delay = 6
        ; Uniform delay remaining = 113 Accumulated Delay = 6
        ; if { leds_mask @ 0 } body end
        ; if exp=` leds_mask @ 0 ' total delay=8
        ; if exp=` leds_mask @ 0 ' generic
label195__1end:
        ; Other expression=`{ leds_mask @ 0 }' delay=8
        ; 1 shared instructions follow
        bsf led0__byte,led0__bit
        ; if { leds_mask @ 0 } end
        ; Uniform delay remaining = 110 Accumulated Delay = 24
        ; Uniform delay remaining = 110 Accumulated Delay = 24
        ; if { leds_mask @ 1 } start
        ; Alias variable for select leds_mask @ 1
leds_mask__205select0 equ leds_mask+0
leds_mask__205select0__byte equ leds_mask+0
leds_mask__205select0__bit equ 1
        ; expression=`{ leds_mask @ 1 }' exp_delay=0 true_delay=5  false_delay=0 true_size=5 false_size=0
        btfsc leds_mask__205select0__byte,leds_mask__205select0__bit
        goto label205__1true
label205__1false:
        ; else body start
        ; Uniform delay remaining = 110 Accumulated Delay = 0
        ;   led1 := 1  
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 109 Accumulated Delay = 1
        ; else body end
        ; Delay 4 cycles
        nop
        nop
        nop
        nop
        goto label205__1end
label205__1true:
        ; if { leds_mask @ 1 } body start
        ; Uniform delay remaining = 110 Accumulated Delay = 0
        ; if { blink & blink_masks ~~ {{ 1 }} != 0 } start
        movf blink_masks+1,w
        andwf delay__blink,w
        ; expression=`{ blink & blink_masks ~~ {{ 1 }} != 0 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss z___byte,z___bit
        ; if { blink & blink_masks ~~ {{ 1 }} != 0 } body start
        ; Uniform delay remaining = 110 Accumulated Delay = 0
        ;   led1 := 0  
        bcf led1__byte,led1__bit
        ; Uniform delay remaining = 109 Accumulated Delay = 1
        ; Uniform delay remaining = 109 Accumulated Delay = 1
        ; if { blink & blink_masks ~~ {{ 1 }} != 0 } body end
        btfsc z___byte,z___bit
        ; else body start
        ; Uniform delay remaining = 110 Accumulated Delay = 0
        ;   led1 := 1  
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 109 Accumulated Delay = 1
        ; else body end
        ; if exp=` blink & blink_masks ~~ {{ 1 }} != 0 ' single true and false skip delay=6
        ; Other expression=`{ blink & blink_masks ~~ {{ 1 }} != 0 }' delay=6
        ; if { blink & blink_masks ~~ {{ 1 }} != 0 } end
        ; Uniform delay remaining = 104 Accumulated Delay = 6
        ; Uniform delay remaining = 104 Accumulated Delay = 6
        ; if { leds_mask @ 1 } body end
        ; if exp=` leds_mask @ 1 ' total delay=8
        ; if exp=` leds_mask @ 1 ' generic
label205__1end:
        ; Other expression=`{ leds_mask @ 1 }' delay=8
        ; 1 shared instructions follow
        bsf led1__byte,led1__bit
        ; if { leds_mask @ 1 } end
        ; Uniform delay remaining = 101 Accumulated Delay = 33
        ; Uniform delay remaining = 101 Accumulated Delay = 33
        ; if { leds_mask @ 2 } start
        ; Alias variable for select leds_mask @ 2
leds_mask__215select0 equ leds_mask+0
leds_mask__215select0__byte equ leds_mask+0
leds_mask__215select0__bit equ 2
        ; expression=`{ leds_mask @ 2 }' exp_delay=0 true_delay=5  false_delay=0 true_size=5 false_size=0
        btfsc leds_mask__215select0__byte,leds_mask__215select0__bit
        goto label215__1true
label215__1false:
        ; else body start
        ; Uniform delay remaining = 101 Accumulated Delay = 0
        ;   led2 := 1  
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 100 Accumulated Delay = 1
        ; else body end
        ; Delay 4 cycles
        nop
        nop
        nop
        nop
        goto label215__1end
label215__1true:
        ; if { leds_mask @ 2 } body start
        ; Uniform delay remaining = 101 Accumulated Delay = 0
        ; if { blink & blink_masks ~~ {{ 2 }} != 0 } start
        movf blink_masks+2,w
        andwf delay__blink,w
        ; expression=`{ blink & blink_masks ~~ {{ 2 }} != 0 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss z___byte,z___bit
        ; if { blink & blink_masks ~~ {{ 2 }} != 0 } body start
        ; Uniform delay remaining = 101 Accumulated Delay = 0
        ;   led2 := 0  
        bcf led2__byte,led2__bit
        ; Uniform delay remaining = 100 Accumulated Delay = 1
        ; Uniform delay remaining = 100 Accumulated Delay = 1
        ; if { blink & blink_masks ~~ {{ 2 }} != 0 } body end
        btfsc z___byte,z___bit
        ; else body start
        ; Uniform delay remaining = 101 Accumulated Delay = 0
        ;   led2 := 1  
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 100 Accumulated Delay = 1
        ; else body end
        ; if exp=` blink & blink_masks ~~ {{ 2 }} != 0 ' single true and false skip delay=6
        ; Other expression=`{ blink & blink_masks ~~ {{ 2 }} != 0 }' delay=6
        ; if { blink & blink_masks ~~ {{ 2 }} != 0 } end
        ; Uniform delay remaining = 95 Accumulated Delay = 6
        ; Uniform delay remaining = 95 Accumulated Delay = 6
        ; if { leds_mask @ 2 } body end
        ; if exp=` leds_mask @ 2 ' total delay=8
        ; if exp=` leds_mask @ 2 ' generic
label215__1end:
        ; Other expression=`{ leds_mask @ 2 }' delay=8
        ; 1 shared instructions follow
        bsf led2__byte,led2__bit
        ; if { leds_mask @ 2 } end
        ; Uniform delay remaining = 92 Accumulated Delay = 42
        ; Uniform delay remaining = 92 Accumulated Delay = 42
        ; if { leds_mask @ 3 } start
        ; Alias variable for select leds_mask @ 3
leds_mask__225select0 equ leds_mask+0
leds_mask__225select0__byte equ leds_mask+0
leds_mask__225select0__bit equ 3
        ; expression=`{ leds_mask @ 3 }' exp_delay=0 true_delay=5  false_delay=0 true_size=5 false_size=0
        btfsc leds_mask__225select0__byte,leds_mask__225select0__bit
        goto label225__1true
label225__1false:
        ; else body start
        ; Uniform delay remaining = 92 Accumulated Delay = 0
        ;   led3 := 1  
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 91 Accumulated Delay = 1
        ; else body end
        ; Delay 4 cycles
        nop
        nop
        nop
        nop
        goto label225__1end
label225__1true:
        ; if { leds_mask @ 3 } body start
        ; Uniform delay remaining = 92 Accumulated Delay = 0
        ; if { blink & blink_masks ~~ {{ 3 }} != 0 } start
        movf blink_masks+3,w
        andwf delay__blink,w
        ; expression=`{ blink & blink_masks ~~ {{ 3 }} != 0 }' exp_delay=2 true_delay=1  false_delay=1 true_size=1 false_size=1
        btfss z___byte,z___bit
        ; if { blink & blink_masks ~~ {{ 3 }} != 0 } body start
        ; Uniform delay remaining = 92 Accumulated Delay = 0
        ;   led3 := 0  
        bcf led3__byte,led3__bit
        ; Uniform delay remaining = 91 Accumulated Delay = 1
        ; Uniform delay remaining = 91 Accumulated Delay = 1
        ; if { blink & blink_masks ~~ {{ 3 }} != 0 } body end
        btfsc z___byte,z___bit
        ; else body start
        ; Uniform delay remaining = 92 Accumulated Delay = 0
        ;   led3 := 1  
        ; 1 instructions found for sharing
        ; Uniform delay remaining = 91 Accumulated Delay = 1
        ; else body end
        ; if exp=` blink & blink_masks ~~ {{ 3 }} != 0 ' single true and false skip delay=6
        ; Other expression=`{ blink & blink_masks ~~ {{ 3 }} != 0 }' delay=6
        ; if { blink & blink_masks ~~ {{ 3 }} != 0 } end
        ; Uniform delay remaining = 86 Accumulated Delay = 6
        ; Uniform delay remaining = 86 Accumulated Delay = 6
        ; if { leds_mask @ 3 } body end
        ; if exp=` leds_mask @ 3 ' total delay=8
        ; if exp=` leds_mask @ 3 ' generic
label225__1end:
        ; Other expression=`{ leds_mask @ 3 }' delay=8
        ; 1 shared instructions follow
        bsf led3__byte,led3__bit
        ; if { leds_mask @ 3 } end
        ; Uniform delay remaining = 83 Accumulated Delay = 51
        ; Uniform delay remaining = 83 Accumulated Delay = 51
        ; Uniform delay remaining = 83 Accumulated Delay = 51
        ; Soak up remaining 83 cycles
        ; Delay 83 cycles
        movlw 27
        movwf delay__157byte1
delay__157delay0:
        decfsz delay__157byte1,f
        goto delay__157delay0
        nop
        ; procedure delay end
        retlw 0
        ; optimize 1
        ;   origin 0x200  
        org 512
        ; comment {The main procedure is loaded with switch statements . On the 12 - bit}
        ; comment {PIC ' s , switch statements have to live in the first 256 bytes of}
        ; comment {each code bank . For this reason , we shove main into code bank 1 .}
        ; comment {If we , try to put main in code bank 0 , it pushes the first bytes}
        ; comment {of several routines out of the first 256 bytes , which is also a}
        ; comment {no - no of the 12 - bit PIC ' s .}

        ; procedure main start
switch__277block_start:
        addwf pcl___register,f
        goto switch__277block278
        goto switch__277block278
        goto switch__277block282
        goto switch__277block293
        goto switch__277block319
        goto switch__277block319
        goto switch__277block319
        goto switch__277block319
switch__277block_end:
        ; switch_check 277 switch__277block_start switch__277block_end
switch__329block_start:
        addwf pcl___register,f
        goto switch__329block330
        goto switch__329block334
        goto switch__329block334
        goto switch__329block334
        goto switch__329block337
        goto switch__329block337
        goto switch__329block337
        goto switch__329block337
switch__329block_end:
        ; switch_check 329 switch__329block_start switch__329block_end
switch__327block_start:
        addwf pcl___register,f
        goto switch__327block328
        goto switch__327block343
        goto switch__327default351
        goto switch__327default351
        goto switch__327default351
        goto switch__327default351
        goto switch__327default351
        goto switch__327default351
switch__327block_end:
        ; switch_check 327 switch__327block_start switch__327block_end
switch__363block_start:
        addwf pcl___register,f
        goto switch__363block364
        goto switch__363block368
        goto switch__363block372
        goto switch__363block376
        goto switch__363block380
        goto switch__363block388
        goto switch__363block392
        goto switch__363block397
switch__363block_end:
        ; switch_check 363 switch__363block_start switch__363block_end
switch__274block_start:
        addwf pcl___register,f
        goto switch__274block275
        goto switch__274block325
        goto switch__274block356
        goto switch__274block359
switch__274block_end:
        ; switch_check 274 switch__274block_start switch__274block_end
main:
        ; Procedure must be called with PCLATH set to code bank 0
main__variables__base equ global__variables__bank0+14
main__bytes__base equ main__variables__base+0
main__bits__base equ main__variables__base+8
main__total__bytes equ 8
main__308byte0 equ main__bytes__base+6
main__301byte0 equ main__bytes__base+6
main__321byte0 equ main__bytes__base+6
main__348byte0 equ main__bytes__base+6
main__321byte1 equ main__bytes__base+6
main__259byte0 equ main__bytes__base+6
main__277byte0 equ main__bytes__base+6
main__295byte0 equ main__bytes__base+6
main__321byte2 equ main__bytes__base+6
main__361byte1 equ main__bytes__base+6
main__361byte2 equ main__bytes__base+6
main__327byte0 equ main__bytes__base+6
main__274byte0 equ main__bytes__base+6
main__284byte0 equ main__bytes__base+6
main__339byte0 equ main__bytes__base+6
main__308byte1 equ main__bytes__base+7
main__348byte1 equ main__bytes__base+7
main__321byte3 equ main__bytes__base+7
main__259byte1 equ main__bytes__base+7
main__339byte1 equ main__bytes__base+7
        ;   arguments_none  
main__command equ main__bytes__base+0
main__glitch equ main__bytes__base+1
main__index equ main__bytes__base+2
main__mask equ main__bytes__base+3
main__rate equ main__bytes__base+4
main__result equ main__bytes__base+5
        ; Initialize blink_masks :
        ; `count_down index 4 ...' start
        movlw 4
        movwf main__index
main__258_loop:
        ;   blink_masks ~~ {{ index - 1 }} := 0xff  
        movlw 255
        movwf main__259byte0
        decf main__index,w
        movwf main__259byte1
        movlw LOW blink_masks
        addwf main__259byte1,
        movwf fsr___register
        ; FSR now points to reg bank 0 (which contains 8[])
        movf main__259byte0,w
        ; FSR must point to reg bank 0 (which contains 8[4]) before using INDF reg
        movwf indf___register
        decfsz main__index,f
        goto main__258_loop
main__258_done:
        ; `count_down index 4 ...' end
        ; Initialize remaining registers :
        ;   serial_out := 1  
        bsf serial_out__byte,serial_out__bit
        ;   glitch := 0  
        clrf main__glitch
        ;   index := 0  
        clrf main__index
        ;   leds_mask := 0  
        clrf leds_mask
        ; Process commands :
        ; loop_forever ... start
main__269loop__forever:
        ; Wait for command :
        ;   command := get_byte {{ }}  
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call get_byte
        movf get_byte__0return__byte,w
        movwf main__command
        ; Dispatch on command :
        ; switch { command >> 6 }
        swapf main__command,w
        movwf main__274byte0
        rrf main__274byte0,f
        rrf main__274byte0,w
        andlw 3
        ; case 0
        ; case 1
        ; case 2
        ; case 3
        ; Switch from code bank 0 to code bank 1 before possible transfer (goto)
        bsf pa0___byte,pa0___bit
        goto switch__274block_start
switch__274block275:
        ; < Command = 00 xx xxxx > :
        ; switch { {{ command >> 3 }} & 7 }
        rrf main__command,w
        movwf main__277byte0
        rrf main__277byte0,f
        rrf main__277byte0,w
        andlw 7
        ; case 0 1
        ; case 2
        ; case 3
        ; case 4 5 6 7
        goto switch__277block_start
switch__277block278:
        ; Write All < Command = 0000 abcd > :
        ;   leds_mask := command  
        movf main__command,w
        movwf leds_mask
        goto switch__277end
switch__277block282:
        ; Command = 0001 0 xxx :
        ;   mask := bit_to_mask ~~ {{ command & 3 }}  
        movlw 3
        andwf main__command,w
        movwf main__284byte0
        incf main__284byte0,w
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call bit_to_mask
        movwf main__mask
        ; if { command @ 2 } start
        ; Alias variable for select command @ 2
main__command__285select0 equ main__command+0
main__command__285select0__byte equ main__command+0
main__command__285select0__bit equ 2
        ; expression=`{ command @ 2 }' exp_delay=0 true_delay=2  false_delay=3 true_size=2 false_size=3
        ; Switch from code bank 0 to code bank 1 before possible transfer (btfss)
        bsf pa0___byte,pa0___bit
        btfss main__command__285select0__byte,main__command__285select0__bit
        goto label285__1false
label285__1true:
        ; if { command @ 2 } body start
        ; Bit set < Command = 0001 01 bb > :
        ;   leds_mask := leds_mask | mask  
        movf main__mask,w
        iorwf leds_mask,f
        ; if { command @ 2 } body end
        goto label285__1end
label285__1false:
        ; else body start
        ; Bit Clear < Command = 0001 00 bb > :
        ;   leds_mask := leds_mask & {{ 0xff ^ mask }}  
        movlw 255
        xorwf main__mask,w
        andwf leds_mask,f
        ; else body end
        ; if exp=` command @ 2 ' generic
label285__1end:
        ; Other expression=`{ command @ 2 }' delay=-1
        ; if { command @ 2 } end
        goto switch__277end
switch__277block293:
        ; Command = 0001 1 xxx :
        ;   mask := bit_to_mask ~~ {{ command & 3 }}  
        movlw 3
        andwf main__command,w
        movwf main__295byte0
        incf main__295byte0,w
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call bit_to_mask
        movwf main__mask
        ; if { command @ 2 } start
        ; Alias variable for select command @ 2
main__command__296select0 equ main__command+0
main__command__296select0__byte equ main__command+0
main__command__296select0__bit equ 2
        ; expression=`{ command @ 2 }' exp_delay=0 true_delay=-1  false_delay=2 true_size=31 false_size=2
        ; Switch from code bank 0 to code bank 1 before possible transfer (btfss)
        bsf pa0___byte,pa0___bit
        btfss main__command__296select0__byte,main__command__296select0__bit
        goto label296__1false
label296__1true:
        ; if { command @ 2 } body start
        ; Bit Read < Command = 0001 11 bb > :
        ; Compute bit rate in < result > :
        ;   result := 0  
        clrf main__result
        ;   mask := blink_masks ~~ {{ command & 3 }}  
        movlw 3
        andwf main__command,w
        movwf main__301byte0
        movlw LOW blink_masks
        addwf main__301byte0,w
        movwf fsr___register
        ; FSR now points to reg bank 0 (which contains 8[4])
        ; FSR must point to reg bank 0 (which contains 8[4]) before using INDF reg
        movf indf___register,w
        movwf main__mask
        ; `while  rate_to_mask ~~ {{ result }} != mask  ...' start
main__302while__continue:
        incf main__result,w
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call rate_to_mask
        subwf main__mask,w
        ; expression=` rate_to_mask ~~ {{ result }} != mask ' exp_delay=3 true_delay=3  false_delay=2 true_size=2 false_size=1
        ; Switch from code bank 0 to code bank 1 before possible transfer (btfsc)
        bsf pa0___byte,pa0___bit
        btfsc z___byte,z___bit
        goto main__302while__break
        ;   result := result + 1  
        incf main__result,f
        goto main__302while__continue
        ; if exp=` rate_to_mask ~~ {{ result }} != mask ' false goto
        ; Other expression=` rate_to_mask ~~ {{ result }} != mask ' delay=-1
main__302while__break:
        ; `while  rate_to_mask ~~ {{ result }} != mask  ...' end
        ; Form the final answer :
        ;   result := result << 1  
        bcf c___byte,c___bit
        rlf main__result,f
        ; if { leds_mask & bit_to_mask ~~ {{ command & 3 }} != 0 } start
        movf leds_mask,w
        movwf main__308byte1
        movlw 3
        andwf main__command,w
        movwf main__308byte0
        incf main__308byte0,w
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call bit_to_mask
        andwf main__308byte1,w
        ; expression=`{ leds_mask & bit_to_mask ~~ {{ command & 3 }} != 0 }' exp_delay=8 true_delay=1  false_delay=0 true_size=1 false_size=0
        ; Switch from code bank 0 to code bank 1 before possible transfer (btfss)
        bsf pa0___byte,pa0___bit
        btfss z___byte,z___bit
        ; if { leds_mask & bit_to_mask ~~ {{ command & 3 }} != 0 } body start
        ;   result := result + 1  
        incf main__result,f
        ; if { leds_mask & bit_to_mask ~~ {{ command & 3 }} != 0 } body end
        ; if exp=` leds_mask & bit_to_mask ~~ {{ command & 3 }} != 0 ' false skip delay=10
        ; Other expression=`{ leds_mask & bit_to_mask ~~ {{ command & 3 }} != 0 }' delay=10
        ; if { leds_mask & bit_to_mask ~~ {{ command & 3 }} != 0 } end
        ; Send it :
        ;   call send_byte {{ result }}  
        movf main__result,w
        movwf send_byte__char
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call send_byte
        ; if { command @ 2 } body end
        ; Switch from code bank 0 to code bank 1 before possible transfer (goto)
        bsf pa0___byte,pa0___bit
        goto label296__1end
label296__1false:
        ; else body start
        ; Bit Toggle < Command = 0001 10 bb > :
        ;   leds_mask := leds_mask ^ mask  
        movf main__mask,w
        xorwf leds_mask,f
        ; else body end
        ; if exp=` command @ 2 ' generic
label296__1end:
        ; Other expression=`{ command @ 2 }' delay=-1
        ; if { command @ 2 } end
        goto switch__277end
switch__277block319:
        ; Blink Rate Set < Command = 001 r rrbb > :
        ;   blink_masks ~~ {{ command & 3 }} := rate_to_mask ~~ {{ {{ command >> 2 }} & 7 }}  
        rrf main__command,w
        movwf main__321byte1
        rrf main__321byte1,w
        andlw 7
        movwf main__321byte2
        incf main__321byte2,w
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call rate_to_mask
        movwf main__321byte0
        movlw 3
        andwf main__command,w
        movwf main__321byte3
        movlw LOW blink_masks
        addwf main__321byte3,
        movwf fsr___register
        ; FSR now points to reg bank 0 (which contains 8[])
        movf main__321byte0,w
        ; FSR must point to reg bank 0 (which contains 8[4]) before using INDF reg
        movwf indf___register
        ; Switch from code bank 0 to code bank 1 before possible transfer (goto)
        bsf pa0___byte,pa0___bit
switch__277end:
        goto switch__274end
switch__274block325:
        ; < Command = 01 xx xxxx > :
        ; switch { {{ command >> 3 }} & 7 }
        rrf main__command,w
        movwf main__327byte0
        rrf main__327byte0,f
        rrf main__327byte0,w
        andlw 7
        ; case 0
        ; case 1
        goto switch__327block_start
switch__327block328:
        ; switch { command & 7 }
        movlw 7
        andwf main__command,w
        ; case 0
        ; case 1 2 3
        ; case 4 5 6 7
        goto switch__329block_start
switch__329block330:
        ; Read all < Command = 0100 0000 > :
        ;   call send_byte {{ leds_mask & 0xf }}  
        movlw 15
        andwf leds_mask,w
        movwf send_byte__char
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call send_byte
        ; Switch from code bank 0 to code bank 1 before possible transfer (goto)
        bsf pa0___byte,pa0___bit
        goto switch__329end
switch__329block334:
        ; Do nothing :
        goto switch__329end
switch__329block337:
        ; Increment LED ' s < Command = 0100 01 bb > :
        ;   leds_mask := {{ leds_mask + bit_to_mask ~~ {{ command & 3 }} }} & 0xf  
        movf leds_mask,w
        movwf main__339byte1
        movlw 3
        andwf main__command,w
        movwf main__339byte0
        incf main__339byte0,w
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call bit_to_mask
        addwf main__339byte1,w
        andlw 15
        movwf leds_mask
        ; Switch from code bank 0 to code bank 1 before possible transfer (goto)
        bsf pa0___byte,pa0___bit
switch__329end:
        goto switch__327end
switch__327block343:
        ; if { command @ 2 } start
        ; Alias variable for select command @ 2
main__command__344select0 equ main__command+0
main__command__344select0__byte equ main__command+0
main__command__344select0__bit equ 2
        ; expression=`{ command @ 2 }' exp_delay=0 true_delay=0  false_delay=10 true_size=0 false_size=10
        btfsc main__command__344select0__byte,main__command__344select0__bit
        goto label344__1end
        ; else body start
        ; Decrement LED ' s < Command = 0100 10 bb > :
        ;   leds_mask := {{ leds_mask - bit_to_mask ~~ {{ command & 3 }} }} & 0xf  
        movf leds_mask,w
        movwf main__348byte1
        movlw 3
        andwf main__command,w
        movwf main__348byte0
        incf main__348byte0,w
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call bit_to_mask
        subwf main__348byte1,w
        andlw 15
        movwf leds_mask
        ; else body end
        ; Switch from code bank 0 to code bank 1 before possible transfer (label)
        bsf pa0___byte,pa0___bit
label344__1end:
        ; if exp=` command @ 2 ' empty true
        ; Other expression=`{ command @ 2 }' delay=-1
        ; if { command @ 2 } end
        goto switch__327end
switch__327default351:
        ; Do nothing :
switch__327end:
        goto switch__274end
switch__274block356:
        ; Do nothing < Command = 10 xx xxx > :
        goto switch__274end
switch__274block359:
        ; < Command = 11 xx xxxx > :
        ; if { {{ command >> 3 }} & 7 = 7 } start
        rrf main__command,w
        movwf main__361byte2
        rrf main__361byte2,f
        rrf main__361byte2,w
        andlw 7
        movwf main__361byte1
        movlw 7
        subwf main__361byte1,w
        ; expression=`{ {{ command >> 3 }} & 7 = 7 }' exp_delay=9 true_delay=38  false_delay=0 true_size=37 false_size=0
        btfss z___byte,z___bit
        goto label361__3end
        ; if { {{ command >> 3 }} & 7 = 7 } body start
        ; Command = 1111 1 xxx :
        ; switch { command & 7 }
        movlw 7
        andwf main__command,w
        ; case 0
        ; case 1
        ; case 2
        ; case 3
        ; case 4
        ; case 5
        ; case 6
        ; case 7
        goto switch__363block_start
switch__363block364:
        ; Clock Decrement < Command = 1111 1000 > :
        ;   osccal := osccal - osccal_lsb  
        movlw 240
        addwf osccal,f
        goto switch__363end
switch__363block368:
        ; Clock Increment < Command = 1111 1001 > :
        ;   osccal := osccal + osccal_lsb  
        movlw 16
        addwf osccal,f
        goto switch__363end
switch__363block372:
        ; Clock Read < Command = 1111 1010 > :
        ;   call send_byte {{ osccal }}  
        movf osccal,w
        movwf send_byte__char
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call send_byte
        ; Switch from code bank 0 to code bank 1 before possible transfer (goto)
        bsf pa0___byte,pa0___bit
        goto switch__363end
switch__363block376:
        ; Clock Pulse < Command = 1111 1011 > :
        ;   call send_byte {{ 0 }}  
        clrf send_byte__char
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call send_byte
        ; Switch from code bank 0 to code bank 1 before possible transfer (goto)
        bsf pa0___byte,pa0___bit
        goto switch__363end
switch__363block380:
        ; ID Next < Command = 1111 1100 > :
        ;   call send_byte {{ id ~~ {{ index }} }}  
        incf main__index,w
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call id
        movwf send_byte__char
        call send_byte
        ;   index := index + 1  
        incf main__index,f
        ; if { index >= id . size } start
        movlw 46
        subwf main__index,w
        ; expression=`{ index >= id . size }' exp_delay=2 true_delay=1  false_delay=0 true_size=1 false_size=0
        ; Switch from code bank 0 to code bank 1 before possible transfer (btfsc)
        bsf pa0___byte,pa0___bit
        btfsc c___byte,c___bit
        ; if { index >= id . size } body start
        ;   index := 0  
        clrf main__index
        ; if { index >= id . size } body end
        ; if exp=` index >= id . size ' false skip delay=4
        ; Other expression=`{ index >= id . size }' delay=4
        ; if { index >= id . size } end
        goto switch__363end
switch__363block388:
        ; ID Reset < Command = 1111 1101 > :
        ;   index := 0  
        clrf main__index
        goto switch__363end
switch__363block392:
        ; Glitch Read < Command = 1111 1110 > :
        ;   call send_byte {{ glitch }}  
        movf main__glitch,w
        movwf send_byte__char
        ; Switch from code bank 1 to code bank 0 before possible transfer (call)
        bcf pa0___byte,pa0___bit
        call send_byte
        ;   glitch := 0  
        clrf main__glitch
        ; Switch from code bank 0 to code bank 1 before possible transfer (goto)
        bsf pa0___byte,pa0___bit
        goto switch__363end
switch__363block397:
        ; Glitch < Command = 1111 1111 > :
        ; if { glitch != 0xff } start
        incf main__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 main__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__363end:
        ; if { {{ command >> 3 }} & 7 = 7 } body end
label361__3end:
        ; if exp=` {{ command >> 3 }} & 7 = 7 ' empty false
        ; Other expression=`{ {{ command >> 3 }} & 7 = 7 }' delay=-1
        ; if { {{ command >> 3 }} & 7 = 7 } end
switch__274end:
        goto main__269loop__forever
        ; loop_forever ... end
        ; procedure main end

        ; Register bank 0 used 22 bytes of 25 available bytes
        ; Register bank 1 used 0 bytes of 16 available bytes

        end

