  1                     radix dec
  2     000c    global__variables__bank0 equ 12
  3     00ff    global__variables__bank1 equ 255
  4     0045    global__bit__variables__bank0 equ 69
  5     00ff    global__bit__variables__bank1 equ 255
  6     0000    indf___register equ 0
  7     0002    pcl___register equ 2
  8     0003    c___byte equ 3
  9     0000    c___bit equ 0
 10     0003    z___byte equ 3
 11     0002    z___bit equ 2
 12     0003    rp0___byte equ 3
 13     0005    rp0___bit equ 5
 14     0003    rp1___byte equ 3
 15     0006    rp1___bit equ 6
 16     0003    irp___byte equ 3
 17     0007    irp___bit equ 7
 18     0085    trisa___register equ 0x85
 19     0086    trisb___register equ 0x86
 20     0004    fsr___register equ 4
 21     000a    pclath___register equ 10
 22                     org 0
 23             start:
 24 000 0000            nop
 25 001 0000            nop
 26 002 0000            nop
 27 003 2805            goto skip___interrupt
 28             interrupt___vector:
 29 004 0009            retfie
 30             skip___interrupt:
 31                     ; Initialize TRIS registers
 32 005 30e9            movlw 233
 33                     ; Switch from register bank 0 to register bank 1 (which contains trisa___register)
 34 006 1683            bsf rp0___byte,rp0___bit
 35                     ; Register bank is now 1
 36 007 0085            movwf trisa___register
 37 008 018a            clrf pclath___register
 38                     ; Switch from register bank 1 to register bank 0
 39 009 1283            bcf rp0___byte,rp0___bit
 40                     ; Register bank is now 0
 41 00a 285c            goto main
 42                     ; comment #############################################################################
 43                     ; comment {}
 44                     ; comment {Copyright < c > 1999 - 2001 by Wayne C . Gramlich .}
 45                     ; comment {All rights reserved .}
 46                     ; comment {}
 47                     ; comment {Permission to use , copy , modify , distribute , and sell this software}
 48                     ; comment {for any purpose is hereby granted without fee provided that the above}
 49                     ; comment {copyright notice and this permission are retained . The author makes}
 50                     ; comment {no representations about the suitability of this software for any purpose .}
 51                     ; comment {It is provided { as is } without express or implied warranty .}
 52                     ; comment {}
 53                     ; comment {This is a test harness for testing the LED10 RoboBrick . See :}
 54                     ; comment {}
 55                     ; comment {http : / / web . gramlich . net / projects / robobricks / led10 / index . html}
 56                     ; comment {}
 57                     ; comment {for more details .}
 58                     ; comment {}
 59                     ; comment #############################################################################
 60                     ;   processor pic16f84 cp = off dp = off pwrte = disabled wdte = disabled fosc = xt  
 61                     ; 16377=0x3ff9 8199=0x2007
 62                     __config 16377
 63     2007    configuration___address equ 8199
 64                     ;   constant clock_rate 4000000  
 65     3d0900    clock_rate equ 4000000
 66                     ;   constant instruction_rate clock_rate / 4  
 67     f4240    instruction_rate equ 1000000
 68                     ;   constant baud_rate 2400  
 69     0960    baud_rate equ 2400
 70                     ;   constant instructions_per_bit instruction_rate / baud_rate  
 71     01a0    instructions_per_bit equ 416
 72                     ;   constant delays_per_bit 3  
 73     0003    delays_per_bit equ 3
 74                     ;   constant instructions_per_delay instructions_per_bit / delays_per_bit  
 75     008a    instructions_per_delay equ 138
 76                     ; comment {The null pulse that comes back from a clock pulse command is supposed to be}
 77                     ; comment {9 bits long . At 4 Mhz = 1 instruction per microsecond , 9 bits is 9 / 2400 =}
 78                     ; comment {3 . 75 ms . The count loop below is 7 instruction long . 3 . 75 / . 007 = 536 = 0x217 .}
 79                     ; comment {So we want our timer loop to get as close to 0x217 as possible .}
 80                     ;   constant clock_fudge 4  
 81     0004    clock_fudge equ 4
 82                     ;   constant clock_target 0x17 + clock_fudge  
 83     001b    clock_target equ 27
 84                     ;   constant sp 32  
 85     0020    sp equ 32
 86                     ;   constant cr 13  
 87     000d    cr equ 13
 88                     ;   constant lf 10  
 89     000a    lf equ 10
 90                     ; comment {Some bit definitions :}
 91                     ;   constant rx_slave_bit 0  
 92     0000    rx_slave_bit equ 0
 93                     ;   constant tx_slave_bit 1  
 94     0001    tx_slave_bit equ 1
 95                     ;   constant tx_master_bit 2  
 96     0002    tx_master_bit equ 2
 97                     ;   constant rx_master_bit 3  
 98     0003    rx_master_bit equ 3
 99                     ;   constant rx_slave_mask 1 << rx_slave_bit  
100     0001    rx_slave_mask equ 1
101                     ;   constant tx_slave_mask 1 << tx_slave_bit  
102     0002    tx_slave_mask equ 2
103                     ;   constant rx_master_mask 1 << rx_master_bit  
104     0008    rx_master_mask equ 8
105                     ;   constant tx_master_mask 1 << tx_master_bit  
106     0004    tx_master_mask equ 4
107     0003    status equ 3
108                     ;   bind c status @ 0  
109     0003    c equ status+0
110     0003    c__byte equ status+0
111     0000    c__bit equ 0
112                     ;   bind z status @ 2  
113     0003    z equ status+0
114     0003    z__byte equ status+0
115     0002    z__bit equ 2
116     0005    porta equ 5
117     0005    tx_master_pin__byte equ 5
118     0002    tx_master_pin__bit equ 2
119     0005    rx_master_pin__byte equ 5
120     0003    rx_master_pin__bit equ 3
121     0005    tx_slave_pin__byte equ 5
122     0001    tx_slave_pin__bit equ 1
123     0005    rx_slave_pin__byte equ 5
124     0000    rx_slave_pin__bit equ 0
125     0005    heart__byte equ 5
126     0004    heart__bit equ 4
127                     ;   constant space 0xff  
128     00ff    space equ 255
129                     ;   constant buffer_size 5  
130     0005    buffer_size equ 5
131                     ; string_constants Start
132             string___fetch:
133 00b 0082            movwf pcl___register
134                     ;   bit_string = 0s'Bit'  
135     0000    bit_string___string equ 0
136             bit_string:
137 00c 0782            addwf pcl___register,f
138                     ; Length = 3
139 00d 3403            retlw 3
140                     ; `Bit'
141 00e 3442            retlw 66
142 00f 3469            retlw 105
143 010 3474            retlw 116
144                     ;   blink_string = 0s'Blink'  
145     0005    blink_string___string equ 5
146             blink_string:
147 011 0782            addwf pcl___register,f
148                     ; Length = 5
149 012 3405            retlw 5
150                     ; `Blink'
151 013 3442            retlw 66
152 014 346c            retlw 108
153 015 3469            retlw 105
154 016 346e            retlw 110
155 017 346b            retlw 107
156                     ;   clock_string = 0s'Clk'  
157     000c    clock_string___string equ 12
158             clock_string:
159 018 0782            addwf pcl___register,f
160                     ; Length = 3
161 019 3403            retlw 3
162                     ; `Clk'
163 01a 3443            retlw 67
164 01b 346c            retlw 108
165 01c 346b            retlw 107
166                     ;   common_string = 0s'Common'  
167     0011    common_string___string equ 17
168             common_string:
169 01d 0782            addwf pcl___register,f
170                     ; Length = 6
171 01e 3406            retlw 6
172                     ; `Common'
173 01f 3443            retlw 67
174 020 346f            retlw 111
175 021 346d            retlw 109
176 022 346d            retlw 109
177 023 346f            retlw 111
178 024 346e            retlw 110
179                     ;   done_string = 0s'Done'  
180     0019    done_string___string equ 25
181             done_string:
182 025 0782            addwf pcl___register,f
183                     ; Length = 4
184 026 3404            retlw 4
185                     ; `Done'
186 027 3444            retlw 68
187 028 346f            retlw 111
188 029 346e            retlw 110
189 02a 3465            retlw 101
190                     ;   fail_string = 0s'Fail'  
191     001f    fail_string___string equ 31
192             fail_string:
193 02b 0782            addwf pcl___register,f
194                     ; Length = 4
195 02c 3404            retlw 4
196                     ; `Fail'
197 02d 3446            retlw 70
198 02e 3461            retlw 97
199 02f 3469            retlw 105
200 030 346c            retlw 108
201                     ;   hello_string = 0s'Out10_Test'  
202     0025    hello_string___string equ 37
203             hello_string:
204 031 0782            addwf pcl___register,f
205                     ; Length = 10
206 032 340a            retlw 10
207                     ; `Out10_Test'
208 033 344f            retlw 79
209 034 3475            retlw 117
210 035 3474            retlw 116
211 036 3431            retlw 49
212 037 3430            retlw 48
213 038 345f            retlw 95
214 039 3454            retlw 84
215 03a 3465            retlw 101
216 03b 3473            retlw 115
217 03c 3474            retlw 116
218                     ;   patterns = 0 , 1 , 2 , 4 , 8 , 0x10 , 0x20 , 0x40 , 0x80 , 0xff , 0  
219     0031    patterns___string equ 49
220             patterns:
221 03d 0782            addwf pcl___register,f
222                     ; Length = 11
223 03e 340b            retlw 11
224                     ; 0
225 03f 3400            retlw 0
226                     ; 1
227 040 3401            retlw 1
228                     ; 2
229 041 3402            retlw 2
230                     ; 4
231 042 3404            retlw 4
232                     ; 8
233 043 3408            retlw 8
234                     ; 0x10
235 044 3410            retlw 16
236                     ; 0x20
237 045 3420            retlw 32
238                     ; 0x40
239 046 3440            retlw 64
240                     ; 0x80
241 047 3480            retlw 128
242                     ; 0xff
243 048 34ff            retlw 255
244                     ; 0
245 049 3400            retlw 0
246                     ;   ramps = 0 , 1 , 0x10 , 0x80 , 0xff  
247     003e    ramps___string equ 62
248             ramps:
249 04a 0782            addwf pcl___register,f
250                     ; Length = 5
251 04b 3405            retlw 5
252                     ; 0
253 04c 3400            retlw 0
254                     ; 1
255 04d 3401            retlw 1
256                     ; 0x10
257 04e 3410            retlw 16
258                     ; 0x80
259 04f 3480            retlw 128
260                     ; 0xff
261 050 34ff            retlw 255
262                     ;   read_string = 0s'Read'  
263     0045    read_string___string equ 69
264             read_string:
265 051 0782            addwf pcl___register,f
266                     ; Length = 4
267 052 3404            retlw 4
268                     ; `Read'
269 053 3452            retlw 82
270 054 3465            retlw 101
271 055 3461            retlw 97
272 056 3464            retlw 100
273                     ;   register_string = 0s'Reg'  
274     004b    register_string___string equ 75
275             register_string:
276 057 0782            addwf pcl___register,f
277                     ; Length = 3
278 058 3403            retlw 3
279                     ; `Reg'
280 059 3452            retlw 82
281 05a 3465            retlw 101
282 05b 3467            retlw 103
283                     ; string__constants End
284             
285                     ; procedure main start
286             main:
287     000c    main__variables__base equ global__variables__bank0+0
288     000c    main__bytes__base equ main__variables__base+0
289     0016    main__bits__base equ main__variables__base+10
290     000a    main__total__bytes equ 10
291     0015    main__109byte0 equ main__bytes__base+9
292     0015    main__137byte0 equ main__bytes__base+9
293                     ;   arguments_none  
294                     ; Read a byte .
295     000c    main__buffer equ main__bytes__base+0
296     0011    main__char equ main__bytes__base+5
297     0012    main__count equ main__bytes__base+6
298     0013    main__index equ main__bytes__base+7
299     0014    main__number equ main__bytes__base+8
300                     ; Print out a welcome message :
301                     ;   call master_crlf {{ }}  
302 05c 2347            call master_crlf
303                     ;   call master_string {{ hello_string }}  
304 05d 3032            movlw LOW hello_string+1
305 05e 00c1            movwf master_string__message
306 05f 23ca            call master_string
307                     ;   call master_crlf {{ }}  
308 060 2347            call master_crlf
309                     ; Main loop
310                     ;   number := 0  
311 061 0194            clrf main__number
312                     ; loop_forever ... start
313             main__97loop__forever:
314                     ; Get a character :
315                     ;   tx_slave_pin := 1  
316 062 1485            bsf tx_slave_pin__byte,tx_slave_pin__bit
317                     ;   char := master_get {{ }}  
318 063 2359            call master_get
319 064 0833            movf master_get__0return__byte,w
320 065 0091            movwf main__char
321                     ; Delay 2 / 3 ' s of bit make sure that get_byte is done .
322                     ;   call delay {{ }}  
323 066 23dd            call delay
324                     ;   call delay {{ }}  
325 067 23dd            call delay
326                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } start
327 068 3030            movlw 48
328 069 0211            subwf main__char,w
329                     ; expression=`0c'0' <= char' exp_delay=2 true_delay=-1  false_delay=1 true_size=127 false_size=1
330 06a 1c03            btfss c___byte,c___bit
331 06b 287c            goto and106__0false
332 06c 303a            movlw 58
333 06d 0211            subwf main__char,w
334                     ; expression=`char < {{ 0c'9' + 1 }}' exp_delay=2 true_delay=9  false_delay=-1 true_size=11 false_size=111
335 06e 1803            btfsc c___byte,c___bit
336 06f 287c            goto label106__1false
337             label106__1true:
338             and106__0true:
339                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } body start
340                     ; Do a multiply by 8 then add in digit :
341                     ;   call master_send {{ char }}  
342 070 0811            movf main__char,w
343 071 00c0            movwf master_send__character
344 072 23c4            call master_send
345                     ;   number := {{ number << 3 }} + char - 0c'0'  
346 073 0d14            rlf main__number,w
347 074 0095            movwf main__109byte0
348 075 0d95            rlf main__109byte0,f
349 076 0d15            rlf main__109byte0,w
350 077 39f8            andlw 248
351 078 0711            addwf main__char,w
352 079 3ed0            addlw 208
353 07a 0094            movwf main__number
354                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } body end
355 07b 28eb            goto label106__1end
356             label106__1false:
357             and106__0false:
358 07c 3073            movlw 115
359 07d 0211            subwf main__char,w
360                     ; expression=`{ char = 0c's' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=8 false_size=98
361 07e 1d03            btfss z___byte,z___bit
362 07f 2889            goto label110__0false
363             label110__0true:
364                     ; else_if { char = 0c's' } body start
365                     ; Send byte to brick , no wait :
366                     ; Echo command and send CRLF :
367                     ;   call master_send {{ char }}  
368 080 0811            movf main__char,w
369 081 00c0            movwf master_send__character
370 082 23c4            call master_send
371                     ;   call master_crlf {{ }}  
372 083 2347            call master_crlf
373                     ; Ship the byte down to the brick :
374                     ;   call slave_send {{ number }}  
375 084 0814            movf main__number,w
376 085 00b7            movwf slave_send__data
377 086 237e            call slave_send
378                     ;   number := 0  
379 087 0194            clrf main__number
380                     ; else_if { char = 0c's' } body end
381 088 28eb            goto label110__0end
382             label110__0false:
383 089 3077            movlw 119
384 08a 0211            subwf main__char,w
385                     ; expression=`{ char = 0c'w' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=37 false_size=56
386 08b 1d03            btfss z___byte,z___bit
387 08c 28b3            goto label121__0false
388             label121__0true:
389                     ; else_if { char = 0c'w' } body start
390                     ; Send byte to brick , wait for results :
391                     ; Echo command and send CRLF :
392                     ;   call master_send {{ char }}  
393 08d 0811            movf main__char,w
394 08e 00c0            movwf master_send__character
395 08f 23c4            call master_send
396                     ;   call master_crlf {{ }}  
397 090 2347            call master_crlf
398                     ; Ship the byte down to the brick ...
399                     ;   call slave_send {{ number }}  
400 091 0814            movf main__number,w
401 092 00b7            movwf slave_send__data
402 093 237e            call slave_send
403                     ;   number := 0  
404 094 0194            clrf main__number
405                     ; call delay < >
406                     ; ... and wait for a response :
407                     ;   index := 0  
408 095 0193            clrf main__index
409                     ; `while  index < buffer_size  ...' start
410             main__136while__continue:
411 096 3005            movlw 5
412 097 0213            subwf main__index,w
413                     ; expression=` index < buffer_size ' exp_delay=2 true_delay=9  false_delay=2 true_size=10 false_size=1
414 098 1803            btfsc c___byte,c___bit
415 099 28a4            goto main__136while__break
416                     ;   buffer ~~ {{ index }} := slave_get {{ }}  
417 09a 2378            call slave_get
418 09b 0836            movf slave_get__0return__byte,w
419 09c 0095            movwf main__137byte0
420 09d 300c            movlw LOW main__buffer
421 09e 0713            addwf main__index,w
422 09f 0084            movwf fsr___register
423 0a0 0815            movf main__137byte0,w
424 0a1 0080            movwf indf___register
425                     ;   index := index + 1  
426 0a2 0a93            incf main__index,f
427 0a3 2896            goto main__136while__continue
428                     ; if exp=` index < buffer_size ' false goto
429                     ; Other expression=` index < buffer_size ' delay=-1
430             main__136while__break:
431                     ; `while  index < buffer_size  ...' end
432                     ;   index := 0  
433 0a4 0193            clrf main__index
434                     ; `while  index < buffer_size  ...' start
435             main__142while__continue:
436 0a5 3005            movlw 5
437 0a6 0213            subwf main__index,w
438                     ; expression=` index < buffer_size ' exp_delay=2 true_delay=7  false_delay=2 true_size=8 false_size=1
439 0a7 1803            btfsc c___byte,c___bit
440 0a8 28b1            goto main__142while__break
441                     ;   call master_octal {{ buffer ~~ {{ index }} }}  
442 0a9 300c            movlw LOW main__buffer
443 0aa 0713            addwf main__index,w
444 0ab 0084            movwf fsr___register
445 0ac 0800            movf indf___register,w
446 0ad 00b4            movwf master_octal__number
447 0ae 235f            call master_octal
448                     ;   index := index + 1  
449 0af 0a93            incf main__index,f
450 0b0 28a5            goto main__142while__continue
451                     ; if exp=` index < buffer_size ' false goto
452                     ; Other expression=` index < buffer_size ' delay=-1
453             main__142while__break:
454                     ; `while  index < buffer_size  ...' end
455                     ; Terminate the output list
456                     ;   call master_crlf {{ }}  
457 0b1 2347            call master_crlf
458                     ; else_if { char = 0c'w' } body end
459 0b2 28eb            goto label121__0end
460             label121__0false:
461 0b3 3069            movlw 105
462 0b4 0211            subwf main__char,w
463                     ; expression=`{ char = 0c'i' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=12 false_size=39
464 0b5 1d03            btfss z___byte,z___bit
465 0b6 28c4            goto label149__0false
466             label149__0true:
467                     ; else_if { char = 0c'i' } body start
468                     ; Interrogate the slave RoboBrick :
469                     ;   call master_send {{ char }}  
470 0b7 0811            movf main__char,w
471 0b8 00c0            movwf master_send__character
472 0b9 23c4            call master_send
473                     ;   call master_crlf {{ }}  
474 0ba 2347            call master_crlf
475                     ; Initialize the id index :
476                     ;   call slave_send {{ 0xfd }}  
477 0bb 30fd            movlw 253
478 0bc 00b7            movwf slave_send__data
479 0bd 237e            call slave_send
480                     ; Get the first 8 bytes :
481                     ;   call common_test_id_bytes8 {{ }}  
482 0be 232b            call common_test_id_bytes8
483                     ; Get the next 8 bytes of random numbers :
484                     ;   call common_test_id_bytes8 {{ }}  
485 0bf 232b            call common_test_id_bytes8
486                     ; Get the next 8 bytes of random numbers :
487                     ;   call common_test_id_bytes8 {{ }}  
488 0c0 232b            call common_test_id_bytes8
489                     ; Get the slave brick name :
490                     ;   call common_test_id_string {{ }}  
491 0c1 2335            call common_test_id_string
492                     ; Get the vendor name :
493                     ;   call common_test_id_string {{ }}  
494 0c2 2335            call common_test_id_string
495                     ; else_if { char = 0c'i' } body end
496 0c3 28eb            goto label149__0end
497             label149__0false:
498 0c4 3074            movlw 116
499 0c5 0211            subwf main__char,w
500                     ; expression=`{ char = 0c't' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=5 false_size=29
501 0c6 1d03            btfss z___byte,z___bit
502 0c7 28ce            goto label172__0false
503             label172__0true:
504                     ; else_if { char = 0c't' } body start
505                     ; Do testing :
506                     ;   call master_send {{ char }}  
507 0c8 0811            movf main__char,w
508 0c9 00c0            movwf master_send__character
509 0ca 23c4            call master_send
510                     ;   call master_crlf {{ }}  
511 0cb 2347            call master_crlf
512                     ;   call test {{ }}  
513 0cc 215d            call test
514                     ; else_if { char = 0c't' } body end
515 0cd 28eb            goto label172__0end
516             label172__0false:
517 0ce 3063            movlw 99
518 0cf 0211            subwf main__char,w
519                     ; expression=`{ char = 0c'c' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=5 false_size=19
520 0d0 1d03            btfss z___byte,z___bit
521 0d1 28d8            goto label177__0false
522             label177__0true:
523                     ; else_if { char = 0c'c' } body start
524                     ;   call master_send {{ char }}  
525 0d2 0811            movf main__char,w
526 0d3 00c0            movwf master_send__character
527 0d4 23c4            call master_send
528                     ;   call master_crlf {{ }}  
529 0d5 2347            call master_crlf
530                     ;   call clock_adjust {{ }}  
531 0d6 20ec            call clock_adjust
532                     ; else_if { char = 0c'c' } body end
533 0d7 28eb            goto label177__0end
534             label177__0false:
535 0d8 30fc            movlw 252
536 0d9 0211            subwf main__char,w
537                     ; expression=`{ char != 0xfc }' exp_delay=2 true_delay=-1  false_delay=0 true_size=15 false_size=0
538 0da 1903            btfsc z___byte,z___bit
539 0db 28eb            goto label182__0end
540                     ; else_if { char != 0xfc } body start
541                     ; Just echo back the current number :
542                     ;   call master_send {{ 0c'<' }}  
543 0dc 303c            movlw 60
544 0dd 00c0            movwf master_send__character
545 0de 23c4            call master_send
546                     ;   call master_octal {{ char }}  
547 0df 0811            movf main__char,w
548 0e0 00b4            movwf master_octal__number
549 0e1 235f            call master_octal
550                     ;   call master_send {{ 0c'>' }}  
551 0e2 303e            movlw 62
552 0e3 00c0            movwf master_send__character
553 0e4 23c4            call master_send
554                     ; Send a carriage - return line - feed :
555                     ;   call master_crlf {{ }}  
556 0e5 2347            call master_crlf
557                     ; Output the character in octal :
558                     ;   call master_octal {{ number }}  
559 0e6 0814            movf main__number,w
560 0e7 00b4            movwf master_octal__number
561 0e8 235f            call master_octal
562                     ; Send a carriage - return line - feed :
563                     ;   call master_crlf {{ }}  
564 0e9 2347            call master_crlf
565                     ; Reset number
566                     ;   number := 0  
567 0ea 0194            clrf main__number
568                     ; else_if { char != 0xfc } body end
569             label182__0end:
570                     ; if exp=` char != 0xfc ' empty false
571                     ; Other expression=`{ char != 0xfc }' delay=-1
572                     ; if exp=` char = 0c'c' ' generic
573             label177__0end:
574                     ; Other expression=`{ char = 0c'c' }' delay=-1
575                     ; if exp=` char = 0c't' ' generic
576             label172__0end:
577                     ; Other expression=`{ char = 0c't' }' delay=-1
578                     ; if exp=` char = 0c'i' ' generic
579             label149__0end:
580                     ; Other expression=`{ char = 0c'i' }' delay=-1
581                     ; if exp=` char = 0c'w' ' generic
582             label121__0end:
583                     ; Other expression=`{ char = 0c'w' }' delay=-1
584                     ; if exp=` char = 0c's' ' generic
585             label110__0end:
586                     ; Other expression=`{ char = 0c's' }' delay=-1
587                     ; if exp=`char < {{ 0c'9' + 1 }}' generic
588             label106__1end:
589                     ; Other expression=`char < {{ 0c'9' + 1 }}' delay=-1
590                     ; if exp=`0c'0' <= char' false goto
591                     ; Other expression=`0c'0' <= char' delay=-1
592             and106__0end:
593                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } end
594 0eb 2862            goto main__97loop__forever
595                     ; loop_forever ... end
596                     ; procedure main end
597             
598                     ; procedure clock_adjust start
599             clock_adjust:
600     0016    clock_adjust__variables__base equ global__variables__bank0+10
601     0016    clock_adjust__bytes__base equ clock_adjust__variables__base+0
602     001d    clock_adjust__bits__base equ clock_adjust__variables__base+7
603     0007    clock_adjust__total__bytes equ 7
604     001c    clock_adjust__267byte0 equ clock_adjust__bytes__base+6
605                     ;   arguments_none  
606                     ; This procedure will adjust the clock to the slave .
607     0016    clock_adjust__command equ clock_adjust__bytes__base+0
608     0017    clock_adjust__count equ clock_adjust__bytes__base+1
609     0018    clock_adjust__error equ clock_adjust__bytes__base+2
610     0019    clock_adjust__error_minimum equ clock_adjust__bytes__base+3
611     001a    clock_adjust__high equ clock_adjust__bytes__base+4
612     001b    clock_adjust__low equ clock_adjust__bytes__base+5
613                     ;   call master_string {{ clock_string }}  
614 0ec 3019            movlw LOW clock_string+1
615 0ed 00c1            movwf master_string__message
616 0ee 23ca            call master_string
617                     ;   call master_crlf {{ }}  
618 0ef 2347            call master_crlf
619                     ;   count := 4  
620 0f0 3004            movlw 4
621 0f1 0097            movwf clock_adjust__count
622                     ;   error := 0xff  
623 0f2 30ff            movlw 255
624 0f3 0098            movwf clock_adjust__error
625                     ;   error_minimum := 0xf0  
626 0f4 30f0            movlw 240
627 0f5 0099            movwf clock_adjust__error_minimum
628                     ; loop_forever ... start
629             clock_adjust__222loop__forever:
630                     ; Print out the clock value :
631                     ;   call master_send {{ 0c'C' }}  
632 0f6 3043            movlw 67
633 0f7 00c0            movwf master_send__character
634 0f8 23c4            call master_send
635                     ;   call slave_send {{ 0xfa }}  
636 0f9 30fa            movlw 250
637 0fa 00b7            movwf slave_send__data
638 0fb 237e            call slave_send
639                     ;   call master_octal {{ slave_get {{ }} }}  
640 0fc 2378            call slave_get
641 0fd 0836            movf slave_get__0return__byte,w
642 0fe 00b4            movwf master_octal__number
643 0ff 235f            call master_octal
644                     ; Ask for a timing byte :
645                     ;   call slave_send {{ 0xfb }}  
646 100 30fb            movlw 251
647 101 00b7            movwf slave_send__data
648 102 237e            call slave_send
649                     ;   low := 0  
650 103 019b            clrf clock_adjust__low
651                     ;   high := 0  
652 104 019a            clrf clock_adjust__high
653                     ; `while rx_slave_pin ...' start
654             clock_adjust__233while__continue:
655                     ; expression=`rx_slave_pin' exp_delay=0 true_delay=2  false_delay=2 true_size=1 false_size=1
656 105 1805            btfsc rx_slave_pin__byte,rx_slave_pin__bit
657                     ; Do nothing :
658 106 2905            goto clock_adjust__233while__continue
659 107 2908            goto clock_adjust__233while__break
660                     ; if exp=`rx_slave_pin' true goto small true
661             clock_adjust__233while__break:
662                     ; `while rx_slave_pin ...' end
663                     ; `while  ! rx_slave_pin  ...' start
664             clock_adjust__236while__continue:
665                     ; expression=`rx_slave_pin' exp_delay=0 true_delay=2  false_delay=5 true_size=1 false_size=4
666 108 1805            btfsc rx_slave_pin__byte,rx_slave_pin__bit
667 109 290e            goto clock_adjust__236while__break
668                     ;   low := low + 1  
669 10a 0a9b            incf clock_adjust__low,f
670                     ; if { z } start
671                     ; expression=`{ z }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
672 10b 1903            btfsc z__byte,z__bit
673                     ; if { z } body start
674                     ;   high := high + 1  
675 10c 0a9a            incf clock_adjust__high,f
676                     ; if { z } body end
677                     ; if exp=`z' false skip delay=2
678                     ; Other expression=`{ z }' delay=2
679                     ; if { z } end
680 10d 2908            goto clock_adjust__236while__continue
681                     ; if exp=`rx_slave_pin' true goto
682                     ; Other expression=`rx_slave_pin' delay=-1
683             clock_adjust__236while__break:
684                     ; `while  ! rx_slave_pin  ...' end
685                     ; Print out high and low :
686                     ;   call master_send {{ 0c'H' }}  
687 10e 3048            movlw 72
688 10f 00c0            movwf master_send__character
689 110 23c4            call master_send
690                     ;   call master_octal {{ high }}  
691 111 081a            movf clock_adjust__high,w
692 112 00b4            movwf master_octal__number
693 113 235f            call master_octal
694                     ;   call master_send {{ 0c'L' }}  
695 114 304c            movlw 76
696 115 00c0            movwf master_send__character
697 116 23c4            call master_send
698                     ;   call master_octal {{ low }}  
699 117 081b            movf clock_adjust__low,w
700 118 00b4            movwf master_octal__number
701 119 235f            call master_octal
702                     ; If high is less than 2 , things are probably pretty broken .
703                     ; We ' ll try a little fix here , but we are probably pretty
704                     ; screwed up .
705                     ; if { high < 2 } start
706 11a 3002            movlw 2
707 11b 021a            subwf clock_adjust__high,w
708                     ; expression=`{ high < 2 }' exp_delay=2 true_delay=1  false_delay=0 true_size=1 false_size=0
709 11c 1c03            btfss c___byte,c___bit
710                     ; if { high < 2 } body start
711                     ;   low := 0  
712 11d 019b            clrf clock_adjust__low
713                     ; if { high < 2 } body end
714                     ; if exp=` high < 2 ' false skip delay=4
715                     ; Other expression=`{ high < 2 }' delay=4
716                     ; if { high < 2 } end
717                     ; Now think about adjusting clock .
718                     ; if { low > clock_target } start
719 11e 301c            movlw 28
720 11f 021b            subwf clock_adjust__low,w
721                     ; expression=`{ low > clock_target }' exp_delay=2 true_delay=5  false_delay=-1 true_size=5 false_size=15
722 120 1803            btfsc c___byte,c___bit
723 121 2932            goto label257__0true
724             label257__0false:
725 122 301b            movlw 27
726 123 021b            subwf clock_adjust__low,w
727                     ; expression=`{ low < clock_target }' exp_delay=2 true_delay=7  false_delay=3 true_size=7 false_size=3
728 124 1c03            btfss c___byte,c___bit
729 125 292a            goto label264__0true
730             label264__0false:
731                     ; else body start
732                     ; call master_send < 0c'x' >
733                     ;   command := 0  
734 126 0196            clrf clock_adjust__command
735                     ;   error := 0  
736 127 0198            clrf clock_adjust__error
737                     ;   error_minimum := 0  
738 128 0199            clrf clock_adjust__error_minimum
739                     ; else body end
740 129 2931            goto label264__0end
741             label264__0true:
742                     ; else_if { low < clock_target } body start
743                     ; call master_send < 0c'-' >
744                     ; Slave clock is too fast < i . e . pulse too short . >
745                     ;   error := clock_target - low  
746 12a 301b            movlw 27
747 12b 009c            movwf clock_adjust__267byte0
748 12c 081b            movf clock_adjust__low,w
749 12d 021c            subwf clock_adjust__267byte0,w
750 12e 0098            movwf clock_adjust__error
751                     ; Decrement clock :
752                     ;   command := 0xf8  
753 12f 30f8            movlw 248
754 130 0096            movwf clock_adjust__command
755                     ; call slave_send < 0xf8 >
756                     ; else_if { low < clock_target } body end
757                     ; if exp=` low < clock_target ' generic
758             label264__0end:
759                     ; Other expression=`{ low < clock_target }' delay=-1
760 131 2937            goto label257__0end
761             label257__0true:
762                     ; if { low > clock_target } body start
763                     ; call master_send < 0c'+' >
764                     ; Slave clock is too slow < i . e . pulse too long . >
765                     ;   error := low - clock_target  
766 132 30e5            movlw 229
767 133 071b            addwf clock_adjust__low,w
768 134 0098            movwf clock_adjust__error
769                     ; Increment clock :
770                     ;   command := 0xf9  
771 135 30f9            movlw 249
772 136 0096            movwf clock_adjust__command
773                     ; call slave_send < 0xf9 >
774                     ; if { low > clock_target } body end
775                     ; if exp=` low > clock_target ' generic
776             label257__0end:
777                     ; Other expression=`{ low > clock_target }' delay=-1
778                     ; if { low > clock_target } end
779                     ; Print out the error and error minimum :
780                     ;   call master_send {{ 0c'E' }}  
781 137 3045            movlw 69
782 138 00c0            movwf master_send__character
783 139 23c4            call master_send
784                     ;   call master_octal {{ error }}  
785 13a 0818            movf clock_adjust__error,w
786 13b 00b4            movwf master_octal__number
787 13c 235f            call master_octal
788                     ;   call master_send {{ 0c'M' }}  
789 13d 304d            movlw 77
790 13e 00c0            movwf master_send__character
791 13f 23c4            call master_send
792                     ;   call master_octal {{ error_minimum }}  
793 140 0819            movf clock_adjust__error_minimum,w
794 141 00b4            movwf master_octal__number
795 142 235f            call master_octal
796                     ; if { error = error_minimum } start
797 143 0818            movf clock_adjust__error,w
798 144 0219            subwf clock_adjust__error_minimum,w
799                     ; expression=`{ error = error_minimum }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=2 false_size=14
800 145 1d03            btfss z___byte,z___bit
801 146 294a            goto label284__0false
802             label284__0true:
803                     ; if { error = error_minimum } body start
804                     ;   call master_crlf {{ }}  
805 147 2347            call master_crlf
806                     ;   return  
807 148 3400            retlw 0
808                     ; if { error = error_minimum } body end
809 149 2958            goto label284__0end
810             label284__0false:
811 14a 0819            movf clock_adjust__error_minimum,w
812 14b 0218            subwf clock_adjust__error,w
813                     ; expression=`{ error < error_minimum }' exp_delay=2 true_delay=3  false_delay=-1 true_size=3 false_size=6
814 14c 1c03            btfss c___byte,c___bit
815 14d 2955            goto label287__0true
816             label287__0false:
817                     ; else body start
818                     ;   count := count - 1  
819 14e 0397            decf clock_adjust__count,f
820                     ; if { z } start
821                     ; expression=`{ z }' exp_delay=0 true_delay=3  false_delay=0 true_size=3 false_size=0
822 14f 1d03            btfss z__byte,z__bit
823 150 2954            goto label292__0end
824                     ; if { z } body start
825                     ;   error_minimum := error_minimum + 1  
826 151 0a99            incf clock_adjust__error_minimum,f
827                     ;   count := 4  
828 152 3004            movlw 4
829 153 0097            movwf clock_adjust__count
830                     ; if { z } body end
831             label292__0end:
832                     ; if exp=`z' empty false
833                     ; Other expression=`{ z }' delay=-1
834                     ; if { z } end
835                     ; else body end
836 154 2958            goto label287__0end
837             label287__0true:
838                     ; else_if { error < error_minimum } body start
839                     ;   error_minimum := error  
840 155 0818            movf clock_adjust__error,w
841 156 0099            movwf clock_adjust__error_minimum
842                     ;   error := error + 1  
843 157 0a98            incf clock_adjust__error,f
844                     ; else_if { error < error_minimum } body end
845                     ; if exp=` error < error_minimum ' generic
846             label287__0end:
847                     ; Other expression=`{ error < error_minimum }' delay=-1
848                     ; if exp=` error = error_minimum ' generic
849             label284__0end:
850                     ; Other expression=`{ error = error_minimum }' delay=-1
851                     ; if { error = error_minimum } end
852                     ; Now adjust the clock :
853                     ;   call slave_send {{ command }}  
854 158 0816            movf clock_adjust__command,w
855 159 00b7            movwf slave_send__data
856 15a 237e            call slave_send
857                     ;   call master_crlf {{ }}  
858 15b 2347            call master_crlf
859 15c 28f6            goto clock_adjust__222loop__forever
860                     ; loop_forever ... end
861                     ; procedure clock_adjust end
862             
863                     ; procedure test start
864             test:
865     001d    test__variables__base equ global__variables__bank0+17
866     001d    test__bytes__base equ test__variables__base+0
867     0022    test__bits__base equ test__variables__base+5
868     0005    test__total__bytes equ 5
869     0021    test__404byte0 equ test__bytes__base+4
870     0021    test__409byte0 equ test__bytes__base+4
871                     ;   arguments_none  
872                     ; This procedure will test the LED10 RoboBrick :
873     001d    test__bit equ test__bytes__base+0
874     001e    test__high equ test__bytes__base+1
875     001f    test__low equ test__bytes__base+2
876     0020    test__temp equ test__bytes__base+3
877                     ; Adjust the clock :
878                     ;   call clock_adjust {{ }}  
879 15d 20ec            call clock_adjust
880                     ; Verify that the common commands are working :
881                     ;   call common_test {{ }}  
882 15e 22ab            call common_test
883                     ; Clear the LEDS :
884                     ;   call slave_send {{ 0 }}  
885 15f 01b7            clrf slave_send__data
886 160 237e            call slave_send
887                     ;   call slave_send {{ 0x20 }}  
888 161 3020            movlw 32
889 162 00b7            movwf slave_send__data
890 163 237e            call slave_send
891                     ;   call test_prompt {{ 0 , 0 }}  
892 164 01a5            clrf test_prompt__high
893 165 01a6            clrf test_prompt__low
894 166 2280            call test_prompt
895                     ; Let ' s do some simple testing first :
896                     ;   high := 0  
897 167 019e            clrf test__high
898                     ;   low := 1  
899 168 3001            movlw 1
900 169 009f            movwf test__low
901                     ; `while  ! {{ high @ 5 }}  ...' start
902             test__330while__continue:
903                     ; Alias variable for select high @ 5
904     001e    test__high__330select0 equ test__high+0
905     001e    test__high__330select0__byte equ test__high+0
906     0005    test__high__330select0__bit equ 5
907                     ; expression=`{{ high @ 5 }}' exp_delay=0 true_delay=2  false_delay=1 true_size=1 false_size=28
908 16a 1a9e            btfsc test__high__330select0__byte,test__high__330select0__bit
909 16b 2988            goto test__330while__break
910                     ; Set the bits :
911                     ;   call slave_send {{ low }}  
912 16c 081f            movf test__low,w
913 16d 00b7            movwf slave_send__data
914 16e 237e            call slave_send
915                     ;   call slave_send {{ 0x20 | high }}  
916 16f 3020            movlw 32
917 170 041e            iorwf test__high,w
918 171 00b7            movwf slave_send__data
919 172 237e            call slave_send
920                     ;   call test_prompt {{ high , low }}  
921 173 081e            movf test__high,w
922 174 00a5            movwf test_prompt__high
923 175 081f            movf test__low,w
924 176 00a6            movwf test_prompt__low
925 177 2280            call test_prompt
926                     ;   call test_verify {{ high , low }}  
927 178 081e            movf test__high,w
928 179 00a2            movwf test_verify__high
929 17a 081f            movf test__low,w
930 17b 00a3            movwf test_verify__low
931 17c 225d            call test_verify
932                     ; Go to next level :
933                     ; if { low @ 4 } start
934                     ; Alias variable for select low @ 4
935     001f    test__low__338select0 equ test__low+0
936     001f    test__low__338select0__byte equ test__low+0
937     0004    test__low__338select0__bit equ 4
938                     ; expression=`{ low @ 4 }' exp_delay=0 true_delay=3  false_delay=4 true_size=3 false_size=4
939 17d 1e1f            btfss test__low__338select0__byte,test__low__338select0__bit
940 17e 2983            goto label338__1false
941             label338__1true:
942                     ; if { low @ 4 } body start
943                     ;   high := 1  
944 17f 3001            movlw 1
945 180 009e            movwf test__high
946                     ;   low := 0  
947 181 019f            clrf test__low
948                     ; if { low @ 4 } body end
949 182 2987            goto label338__1end
950             label338__1false:
951                     ; else body start
952                     ;   high := high << 1  
953 183 1003            bcf c___byte,c___bit
954 184 0d9e            rlf test__high,f
955                     ;   low := low << 1  
956 185 1003            bcf c___byte,c___bit
957 186 0d9f            rlf test__low,f
958                     ; else body end
959                     ; if exp=` low @ 4 ' generic
960             label338__1end:
961                     ; Other expression=`{ low @ 4 }' delay=-1
962                     ; if { low @ 4 } end
963 187 296a            goto test__330while__continue
964                     ; if exp=` high @ 5 ' true goto
965                     ; Other expression=`{{ high @ 5 }}' delay=-1
966             test__330while__break:
967                     ; `while  ! {{ high @ 5 }}  ...' end
968                     ; Clear the high order bit :
969                     ;   call slave_send {{ 0x20 }}  
970 188 3020            movlw 32
971 189 00b7            movwf slave_send__data
972 18a 237e            call slave_send
973                     ; Let ' s test out the bit twiddle commands :
974                     ;   bit := 0  
975 18b 019d            clrf test__bit
976                     ;   high := 0  
977 18c 019e            clrf test__high
978                     ;   low := 1  
979 18d 3001            movlw 1
980 18e 009f            movwf test__low
981                     ; `while  bit < 10  ...' start
982             test__353while__continue:
983 18f 300a            movlw 10
984 190 021d            subwf test__bit,w
985                     ; expression=` bit < 10 ' exp_delay=2 true_delay=1  false_delay=2 true_size=80 false_size=1
986 191 1803            btfsc c___byte,c___bit
987 192 29e2            goto test__353while__break
988                     ; Bit set :
989                     ;   call slave_send {{ 0x50 | bit }}  
990 193 3050            movlw 80
991 194 041d            iorwf test__bit,w
992 195 00b7            movwf slave_send__data
993 196 237e            call slave_send
994                     ;   call test_verify {{ high , low }}  
995 197 081e            movf test__high,w
996 198 00a2            movwf test_verify__high
997 199 081f            movf test__low,w
998 19a 00a3            movwf test_verify__low
999 19b 225d            call test_verify
1000                     ; Read the bit :
1001                     ;   call slave_send {{ 0x70 | bit }}  
1002 19c 3070            movlw 112
1003 19d 041d            iorwf test__bit,w
1004 19e 00b7            movwf slave_send__data
1005 19f 237e            call slave_send
1006                     ;   temp := slave_get {{ }}  
1007 1a0 2378            call slave_get
1008 1a1 0836            movf slave_get__0return__byte,w
1009 1a2 00a0            movwf test__temp
1010                     ; if { temp != 1 } start
1011 1a3 0320            decf test__temp,w
1012                     ; expression=`{ temp != 1 }' exp_delay=1 true_delay=4  false_delay=0 true_size=8 false_size=0
1013 1a4 1903            btfsc z___byte,z___bit
1014 1a5 29ae            goto label361__0end
1015                     ; if { temp != 1 } body start
1016                     ;   call master_octal {{ temp }}  
1017 1a6 0820            movf test__temp,w
1018 1a7 00b4            movwf master_octal__number
1019 1a8 235f            call master_octal
1020                     ;   call master_fail {{ bit_string , 0x30 }}  
1021 1a9 300d            movlw LOW bit_string+1
1022 1aa 00b1            movwf master_fail__test_name
1023 1ab 3030            movlw 48
1024 1ac 00b2            movwf master_fail__test_number
1025 1ad 234e            call master_fail
1026                     ; if { temp != 1 } body end
1027             label361__0end:
1028                     ; if exp=` temp != 1 ' empty false
1029                     ; Other expression=`{ temp != 1 }' delay=-1
1030                     ; if { temp != 1 } end
1031                     ; Bit clear :
1032                     ;   call slave_send {{ 0x40 | bit }}  
1033 1ae 3040            movlw 64
1034 1af 041d            iorwf test__bit,w
1035 1b0 00b7            movwf slave_send__data
1036 1b1 237e            call slave_send
1037                     ;   call test_verify {{ 0 , 0 }}  
1038 1b2 01a2            clrf test_verify__high
1039 1b3 01a3            clrf test_verify__low
1040 1b4 225d            call test_verify
1041                     ; Read the bit again :
1042                     ;   call slave_send {{ 0x70 | bit }}  
1043 1b5 3070            movlw 112
1044 1b6 041d            iorwf test__bit,w
1045 1b7 00b7            movwf slave_send__data
1046 1b8 237e            call slave_send
1047                     ;   temp := slave_get {{ }}  
1048 1b9 2378            call slave_get
1049 1ba 0836            movf slave_get__0return__byte,w
1050 1bb 00a0            movwf test__temp
1051                     ; if { temp != 0 } start
1052                     ; expression=`{ temp != 0 }' exp_delay=1 true_delay=4  false_delay=0 true_size=8 false_size=0
1053 1bc 1903            btfsc z___byte,z___bit
1054 1bd 29c6            goto label373__0end
1055                     ; if { temp != 0 } body start
1056                     ;   call master_octal {{ temp }}  
1057 1be 0820            movf test__temp,w
1058 1bf 00b4            movwf master_octal__number
1059 1c0 235f            call master_octal
1060                     ;   call master_fail {{ bit_string , 0x31 }}  
1061 1c1 300d            movlw LOW bit_string+1
1062 1c2 00b1            movwf master_fail__test_name
1063 1c3 3031            movlw 49
1064 1c4 00b2            movwf master_fail__test_number
1065 1c5 234e            call master_fail
1066                     ; if { temp != 0 } body end
1067             label373__0end:
1068                     ; if exp=` temp != 0 ' empty false
1069                     ; Other expression=`{ temp != 0 }' delay=-1
1070                     ; if { temp != 0 } end
1071                     ; Bit toggle :
1072                     ;   call slave_send {{ 0x60 | bit }}  
1073 1c6 3060            movlw 96
1074 1c7 041d            iorwf test__bit,w
1075 1c8 00b7            movwf slave_send__data
1076 1c9 237e            call slave_send
1077                     ;   call test_verify {{ high , low }}  
1078 1ca 081e            movf test__high,w
1079 1cb 00a2            movwf test_verify__high
1080 1cc 081f            movf test__low,w
1081 1cd 00a3            movwf test_verify__low
1082 1ce 225d            call test_verify
1083                     ; Bit toggle again :
1084                     ;   call slave_send {{ 0x60 | bit }}  
1085 1cf 3060            movlw 96
1086 1d0 041d            iorwf test__bit,w
1087 1d1 00b7            movwf slave_send__data
1088 1d2 237e            call slave_send
1089                     ;   call test_verify {{ 0 , 0 }}  
1090 1d3 01a2            clrf test_verify__high
1091 1d4 01a3            clrf test_verify__low
1092 1d5 225d            call test_verify
1093                     ; if { low @ 4 } start
1094                     ; Alias variable for select low @ 4
1095     001f    test__low__386select0 equ test__low+0
1096     001f    test__low__386select0__byte equ test__low+0
1097     0004    test__low__386select0__bit equ 4
1098                     ; expression=`{ low @ 4 }' exp_delay=0 true_delay=3  false_delay=4 true_size=3 false_size=4
1099 1d6 1e1f            btfss test__low__386select0__byte,test__low__386select0__bit
1100 1d7 29dc            goto label386__1false
1101             label386__1true:
1102                     ; if { low @ 4 } body start
1103                     ;   high := 1  
1104 1d8 3001            movlw 1
1105 1d9 009e            movwf test__high
1106                     ;   low := 0  
1107 1da 019f            clrf test__low
1108                     ; if { low @ 4 } body end
1109 1db 29e0            goto label386__1end
1110             label386__1false:
1111                     ; else body start
1112                     ;   high := high << 1  
1113 1dc 1003            bcf c___byte,c___bit
1114 1dd 0d9e            rlf test__high,f
1115                     ;   low := low << 1  
1116 1de 1003            bcf c___byte,c___bit
1117 1df 0d9f            rlf test__low,f
1118                     ; else body end
1119                     ; if exp=` low @ 4 ' generic
1120             label386__1end:
1121                     ; Other expression=`{ low @ 4 }' delay=-1
1122                     ; if { low @ 4 } end
1123                     ;   bit := bit + 1  
1124 1e0 0a9d            incf test__bit,f
1125 1e1 298f            goto test__353while__continue
1126                     ; if exp=` bit < 10 ' false goto
1127                     ; Other expression=` bit < 10 ' delay=-1
1128             test__353while__break:
1129                     ; `while  bit < 10  ...' end
1130                     ; Now do some blink rate tests :
1131                     ; First turn the bits on :
1132                     ;   call slave_send {{ 0x1f }}  
1133 1e2 301f            movlw 31
1134 1e3 00b7            movwf slave_send__data
1135 1e4 237e            call slave_send
1136                     ;   call slave_send {{ 0x3f }}  
1137 1e5 303f            movlw 63
1138 1e6 00b7            movwf slave_send__data
1139 1e7 237e            call slave_send
1140                     ;   bit := 0  
1141 1e8 019d            clrf test__bit
1142                     ; `while  bit < 10  ...' start
1143             test__401while__continue:
1144 1e9 300a            movlw 10
1145 1ea 021d            subwf test__bit,w
1146                     ; expression=` bit < 10 ' exp_delay=2 true_delay=1  false_delay=2 true_size=35 false_size=1
1147 1eb 1803            btfsc c___byte,c___bit
1148 1ec 2a10            goto test__401while__break
1149                     ; Set the blink rate :
1150                     ;   call slave_send {{ 0x83 }}  
1151 1ed 3083            movlw 131
1152 1ee 00b7            movwf slave_send__data
1153 1ef 237e            call slave_send
1154                     ;   call slave_send {{ {{ bit << 5 }} | bit }}  
1155 1f0 0e1d            swapf test__bit,w
1156 1f1 00a1            movwf test__404byte0
1157 1f2 0d21            rlf test__404byte0,w
1158 1f3 39e0            andlw 224
1159 1f4 041d            iorwf test__bit,w
1160 1f5 00b7            movwf slave_send__data
1161 1f6 237e            call slave_send
1162                     ; Read the blink rate back :
1163                     ;   call slave_send {{ 0x70 | bit }}  
1164 1f7 3070            movlw 112
1165 1f8 041d            iorwf test__bit,w
1166 1f9 00b7            movwf slave_send__data
1167 1fa 237e            call slave_send
1168                     ;   temp := slave_get {{ }}  
1169 1fb 2378            call slave_get
1170 1fc 0836            movf slave_get__0return__byte,w
1171 1fd 00a0            movwf test__temp
1172                     ; if { temp != {{ bit << 5 }} | 1 } start
1173 1fe 0e1d            swapf test__bit,w
1174 1ff 00a1            movwf test__409byte0
1175 200 0d21            rlf test__409byte0,w
1176 201 39e0            andlw 224
1177 202 3801            iorlw 1
1178 203 0220            subwf test__temp,w
1179                     ; expression=`{ temp != {{ bit << 5 }} | 1 }' exp_delay=6 true_delay=4  false_delay=0 true_size=8 false_size=0
1180 204 1903            btfsc z___byte,z___bit
1181 205 2a0e            goto label409__1end
1182                     ; if { temp != {{ bit << 5 }} | 1 } body start
1183                     ;   call master_octal {{ temp }}  
1184 206 0820            movf test__temp,w
1185 207 00b4            movwf master_octal__number
1186 208 235f            call master_octal
1187                     ;   call master_fail {{ blink_string , 0x32 }}  
1188 209 3012            movlw LOW blink_string+1
1189 20a 00b1            movwf master_fail__test_name
1190 20b 3032            movlw 50
1191 20c 00b2            movwf master_fail__test_number
1192 20d 234e            call master_fail
1193                     ; if { temp != {{ bit << 5 }} | 1 } body end
1194             label409__1end:
1195                     ; if exp=` temp != {{ bit << 5 }} | 1 ' empty false
1196                     ; Other expression=`{ temp != {{ bit << 5 }} | 1 }' delay=-1
1197                     ; if { temp != {{ bit << 5 }} | 1 } end
1198                     ;   bit := bit + 1  
1199 20e 0a9d            incf test__bit,f
1200 20f 29e9            goto test__401while__continue
1201                     ; if exp=` bit < 10 ' false goto
1202                     ; Other expression=` bit < 10 ' delay=-1
1203             test__401while__break:
1204                     ; `while  bit < 10  ...' end
1205                     ; Now turn the bits on and let them blink :
1206                     ;   call test_prompt {{ 0x1f , 0x1f }}  
1207 210 301f            movlw 31
1208 211 00a5            movwf test_prompt__high
1209 212 301f            movlw 31
1210 213 00a6            movwf test_prompt__low
1211 214 2280            call test_prompt
1212                     ; Now clear the blink rates :
1213                     ;   bit := 0  
1214 215 019d            clrf test__bit
1215                     ; `while  bit < 10  ...' start
1216             test__420while__continue:
1217 216 300a            movlw 10
1218 217 021d            subwf test__bit,w
1219                     ; expression=` bit < 10 ' exp_delay=2 true_delay=5  false_delay=2 true_size=8 false_size=1
1220 218 1803            btfsc c___byte,c___bit
1221 219 2a22            goto test__420while__break
1222                     ; Clear the blink rate :
1223                     ;   call slave_send {{ 0x83 }}  
1224 21a 3083            movlw 131
1225 21b 00b7            movwf slave_send__data
1226 21c 237e            call slave_send
1227                     ;   call slave_send {{ bit }}  
1228 21d 081d            movf test__bit,w
1229 21e 00b7            movwf slave_send__data
1230 21f 237e            call slave_send
1231                     ;   bit := bit + 1  
1232 220 0a9d            incf test__bit,f
1233 221 2a16            goto test__420while__continue
1234                     ; if exp=` bit < 10 ' false goto
1235                     ; Other expression=` bit < 10 ' delay=-1
1236             test__420while__break:
1237                     ; `while  bit < 10  ...' end
1238                     ; Clear the bits :
1239                     ;   call slave_send {{ 0 }}  
1240 222 01b7            clrf slave_send__data
1241 223 237e            call slave_send
1242                     ;   call slave_send {{ 0x20 }}  
1243 224 3020            movlw 32
1244 225 00b7            movwf slave_send__data
1245 226 237e            call slave_send
1246                     ; Now test increment :
1247                     ;   high := 0  
1248 227 019e            clrf test__high
1249                     ; `while  high < 0x20  ...' start
1250             test__432while__continue:
1251 228 3020            movlw 32
1252 229 021e            subwf test__high,w
1253                     ; expression=` high < 0x20 ' exp_delay=2 true_delay=1  false_delay=2 true_size=17 false_size=1
1254 22a 1803            btfsc c___byte,c___bit
1255 22b 2a3d            goto test__432while__break
1256                     ;   low := 0  
1257 22c 019f            clrf test__low
1258                     ; `while  low < 0x20  ...' start
1259             test__434while__continue:
1260 22d 3020            movlw 32
1261 22e 021f            subwf test__low,w
1262                     ; expression=` low < 0x20 ' exp_delay=2 true_delay=7  false_delay=2 true_size=10 false_size=1
1263 22f 1803            btfsc c___byte,c___bit
1264 230 2a3b            goto test__434while__break
1265                     ;   call test_verify {{ high , low }}  
1266 231 081e            movf test__high,w
1267 232 00a2            movwf test_verify__high
1268 233 081f            movf test__low,w
1269 234 00a3            movwf test_verify__low
1270 235 225d            call test_verify
1271                     ; Now increment the LED ' s :
1272                     ;   call slave_send {{ 0x90 }}  
1273 236 3090            movlw 144
1274 237 00b7            movwf slave_send__data
1275 238 237e            call slave_send
1276                     ;   low := low + 1  
1277 239 0a9f            incf test__low,f
1278 23a 2a2d            goto test__434while__continue
1279                     ; if exp=` low < 0x20 ' false goto
1280                     ; Other expression=` low < 0x20 ' delay=-1
1281             test__434while__break:
1282                     ; `while  low < 0x20  ...' end
1283                     ;   high := high + 1  
1284 23b 0a9e            incf test__high,f
1285 23c 2a28            goto test__432while__continue
1286                     ; if exp=` high < 0x20 ' false goto
1287                     ; Other expression=` high < 0x20 ' delay=-1
1288             test__432while__break:
1289                     ; `while  high < 0x20  ...' end
1290                     ; Now test decrement :
1291                     ;   high := 0x20  
1292 23d 3020            movlw 32
1293 23e 009e            movwf test__high
1294                     ; `while  high != 0  ...' start
1295             test__446while__continue:
1296 23f 081e            movf test__high,w
1297                     ; expression=` high != 0 ' exp_delay=1 true_delay=1  false_delay=2 true_size=17 false_size=1
1298 240 1903            btfsc z___byte,z___bit
1299 241 2a53            goto test__446while__break
1300                     ;   high := high - 1  
1301 242 039e            decf test__high,f
1302                     ;   low := 0x20  
1303 243 3020            movlw 32
1304 244 009f            movwf test__low
1305                     ; `while  low != 0  ...' start
1306             test__449while__continue:
1307 245 081f            movf test__low,w
1308                     ; expression=` low != 0 ' exp_delay=1 true_delay=7  false_delay=2 true_size=10 false_size=1
1309 246 1903            btfsc z___byte,z___bit
1310 247 2a52            goto test__449while__break
1311                     ;   low := low - 1  
1312 248 039f            decf test__low,f
1313                     ; Now decrement the LED ' s :
1314                     ;   call slave_send {{ 0xa0 }}  
1315 249 30a0            movlw 160
1316 24a 00b7            movwf slave_send__data
1317 24b 237e            call slave_send
1318                     ; Now verify :
1319                     ;   call test_verify {{ high , low }}  
1320 24c 081e            movf test__high,w
1321 24d 00a2            movwf test_verify__high
1322 24e 081f            movf test__low,w
1323 24f 00a3            movwf test_verify__low
1324 250 225d            call test_verify
1325 251 2a45            goto test__449while__continue
1326                     ; if exp=` low != 0 ' false goto
1327                     ; Other expression=` low != 0 ' delay=-1
1328             test__449while__break:
1329                     ; `while  low != 0  ...' end
1330 252 2a3f            goto test__446while__continue
1331                     ; if exp=` high != 0 ' false goto
1332                     ; Other expression=` high != 0 ' delay=-1
1333             test__446while__break:
1334                     ; `while  high != 0  ...' end
1335                     ; Let ' s clear the LED ' s :
1336                     ;   call slave_send {{ 0 }}  
1337 253 01b7            clrf slave_send__data
1338 254 237e            call slave_send
1339                     ;   call slave_send {{ 0x20 }}  
1340 255 3020            movlw 32
1341 256 00b7            movwf slave_send__data
1342 257 237e            call slave_send
1343                     ; Announce that we are done :
1344                     ;   call master_string {{ done_string }}  
1345 258 3026            movlw LOW done_string+1
1346 259 00c1            movwf master_string__message
1347 25a 23ca            call master_string
1348                     ;   call master_crlf {{ }}  
1349 25b 2347            call master_crlf
1350                     ; procedure test end
1351 25c 3400            retlw 0
1352             
1353                     ; procedure test_verify start
1354             test_verify:
1355     0022    test_verify__variables__base equ global__variables__bank0+22
1356     0022    test_verify__bytes__base equ test_verify__variables__base+0
1357     0025    test_verify__bits__base equ test_verify__variables__base+3
1358     0003    test_verify__total__bytes equ 3
1359     0022    test_verify__high equ test_verify__bytes__base+0
1360     0023    test_verify__low equ test_verify__bytes__base+1
1361                     ; This procedure will verify that the registers contain high and low .
1362     0024    test_verify__temp equ test_verify__bytes__base+2
1363                     ; Read low register :
1364                     ;   call slave_send {{ 0x81 }}  
1365 25d 3081            movlw 129
1366 25e 00b7            movwf slave_send__data
1367 25f 237e            call slave_send
1368                     ;   temp := slave_get {{ }}  
1369 260 2378            call slave_get
1370 261 0836            movf slave_get__0return__byte,w
1371 262 00a4            movwf test_verify__temp
1372                     ; if { temp != low } start
1373 263 0223            subwf test_verify__low,w
1374                     ; expression=`{ temp != low }' exp_delay=2 true_delay=3  false_delay=0 true_size=5 false_size=0
1375 264 1903            btfsc z___byte,z___bit
1376 265 2a6b            goto label480__0end
1377                     ; if { temp != low } body start
1378                     ;   call master_fail {{ read_string , 0x50 }}  
1379 266 3052            movlw LOW read_string+1
1380 267 00b1            movwf master_fail__test_name
1381 268 3050            movlw 80
1382 269 00b2            movwf master_fail__test_number
1383 26a 234e            call master_fail
1384                     ; if { temp != low } body end
1385             label480__0end:
1386                     ; if exp=` temp != low ' empty false
1387                     ; Other expression=`{ temp != low }' delay=-1
1388                     ; if { temp != low } end
1389                     ; Read high register :
1390                     ;   call slave_send {{ 0x82 }}  
1391 26b 3082            movlw 130
1392 26c 00b7            movwf slave_send__data
1393 26d 237e            call slave_send
1394                     ;   temp := slave_get {{ }}  
1395 26e 2378            call slave_get
1396 26f 0836            movf slave_get__0return__byte,w
1397 270 00a4            movwf test_verify__temp
1398                     ; if { temp != high } start
1399 271 0222            subwf test_verify__high,w
1400                     ; expression=`{ temp != high }' exp_delay=2 true_delay=5  false_delay=0 true_size=11 false_size=0
1401 272 1903            btfsc z___byte,z___bit
1402 273 2a7f            goto label487__0end
1403                     ; if { temp != high } body start
1404                     ;   call master_octal {{ temp }}  
1405 274 0824            movf test_verify__temp,w
1406 275 00b4            movwf master_octal__number
1407 276 235f            call master_octal
1408                     ;   call master_octal {{ high }}  
1409 277 0822            movf test_verify__high,w
1410 278 00b4            movwf master_octal__number
1411 279 235f            call master_octal
1412                     ;   call master_fail {{ read_string , 0x51 }}  
1413 27a 3052            movlw LOW read_string+1
1414 27b 00b1            movwf master_fail__test_name
1415 27c 3051            movlw 81
1416 27d 00b2            movwf master_fail__test_number
1417 27e 234e            call master_fail
1418                     ; if { temp != high } body end
1419             label487__0end:
1420                     ; if exp=` temp != high ' empty false
1421                     ; Other expression=`{ temp != high }' delay=-1
1422                     ; if { temp != high } end
1423                     ; procedure test_verify end
1424 27f 3400            retlw 0
1425             
1426                     ; procedure test_prompt start
1427             test_prompt:
1428     0025    test_prompt__variables__base equ global__variables__bank0+25
1429     0025    test_prompt__bytes__base equ test_prompt__variables__base+0
1430     002a    test_prompt__bits__base equ test_prompt__variables__base+5
1431     0005    test_prompt__total__bytes equ 5
1432     0029    test_prompt__523byte0 equ test_prompt__bytes__base+4
1433     0025    test_prompt__high equ test_prompt__bytes__base+0
1434     0026    test_prompt__low equ test_prompt__bytes__base+1
1435                     ; This procedure will prompt the user to input a paticular pattern :
1436     0027    test_prompt__count equ test_prompt__bytes__base+2
1437     0028    test_prompt__char equ test_prompt__bytes__base+3
1438                     ; Print high order pattern :
1439                     ; `count_down count 5 ...' start
1440 280 3005            movlw 5
1441 281 00a7            movwf test_prompt__count
1442             test_prompt__505_loop:
1443                     ;   char := 0c'.'  
1444 282 302e            movlw 46
1445 283 00a8            movwf test_prompt__char
1446                     ; if { high @ 4 } start
1447                     ; Alias variable for select high @ 4
1448     0025    test_prompt__high__507select0 equ test_prompt__high+0
1449     0025    test_prompt__high__507select0__byte equ test_prompt__high+0
1450     0004    test_prompt__high__507select0__bit equ 4
1451                     ; expression=`{ high @ 4 }' exp_delay=0 true_delay=2  false_delay=0 true_size=2 false_size=0
1452 284 1e25            btfss test_prompt__high__507select0__byte,test_prompt__high__507select0__bit
1453 285 2a88            goto label507__1end
1454                     ; if { high @ 4 } body start
1455                     ;   char := 0c'*'  
1456 286 302a            movlw 42
1457 287 00a8            movwf test_prompt__char
1458                     ; if { high @ 4 } body end
1459             label507__1end:
1460                     ; if exp=` high @ 4 ' empty false
1461                     ; Other expression=`{ high @ 4 }' delay=-1
1462                     ; if { high @ 4 } end
1463                     ;   call master_send {{ char }}  
1464 288 0828            movf test_prompt__char,w
1465 289 00c0            movwf master_send__character
1466 28a 23c4            call master_send
1467                     ;   high := high << 1  
1468 28b 1003            bcf c___byte,c___bit
1469 28c 0da5            rlf test_prompt__high,f
1470 28d 0ba7            decfsz test_prompt__count,f
1471 28e 2a82            goto test_prompt__505_loop
1472             test_prompt__505_done:
1473                     ; `count_down count 5 ...' end
1474                     ; `count_down count 5 ...' start
1475 28f 3005            movlw 5
1476 290 00a7            movwf test_prompt__count
1477             test_prompt__513_loop:
1478                     ;   char := 0c'.'  
1479 291 302e            movlw 46
1480 292 00a8            movwf test_prompt__char
1481                     ; if { low @ 4 } start
1482                     ; Alias variable for select low @ 4
1483     0026    test_prompt__low__515select0 equ test_prompt__low+0
1484     0026    test_prompt__low__515select0__byte equ test_prompt__low+0
1485     0004    test_prompt__low__515select0__bit equ 4
1486                     ; expression=`{ low @ 4 }' exp_delay=0 true_delay=2  false_delay=0 true_size=2 false_size=0
1487 293 1e26            btfss test_prompt__low__515select0__byte,test_prompt__low__515select0__bit
1488 294 2a97            goto label515__1end
1489                     ; if { low @ 4 } body start
1490                     ;   char := 0c'*'  
1491 295 302a            movlw 42
1492 296 00a8            movwf test_prompt__char
1493                     ; if { low @ 4 } body end
1494             label515__1end:
1495                     ; if exp=` low @ 4 ' empty false
1496                     ; Other expression=`{ low @ 4 }' delay=-1
1497                     ; if { low @ 4 } end
1498                     ;   call master_send {{ char }}  
1499 297 0828            movf test_prompt__char,w
1500 298 00c0            movwf master_send__character
1501 299 23c4            call master_send
1502                     ;   low := low << 1  
1503 29a 1003            bcf c___byte,c___bit
1504 29b 0da6            rlf test_prompt__low,f
1505 29c 0ba7            decfsz test_prompt__count,f
1506 29d 2a91            goto test_prompt__513_loop
1507             test_prompt__513_done:
1508                     ; `count_down count 5 ...' end
1509                     ;   call master_send {{ 0c':' }}  
1510 29e 303a            movlw 58
1511 29f 00c0            movwf master_send__character
1512 2a0 23c4            call master_send
1513                     ; `while  master_get ## {{ }} = 0xfc  ...' start
1514             test_prompt__523while__continue:
1515 2a1 2359            call master_get
1516 2a2 0833            movf master_get__0return__byte,w
1517 2a3 00a9            movwf test_prompt__523byte0
1518 2a4 30fc            movlw 252
1519 2a5 0229            subwf test_prompt__523byte0,w
1520                     ; expression=` master_get ## {{ }} = 0xfc ' exp_delay=3 true_delay=2  false_delay=2 true_size=1 false_size=1
1521 2a6 1903            btfsc z___byte,z___bit
1522                     ; Do nothing :
1523 2a7 2aa1            goto test_prompt__523while__continue
1524 2a8 2aa9            goto test_prompt__523while__break
1525                     ; if exp=` master_get ## {{ }} = 0xfc ' true goto small true
1526             test_prompt__523while__break:
1527                     ; `while  master_get ## {{ }} = 0xfc  ...' end
1528                     ;   call master_crlf {{ }}  
1529 2a9 2347            call master_crlf
1530                     ; procedure test_prompt end
1531 2aa 3400            retlw 0
1532                     ; comment {The procedures below are used to test the common shared commands :}
1533             
1534                     ; procedure common_test start
1535             common_test:
1536     002a    common_test__variables__base equ global__variables__bank0+30
1537     002a    common_test__bytes__base equ common_test__variables__base+0
1538     002c    common_test__bits__base equ common_test__variables__base+2
1539     0002    common_test__total__bytes equ 2
1540     002b    common_test__574byte0 equ common_test__bytes__base+1
1541                     ;   arguments_none  
1542                     ; This procedure will verify that the common shared commands work .
1543     002a    common_test__actual equ common_test__bytes__base+0
1544                     ; Print the ID information :
1545                     ; ID reset :
1546                     ;   call slave_send {{ 0xfd }}  
1547 2ab 30fd            movlw 253
1548 2ac 00b7            movwf slave_send__data
1549 2ad 237e            call slave_send
1550                     ; Read the fixed bytes :
1551                     ;   call common_test_id_match {{ 1 , 0xc0 }}  
1552 2ae 3001            movlw 1
1553 2af 00ac            movwf common_test_id_match__desired
1554 2b0 30c0            movlw 192
1555 2b1 00ad            movwf common_test_id_match__test_number
1556 2b2 2320            call common_test_id_match
1557                     ;   call common_test_id_match {{ 0 , 0xc1 }}  
1558 2b3 01ac            clrf common_test_id_match__desired
1559 2b4 30c1            movlw 193
1560 2b5 00ad            movwf common_test_id_match__test_number
1561 2b6 2320            call common_test_id_match
1562                     ;   call common_test_id_match {{ 13 , 0xc2 }}  
1563 2b7 300d            movlw 13
1564 2b8 00ac            movwf common_test_id_match__desired
1565 2b9 30c2            movlw 194
1566 2ba 00ad            movwf common_test_id_match__test_number
1567 2bb 2320            call common_test_id_match
1568                     ;   call common_test_id_match {{ 0 , 0xc3 }}  
1569 2bc 01ac            clrf common_test_id_match__desired
1570 2bd 30c3            movlw 195
1571 2be 00ad            movwf common_test_id_match__test_number
1572 2bf 2320            call common_test_id_match
1573                     ;   call common_test_id_match {{ 0 , 0xc4 }}  
1574 2c0 01ac            clrf common_test_id_match__desired
1575 2c1 30c4            movlw 196
1576 2c2 00ad            movwf common_test_id_match__test_number
1577 2c3 2320            call common_test_id_match
1578                     ;   call common_test_id_match {{ 0 , 0xc5 }}  
1579 2c4 01ac            clrf common_test_id_match__desired
1580 2c5 30c5            movlw 197
1581 2c6 00ad            movwf common_test_id_match__test_number
1582 2c7 2320            call common_test_id_match
1583                     ;   call common_test_id_match {{ 0 , 0xc6 }}  
1584 2c8 01ac            clrf common_test_id_match__desired
1585 2c9 30c6            movlw 198
1586 2ca 00ad            movwf common_test_id_match__test_number
1587 2cb 2320            call common_test_id_match
1588                     ;   call common_test_id_match {{ 0 , 0xc7 }}  
1589 2cc 01ac            clrf common_test_id_match__desired
1590 2cd 30c7            movlw 199
1591 2ce 00ad            movwf common_test_id_match__test_number
1592 2cf 2320            call common_test_id_match
1593                     ;   call master_crlf {{ }}  
1594 2d0 2347            call master_crlf
1595                     ;   call common_test_id_bytes8 {{ }}  
1596 2d1 232b            call common_test_id_bytes8
1597                     ;   call common_test_id_bytes8 {{ }}  
1598 2d2 232b            call common_test_id_bytes8
1599                     ; Read the brick name :
1600                     ;   call common_test_id_string {{ }}  
1601 2d3 2335            call common_test_id_string
1602                     ; Read the vendor name :
1603                     ;   call common_test_id_string {{ }}  
1604 2d4 2335            call common_test_id_string
1605                     ; Verfify that we don ' t read off the end of the id and crash :
1606                     ;   call common_test_id_next {{ }}  
1607 2d5 2340            call common_test_id_next
1608 2d6 0830            movf common_test_id_next__0return__byte,w
1609                     ; Reset id :
1610                     ;   call slave_send {{ 0xfd }}  
1611 2d7 30fd            movlw 253
1612 2d8 00b7            movwf slave_send__data
1613 2d9 237e            call slave_send
1614                     ; Verify that we are still alive :
1615                     ;   call common_test_id_match {{ 1 , 0xc8 }}  
1616 2da 3001            movlw 1
1617 2db 00ac            movwf common_test_id_match__desired
1618 2dc 30c8            movlw 200
1619 2dd 00ad            movwf common_test_id_match__test_number
1620 2de 2320            call common_test_id_match
1621                     ; Read glitch :
1622                     ; Clear glitch register :
1623                     ;   call slave_send {{ 0xfe }}  
1624 2df 30fe            movlw 254
1625 2e0 00b7            movwf slave_send__data
1626 2e1 237e            call slave_send
1627                     ;   actual := slave_get {{ }}  
1628 2e2 2378            call slave_get
1629 2e3 0836            movf slave_get__0return__byte,w
1630 2e4 00aa            movwf common_test__actual
1631                     ; Send a couple of glitches :
1632                     ;   call slave_send {{ 0xff }}  
1633 2e5 30ff            movlw 255
1634 2e6 00b7            movwf slave_send__data
1635 2e7 237e            call slave_send
1636                     ;   call slave_send {{ 0xff }}  
1637 2e8 30ff            movlw 255
1638 2e9 00b7            movwf slave_send__data
1639 2ea 237e            call slave_send
1640                     ; Read the glitch register :
1641                     ;   call slave_send {{ 0xfe }}  
1642 2eb 30fe            movlw 254
1643 2ec 00b7            movwf slave_send__data
1644 2ed 237e            call slave_send
1645                     ; if { slave_get {{ }} != 2 } start
1646 2ee 2378            call slave_get
1647 2ef 0836            movf slave_get__0return__byte,w
1648 2f0 00ab            movwf common_test__574byte0
1649 2f1 3002            movlw 2
1650 2f2 022b            subwf common_test__574byte0,w
1651                     ; expression=`{ slave_get {{ }} != 2 }' exp_delay=3 true_delay=3  false_delay=0 true_size=5 false_size=0
1652 2f3 1903            btfsc z___byte,z___bit
1653 2f4 2afa            goto label574__1end
1654                     ; if { slave_get {{ }} != 2 } body start
1655                     ;   call master_fail {{ common_string , 0xc9 }}  
1656 2f5 301e            movlw LOW common_string+1
1657 2f6 00b1            movwf master_fail__test_name
1658 2f7 30c9            movlw 201
1659 2f8 00b2            movwf master_fail__test_number
1660 2f9 234e            call master_fail
1661                     ; if { slave_get {{ }} != 2 } body end
1662             label574__1end:
1663                     ; if exp=` slave_get ## {{ }} != 2 ' empty false
1664                     ; Other expression=`{ slave_get {{ }} != 2 }' delay=-1
1665                     ; if { slave_get {{ }} != 2 } end
1666                     ; Do a clock pulse :
1667                     ;   call slave_send {{ 0xfb }}  
1668 2fa 30fb            movlw 251
1669 2fb 00b7            movwf slave_send__data
1670 2fc 237e            call slave_send
1671                     ; if { slave_get {{ }} != 0 } start
1672 2fd 2378            call slave_get
1673 2fe 0836            movf slave_get__0return__byte,w
1674                     ; expression=`{ slave_get {{ }} != 0 }' exp_delay=0 true_delay=3  false_delay=0 true_size=5 false_size=0
1675 2ff 1903            btfsc z___byte,z___bit
1676 300 2b06            goto label580__0end
1677                     ; if { slave_get {{ }} != 0 } body start
1678                     ;   call master_fail {{ common_string , 0xca }}  
1679 301 301e            movlw LOW common_string+1
1680 302 00b1            movwf master_fail__test_name
1681 303 30ca            movlw 202
1682 304 00b2            movwf master_fail__test_number
1683 305 234e            call master_fail
1684                     ; if { slave_get {{ }} != 0 } body end
1685             label580__0end:
1686                     ; if exp=` slave_get ## {{ }} != 0 ' empty false
1687                     ; Other expression=`{ slave_get {{ }} != 0 }' delay=-1
1688                     ; if { slave_get {{ }} != 0 } end
1689                     ; Read clock :
1690                     ;   call slave_send {{ 0xfa }}  
1691 306 30fa            movlw 250
1692 307 00b7            movwf slave_send__data
1693 308 237e            call slave_send
1694                     ;   actual := slave_get {{ }}  
1695 309 2378            call slave_get
1696 30a 0836            movf slave_get__0return__byte,w
1697 30b 00aa            movwf common_test__actual
1698                     ; Increment :
1699                     ;   call slave_send {{ 0xf9 }}  
1700 30c 30f9            movlw 249
1701 30d 00b7            movwf slave_send__data
1702 30e 237e            call slave_send
1703                     ; Decrement :
1704                     ;   call slave_send {{ 0xf8 }}  
1705 30f 30f8            movlw 248
1706 310 00b7            movwf slave_send__data
1707 311 237e            call slave_send
1708                     ; Read clock again :
1709                     ;   call slave_send {{ 0xfa }}  
1710 312 30fa            movlw 250
1711 313 00b7            movwf slave_send__data
1712 314 237e            call slave_send
1713                     ; if { actual != slave_get {{ }} } start
1714 315 2378            call slave_get
1715 316 0836            movf slave_get__0return__byte,w
1716 317 022a            subwf common_test__actual,w
1717                     ; expression=`{ actual != slave_get {{ }} }' exp_delay=1 true_delay=3  false_delay=0 true_size=5 false_size=0
1718 318 1903            btfsc z___byte,z___bit
1719 319 2b1f            goto label592__0end
1720                     ; if { actual != slave_get {{ }} } body start
1721                     ;   call master_fail {{ common_string , 0xcb }}  
1722 31a 301e            movlw LOW common_string+1
1723 31b 00b1            movwf master_fail__test_name
1724 31c 30cb            movlw 203
1725 31d 00b2            movwf master_fail__test_number
1726 31e 234e            call master_fail
1727                     ; if { actual != slave_get {{ }} } body end
1728             label592__0end:
1729                     ; if exp=` actual != slave_get ## {{ }} ' empty false
1730                     ; Other expression=`{ actual != slave_get {{ }} }' delay=-1
1731                     ; if { actual != slave_get {{ }} } end
1732                     ; procedure common_test end
1733 31f 3400            retlw 0
1734             
1735                     ; procedure common_test_id_match start
1736             common_test_id_match:
1737     002c    common_test_id_match__variables__base equ global__variables__bank0+32
1738     002c    common_test_id_match__bytes__base equ common_test_id_match__variables__base+0
1739     002e    common_test_id_match__bits__base equ common_test_id_match__variables__base+2
1740     0002    common_test_id_match__total__bytes equ 2
1741     002c    common_test_id_match__desired equ common_test_id_match__bytes__base+0
1742     002d    common_test_id_match__test_number equ common_test_id_match__bytes__base+1
1743                     ; This procedure will verify that the next byte in the id is < desired > .
1744                     ; if { desired != common_test_id_next {{ }} } start
1745 320 2340            call common_test_id_next
1746 321 0830            movf common_test_id_next__0return__byte,w
1747 322 022c            subwf common_test_id_match__desired,w
1748                     ; expression=`{ desired != common_test_id_next {{ }} }' exp_delay=1 true_delay=3  false_delay=0 true_size=5 false_size=0
1749 323 1903            btfsc z___byte,z___bit
1750 324 2b2a            goto label604__0end
1751                     ; if { desired != common_test_id_next {{ }} } body start
1752                     ;   call master_fail {{ common_string , test_number }}  
1753 325 301e            movlw LOW common_string+1
1754 326 00b1            movwf master_fail__test_name
1755 327 082d            movf common_test_id_match__test_number,w
1756 328 00b2            movwf master_fail__test_number
1757 329 234e            call master_fail
1758                     ; if { desired != common_test_id_next {{ }} } body end
1759             label604__0end:
1760                     ; if exp=` desired != common_test_id_next ## {{ }} ' empty false
1761                     ; Other expression=`{ desired != common_test_id_next {{ }} }' delay=-1
1762                     ; if { desired != common_test_id_next {{ }} } end
1763                     ; procedure common_test_id_match end
1764 32a 3400            retlw 0
1765             
1766                     ; procedure common_test_id_bytes8 start
1767             common_test_id_bytes8:
1768     002e    common_test_id_bytes8__variables__base equ global__variables__bank0+34
1769     002e    common_test_id_bytes8__bytes__base equ common_test_id_bytes8__variables__base+0
1770     002f    common_test_id_bytes8__bits__base equ common_test_id_bytes8__variables__base+1
1771     0001    common_test_id_bytes8__total__bytes equ 1
1772                     ;   arguments_none  
1773                     ; This procedure will print out the next 8 bytes of the id in octal .
1774     002e    common_test_id_bytes8__count equ common_test_id_bytes8__bytes__base+0
1775                     ; `count_down count 8 ...' start
1776 32b 3008            movlw 8
1777 32c 00ae            movwf common_test_id_bytes8__count
1778             common_test_id_bytes8__617_loop:
1779                     ;   call master_octal {{ common_test_id_next {{ }} }}  
1780 32d 2340            call common_test_id_next
1781 32e 0830            movf common_test_id_next__0return__byte,w
1782 32f 00b4            movwf master_octal__number
1783 330 235f            call master_octal
1784 331 0bae            decfsz common_test_id_bytes8__count,f
1785 332 2b2d            goto common_test_id_bytes8__617_loop
1786             common_test_id_bytes8__617_done:
1787                     ; `count_down count 8 ...' end
1788                     ;   call master_crlf {{ }}  
1789 333 2347            call master_crlf
1790                     ; procedure common_test_id_bytes8 end
1791 334 3400            retlw 0
1792             
1793                     ; procedure common_test_id_string start
1794             common_test_id_string:
1795     002f    common_test_id_string__variables__base equ global__variables__bank0+35
1796     002f    common_test_id_string__bytes__base equ common_test_id_string__variables__base+0
1797     0030    common_test_id_string__bits__base equ common_test_id_string__variables__base+1
1798     0001    common_test_id_string__total__bytes equ 1
1799                     ;   arguments_none  
1800                     ; This procedure will print out the next id string .
1801     002f    common_test_id_string__count equ common_test_id_string__bytes__base+0
1802                     ; `count_down count  common_test_id_next ## {{ }}  ...' start
1803 335 2340            call common_test_id_next
1804 336 0830            movf common_test_id_next__0return__byte,w
1805 337 00af            movwf common_test_id_string__count
1806             common_test_id_string__631_loop:
1807                     ;   call master_send {{ common_test_id_next {{ }} }}  
1808 338 2340            call common_test_id_next
1809 339 0830            movf common_test_id_next__0return__byte,w
1810 33a 00c0            movwf master_send__character
1811 33b 23c4            call master_send
1812 33c 0baf            decfsz common_test_id_string__count,f
1813 33d 2b38            goto common_test_id_string__631_loop
1814             common_test_id_string__631_done:
1815                     ; `count_down count  common_test_id_next ## {{ }}  ...' end
1816                     ;   call master_crlf {{ }}  
1817 33e 2347            call master_crlf
1818                     ; procedure common_test_id_string end
1819 33f 3400            retlw 0
1820             
1821                     ; procedure common_test_id_next start
1822             common_test_id_next:
1823     0030    common_test_id_next__variables__base equ global__variables__bank0+36
1824     0030    common_test_id_next__bytes__base equ common_test_id_next__variables__base+0
1825     0031    common_test_id_next__bits__base equ common_test_id_next__variables__base+1
1826     0001    common_test_id_next__total__bytes equ 1
1827                     ;   arguments_none  
1828     0030    common_test_id_next__0return__byte equ common_test_id_next__bytes__base+0
1829                     ; This procedure returns the next byte from the identification string .
1830                     ;   call slave_send {{ 0xfc }}  
1831 340 30fc            movlw 252
1832 341 00b7            movwf slave_send__data
1833 342 237e            call slave_send
1834                     ;   return slave_get {{ }}  
1835 343 2378            call slave_get
1836 344 0836            movf slave_get__0return__byte,w
1837 345 00b0            movwf common_test_id_next__0return__byte
1838 346 3400            retlw 0
1839                     ; procedure common_test_id_next end
1840                     ; comment {The following procedures are used to communicate with the master :}
1841             
1842                     ; procedure master_crlf start
1843             master_crlf:
1844     0031    master_crlf__variables__base equ global__variables__bank0+37
1845     0031    master_crlf__bytes__base equ master_crlf__variables__base+0
1846     0031    master_crlf__bits__base equ master_crlf__variables__base+0
1847     0000    master_crlf__total__bytes equ 0
1848                     ;   arguments_none  
1849                     ; This procedure will output a carriage - return line - feed
1850                     ; to the master .
1851                     ;   call master_send {{ cr }}  
1852 347 300d            movlw 13
1853 348 00c0            movwf master_send__character
1854 349 23c4            call master_send
1855                     ;   call master_send {{ lf }}  
1856 34a 300a            movlw 10
1857 34b 00c0            movwf master_send__character
1858 34c 23c4            call master_send
1859                     ; procedure master_crlf end
1860 34d 3400            retlw 0
1861             
1862                     ; procedure master_fail start
1863             master_fail:
1864     0031    master_fail__variables__base equ global__variables__bank0+37
1865     0031    master_fail__bytes__base equ master_fail__variables__base+0
1866     0033    master_fail__bits__base equ master_fail__variables__base+2
1867     0002    master_fail__total__bytes equ 2
1868     0031    master_fail__test_name equ master_fail__bytes__base+0
1869     0032    master_fail__test_number equ master_fail__bytes__base+1
1870                     ; This procedure will output ` fail ' followed by a carriage return
1871                     ; and line feed .
1872                     ;   call master_string {{ fail_string }}  
1873 34e 302c            movlw LOW fail_string+1
1874 34f 00c1            movwf master_string__message
1875 350 23ca            call master_string
1876                     ;   call master_string {{ test_name }}  
1877 351 0831            movf master_fail__test_name,w
1878 352 00c1            movwf master_string__message
1879 353 23ca            call master_string
1880                     ;   call master_octal {{ test_number }}  
1881 354 0832            movf master_fail__test_number,w
1882 355 00b4            movwf master_octal__number
1883 356 235f            call master_octal
1884                     ;   call master_crlf {{ }}  
1885 357 2347            call master_crlf
1886                     ; procedure master_fail end
1887 358 3400            retlw 0
1888             
1889                     ; procedure master_get start
1890             master_get:
1891     0033    master_get__variables__base equ global__variables__bank0+39
1892     0033    master_get__bytes__base equ master_get__variables__base+0
1893     0034    master_get__bits__base equ master_get__variables__base+1
1894     0001    master_get__total__bytes equ 1
1895                     ;   arguments_none  
1896     0033    master_get__0return__byte equ master_get__bytes__base+0
1897                     ; This procedure will get the next byte or return 0xfc if
1898                     ; no byte is forthcoming .
1899                     ;   return get_byte {{ rx_master_mask }}  
1900 359 3008            movlw 8
1901 35a 00b8            movwf get_byte__mask
1902 35b 2384            call get_byte
1903 35c 0839            movf get_byte__0return__byte,w
1904 35d 00b3            movwf master_get__0return__byte
1905 35e 3400            retlw 0
1906                     ; procedure master_get end
1907             
1908                     ; procedure master_octal start
1909             master_octal:
1910     0034    master_octal__variables__base equ global__variables__bank0+40
1911     0034    master_octal__bytes__base equ master_octal__variables__base+0
1912     0036    master_octal__bits__base equ master_octal__variables__base+2
1913     0002    master_octal__total__bytes equ 2
1914     0035    master_octal__691byte0 equ master_octal__bytes__base+1
1915     0035    master_octal__692byte0 equ master_octal__bytes__base+1
1916     0034    master_octal__number equ master_octal__bytes__base+0
1917                     ; This procedure will output < number > in octal to the tx port .
1918                     ; Output the character in octal :
1919                     ;   call master_send {{ {{ number >> 6 }} + 0c'0' }}  
1920 35f 0e34            swapf master_octal__number,w
1921 360 00b5            movwf master_octal__691byte0
1922 361 0cb5            rrf master_octal__691byte0,f
1923 362 0c35            rrf master_octal__691byte0,w
1924 363 3903            andlw 3
1925 364 3e30            addlw 48
1926 365 00c0            movwf master_send__character
1927 366 23c4            call master_send
1928                     ;   call master_send {{ {{ {{ number >> 3 }} & 7 }} + 0c'0' }}  
1929 367 0c34            rrf master_octal__number,w
1930 368 00b5            movwf master_octal__692byte0
1931 369 0cb5            rrf master_octal__692byte0,f
1932 36a 0c35            rrf master_octal__692byte0,w
1933 36b 3907            andlw 7
1934 36c 3e30            addlw 48
1935 36d 00c0            movwf master_send__character
1936 36e 23c4            call master_send
1937                     ;   call master_send {{ {{ number & 7 }} + 0c'0' }}  
1938 36f 3007            movlw 7
1939 370 0534            andwf master_octal__number,w
1940 371 3e30            addlw 48
1941 372 00c0            movwf master_send__character
1942 373 23c4            call master_send
1943                     ;   call master_send {{ sp }}  
1944 374 3020            movlw 32
1945 375 00c0            movwf master_send__character
1946 376 23c4            call master_send
1947                     ; procedure master_octal end
1948 377 3400            retlw 0
1949             
1950                     ; procedure slave_get start
1951             slave_get:
1952     0036    slave_get__variables__base equ global__variables__bank0+42
1953     0036    slave_get__bytes__base equ slave_get__variables__base+0
1954     0037    slave_get__bits__base equ slave_get__variables__base+1
1955     0001    slave_get__total__bytes equ 1
1956                     ;   arguments_none  
1957     0036    slave_get__0return__byte equ slave_get__bytes__base+0
1958                     ; This procedure will get a byte from the slave or return 0xfc
1959                     ; if no byte is forthcoming .
1960                     ;   return get_byte {{ rx_slave_mask }}  
1961 378 3001            movlw 1
1962 379 00b8            movwf get_byte__mask
1963 37a 2384            call get_byte
1964 37b 0839            movf get_byte__0return__byte,w
1965 37c 00b6            movwf slave_get__0return__byte
1966 37d 3400            retlw 0
1967                     ; procedure slave_get end
1968             
1969                     ; procedure slave_send start
1970             slave_send:
1971     0037    slave_send__variables__base equ global__variables__bank0+43
1972     0037    slave_send__bytes__base equ slave_send__variables__base+0
1973     0038    slave_send__bits__base equ slave_send__variables__base+1
1974     0001    slave_send__total__bytes equ 1
1975     0037    slave_send__data equ slave_send__bytes__base+0
1976                     ; This procedure will send one byte of < data > to the slave .
1977                     ;   call send_byte {{ data , tx_slave_mask }}  
1978 37e 0837            movf slave_send__data,w
1979 37f 00bc            movwf send_byte__char
1980 380 3002            movlw 2
1981 381 00bd            movwf send_byte__mask
1982 382 23a9            call send_byte
1983                     ; procedure slave_send end
1984 383 3400            retlw 0
1985                     ; comment {The last procedures do character sending and receiving :}
1986             
1987                     ; procedure get_byte start
1988             get_byte:
1989     0038    get_byte__variables__base equ global__variables__bank0+44
1990     0038    get_byte__bytes__base equ get_byte__variables__base+0
1991     003c    get_byte__bits__base equ get_byte__variables__base+4
1992     0004    get_byte__total__bytes equ 4
1993     0038    get_byte__mask equ get_byte__bytes__base+0
1994     0039    get_byte__0return__byte equ get_byte__bytes__base+1
1995                     ; Get an 8 - bit byte from < mask > bit of < porta > and return it .
1996                     ; If no character shows up in a while 0xfc is returned .
1997     003a    get_byte__count equ get_byte__bytes__base+2
1998     003b    get_byte__char equ get_byte__bytes__base+3
1999                     ; Wait until a start bit arrives :
2000                     ;   count := 0  
2001 384 01ba            clrf get_byte__count
2002                     ; `while  porta & mask != 0  ...' start
2003             get_byte__730while__continue:
2004 385 0805            movf porta,w
2005 386 0538            andwf get_byte__mask,w
2006                     ; expression=` porta & mask != 0 ' exp_delay=2 true_delay=1  false_delay=2 true_size=9 false_size=1
2007 387 1903            btfsc z___byte,z___bit
2008 388 2b92            goto get_byte__730while__break
2009                     ;   count := count - 1  
2010 389 03ba            decf get_byte__count,f
2011                     ; if { count = 0 } start
2012 38a 083a            movf get_byte__count,w
2013                     ; expression=`{ count = 0 }' exp_delay=1 true_delay=3  false_delay=0 true_size=3 false_size=0
2014 38b 1d03            btfss z___byte,z___bit
2015 38c 2b90            goto label732__0end
2016                     ; if { count = 0 } body start
2017                     ;   return 0xfc  
2018 38d 30fc            movlw 252
2019 38e 00b9            movwf get_byte__0return__byte
2020 38f 3400            retlw 0
2021                     ; if { count = 0 } body end
2022             label732__0end:
2023                     ; if exp=` count = 0 ' empty false
2024                     ; Other expression=`{ count = 0 }' delay=-1
2025                     ; if { count = 0 } end
2026                     ;   call delay {{ }}  
2027 390 23dd            call delay
2028 391 2b85            goto get_byte__730while__continue
2029                     ; if exp=` porta & mask != 0 ' false goto
2030                     ; Other expression=` porta & mask != 0 ' delay=-1
2031             get_byte__730while__break:
2032                     ; `while  porta & mask != 0  ...' end
2033                     ; Skip over the start bit :
2034                     ;   call delay {{ }}  
2035 392 23dd            call delay
2036                     ;   call delay {{ }}  
2037 393 23dd            call delay
2038                     ;   call delay {{ }}  
2039 394 23dd            call delay
2040                     ; Sample in the middle third of each data bit :
2041                     ;   char := 0  
2042 395 01bb            clrf get_byte__char
2043                     ; `count_down count 8 ...' start
2044 396 3008            movlw 8
2045 397 00ba            movwf get_byte__count
2046             get_byte__745_loop:
2047                     ;   call delay {{ }}  
2048 398 23dd            call delay
2049                     ;   char := char >> 1  
2050 399 1003            bcf c___byte,c___bit
2051 39a 0cbb            rrf get_byte__char,f
2052                     ; if { porta & mask != 0 } start
2053 39b 0805            movf porta,w
2054 39c 0538            andwf get_byte__mask,w
2055                     ; expression=`{ porta & mask != 0 }' exp_delay=2 true_delay=2  false_delay=0 true_size=2 false_size=0
2056 39d 1903            btfsc z___byte,z___bit
2057 39e 2ba1            goto label748__0end
2058                     ; if { porta & mask != 0 } body start
2059                     ;   char := char | 0x80  
2060 39f 3080            movlw 128
2061 3a0 04bb            iorwf get_byte__char,f
2062                     ; if { porta & mask != 0 } body end
2063             label748__0end:
2064                     ; if exp=` porta & mask != 0 ' empty false
2065                     ; Other expression=`{ porta & mask != 0 }' delay=-1
2066                     ; if { porta & mask != 0 } end
2067                     ;   call delay {{ }}  
2068 3a1 23dd            call delay
2069                     ;   call delay {{ }}  
2070 3a2 23dd            call delay
2071 3a3 0bba            decfsz get_byte__count,f
2072 3a4 2b98            goto get_byte__745_loop
2073             get_byte__745_done:
2074                     ; `count_down count 8 ...' end
2075                     ; Skip over 1 / 3 of the stop bit :
2076                     ;   call delay {{ }}  
2077 3a5 23dd            call delay
2078                     ;   return char  
2079 3a6 083b            movf get_byte__char,w
2080 3a7 00b9            movwf get_byte__0return__byte
2081 3a8 3400            retlw 0
2082                     ; procedure get_byte end
2083             
2084                     ; procedure send_byte start
2085             send_byte:
2086     003c    send_byte__variables__base equ global__variables__bank0+48
2087     003c    send_byte__bytes__base equ send_byte__variables__base+0
2088     0040    send_byte__bits__base equ send_byte__variables__base+4
2089     0004    send_byte__total__bytes equ 4
2090     003c    send_byte__char equ send_byte__bytes__base+0
2091     003d    send_byte__mask equ send_byte__bytes__base+1
2092                     ; Send < char > to < mask > bit of < porta > .
2093     003e    send_byte__count equ send_byte__bytes__base+2
2094     003f    send_byte__mark equ send_byte__bytes__base+3
2095                     ; Send the start bit :
2096                     ;   mark := mask ^ space  
2097 3a9 30ff            movlw 255
2098 3aa 063d            xorwf send_byte__mask,w
2099 3ab 00bf            movwf send_byte__mark
2100                     ;   porta := mark  
2101 3ac 0085            movwf porta
2102                     ;   call delay {{ }}  
2103 3ad 23dd            call delay
2104                     ;   call delay {{ }}  
2105 3ae 23dd            call delay
2106                     ;   call delay {{ }}  
2107 3af 23dd            call delay
2108                     ; Send the data :
2109                     ; `count_down count 8 ...' start
2110 3b0 3008            movlw 8
2111 3b1 00be            movwf send_byte__count
2112             send_byte__780_loop:
2113                     ; if { char @ 0 } start
2114                     ; Alias variable for select char @ 0
2115     003c    send_byte__char__781select0 equ send_byte__char+0
2116     003c    send_byte__char__781select0__byte equ send_byte__char+0
2117     0000    send_byte__char__781select0__bit equ 0
2118                     ; expression=`{ char @ 0 }' exp_delay=0 true_delay=1  false_delay=1 true_size=1 false_size=1
2119 3b2 183c            btfsc send_byte__char__781select0__byte,send_byte__char__781select0__bit
2120                     ; if { char @ 0 } body start
2121                     ;   porta := space  
2122 3b3 30ff            movlw 255
2123                     ; 1 instructions found for sharing
2124 3b4 1c3c            btfss send_byte__char__781select0__byte,send_byte__char__781select0__bit
2125                     ; else body start
2126                     ;   porta := mark  
2127 3b5 083f            movf send_byte__mark,w
2128                     ; 1 instructions found for sharing
2129                     ; if exp=` char @ 0 ' single true and false skip delay=4
2130                     ; Other expression=`{ char @ 0 }' delay=4
2131                     ; 1 shared instructions follow
2132 3b6 0085            movwf porta
2133                     ; if { char @ 0 } end
2134                     ;   char := char >> 1  
2135 3b7 1003            bcf c___byte,c___bit
2136 3b8 0cbc            rrf send_byte__char,f
2137                     ;   call delay {{ }}  
2138 3b9 23dd            call delay
2139                     ;   call delay {{ }}  
2140 3ba 23dd            call delay
2141                     ;   call delay {{ }}  
2142 3bb 23dd            call delay
2143 3bc 0bbe            decfsz send_byte__count,f
2144 3bd 2bb2            goto send_byte__780_loop
2145             send_byte__780_done:
2146                     ; `count_down count 8 ...' end
2147                     ; Send the stop bit :
2148                     ;   porta := space  
2149 3be 30ff            movlw 255
2150 3bf 0085            movwf porta
2151                     ;   call delay {{ }}  
2152 3c0 23dd            call delay
2153                     ;   call delay {{ }}  
2154 3c1 23dd            call delay
2155                     ;   call delay {{ }}  
2156 3c2 23dd            call delay
2157                     ; procedure send_byte end
2158 3c3 3400            retlw 0
2159             
2160                     ; procedure master_send start
2161             master_send:
2162     0040    master_send__variables__base equ global__variables__bank0+52
2163     0040    master_send__bytes__base equ master_send__variables__base+0
2164     0041    master_send__bits__base equ master_send__variables__base+1
2165     0001    master_send__total__bytes equ 1
2166     0040    master_send__character equ master_send__bytes__base+0
2167                     ; This procedure will output < character > to the master .
2168                     ;   call send_byte {{ character , tx_master_mask }}  
2169 3c4 0840            movf master_send__character,w
2170 3c5 00bc            movwf send_byte__char
2171 3c6 3004            movlw 4
2172 3c7 00bd            movwf send_byte__mask
2173 3c8 23a9            call send_byte
2174                     ; procedure master_send end
2175 3c9 3400            retlw 0
2176             
2177                     ; procedure master_string start
2178             master_string:
2179     0041    master_string__variables__base equ global__variables__bank0+53
2180     0041    master_string__bytes__base equ master_string__variables__base+0
2181     0044    master_string__bits__base equ master_string__variables__base+3
2182     0003    master_string__total__bytes equ 3
2183     0041    master_string__message equ master_string__bytes__base+0
2184                     ; This procedure will output < message > to the master .
2185     0042    master_string__size equ master_string__bytes__base+1
2186     0043    master_string__index equ master_string__bytes__base+2
2187                     ;   index := 0  
2188 3ca 01c3            clrf master_string__index
2189                     ; `while  index < message . size  ...' start
2190             master_string__818while__continue:
2191 3cb 018a            clrf pclath___register
2192 3cc 0841            movf master_string__message,w
2193 3cd 200b            call string___fetch
2194 3ce 0243            subwf master_string__index,w
2195                     ; expression=` index < message . size ' exp_delay=4 true_delay=7  false_delay=2 true_size=8 false_size=1
2196 3cf 1803            btfsc c___byte,c___bit
2197 3d0 2bd9            goto master_string__818while__break
2198                     ;   call master_send {{ message ~~ {{ index }} }}  
2199 3d1 0a43            incf master_string__index,w
2200 3d2 0741            addwf master_string__message,w
2201 3d3 018a            clrf pclath___register
2202 3d4 200b            call string___fetch
2203 3d5 00c0            movwf master_send__character
2204 3d6 23c4            call master_send
2205                     ;   index := index + 1  
2206 3d7 0ac3            incf master_string__index,f
2207 3d8 2bcb            goto master_string__818while__continue
2208                     ; if exp=` index < message . size ' false goto
2209                     ; Other expression=` index < message . size ' delay=-1
2210             master_string__818while__break:
2211                     ; `while  index < message . size  ...' end
2212                     ;   call master_send {{ sp }}  
2213 3d9 3020            movlw 32
2214 3da 00c0            movwf master_send__character
2215 3db 23c4            call master_send
2216                     ; procedure master_string end
2217 3dc 3400            retlw 0
2218             
2219                     ; procedure delay start
2220                     ; optimize 0
2221             delay:
2222     0044    delay__variables__base equ global__variables__bank0+56
2223     0044    delay__bytes__base equ delay__variables__base+0
2224     0045    delay__bits__base equ delay__variables__base+1
2225     0001    delay__total__bytes equ 1
2226     0044    delay__825byte1 equ delay__bytes__base+0
2227                     ;   arguments_none  
2228                     ;   uniform_delay instructions_per_delay  
2229                     ; Uniform delay remaining = 134 Accumulated Delay = 0
2230                     ; Uniform delay remaining = 134 Accumulated Delay = 0
2231                     ; Delay 1 third of a bit :
2232                     ; Uniform delay remaining = 134 Accumulated Delay = 0
2233                     ; Uniform delay remaining = 134 Accumulated Delay = 0
2234                     ; Soak up remaining 134 cycles
2235                     ; Delay 134 cycles
2236 3dd 302c            movlw 44
2237 3de 00c4            movwf delay__825byte1
2238             delay__825delay0:
2239 3df 0bc4            decfsz delay__825byte1,f
2240 3e0 2bdf            goto delay__825delay0
2241 3e1 0000            nop
2242                     ; procedure delay end
2243 3e2 3400            retlw 0
2244                     ; optimize 1
2245             
2246                     ; Register bank 0 used 57 bytes of 68 available bytes
2247                     ; Register bank 1 used 0 bytes of 0 available bytes
2248             
2249                     end

