  1                     radix dec
  2     0020    global__variables__bank0 equ 32
  3     00a0    global__variables__bank1 equ 160
  4     0120    global__variables__bank2 equ 288
  5     01f0    global__variables__bank3 equ 496
  6     005c    global__bit__variables__bank0 equ 92
  7     00a0    global__bit__variables__bank1 equ 160
  8     0120    global__bit__variables__bank2 equ 288
  9     01f0    global__bit__variables__bank3 equ 496
 10     0000    indf___register equ 0
 11     0002    pcl___register equ 2
 12     0003    c___byte equ 3
 13     0000    c___bit equ 0
 14     0003    z___byte equ 3
 15     0002    z___bit equ 2
 16     0003    rp0___byte equ 3
 17     0005    rp0___bit equ 5
 18     0003    rp1___byte equ 3
 19     0006    rp1___bit equ 6
 20     0003    irp___byte equ 3
 21     0007    irp___bit equ 7
 22     0085    trisa___register equ 0x85
 23     0086    trisb___register equ 0x86
 24     0004    fsr___register equ 4
 25     000a    pclath___register equ 10
 26                     org 0
 27             start:
 28 000 0000            nop
 29 001 0000            nop
 30 002 0000            nop
 31 003 2805            goto skip___interrupt
 32             interrupt___vector:
 33 004 0009            retfie
 34             skip___interrupt:
 35                     ; Initialize A/D system to allow digital I/O
 36 005 3007            movlw 7
 37 006 009f            movwf 31
 38                     ; Switch from register bank 0 to register bank 1 (which contains 159)
 39 007 1683            bsf rp0___byte,rp0___bit
 40                     ; Register bank is now 1
 41 008 019f            clrf 159
 42                     ; Initialize TRIS registers
 43 009 30eb            movlw 235
 44 00a 0086            movwf trisb___register
 45 00b 018a            clrf pclath___register
 46                     ; Switch from register bank 1 to register bank 0
 47 00c 1283            bcf rp0___byte,rp0___bit
 48                     ; Register bank is now 0
 49 00d 285f            goto main
 50                     ; comment #############################################################################
 51                     ; comment {}
 52                     ; comment {Copyright < c > 1999 - 2001 by Wayne C . Gramlich .}
 53                     ; comment {All rights reserved .}
 54                     ; comment {}
 55                     ; comment {Permission to use , copy , modify , distribute , and sell this software}
 56                     ; comment {for any purpose is hereby granted without fee provided that the above}
 57                     ; comment {copyright notice and this permission are retained . The author makes}
 58                     ; comment {no representations about the suitability of this software for any purpose .}
 59                     ; comment {It is provided { as is } without express or implied warranty .}
 60                     ; comment {}
 61                     ; comment {This is a test harness for testing the LED10 RoboBrick . See :}
 62                     ; comment {}
 63                     ; comment {http : / / web . gramlich . net / projects / robobricks / led10 / index . html}
 64                     ; comment {}
 65                     ; comment {for more details .}
 66                     ; comment {}
 67                     ; comment #############################################################################
 68                     ;   processor pic16f628 cp = off cpd = off lvp = off bowden = off mclre = on pwrte = off wdte = off fosc = xt  
 69                     ; 16169=0x3f29 8199=0x2007
 70                     __config 16169
 71     2007    configuration___address equ 8199
 72                     ; comment {processor pic16f84 cp = off dp = off pwrte = disabled wdte = disabled fosc = xt}
 73                     ;   constant clock_rate 10000000  
 74     989680    clock_rate equ 10000000
 75                     ;   constant clock_ticks_per_instruction 4  
 76     0004    clock_ticks_per_instruction equ 4
 77                     ;   constant instructions_per_second clock_rate / clock_ticks_per_instruction  
 78     2625a0    instructions_per_second equ 2500000
 79                     ;   constant baud_rate 2400  
 80     0960    baud_rate equ 2400
 81                     ;   constant instructions_per_bit clock_rate / {{ clock_ticks_per_instruction * baud_rate }}  
 82     0411    instructions_per_bit equ 1041
 83                     ;   constant delays_per_bit 3  
 84     0003    delays_per_bit equ 3
 85                     ;   constant instructions_per_delay instructions_per_bit / delays_per_bit  
 86     015b    instructions_per_delay equ 347
 87                     ;   constant extra_instructions_per_bit 12  
 88     000c    extra_instructions_per_bit equ 12
 89                     ; comment {constant extra_instructions_per_bit 0}
 90                     ;   constant extra_instructions_per_delay extra_instructions_per_bit / delays_per_bit  
 91     0004    extra_instructions_per_delay equ 4
 92                     ;   constant delay_instructions instructions_per_delay - extra_instructions_per_delay  
 93     0157    delay_instructions equ 343
 94                     ; comment {The null pulse that comes back from a clock pulse command is supposed to be}
 95                     ; comment {exactly 9 bits long . 9 bits at 2400 baud is 9 / 2400 = 3 . 75 mS . The number}
 96                     ; comment {iterations through the loop is 3 . 75 mS / < number of instructions per iteration . >}
 97                     ;   constant nine_bits_instructions {{ clock_rate * 9 }} / {{ clock_ticks_per_instruction * baud_rate }}  
 98     249f    nine_bits_instructions equ 9375
 99                     ;   constant instructions_per_iteration 7  
100     0007    instructions_per_iteration equ 7
101                     ;   constant iterations_for_nine_bits nine_bits_instructions / instructions_per_iteration  
102     053b    iterations_for_nine_bits equ 1339
103                     ;   constant iterations_high iterations_for_nine_bits / 256  
104     0005    iterations_high equ 5
105                     ;   constant iterations_low iterations_for_nine_bits - {{ iterations_high * 256 }}  
106     003b    iterations_low equ 59
107                     ;   constant sp 32  
108     0020    sp equ 32
109                     ;   constant cr 13  
110     000d    cr equ 13
111                     ;   constant lf 10  
112     000a    lf equ 10
113                     ; comment {Some bit definitions :}
114                     ;   constant rx_slave_bit 5  
115     0005    rx_slave_bit equ 5
116                     ;   constant tx_slave_bit 4  
117     0004    tx_slave_bit equ 4
118                     ;   constant rx_master_bit 1  
119     0001    rx_master_bit equ 1
120                     ;   constant tx_master_bit 2  
121     0002    tx_master_bit equ 2
122                     ;   constant rx_slave_mask 1 << rx_slave_bit  
123     0020    rx_slave_mask equ 32
124                     ;   constant tx_slave_mask 1 << tx_slave_bit  
125     0010    tx_slave_mask equ 16
126                     ;   constant rx_master_mask 1 << rx_master_bit  
127     0002    rx_master_mask equ 2
128                     ;   constant tx_master_mask 1 << tx_master_bit  
129     0004    tx_master_mask equ 4
130     0003    status equ 3
131                     ;   bind c status @ 0  
132     0003    c equ status+0
133     0003    c__byte equ status+0
134     0000    c__bit equ 0
135                     ;   bind z status @ 2  
136     0003    z equ status+0
137     0003    z__byte equ status+0
138     0002    z__bit equ 2
139                     ; comment {Some port and pin definitions :}
140                     ; comment {port porta a unused none}
141     0006    portb equ 6
142     0006    tx_master_pin__byte equ 6
143     0002    tx_master_pin__bit equ 2
144     0006    rx_master_pin__byte equ 6
145     0001    rx_master_pin__bit equ 1
146     0006    tx_slave_pin__byte equ 6
147     0004    tx_slave_pin__bit equ 4
148     0006    rx_slave_pin__byte equ 6
149     0005    rx_slave_pin__bit equ 5
150                     ;   constant space 0xff  
151     00ff    space equ 255
152                     ;   constant buffer_size 5  
153     0005    buffer_size equ 5
154                     ; string_constants Start
155             string___fetch:
156 00e 0082            movwf pcl___register
157                     ;   bit_string = 0s'Bit'  
158     0000    bit_string___string equ 0
159             bit_string:
160 00f 0782            addwf pcl___register,f
161                     ; Length = 3
162 010 3403            retlw 3
163                     ; `Bit'
164 011 3442            retlw 66
165 012 3469            retlw 105
166 013 3474            retlw 116
167                     ;   blink_string = 0s'Blink'  
168     0005    blink_string___string equ 5
169             blink_string:
170 014 0782            addwf pcl___register,f
171                     ; Length = 5
172 015 3405            retlw 5
173                     ; `Blink'
174 016 3442            retlw 66
175 017 346c            retlw 108
176 018 3469            retlw 105
177 019 346e            retlw 110
178 01a 346b            retlw 107
179                     ;   clock_string = 0s'Clk'  
180     000c    clock_string___string equ 12
181             clock_string:
182 01b 0782            addwf pcl___register,f
183                     ; Length = 3
184 01c 3403            retlw 3
185                     ; `Clk'
186 01d 3443            retlw 67
187 01e 346c            retlw 108
188 01f 346b            retlw 107
189                     ;   common_string = 0s'Common'  
190     0011    common_string___string equ 17
191             common_string:
192 020 0782            addwf pcl___register,f
193                     ; Length = 6
194 021 3406            retlw 6
195                     ; `Common'
196 022 3443            retlw 67
197 023 346f            retlw 111
198 024 346d            retlw 109
199 025 346d            retlw 109
200 026 346f            retlw 111
201 027 346e            retlw 110
202                     ;   done_string = 0s'Done'  
203     0019    done_string___string equ 25
204             done_string:
205 028 0782            addwf pcl___register,f
206                     ; Length = 4
207 029 3404            retlw 4
208                     ; `Done'
209 02a 3444            retlw 68
210 02b 346f            retlw 111
211 02c 346e            retlw 110
212 02d 3465            retlw 101
213                     ;   fail_string = 0s'Fail'  
214     001f    fail_string___string equ 31
215             fail_string:
216 02e 0782            addwf pcl___register,f
217                     ; Length = 4
218 02f 3404            retlw 4
219                     ; `Fail'
220 030 3446            retlw 70
221 031 3461            retlw 97
222 032 3469            retlw 105
223 033 346c            retlw 108
224                     ;   hello_string = 0s'LED10_Test'  
225     0025    hello_string___string equ 37
226             hello_string:
227 034 0782            addwf pcl___register,f
228                     ; Length = 10
229 035 340a            retlw 10
230                     ; `LED10_Test'
231 036 344c            retlw 76
232 037 3445            retlw 69
233 038 3444            retlw 68
234 039 3431            retlw 49
235 03a 3430            retlw 48
236 03b 345f            retlw 95
237 03c 3454            retlw 84
238 03d 3465            retlw 101
239 03e 3473            retlw 115
240 03f 3474            retlw 116
241                     ;   patterns = 0 , 1 , 2 , 4 , 8 , 0x10 , 0x20 , 0x40 , 0x80 , 0xff , 0  
242     0031    patterns___string equ 49
243             patterns:
244 040 0782            addwf pcl___register,f
245                     ; Length = 11
246 041 340b            retlw 11
247                     ; 0
248 042 3400            retlw 0
249                     ; 1
250 043 3401            retlw 1
251                     ; 2
252 044 3402            retlw 2
253                     ; 4
254 045 3404            retlw 4
255                     ; 8
256 046 3408            retlw 8
257                     ; 0x10
258 047 3410            retlw 16
259                     ; 0x20
260 048 3420            retlw 32
261                     ; 0x40
262 049 3440            retlw 64
263                     ; 0x80
264 04a 3480            retlw 128
265                     ; 0xff
266 04b 34ff            retlw 255
267                     ; 0
268 04c 3400            retlw 0
269                     ;   ramps = 0 , 1 , 0x10 , 0x80 , 0xff  
270     003e    ramps___string equ 62
271             ramps:
272 04d 0782            addwf pcl___register,f
273                     ; Length = 5
274 04e 3405            retlw 5
275                     ; 0
276 04f 3400            retlw 0
277                     ; 1
278 050 3401            retlw 1
279                     ; 0x10
280 051 3410            retlw 16
281                     ; 0x80
282 052 3480            retlw 128
283                     ; 0xff
284 053 34ff            retlw 255
285                     ;   read_string = 0s'Read'  
286     0045    read_string___string equ 69
287             read_string:
288 054 0782            addwf pcl___register,f
289                     ; Length = 4
290 055 3404            retlw 4
291                     ; `Read'
292 056 3452            retlw 82
293 057 3465            retlw 101
294 058 3461            retlw 97
295 059 3464            retlw 100
296                     ;   register_string = 0s'Reg'  
297     004b    register_string___string equ 75
298             register_string:
299 05a 0782            addwf pcl___register,f
300                     ; Length = 3
301 05b 3403            retlw 3
302                     ; `Reg'
303 05c 3452            retlw 82
304 05d 3465            retlw 101
305 05e 3467            retlw 103
306                     ; string__constants End
307             
308                     ; procedure main start
309             main:
310     0020    main__variables__base equ global__variables__bank0+0
311     0020    main__bytes__base equ main__variables__base+0
312     002a    main__bits__base equ main__variables__base+10
313     000a    main__total__bytes equ 10
314     0029    main__117byte0 equ main__bytes__base+9
315     0029    main__145byte0 equ main__bytes__base+9
316                     ;   arguments_none  
317                     ; Read a byte .
318     0020    main__buffer equ main__bytes__base+0
319     0025    main__char equ main__bytes__base+5
320     0026    main__count equ main__bytes__base+6
321     0027    main__index equ main__bytes__base+7
322     0028    main__number equ main__bytes__base+8
323                     ; Print out a welcome message :
324                     ;   call master_crlf {{ }}  
325 05f 2388            call master_crlf
326                     ;   call master_string {{ hello_string }}  
327 060 3035            movlw LOW hello_string+1
328 061 00d8            movwf master_string__message
329 062 2419            call master_string
330                     ;   call master_crlf {{ }}  
331 063 2388            call master_crlf
332                     ; Main loop
333                     ;   number := 0  
334 064 01a8            clrf main__number
335                     ; loop_forever ... start
336             main__106loop__forever:
337                     ; Get a character :
338                     ;   tx_slave_pin := 1  
339 065 1606            bsf tx_slave_pin__byte,tx_slave_pin__bit
340                     ;   char := master_get {{ }}  
341 066 239a            call master_get
342 067 084a            movf master_get__0return__byte,w
343 068 00a5            movwf main__char
344                     ; Delay 1 / 3 ' s of bit make sure that get_byte is done .
345                     ;   call delay {{ }}  
346 069 242c            call delay
347                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } start
348 06a 3030            movlw 48
349 06b 0225            subwf main__char,w
350                     ; expression=`0c'0' <= char' exp_delay=2 true_delay=-1  false_delay=1 true_size=132 false_size=1
351 06c 1c03            btfss c___byte,c___bit
352 06d 287e            goto and114__0false
353 06e 303a            movlw 58
354 06f 0225            subwf main__char,w
355                     ; expression=`char < {{ 0c'9' + 1 }}' exp_delay=2 true_delay=9  false_delay=-1 true_size=11 false_size=116
356 070 1803            btfsc c___byte,c___bit
357 071 287e            goto label114__1false
358             label114__1true:
359             and114__0true:
360                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } body start
361                     ; Do a multiply by 8 then add in digit :
362                     ;   call master_send {{ char }}  
363 072 0825            movf main__char,w
364 073 00d7            movwf master_send__character
365 074 2413            call master_send
366                     ;   number := {{ number << 3 }} + char - 0c'0'  
367 075 0d28            rlf main__number,w
368 076 00a9            movwf main__117byte0
369 077 0da9            rlf main__117byte0,f
370 078 0d29            rlf main__117byte0,w
371 079 39f8            andlw 248
372 07a 0725            addwf main__char,w
373 07b 3ed0            addlw 208
374 07c 00a8            movwf main__number
375                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } body end
376 07d 28f2            goto label114__1end
377             label114__1false:
378             and114__0false:
379 07e 3073            movlw 115
380 07f 0225            subwf main__char,w
381                     ; expression=`{ char = 0c's' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=8 false_size=103
382 080 1d03            btfss z___byte,z___bit
383 081 288b            goto label118__0false
384             label118__0true:
385                     ; else_if { char = 0c's' } body start
386                     ; Send byte to brick , no wait :
387                     ; Echo command and send CRLF :
388                     ;   call master_send {{ char }}  
389 082 0825            movf main__char,w
390 083 00d7            movwf master_send__character
391 084 2413            call master_send
392                     ;   call master_crlf {{ }}  
393 085 2388            call master_crlf
394                     ; Ship the byte down to the brick :
395                     ;   call slave_send {{ number }}  
396 086 0828            movf main__number,w
397 087 00ce            movwf slave_send__data
398 088 23bf            call slave_send
399                     ;   number := 0  
400 089 01a8            clrf main__number
401                     ; else_if { char = 0c's' } body end
402 08a 28f2            goto label118__0end
403             label118__0false:
404 08b 3077            movlw 119
405 08c 0225            subwf main__char,w
406                     ; expression=`{ char = 0c'w' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=39 false_size=59
407 08d 1d03            btfss z___byte,z___bit
408 08e 28b7            goto label129__0false
409             label129__0true:
410                     ; else_if { char = 0c'w' } body start
411                     ; Send byte to brick , wait for results :
412                     ; Echo command and send CRLF :
413                     ;   call master_send {{ char }}  
414 08f 0825            movf main__char,w
415 090 00d7            movwf master_send__character
416 091 2413            call master_send
417                     ;   call master_crlf {{ }}  
418 092 2388            call master_crlf
419                     ; Ship the byte down to the brick ...
420                     ;   call slave_send {{ number }}  
421 093 0828            movf main__number,w
422 094 00ce            movwf slave_send__data
423 095 23bf            call slave_send
424                     ;   number := 0  
425 096 01a8            clrf main__number
426                     ; call delay < >
427                     ; ... and wait for a response :
428                     ;   index := 0  
429 097 01a7            clrf main__index
430                     ; `while  index < buffer_size  ...' start
431             main__144while__continue:
432 098 3005            movlw 5
433 099 0227            subwf main__index,w
434                     ; expression=` index < buffer_size ' exp_delay=2 true_delay=10  false_delay=2 true_size=11 false_size=1
435 09a 1803            btfsc c___byte,c___bit
436 09b 28a7            goto main__144while__break
437                     ;   buffer ~~ {{ index }} := slave_get {{ }}  
438 09c 23b9            call slave_get
439 09d 084d            movf slave_get__0return__byte,w
440 09e 00a9            movwf main__145byte0
441 09f 3020            movlw LOW main__buffer
442 0a0 0727            addwf main__index,w
443 0a1 0084            movwf fsr___register
444 0a2 0829            movf main__145byte0,w
445 0a3 1383            bcf irp___register,irp___bit
446 0a4 0080            movwf indf___register
447                     ;   index := index + 1  
448 0a5 0aa7            incf main__index,f
449 0a6 2898            goto main__144while__continue
450                     ; if exp=` index < buffer_size ' false goto
451                     ; Other expression=` index < buffer_size ' delay=-1
452             main__144while__break:
453                     ; `while  index < buffer_size  ...' end
454                     ;   index := 0  
455 0a7 01a7            clrf main__index
456                     ; `while  index < buffer_size  ...' start
457             main__150while__continue:
458 0a8 3005            movlw 5
459 0a9 0227            subwf main__index,w
460                     ; expression=` index < buffer_size ' exp_delay=2 true_delay=8  false_delay=2 true_size=9 false_size=1
461 0aa 1803            btfsc c___byte,c___bit
462 0ab 28b5            goto main__150while__break
463                     ;   call master_octal {{ buffer ~~ {{ index }} }}  
464 0ac 3020            movlw LOW main__buffer
465 0ad 0727            addwf main__index,w
466 0ae 0084            movwf fsr___register
467 0af 1383            bcf irp___register,irp___bit
468 0b0 0800            movf indf___register,w
469 0b1 00cb            movwf master_octal__number
470 0b2 23a0            call master_octal
471                     ;   index := index + 1  
472 0b3 0aa7            incf main__index,f
473 0b4 28a8            goto main__150while__continue
474                     ; if exp=` index < buffer_size ' false goto
475                     ; Other expression=` index < buffer_size ' delay=-1
476             main__150while__break:
477                     ; `while  index < buffer_size  ...' end
478                     ; Terminate the output list
479                     ;   call master_crlf {{ }}  
480 0b5 2388            call master_crlf
481                     ; else_if { char = 0c'w' } body end
482 0b6 28f2            goto label129__0end
483             label129__0false:
484 0b7 3069            movlw 105
485 0b8 0225            subwf main__char,w
486                     ; expression=`{ char = 0c'i' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=12 false_size=42
487 0b9 1d03            btfss z___byte,z___bit
488 0ba 28c8            goto label157__0false
489             label157__0true:
490                     ; else_if { char = 0c'i' } body start
491                     ; Interrogate the slave RoboBrick :
492                     ;   call master_send {{ char }}  
493 0bb 0825            movf main__char,w
494 0bc 00d7            movwf master_send__character
495 0bd 2413            call master_send
496                     ;   call master_crlf {{ }}  
497 0be 2388            call master_crlf
498                     ; Initialize the id index :
499                     ;   call slave_send {{ 0xfd }}  
500 0bf 30fd            movlw 253
501 0c0 00ce            movwf slave_send__data
502 0c1 23bf            call slave_send
503                     ; Get the first 8 bytes :
504                     ;   call common_test_id_bytes8 {{ }}  
505 0c2 236c            call common_test_id_bytes8
506                     ; Get the next 8 bytes of random numbers :
507                     ;   call common_test_id_bytes8 {{ }}  
508 0c3 236c            call common_test_id_bytes8
509                     ; Get the next 8 bytes of random numbers :
510                     ;   call common_test_id_bytes8 {{ }}  
511 0c4 236c            call common_test_id_bytes8
512                     ; Get the slave brick name :
513                     ;   call common_test_id_string {{ }}  
514 0c5 2376            call common_test_id_string
515                     ; Get the vendor name :
516                     ;   call common_test_id_string {{ }}  
517 0c6 2376            call common_test_id_string
518                     ; else_if { char = 0c'i' } body end
519 0c7 28f2            goto label157__0end
520             label157__0false:
521 0c8 3074            movlw 116
522 0c9 0225            subwf main__char,w
523                     ; expression=`{ char = 0c't' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=5 false_size=32
524 0ca 1d03            btfss z___byte,z___bit
525 0cb 28d2            goto label180__0false
526             label180__0true:
527                     ; else_if { char = 0c't' } body start
528                     ; Do testing :
529                     ;   call master_send {{ char }}  
530 0cc 0825            movf main__char,w
531 0cd 00d7            movwf master_send__character
532 0ce 2413            call master_send
533                     ;   call master_crlf {{ }}  
534 0cf 2388            call master_crlf
535                     ;   call test {{ }}  
536 0d0 2182            call test
537                     ; else_if { char = 0c't' } body end
538 0d1 28f2            goto label180__0end
539             label180__0false:
540 0d2 3063            movlw 99
541 0d3 0225            subwf main__char,w
542                     ; expression=`{ char = 0c'c' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=8 false_size=19
543 0d4 1d03            btfss z___byte,z___bit
544 0d5 28df            goto label185__0false
545             label185__0true:
546                     ; else_if { char = 0c'c' } body start
547                     ; Clock adjust :
548                     ;   call master_send {{ char }}  
549 0d6 0825            movf main__char,w
550 0d7 00d7            movwf master_send__character
551 0d8 2413            call master_send
552                     ;   call master_crlf {{ }}  
553 0d9 2388            call master_crlf
554                     ;   call clock_adjust {{ number }}  
555 0da 0828            movf main__number,w
556 0db 00aa            movwf clock_adjust__adjust
557 0dc 20f3            call clock_adjust
558                     ;   number := 0  
559 0dd 01a8            clrf main__number
560                     ; else_if { char = 0c'c' } body end
561 0de 28f2            goto label185__0end
562             label185__0false:
563 0df 30fc            movlw 252
564 0e0 0225            subwf main__char,w
565                     ; expression=`{ char != 0xfc }' exp_delay=2 true_delay=-1  false_delay=0 true_size=15 false_size=0
566 0e1 1903            btfsc z___byte,z___bit
567 0e2 28f2            goto label191__0end
568                     ; else_if { char != 0xfc } body start
569                     ; Just echo back the current number :
570                     ;   call master_send {{ 0c'<' }}  
571 0e3 303c            movlw 60
572 0e4 00d7            movwf master_send__character
573 0e5 2413            call master_send
574                     ;   call master_octal {{ char }}  
575 0e6 0825            movf main__char,w
576 0e7 00cb            movwf master_octal__number
577 0e8 23a0            call master_octal
578                     ;   call master_send {{ 0c'>' }}  
579 0e9 303e            movlw 62
580 0ea 00d7            movwf master_send__character
581 0eb 2413            call master_send
582                     ; Send a carriage - return line - feed :
583                     ;   call master_crlf {{ }}  
584 0ec 2388            call master_crlf
585                     ; Output the character in octal :
586                     ;   call master_octal {{ number }}  
587 0ed 0828            movf main__number,w
588 0ee 00cb            movwf master_octal__number
589 0ef 23a0            call master_octal
590                     ; Send a carriage - return line - feed :
591                     ;   call master_crlf {{ }}  
592 0f0 2388            call master_crlf
593                     ; Reset number
594                     ;   number := 0  
595 0f1 01a8            clrf main__number
596                     ; else_if { char != 0xfc } body end
597             label191__0end:
598                     ; if exp=` char != 0xfc ' empty false
599                     ; Other expression=`{ char != 0xfc }' delay=-1
600                     ; if exp=` char = 0c'c' ' generic
601             label185__0end:
602                     ; Other expression=`{ char = 0c'c' }' delay=-1
603                     ; if exp=` char = 0c't' ' generic
604             label180__0end:
605                     ; Other expression=`{ char = 0c't' }' delay=-1
606                     ; if exp=` char = 0c'i' ' generic
607             label157__0end:
608                     ; Other expression=`{ char = 0c'i' }' delay=-1
609                     ; if exp=` char = 0c'w' ' generic
610             label129__0end:
611                     ; Other expression=`{ char = 0c'w' }' delay=-1
612                     ; if exp=` char = 0c's' ' generic
613             label118__0end:
614                     ; Other expression=`{ char = 0c's' }' delay=-1
615                     ; if exp=`char < {{ 0c'9' + 1 }}' generic
616             label114__1end:
617                     ; Other expression=`char < {{ 0c'9' + 1 }}' delay=-1
618                     ; if exp=`0c'0' <= char' false goto
619                     ; Other expression=`0c'0' <= char' delay=-1
620             and114__0end:
621                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } end
622 0f2 2865            goto main__106loop__forever
623                     ; loop_forever ... end
624                     ; procedure main end
625             
626                     ; procedure clock_adjust start
627             clock_adjust:
628     002a    clock_adjust__variables__base equ global__variables__bank0+10
629     002a    clock_adjust__bytes__base equ clock_adjust__variables__base+0
630     0033    clock_adjust__bits__base equ clock_adjust__variables__base+9
631     0009    clock_adjust__total__bytes equ 9
632     0032    clock_adjust__269byte0 equ clock_adjust__bytes__base+8
633     0032    clock_adjust__283byte0 equ clock_adjust__bytes__base+8
634     0032    clock_adjust__279byte0 equ clock_adjust__bytes__base+8
635     0032    clock_adjust__227byte0 equ clock_adjust__bytes__base+8
636     002a    clock_adjust__adjust equ clock_adjust__bytes__base+0
637                     ; This procedure will adjust the clock to the slave .
638     002b    clock_adjust__command equ clock_adjust__bytes__base+1
639     002c    clock_adjust__count equ clock_adjust__bytes__base+2
640     002d    clock_adjust__error equ clock_adjust__bytes__base+3
641     002e    clock_adjust__error_minimum equ clock_adjust__bytes__base+4
642     002f    clock_adjust__high equ clock_adjust__bytes__base+5
643     0030    clock_adjust__low equ clock_adjust__bytes__base+6
644     0031    clock_adjust__target equ clock_adjust__bytes__base+7
645                     ;   target := iterations_low - adjust  
646 0f3 303b            movlw 59
647 0f4 00b2            movwf clock_adjust__227byte0
648 0f5 082a            movf clock_adjust__adjust,w
649 0f6 0232            subwf clock_adjust__227byte0,w
650 0f7 00b1            movwf clock_adjust__target
651                     ;   count := 2  
652 0f8 3002            movlw 2
653 0f9 00ac            movwf clock_adjust__count
654                     ;   error := 0xff  
655 0fa 30ff            movlw 255
656 0fb 00ad            movwf clock_adjust__error
657                     ;   error_minimum := 0xf0  
658 0fc 30f0            movlw 240
659 0fd 00ae            movwf clock_adjust__error_minimum
660                     ; Print out the target :
661                     ;   call master_send {{ 0c'T' }}  
662 0fe 3054            movlw 84
663 0ff 00d7            movwf master_send__character
664 100 2413            call master_send
665                     ;   call master_octal {{ iterations_high }}  
666 101 3005            movlw 5
667 102 00cb            movwf master_octal__number
668 103 23a0            call master_octal
669                     ;   call master_octal {{ target }}  
670 104 0831            movf clock_adjust__target,w
671 105 00cb            movwf master_octal__number
672 106 23a0            call master_octal
673                     ;   call master_crlf {{ }}  
674 107 2388            call master_crlf
675                     ; loop_forever ... start
676             clock_adjust__238loop__forever:
677                     ; Print out the clock value :
678                     ;   call master_send {{ 0c'C' }}  
679 108 3043            movlw 67
680 109 00d7            movwf master_send__character
681 10a 2413            call master_send
682                     ;   call slave_send {{ 0xfa }}  
683 10b 30fa            movlw 250
684 10c 00ce            movwf slave_send__data
685 10d 23bf            call slave_send
686                     ;   call master_octal {{ slave_get {{ }} }}  
687 10e 23b9            call slave_get
688 10f 084d            movf slave_get__0return__byte,w
689 110 00cb            movwf master_octal__number
690 111 23a0            call master_octal
691                     ; Ask for a timing byte :
692                     ;   call slave_send {{ 0xfb }}  
693 112 30fb            movlw 251
694 113 00ce            movwf slave_send__data
695 114 23bf            call slave_send
696                     ;   low := 0  
697 115 01b0            clrf clock_adjust__low
698                     ;   high := 0  
699 116 01af            clrf clock_adjust__high
700                     ; `while rx_slave_pin ...' start
701             clock_adjust__249while__continue:
702                     ; expression=`rx_slave_pin' exp_delay=0 true_delay=2  false_delay=2 true_size=1 false_size=1
703 117 1a86            btfsc rx_slave_pin__byte,rx_slave_pin__bit
704                     ; Do nothing :
705 118 2917            goto clock_adjust__249while__continue
706 119 291a            goto clock_adjust__249while__break
707                     ; if exp=`rx_slave_pin' true goto small true
708             clock_adjust__249while__break:
709                     ; `while rx_slave_pin ...' end
710                     ; `while  ! rx_slave_pin  ...' start
711             clock_adjust__252while__continue:
712                     ; expression=`rx_slave_pin' exp_delay=0 true_delay=2  false_delay=5 true_size=1 false_size=4
713 11a 1a86            btfsc rx_slave_pin__byte,rx_slave_pin__bit
714 11b 2920            goto clock_adjust__252while__break
715                     ;   low := low + 1  
716 11c 0ab0            incf clock_adjust__low,f
717                     ; if { z } start
718                     ; expression=`{ z }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
719 11d 1903            btfsc z__byte,z__bit
720                     ; if { z } body start
721                     ;   high := high + 1  
722 11e 0aaf            incf clock_adjust__high,f
723                     ; if { z } body end
724                     ; if exp=`z' false skip delay=2
725                     ; Other expression=`{ z }' delay=2
726                     ; if { z } end
727 11f 291a            goto clock_adjust__252while__continue
728                     ; if exp=`rx_slave_pin' true goto
729                     ; Other expression=`rx_slave_pin' delay=-1
730             clock_adjust__252while__break:
731                     ; `while  ! rx_slave_pin  ...' end
732                     ; Print out high and low :
733                     ;   call master_send {{ 0c'H' }}  
734 120 3048            movlw 72
735 121 00d7            movwf master_send__character
736 122 2413            call master_send
737                     ;   call master_octal {{ high }}  
738 123 082f            movf clock_adjust__high,w
739 124 00cb            movwf master_octal__number
740 125 23a0            call master_octal
741                     ;   call master_send {{ 0c'L' }}  
742 126 304c            movlw 76
743 127 00d7            movwf master_send__character
744 128 2413            call master_send
745                     ;   call master_octal {{ low }}  
746 129 0830            movf clock_adjust__low,w
747 12a 00cb            movwf master_octal__number
748 12b 23a0            call master_octal
749                     ; Now think about adjusting clock .
750                     ; if { high > iterations_high } start
751 12c 3006            movlw 6
752 12d 022f            subwf clock_adjust__high,w
753                     ; expression=`{ high > iterations_high }' exp_delay=2 true_delay=7  false_delay=-1 true_size=7 false_size=36
754 12e 1803            btfsc c___byte,c___bit
755 12f 2955            goto label266__0true
756             label266__0false:
757 130 3005            movlw 5
758 131 022f            subwf clock_adjust__high,w
759                     ; expression=`{ high < iterations_high }' exp_delay=2 true_delay=4  false_delay=-1 true_size=4 false_size=27
760 132 1c03            btfss c___byte,c___bit
761 133 2950            goto label270__0true
762             label270__0false:
763                     ; else body start
764                     ; The high 8 - bits are equal :
765                     ; if { low > target } start
766 134 0830            movf clock_adjust__low,w
767 135 0231            subwf clock_adjust__target,w
768                     ; expression=`{ low > target }' exp_delay=2 true_delay=7  false_delay=-1 true_size=7 false_size=15
769 136 1c03            btfss c___byte,c___bit
770 137 2948            goto label276__0true
771             label276__0false:
772 138 0831            movf clock_adjust__target,w
773 139 0230            subwf clock_adjust__low,w
774                     ; expression=`{ low < target }' exp_delay=2 true_delay=7  false_delay=3 true_size=7 false_size=3
775 13a 1c03            btfss c___byte,c___bit
776 13b 2940            goto label280__0true
777             label280__0false:
778                     ; else body start
779                     ; Exact match ; we are done :
780                     ;   command := 0  
781 13c 01ab            clrf clock_adjust__command
782                     ;   error := 0  
783 13d 01ad            clrf clock_adjust__error
784                     ;   error_minimum := 0  
785 13e 01ae            clrf clock_adjust__error_minimum
786                     ; else body end
787 13f 2947            goto label280__0end
788             label280__0true:
789                     ; else_if { low < target } body start
790                     ; Clock pulse is too short ; slave clock is too fast :
791                     ;   command := 0xf8  
792 140 30f8            movlw 248
793 141 00ab            movwf clock_adjust__command
794                     ;   error := target - low  
795 142 0831            movf clock_adjust__target,w
796 143 00b2            movwf clock_adjust__283byte0
797 144 0830            movf clock_adjust__low,w
798 145 0232            subwf clock_adjust__283byte0,w
799 146 00ad            movwf clock_adjust__error
800                     ; else_if { low < target } body end
801                     ; if exp=` low < target ' generic
802             label280__0end:
803                     ; Other expression=`{ low < target }' delay=-1
804 147 294f            goto label276__0end
805             label276__0true:
806                     ; if { low > target } body start
807                     ; Clock pulse is too long ; slave clock is too slow :
808                     ;   command := 0xf9  
809 148 30f9            movlw 249
810 149 00ab            movwf clock_adjust__command
811                     ;   error := low - target  
812 14a 0830            movf clock_adjust__low,w
813 14b 00b2            movwf clock_adjust__279byte0
814 14c 0831            movf clock_adjust__target,w
815 14d 0232            subwf clock_adjust__279byte0,w
816 14e 00ad            movwf clock_adjust__error
817                     ; if { low > target } body end
818                     ; if exp=` low > target ' generic
819             label276__0end:
820                     ; Other expression=`{ low > target }' delay=-1
821                     ; if { low > target } end
822                     ; else body end
823 14f 2954            goto label270__0end
824             label270__0true:
825                     ; else_if { high < iterations_high } body start
826                     ; Clock pulse is too short ; slave clock is too fast :
827                     ;   command := 0xf8  
828 150 30f8            movlw 248
829 151 00ab            movwf clock_adjust__command
830                     ;   error := target  
831 152 0831            movf clock_adjust__target,w
832 153 00ad            movwf clock_adjust__error
833                     ; else_if { high < iterations_high } body end
834                     ; if exp=` high < iterations_high ' generic
835             label270__0end:
836                     ; Other expression=`{ high < iterations_high }' delay=-1
837 154 295c            goto label266__0end
838             label266__0true:
839                     ; if { high > iterations_high } body start
840                     ; Clock pulse is too long ; slave clock is too slow :
841                     ;   command := 0xf9  
842 155 30f9            movlw 249
843 156 00ab            movwf clock_adjust__command
844                     ;   error := 0xff - target  
845 157 30ff            movlw 255
846 158 00b2            movwf clock_adjust__269byte0
847 159 0831            movf clock_adjust__target,w
848 15a 0232            subwf clock_adjust__269byte0,w
849 15b 00ad            movwf clock_adjust__error
850                     ; if { high > iterations_high } body end
851                     ; if exp=` high > iterations_high ' generic
852             label266__0end:
853                     ; Other expression=`{ high > iterations_high }' delay=-1
854                     ; if { high > iterations_high } end
855                     ; Print out the error and error minimum :
856                     ;   call master_send {{ 0c'E' }}  
857 15c 3045            movlw 69
858 15d 00d7            movwf master_send__character
859 15e 2413            call master_send
860                     ;   call master_octal {{ error }}  
861 15f 082d            movf clock_adjust__error,w
862 160 00cb            movwf master_octal__number
863 161 23a0            call master_octal
864                     ;   call master_send {{ 0c'M' }}  
865 162 304d            movlw 77
866 163 00d7            movwf master_send__character
867 164 2413            call master_send
868                     ;   call master_octal {{ error_minimum }}  
869 165 082e            movf clock_adjust__error_minimum,w
870 166 00cb            movwf master_octal__number
871 167 23a0            call master_octal
872                     ; if { error = error_minimum } start
873 168 082d            movf clock_adjust__error,w
874 169 022e            subwf clock_adjust__error_minimum,w
875                     ; expression=`{ error = error_minimum }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=2 false_size=14
876 16a 1d03            btfss z___byte,z___bit
877 16b 296f            goto label298__0false
878             label298__0true:
879                     ; if { error = error_minimum } body start
880                     ;   call master_crlf {{ }}  
881 16c 2388            call master_crlf
882                     ;   return  
883 16d 3400            retlw 0
884                     ; if { error = error_minimum } body end
885 16e 297d            goto label298__0end
886             label298__0false:
887 16f 082e            movf clock_adjust__error_minimum,w
888 170 022d            subwf clock_adjust__error,w
889                     ; expression=`{ error < error_minimum }' exp_delay=2 true_delay=3  false_delay=-1 true_size=3 false_size=6
890 171 1c03            btfss c___byte,c___bit
891 172 297a            goto label301__0true
892             label301__0false:
893                     ; else body start
894                     ;   count := count - 1  
895 173 03ac            decf clock_adjust__count,f
896                     ; if { z } start
897                     ; expression=`{ z }' exp_delay=0 true_delay=3  false_delay=0 true_size=3 false_size=0
898 174 1d03            btfss z__byte,z__bit
899 175 2979            goto label306__0end
900                     ; if { z } body start
901                     ;   error_minimum := error_minimum + 1  
902 176 0aae            incf clock_adjust__error_minimum,f
903                     ;   count := 2  
904 177 3002            movlw 2
905 178 00ac            movwf clock_adjust__count
906                     ; if { z } body end
907             label306__0end:
908                     ; if exp=`z' empty false
909                     ; Other expression=`{ z }' delay=-1
910                     ; if { z } end
911                     ; else body end
912 179 297d            goto label301__0end
913             label301__0true:
914                     ; else_if { error < error_minimum } body start
915                     ;   error_minimum := error  
916 17a 082d            movf clock_adjust__error,w
917 17b 00ae            movwf clock_adjust__error_minimum
918                     ;   error := error + 1  
919 17c 0aad            incf clock_adjust__error,f
920                     ; else_if { error < error_minimum } body end
921                     ; if exp=` error < error_minimum ' generic
922             label301__0end:
923                     ; Other expression=`{ error < error_minimum }' delay=-1
924                     ; if exp=` error = error_minimum ' generic
925             label298__0end:
926                     ; Other expression=`{ error = error_minimum }' delay=-1
927                     ; if { error = error_minimum } end
928                     ; Now adjust the clock :
929                     ;   call slave_send {{ command }}  
930 17d 082b            movf clock_adjust__command,w
931 17e 00ce            movwf slave_send__data
932 17f 23bf            call slave_send
933                     ;   call master_crlf {{ }}  
934 180 2388            call master_crlf
935 181 2908            goto clock_adjust__238loop__forever
936                     ; loop_forever ... end
937                     ; procedure clock_adjust end
938             
939                     ; procedure test start
940             test:
941     0033    test__variables__base equ global__variables__bank0+19
942     0033    test__bytes__base equ test__variables__base+0
943     0039    test__bits__base equ test__variables__base+6
944     0006    test__total__bytes equ 6
945     0038    test__421byte0 equ test__bytes__base+5
946     0038    test__416byte0 equ test__bytes__base+5
947                     ;   arguments_none  
948                     ; This procedure will test the LED10 RoboBrick :
949     0033    test__bit equ test__bytes__base+0
950     0034    test__high equ test__bytes__base+1
951     0035    test__level equ test__bytes__base+2
952     0036    test__low equ test__bytes__base+3
953     0037    test__temp equ test__bytes__base+4
954                     ; Verify that the common commands are working :
955                     ;   call common_test {{ }}  
956 182 22ec            call common_test
957                     ; Clear the LEDS :
958                     ;   call slave_send {{ 0 }}  
959 183 01ce            clrf slave_send__data
960 184 23bf            call slave_send
961                     ;   call slave_send {{ 0x20 }}  
962 185 3020            movlw 32
963 186 00ce            movwf slave_send__data
964 187 23bf            call slave_send
965                     ;   call test_prompt {{ 0 , 0 }}  
966 188 01bc            clrf test_prompt__high
967 189 01bd            clrf test_prompt__low
968 18a 22c1            call test_prompt
969                     ; Let ' s do some simple testing first :
970                     ;   high := 0  
971 18b 01b4            clrf test__high
972                     ;   low := 1  
973 18c 3001            movlw 1
974 18d 00b6            movwf test__low
975                     ; `while  ! {{ high @ 5 }}  ...' start
976             test__342while__continue:
977                     ; Alias variable for select high @ 5
978     0034    test__high__342select0 equ test__high+0
979     0034    test__high__342select0__byte equ test__high+0
980     0005    test__high__342select0__bit equ 5
981                     ; expression=`{{ high @ 5 }}' exp_delay=0 true_delay=2  false_delay=1 true_size=1 false_size=28
982 18e 1ab4            btfsc test__high__342select0__byte,test__high__342select0__bit
983 18f 29ac            goto test__342while__break
984                     ; Set the bits :
985                     ;   call slave_send {{ low }}  
986 190 0836            movf test__low,w
987 191 00ce            movwf slave_send__data
988 192 23bf            call slave_send
989                     ;   call slave_send {{ 0x20 | high }}  
990 193 3020            movlw 32
991 194 0434            iorwf test__high,w
992 195 00ce            movwf slave_send__data
993 196 23bf            call slave_send
994                     ;   call test_prompt {{ high , low }}  
995 197 0834            movf test__high,w
996 198 00bc            movwf test_prompt__high
997 199 0836            movf test__low,w
998 19a 00bd            movwf test_prompt__low
999 19b 22c1            call test_prompt
1000                     ;   call test_verify {{ high , low }}  
1001 19c 0834            movf test__high,w
1002 19d 00b9            movwf test_verify__high
1003 19e 0836            movf test__low,w
1004 19f 00ba            movwf test_verify__low
1005 1a0 229e            call test_verify
1006                     ; Go to next level :
1007                     ; if { low @ 4 } start
1008                     ; Alias variable for select low @ 4
1009     0036    test__low__350select0 equ test__low+0
1010     0036    test__low__350select0__byte equ test__low+0
1011     0004    test__low__350select0__bit equ 4
1012                     ; expression=`{ low @ 4 }' exp_delay=0 true_delay=3  false_delay=4 true_size=3 false_size=4
1013 1a1 1e36            btfss test__low__350select0__byte,test__low__350select0__bit
1014 1a2 29a7            goto label350__1false
1015             label350__1true:
1016                     ; if { low @ 4 } body start
1017                     ;   high := 1  
1018 1a3 3001            movlw 1
1019 1a4 00b4            movwf test__high
1020                     ;   low := 0  
1021 1a5 01b6            clrf test__low
1022                     ; if { low @ 4 } body end
1023 1a6 29ab            goto label350__1end
1024             label350__1false:
1025                     ; else body start
1026                     ;   high := high << 1  
1027 1a7 1003            bcf c___byte,c___bit
1028 1a8 0db4            rlf test__high,f
1029                     ;   low := low << 1  
1030 1a9 1003            bcf c___byte,c___bit
1031 1aa 0db6            rlf test__low,f
1032                     ; else body end
1033                     ; if exp=` low @ 4 ' generic
1034             label350__1end:
1035                     ; Other expression=`{ low @ 4 }' delay=-1
1036                     ; if { low @ 4 } end
1037 1ab 298e            goto test__342while__continue
1038                     ; if exp=` high @ 5 ' true goto
1039                     ; Other expression=`{{ high @ 5 }}' delay=-1
1040             test__342while__break:
1041                     ; `while  ! {{ high @ 5 }}  ...' end
1042                     ; Clear the high order bit :
1043                     ;   call slave_send {{ 0x20 }}  
1044 1ac 3020            movlw 32
1045 1ad 00ce            movwf slave_send__data
1046 1ae 23bf            call slave_send
1047                     ; Let ' s test out the bit twiddle commands :
1048                     ;   bit := 0  
1049 1af 01b3            clrf test__bit
1050                     ;   high := 0  
1051 1b0 01b4            clrf test__high
1052                     ;   low := 1  
1053 1b1 3001            movlw 1
1054 1b2 00b6            movwf test__low
1055                     ; `while  bit < 10  ...' start
1056             test__365while__continue:
1057 1b3 300a            movlw 10
1058 1b4 0233            subwf test__bit,w
1059                     ; expression=` bit < 10 ' exp_delay=2 true_delay=1  false_delay=2 true_size=80 false_size=1
1060 1b5 1803            btfsc c___byte,c___bit
1061 1b6 2a06            goto test__365while__break
1062                     ; Bit set :
1063                     ;   call slave_send {{ 0x50 | bit }}  
1064 1b7 3050            movlw 80
1065 1b8 0433            iorwf test__bit,w
1066 1b9 00ce            movwf slave_send__data
1067 1ba 23bf            call slave_send
1068                     ;   call test_verify {{ high , low }}  
1069 1bb 0834            movf test__high,w
1070 1bc 00b9            movwf test_verify__high
1071 1bd 0836            movf test__low,w
1072 1be 00ba            movwf test_verify__low
1073 1bf 229e            call test_verify
1074                     ; Read the bit :
1075                     ;   call slave_send {{ 0x70 | bit }}  
1076 1c0 3070            movlw 112
1077 1c1 0433            iorwf test__bit,w
1078 1c2 00ce            movwf slave_send__data
1079 1c3 23bf            call slave_send
1080                     ;   temp := slave_get {{ }}  
1081 1c4 23b9            call slave_get
1082 1c5 084d            movf slave_get__0return__byte,w
1083 1c6 00b7            movwf test__temp
1084                     ; if { temp != 1 } start
1085 1c7 0337            decf test__temp,w
1086                     ; expression=`{ temp != 1 }' exp_delay=1 true_delay=4  false_delay=0 true_size=8 false_size=0
1087 1c8 1903            btfsc z___byte,z___bit
1088 1c9 29d2            goto label373__0end
1089                     ; if { temp != 1 } body start
1090                     ;   call master_octal {{ temp }}  
1091 1ca 0837            movf test__temp,w
1092 1cb 00cb            movwf master_octal__number
1093 1cc 23a0            call master_octal
1094                     ;   call master_fail {{ bit_string , 0x30 }}  
1095 1cd 3010            movlw LOW bit_string+1
1096 1ce 00c8            movwf master_fail__test_name
1097 1cf 3030            movlw 48
1098 1d0 00c9            movwf master_fail__test_number
1099 1d1 238f            call master_fail
1100                     ; if { temp != 1 } body end
1101             label373__0end:
1102                     ; if exp=` temp != 1 ' empty false
1103                     ; Other expression=`{ temp != 1 }' delay=-1
1104                     ; if { temp != 1 } end
1105                     ; Bit clear :
1106                     ;   call slave_send {{ 0x40 | bit }}  
1107 1d2 3040            movlw 64
1108 1d3 0433            iorwf test__bit,w
1109 1d4 00ce            movwf slave_send__data
1110 1d5 23bf            call slave_send
1111                     ;   call test_verify {{ 0 , 0 }}  
1112 1d6 01b9            clrf test_verify__high
1113 1d7 01ba            clrf test_verify__low
1114 1d8 229e            call test_verify
1115                     ; Read the bit again :
1116                     ;   call slave_send {{ 0x70 | bit }}  
1117 1d9 3070            movlw 112
1118 1da 0433            iorwf test__bit,w
1119 1db 00ce            movwf slave_send__data
1120 1dc 23bf            call slave_send
1121                     ;   temp := slave_get {{ }}  
1122 1dd 23b9            call slave_get
1123 1de 084d            movf slave_get__0return__byte,w
1124 1df 00b7            movwf test__temp
1125                     ; if { temp != 0 } start
1126                     ; expression=`{ temp != 0 }' exp_delay=1 true_delay=4  false_delay=0 true_size=8 false_size=0
1127 1e0 1903            btfsc z___byte,z___bit
1128 1e1 29ea            goto label385__0end
1129                     ; if { temp != 0 } body start
1130                     ;   call master_octal {{ temp }}  
1131 1e2 0837            movf test__temp,w
1132 1e3 00cb            movwf master_octal__number
1133 1e4 23a0            call master_octal
1134                     ;   call master_fail {{ bit_string , 0x31 }}  
1135 1e5 3010            movlw LOW bit_string+1
1136 1e6 00c8            movwf master_fail__test_name
1137 1e7 3031            movlw 49
1138 1e8 00c9            movwf master_fail__test_number
1139 1e9 238f            call master_fail
1140                     ; if { temp != 0 } body end
1141             label385__0end:
1142                     ; if exp=` temp != 0 ' empty false
1143                     ; Other expression=`{ temp != 0 }' delay=-1
1144                     ; if { temp != 0 } end
1145                     ; Bit toggle :
1146                     ;   call slave_send {{ 0x60 | bit }}  
1147 1ea 3060            movlw 96
1148 1eb 0433            iorwf test__bit,w
1149 1ec 00ce            movwf slave_send__data
1150 1ed 23bf            call slave_send
1151                     ;   call test_verify {{ high , low }}  
1152 1ee 0834            movf test__high,w
1153 1ef 00b9            movwf test_verify__high
1154 1f0 0836            movf test__low,w
1155 1f1 00ba            movwf test_verify__low
1156 1f2 229e            call test_verify
1157                     ; Bit toggle again :
1158                     ;   call slave_send {{ 0x60 | bit }}  
1159 1f3 3060            movlw 96
1160 1f4 0433            iorwf test__bit,w
1161 1f5 00ce            movwf slave_send__data
1162 1f6 23bf            call slave_send
1163                     ;   call test_verify {{ 0 , 0 }}  
1164 1f7 01b9            clrf test_verify__high
1165 1f8 01ba            clrf test_verify__low
1166 1f9 229e            call test_verify
1167                     ; if { low @ 4 } start
1168                     ; Alias variable for select low @ 4
1169     0036    test__low__398select0 equ test__low+0
1170     0036    test__low__398select0__byte equ test__low+0
1171     0004    test__low__398select0__bit equ 4
1172                     ; expression=`{ low @ 4 }' exp_delay=0 true_delay=3  false_delay=4 true_size=3 false_size=4
1173 1fa 1e36            btfss test__low__398select0__byte,test__low__398select0__bit
1174 1fb 2a00            goto label398__1false
1175             label398__1true:
1176                     ; if { low @ 4 } body start
1177                     ;   high := 1  
1178 1fc 3001            movlw 1
1179 1fd 00b4            movwf test__high
1180                     ;   low := 0  
1181 1fe 01b6            clrf test__low
1182                     ; if { low @ 4 } body end
1183 1ff 2a04            goto label398__1end
1184             label398__1false:
1185                     ; else body start
1186                     ;   high := high << 1  
1187 200 1003            bcf c___byte,c___bit
1188 201 0db4            rlf test__high,f
1189                     ;   low := low << 1  
1190 202 1003            bcf c___byte,c___bit
1191 203 0db6            rlf test__low,f
1192                     ; else body end
1193                     ; if exp=` low @ 4 ' generic
1194             label398__1end:
1195                     ; Other expression=`{ low @ 4 }' delay=-1
1196                     ; if { low @ 4 } end
1197                     ;   bit := bit + 1  
1198 204 0ab3            incf test__bit,f
1199 205 29b3            goto test__365while__continue
1200                     ; if exp=` bit < 10 ' false goto
1201                     ; Other expression=` bit < 10 ' delay=-1
1202             test__365while__break:
1203                     ; `while  bit < 10  ...' end
1204                     ; Now do some blink rate tests :
1205                     ; First turn the bits on :
1206                     ;   call slave_send {{ 0x1f }}  
1207 206 301f            movlw 31
1208 207 00ce            movwf slave_send__data
1209 208 23bf            call slave_send
1210                     ;   call slave_send {{ 0x3f }}  
1211 209 303f            movlw 63
1212 20a 00ce            movwf slave_send__data
1213 20b 23bf            call slave_send
1214                     ;   bit := 0  
1215 20c 01b3            clrf test__bit
1216                     ; `while  bit < 10  ...' start
1217             test__413while__continue:
1218 20d 300a            movlw 10
1219 20e 0233            subwf test__bit,w
1220                     ; expression=` bit < 10 ' exp_delay=2 true_delay=1  false_delay=2 true_size=35 false_size=1
1221 20f 1803            btfsc c___byte,c___bit
1222 210 2a34            goto test__413while__break
1223                     ; Set the blink rate :
1224                     ;   call slave_send {{ 0x83 }}  
1225 211 3083            movlw 131
1226 212 00ce            movwf slave_send__data
1227 213 23bf            call slave_send
1228                     ;   call slave_send {{ {{ bit << 5 }} | bit }}  
1229 214 0e33            swapf test__bit,w
1230 215 00b8            movwf test__416byte0
1231 216 0d38            rlf test__416byte0,w
1232 217 39e0            andlw 224
1233 218 0433            iorwf test__bit,w
1234 219 00ce            movwf slave_send__data
1235 21a 23bf            call slave_send
1236                     ; Read the blink rate back :
1237                     ;   call slave_send {{ 0x70 | bit }}  
1238 21b 3070            movlw 112
1239 21c 0433            iorwf test__bit,w
1240 21d 00ce            movwf slave_send__data
1241 21e 23bf            call slave_send
1242                     ;   temp := slave_get {{ }}  
1243 21f 23b9            call slave_get
1244 220 084d            movf slave_get__0return__byte,w
1245 221 00b7            movwf test__temp
1246                     ; if { temp != {{ bit << 5 }} | 1 } start
1247 222 0e33            swapf test__bit,w
1248 223 00b8            movwf test__421byte0
1249 224 0d38            rlf test__421byte0,w
1250 225 39e0            andlw 224
1251 226 3801            iorlw 1
1252 227 0237            subwf test__temp,w
1253                     ; expression=`{ temp != {{ bit << 5 }} | 1 }' exp_delay=6 true_delay=4  false_delay=0 true_size=8 false_size=0
1254 228 1903            btfsc z___byte,z___bit
1255 229 2a32            goto label421__1end
1256                     ; if { temp != {{ bit << 5 }} | 1 } body start
1257                     ;   call master_octal {{ temp }}  
1258 22a 0837            movf test__temp,w
1259 22b 00cb            movwf master_octal__number
1260 22c 23a0            call master_octal
1261                     ;   call master_fail {{ blink_string , 0x32 }}  
1262 22d 3015            movlw LOW blink_string+1
1263 22e 00c8            movwf master_fail__test_name
1264 22f 3032            movlw 50
1265 230 00c9            movwf master_fail__test_number
1266 231 238f            call master_fail
1267                     ; if { temp != {{ bit << 5 }} | 1 } body end
1268             label421__1end:
1269                     ; if exp=` temp != {{ bit << 5 }} | 1 ' empty false
1270                     ; Other expression=`{ temp != {{ bit << 5 }} | 1 }' delay=-1
1271                     ; if { temp != {{ bit << 5 }} | 1 } end
1272                     ;   bit := bit + 1  
1273 232 0ab3            incf test__bit,f
1274 233 2a0d            goto test__413while__continue
1275                     ; if exp=` bit < 10 ' false goto
1276                     ; Other expression=` bit < 10 ' delay=-1
1277             test__413while__break:
1278                     ; `while  bit < 10  ...' end
1279                     ; Now turn the bits on and let them blink :
1280                     ;   call test_prompt {{ 0x1f , 0x1f }}  
1281 234 301f            movlw 31
1282 235 00bc            movwf test_prompt__high
1283 236 301f            movlw 31
1284 237 00bd            movwf test_prompt__low
1285 238 22c1            call test_prompt
1286                     ; Now clear the blink rates :
1287                     ;   bit := 0  
1288 239 01b3            clrf test__bit
1289                     ; `while  bit < 10  ...' start
1290             test__432while__continue:
1291 23a 300a            movlw 10
1292 23b 0233            subwf test__bit,w
1293                     ; expression=` bit < 10 ' exp_delay=2 true_delay=5  false_delay=2 true_size=8 false_size=1
1294 23c 1803            btfsc c___byte,c___bit
1295 23d 2a46            goto test__432while__break
1296                     ; Clear the blink rate :
1297                     ;   call slave_send {{ 0x83 }}  
1298 23e 3083            movlw 131
1299 23f 00ce            movwf slave_send__data
1300 240 23bf            call slave_send
1301                     ;   call slave_send {{ bit }}  
1302 241 0833            movf test__bit,w
1303 242 00ce            movwf slave_send__data
1304 243 23bf            call slave_send
1305                     ;   bit := bit + 1  
1306 244 0ab3            incf test__bit,f
1307 245 2a3a            goto test__432while__continue
1308                     ; if exp=` bit < 10 ' false goto
1309                     ; Other expression=` bit < 10 ' delay=-1
1310             test__432while__break:
1311                     ; `while  bit < 10  ...' end
1312                     ; Clear the bits :
1313                     ;   call slave_send {{ 0 }}  
1314 246 01ce            clrf slave_send__data
1315 247 23bf            call slave_send
1316                     ;   call slave_send {{ 0x20 }}  
1317 248 3020            movlw 32
1318 249 00ce            movwf slave_send__data
1319 24a 23bf            call slave_send
1320                     ; Now test increment :
1321                     ;   high := 0  
1322 24b 01b4            clrf test__high
1323                     ; `while  high < 0x20  ...' start
1324             test__444while__continue:
1325 24c 3020            movlw 32
1326 24d 0234            subwf test__high,w
1327                     ; expression=` high < 0x20 ' exp_delay=2 true_delay=1  false_delay=2 true_size=17 false_size=1
1328 24e 1803            btfsc c___byte,c___bit
1329 24f 2a61            goto test__444while__break
1330                     ;   low := 0  
1331 250 01b6            clrf test__low
1332                     ; `while  low < 0x20  ...' start
1333             test__446while__continue:
1334 251 3020            movlw 32
1335 252 0236            subwf test__low,w
1336                     ; expression=` low < 0x20 ' exp_delay=2 true_delay=7  false_delay=2 true_size=10 false_size=1
1337 253 1803            btfsc c___byte,c___bit
1338 254 2a5f            goto test__446while__break
1339                     ;   call test_verify {{ high , low }}  
1340 255 0834            movf test__high,w
1341 256 00b9            movwf test_verify__high
1342 257 0836            movf test__low,w
1343 258 00ba            movwf test_verify__low
1344 259 229e            call test_verify
1345                     ; Now increment the LED ' s :
1346                     ;   call slave_send {{ 0x90 }}  
1347 25a 3090            movlw 144
1348 25b 00ce            movwf slave_send__data
1349 25c 23bf            call slave_send
1350                     ;   low := low + 1  
1351 25d 0ab6            incf test__low,f
1352 25e 2a51            goto test__446while__continue
1353                     ; if exp=` low < 0x20 ' false goto
1354                     ; Other expression=` low < 0x20 ' delay=-1
1355             test__446while__break:
1356                     ; `while  low < 0x20  ...' end
1357                     ;   high := high + 1  
1358 25f 0ab4            incf test__high,f
1359 260 2a4c            goto test__444while__continue
1360                     ; if exp=` high < 0x20 ' false goto
1361                     ; Other expression=` high < 0x20 ' delay=-1
1362             test__444while__break:
1363                     ; `while  high < 0x20  ...' end
1364                     ; Now test decrement :
1365                     ;   high := 0x20  
1366 261 3020            movlw 32
1367 262 00b4            movwf test__high
1368                     ; `while  high != 0  ...' start
1369             test__458while__continue:
1370 263 0834            movf test__high,w
1371                     ; expression=` high != 0 ' exp_delay=1 true_delay=1  false_delay=2 true_size=17 false_size=1
1372 264 1903            btfsc z___byte,z___bit
1373 265 2a77            goto test__458while__break
1374                     ;   high := high - 1  
1375 266 03b4            decf test__high,f
1376                     ;   low := 0x20  
1377 267 3020            movlw 32
1378 268 00b6            movwf test__low
1379                     ; `while  low != 0  ...' start
1380             test__461while__continue:
1381 269 0836            movf test__low,w
1382                     ; expression=` low != 0 ' exp_delay=1 true_delay=7  false_delay=2 true_size=10 false_size=1
1383 26a 1903            btfsc z___byte,z___bit
1384 26b 2a76            goto test__461while__break
1385                     ;   low := low - 1  
1386 26c 03b6            decf test__low,f
1387                     ; Now decrement the LED ' s :
1388                     ;   call slave_send {{ 0xa0 }}  
1389 26d 30a0            movlw 160
1390 26e 00ce            movwf slave_send__data
1391 26f 23bf            call slave_send
1392                     ; Now verify :
1393                     ;   call test_verify {{ high , low }}  
1394 270 0834            movf test__high,w
1395 271 00b9            movwf test_verify__high
1396 272 0836            movf test__low,w
1397 273 00ba            movwf test_verify__low
1398 274 229e            call test_verify
1399 275 2a69            goto test__461while__continue
1400                     ; if exp=` low != 0 ' false goto
1401                     ; Other expression=` low != 0 ' delay=-1
1402             test__461while__break:
1403                     ; `while  low != 0  ...' end
1404 276 2a63            goto test__458while__continue
1405                     ; if exp=` high != 0 ' false goto
1406                     ; Other expression=` high != 0 ' delay=-1
1407             test__458while__break:
1408                     ; `while  high != 0  ...' end
1409                     ; Test power level :
1410                     ;   high := 0  
1411 277 01b4            clrf test__high
1412                     ;   low := 0  
1413 278 01b6            clrf test__low
1414                     ;   level := 0  
1415 279 01b5            clrf test__level
1416                     ; `while  level <= 10  ...' start
1417             test__475while__continue:
1418 27a 300b            movlw 11
1419 27b 0235            subwf test__level,w
1420                     ; expression=` level <= 10 ' exp_delay=2 true_delay=1  false_delay=2 true_size=22 false_size=1
1421 27c 1803            btfsc c___byte,c___bit
1422 27d 2a94            goto test__475while__break
1423                     ;   call slave_send {{ 0xb0 | level }}  
1424 27e 30b0            movlw 176
1425 27f 0435            iorwf test__level,w
1426 280 00ce            movwf slave_send__data
1427 281 23bf            call slave_send
1428                     ;   call test_verify {{ high , low }}  
1429 282 0834            movf test__high,w
1430 283 00b9            movwf test_verify__high
1431 284 0836            movf test__low,w
1432 285 00ba            movwf test_verify__low
1433 286 229e            call test_verify
1434                     ; if { low @ 4 } start
1435                     ; Alias variable for select low @ 4
1436     0036    test__low__478select0 equ test__low+0
1437     0036    test__low__478select0__byte equ test__low+0
1438     0004    test__low__478select0__bit equ 4
1439                     ; expression=`{ low @ 4 }' exp_delay=0 true_delay=4  false_delay=4 true_size=4 false_size=4
1440 287 1e36            btfss test__low__478select0__byte,test__low__478select0__bit
1441 288 2a8e            goto label478__1false
1442             label478__1true:
1443                     ; if { low @ 4 } body start
1444                     ;   high := {{ high << 1 }} | 1  
1445 289 1003            bcf c___byte,c___bit
1446 28a 0d34            rlf test__high,w
1447 28b 3801            iorlw 1
1448 28c 00b4            movwf test__high
1449                     ; if { low @ 4 } body end
1450 28d 2a92            goto label478__1end
1451             label478__1false:
1452                     ; else body start
1453                     ;   low := {{ low << 1 }} | 1  
1454 28e 1003            bcf c___byte,c___bit
1455 28f 0d36            rlf test__low,w
1456 290 3801            iorlw 1
1457 291 00b6            movwf test__low
1458                     ; else body end
1459                     ; if exp=` low @ 4 ' generic
1460             label478__1end:
1461                     ; Other expression=`{ low @ 4 }' delay=-1
1462                     ; if { low @ 4 } end
1463                     ;   level := level + 1  
1464 292 0ab5            incf test__level,f
1465 293 2a7a            goto test__475while__continue
1466                     ; if exp=` level <= 10 ' false goto
1467                     ; Other expression=` level <= 10 ' delay=-1
1468             test__475while__break:
1469                     ; `while  level <= 10  ...' end
1470                     ; Let ' s clear the LED ' s :
1471                     ;   call slave_send {{ 0 }}  
1472 294 01ce            clrf slave_send__data
1473 295 23bf            call slave_send
1474                     ;   call slave_send {{ 0x20 }}  
1475 296 3020            movlw 32
1476 297 00ce            movwf slave_send__data
1477 298 23bf            call slave_send
1478                     ; Announce that we are done :
1479                     ;   call master_string {{ done_string }}  
1480 299 3029            movlw LOW done_string+1
1481 29a 00d8            movwf master_string__message
1482 29b 2419            call master_string
1483                     ;   call master_crlf {{ }}  
1484 29c 2388            call master_crlf
1485                     ; procedure test end
1486 29d 3400            retlw 0
1487             
1488                     ; procedure test_verify start
1489             test_verify:
1490     0039    test_verify__variables__base equ global__variables__bank0+25
1491     0039    test_verify__bytes__base equ test_verify__variables__base+0
1492     003c    test_verify__bits__base equ test_verify__variables__base+3
1493     0003    test_verify__total__bytes equ 3
1494     0039    test_verify__high equ test_verify__bytes__base+0
1495     003a    test_verify__low equ test_verify__bytes__base+1
1496                     ; This procedure will verify that the registers contain high and low .
1497     003b    test_verify__temp equ test_verify__bytes__base+2
1498                     ; Read low register :
1499                     ;   call slave_send {{ 0x81 }}  
1500 29e 3081            movlw 129
1501 29f 00ce            movwf slave_send__data
1502 2a0 23bf            call slave_send
1503                     ;   temp := slave_get {{ }}  
1504 2a1 23b9            call slave_get
1505 2a2 084d            movf slave_get__0return__byte,w
1506 2a3 00bb            movwf test_verify__temp
1507                     ; if { temp != low } start
1508 2a4 023a            subwf test_verify__low,w
1509                     ; expression=`{ temp != low }' exp_delay=2 true_delay=3  false_delay=0 true_size=5 false_size=0
1510 2a5 1903            btfsc z___byte,z___bit
1511 2a6 2aac            goto label507__0end
1512                     ; if { temp != low } body start
1513                     ;   call master_fail {{ read_string , 0x50 }}  
1514 2a7 3055            movlw LOW read_string+1
1515 2a8 00c8            movwf master_fail__test_name
1516 2a9 3050            movlw 80
1517 2aa 00c9            movwf master_fail__test_number
1518 2ab 238f            call master_fail
1519                     ; if { temp != low } body end
1520             label507__0end:
1521                     ; if exp=` temp != low ' empty false
1522                     ; Other expression=`{ temp != low }' delay=-1
1523                     ; if { temp != low } end
1524                     ; Read high register :
1525                     ;   call slave_send {{ 0x82 }}  
1526 2ac 3082            movlw 130
1527 2ad 00ce            movwf slave_send__data
1528 2ae 23bf            call slave_send
1529                     ;   temp := slave_get {{ }}  
1530 2af 23b9            call slave_get
1531 2b0 084d            movf slave_get__0return__byte,w
1532 2b1 00bb            movwf test_verify__temp
1533                     ; if { temp != high } start
1534 2b2 0239            subwf test_verify__high,w
1535                     ; expression=`{ temp != high }' exp_delay=2 true_delay=5  false_delay=0 true_size=11 false_size=0
1536 2b3 1903            btfsc z___byte,z___bit
1537 2b4 2ac0            goto label514__0end
1538                     ; if { temp != high } body start
1539                     ;   call master_octal {{ temp }}  
1540 2b5 083b            movf test_verify__temp,w
1541 2b6 00cb            movwf master_octal__number
1542 2b7 23a0            call master_octal
1543                     ;   call master_octal {{ high }}  
1544 2b8 0839            movf test_verify__high,w
1545 2b9 00cb            movwf master_octal__number
1546 2ba 23a0            call master_octal
1547                     ;   call master_fail {{ read_string , 0x51 }}  
1548 2bb 3055            movlw LOW read_string+1
1549 2bc 00c8            movwf master_fail__test_name
1550 2bd 3051            movlw 81
1551 2be 00c9            movwf master_fail__test_number
1552 2bf 238f            call master_fail
1553                     ; if { temp != high } body end
1554             label514__0end:
1555                     ; if exp=` temp != high ' empty false
1556                     ; Other expression=`{ temp != high }' delay=-1
1557                     ; if { temp != high } end
1558                     ; procedure test_verify end
1559 2c0 3400            retlw 0
1560             
1561                     ; procedure test_prompt start
1562             test_prompt:
1563     003c    test_prompt__variables__base equ global__variables__bank0+28
1564     003c    test_prompt__bytes__base equ test_prompt__variables__base+0
1565     0041    test_prompt__bits__base equ test_prompt__variables__base+5
1566     0005    test_prompt__total__bytes equ 5
1567     0040    test_prompt__550byte0 equ test_prompt__bytes__base+4
1568     003c    test_prompt__high equ test_prompt__bytes__base+0
1569     003d    test_prompt__low equ test_prompt__bytes__base+1
1570                     ; This procedure will prompt the user to input a paticular pattern :
1571     003e    test_prompt__count equ test_prompt__bytes__base+2
1572     003f    test_prompt__char equ test_prompt__bytes__base+3
1573                     ; Print high order pattern :
1574                     ; `count_down count 5 ...' start
1575 2c1 3005            movlw 5
1576 2c2 00be            movwf test_prompt__count
1577             test_prompt__532_loop:
1578                     ;   char := 0c'.'  
1579 2c3 302e            movlw 46
1580 2c4 00bf            movwf test_prompt__char
1581                     ; if { high @ 4 } start
1582                     ; Alias variable for select high @ 4
1583     003c    test_prompt__high__534select0 equ test_prompt__high+0
1584     003c    test_prompt__high__534select0__byte equ test_prompt__high+0
1585     0004    test_prompt__high__534select0__bit equ 4
1586                     ; expression=`{ high @ 4 }' exp_delay=0 true_delay=2  false_delay=0 true_size=2 false_size=0
1587 2c5 1e3c            btfss test_prompt__high__534select0__byte,test_prompt__high__534select0__bit
1588 2c6 2ac9            goto label534__1end
1589                     ; if { high @ 4 } body start
1590                     ;   char := 0c'*'  
1591 2c7 302a            movlw 42
1592 2c8 00bf            movwf test_prompt__char
1593                     ; if { high @ 4 } body end
1594             label534__1end:
1595                     ; if exp=` high @ 4 ' empty false
1596                     ; Other expression=`{ high @ 4 }' delay=-1
1597                     ; if { high @ 4 } end
1598                     ;   call master_send {{ char }}  
1599 2c9 083f            movf test_prompt__char,w
1600 2ca 00d7            movwf master_send__character
1601 2cb 2413            call master_send
1602                     ;   high := high << 1  
1603 2cc 1003            bcf c___byte,c___bit
1604 2cd 0dbc            rlf test_prompt__high,f
1605 2ce 0bbe            decfsz test_prompt__count,f
1606 2cf 2ac3            goto test_prompt__532_loop
1607             test_prompt__532_done:
1608                     ; `count_down count 5 ...' end
1609                     ; `count_down count 5 ...' start
1610 2d0 3005            movlw 5
1611 2d1 00be            movwf test_prompt__count
1612             test_prompt__540_loop:
1613                     ;   char := 0c'.'  
1614 2d2 302e            movlw 46
1615 2d3 00bf            movwf test_prompt__char
1616                     ; if { low @ 4 } start
1617                     ; Alias variable for select low @ 4
1618     003d    test_prompt__low__542select0 equ test_prompt__low+0
1619     003d    test_prompt__low__542select0__byte equ test_prompt__low+0
1620     0004    test_prompt__low__542select0__bit equ 4
1621                     ; expression=`{ low @ 4 }' exp_delay=0 true_delay=2  false_delay=0 true_size=2 false_size=0
1622 2d4 1e3d            btfss test_prompt__low__542select0__byte,test_prompt__low__542select0__bit
1623 2d5 2ad8            goto label542__1end
1624                     ; if { low @ 4 } body start
1625                     ;   char := 0c'*'  
1626 2d6 302a            movlw 42
1627 2d7 00bf            movwf test_prompt__char
1628                     ; if { low @ 4 } body end
1629             label542__1end:
1630                     ; if exp=` low @ 4 ' empty false
1631                     ; Other expression=`{ low @ 4 }' delay=-1
1632                     ; if { low @ 4 } end
1633                     ;   call master_send {{ char }}  
1634 2d8 083f            movf test_prompt__char,w
1635 2d9 00d7            movwf master_send__character
1636 2da 2413            call master_send
1637                     ;   low := low << 1  
1638 2db 1003            bcf c___byte,c___bit
1639 2dc 0dbd            rlf test_prompt__low,f
1640 2dd 0bbe            decfsz test_prompt__count,f
1641 2de 2ad2            goto test_prompt__540_loop
1642             test_prompt__540_done:
1643                     ; `count_down count 5 ...' end
1644                     ;   call master_send {{ 0c':' }}  
1645 2df 303a            movlw 58
1646 2e0 00d7            movwf master_send__character
1647 2e1 2413            call master_send
1648                     ; `while  master_get ## {{ }} = 0xfc  ...' start
1649             test_prompt__550while__continue:
1650 2e2 239a            call master_get
1651 2e3 084a            movf master_get__0return__byte,w
1652 2e4 00c0            movwf test_prompt__550byte0
1653 2e5 30fc            movlw 252
1654 2e6 0240            subwf test_prompt__550byte0,w
1655                     ; expression=` master_get ## {{ }} = 0xfc ' exp_delay=3 true_delay=2  false_delay=2 true_size=1 false_size=1
1656 2e7 1903            btfsc z___byte,z___bit
1657                     ; Do nothing :
1658 2e8 2ae2            goto test_prompt__550while__continue
1659 2e9 2aea            goto test_prompt__550while__break
1660                     ; if exp=` master_get ## {{ }} = 0xfc ' true goto small true
1661             test_prompt__550while__break:
1662                     ; `while  master_get ## {{ }} = 0xfc  ...' end
1663                     ;   call master_crlf {{ }}  
1664 2ea 2388            call master_crlf
1665                     ; procedure test_prompt end
1666 2eb 3400            retlw 0
1667                     ; comment {The procedures below are used to test the common shared commands :}
1668             
1669                     ; procedure common_test start
1670             common_test:
1671     0041    common_test__variables__base equ global__variables__bank0+33
1672     0041    common_test__bytes__base equ common_test__variables__base+0
1673     0043    common_test__bits__base equ common_test__variables__base+2
1674     0002    common_test__total__bytes equ 2
1675     0042    common_test__601byte0 equ common_test__bytes__base+1
1676                     ;   arguments_none  
1677                     ; This procedure will verify that the common shared commands work .
1678     0041    common_test__actual equ common_test__bytes__base+0
1679                     ; Print the ID information :
1680                     ; ID reset :
1681                     ;   call slave_send {{ 0xfd }}  
1682 2ec 30fd            movlw 253
1683 2ed 00ce            movwf slave_send__data
1684 2ee 23bf            call slave_send
1685                     ; Read the fixed bytes :
1686                     ;   call common_test_id_match {{ 1 , 0xc0 }}  
1687 2ef 3001            movlw 1
1688 2f0 00c3            movwf common_test_id_match__desired
1689 2f1 30c0            movlw 192
1690 2f2 00c4            movwf common_test_id_match__test_number
1691 2f3 2361            call common_test_id_match
1692                     ;   call common_test_id_match {{ 0 , 0xc1 }}  
1693 2f4 01c3            clrf common_test_id_match__desired
1694 2f5 30c1            movlw 193
1695 2f6 00c4            movwf common_test_id_match__test_number
1696 2f7 2361            call common_test_id_match
1697                     ;   call common_test_id_match {{ 9 , 0xc2 }}  
1698 2f8 3009            movlw 9
1699 2f9 00c3            movwf common_test_id_match__desired
1700 2fa 30c2            movlw 194
1701 2fb 00c4            movwf common_test_id_match__test_number
1702 2fc 2361            call common_test_id_match
1703                     ;   call common_test_id_match {{ 0 , 0xc3 }}  
1704 2fd 01c3            clrf common_test_id_match__desired
1705 2fe 30c3            movlw 195
1706 2ff 00c4            movwf common_test_id_match__test_number
1707 300 2361            call common_test_id_match
1708                     ;   call common_test_id_match {{ 0 , 0xc4 }}  
1709 301 01c3            clrf common_test_id_match__desired
1710 302 30c4            movlw 196
1711 303 00c4            movwf common_test_id_match__test_number
1712 304 2361            call common_test_id_match
1713                     ;   call common_test_id_match {{ 0 , 0xc5 }}  
1714 305 01c3            clrf common_test_id_match__desired
1715 306 30c5            movlw 197
1716 307 00c4            movwf common_test_id_match__test_number
1717 308 2361            call common_test_id_match
1718                     ;   call common_test_id_match {{ 0 , 0xc6 }}  
1719 309 01c3            clrf common_test_id_match__desired
1720 30a 30c6            movlw 198
1721 30b 00c4            movwf common_test_id_match__test_number
1722 30c 2361            call common_test_id_match
1723                     ;   call common_test_id_match {{ 0 , 0xc7 }}  
1724 30d 01c3            clrf common_test_id_match__desired
1725 30e 30c7            movlw 199
1726 30f 00c4            movwf common_test_id_match__test_number
1727 310 2361            call common_test_id_match
1728                     ;   call master_crlf {{ }}  
1729 311 2388            call master_crlf
1730                     ;   call common_test_id_bytes8 {{ }}  
1731 312 236c            call common_test_id_bytes8
1732                     ;   call common_test_id_bytes8 {{ }}  
1733 313 236c            call common_test_id_bytes8
1734                     ; Read the brick name :
1735                     ;   call common_test_id_string {{ }}  
1736 314 2376            call common_test_id_string
1737                     ; Read the vendor name :
1738                     ;   call common_test_id_string {{ }}  
1739 315 2376            call common_test_id_string
1740                     ; Verfify that we don ' t read off the end of the id and crash :
1741                     ;   call common_test_id_next {{ }}  
1742 316 2381            call common_test_id_next
1743 317 0847            movf common_test_id_next__0return__byte,w
1744                     ; Reset id :
1745                     ;   call slave_send {{ 0xfd }}  
1746 318 30fd            movlw 253
1747 319 00ce            movwf slave_send__data
1748 31a 23bf            call slave_send
1749                     ; Verify that we are still alive :
1750                     ;   call common_test_id_match {{ 1 , 0xc8 }}  
1751 31b 3001            movlw 1
1752 31c 00c3            movwf common_test_id_match__desired
1753 31d 30c8            movlw 200
1754 31e 00c4            movwf common_test_id_match__test_number
1755 31f 2361            call common_test_id_match
1756                     ; Read glitch :
1757                     ; Clear glitch register :
1758                     ;   call slave_send {{ 0xfe }}  
1759 320 30fe            movlw 254
1760 321 00ce            movwf slave_send__data
1761 322 23bf            call slave_send
1762                     ;   actual := slave_get {{ }}  
1763 323 23b9            call slave_get
1764 324 084d            movf slave_get__0return__byte,w
1765 325 00c1            movwf common_test__actual
1766                     ; Send a couple of glitches :
1767                     ;   call slave_send {{ 0xff }}  
1768 326 30ff            movlw 255
1769 327 00ce            movwf slave_send__data
1770 328 23bf            call slave_send
1771                     ;   call slave_send {{ 0xff }}  
1772 329 30ff            movlw 255
1773 32a 00ce            movwf slave_send__data
1774 32b 23bf            call slave_send
1775                     ; Read the glitch register :
1776                     ;   call slave_send {{ 0xfe }}  
1777 32c 30fe            movlw 254
1778 32d 00ce            movwf slave_send__data
1779 32e 23bf            call slave_send
1780                     ; if { slave_get {{ }} != 2 } start
1781 32f 23b9            call slave_get
1782 330 084d            movf slave_get__0return__byte,w
1783 331 00c2            movwf common_test__601byte0
1784 332 3002            movlw 2
1785 333 0242            subwf common_test__601byte0,w
1786                     ; expression=`{ slave_get {{ }} != 2 }' exp_delay=3 true_delay=3  false_delay=0 true_size=5 false_size=0
1787 334 1903            btfsc z___byte,z___bit
1788 335 2b3b            goto label601__1end
1789                     ; if { slave_get {{ }} != 2 } body start
1790                     ;   call master_fail {{ common_string , 0xc9 }}  
1791 336 3021            movlw LOW common_string+1
1792 337 00c8            movwf master_fail__test_name
1793 338 30c9            movlw 201
1794 339 00c9            movwf master_fail__test_number
1795 33a 238f            call master_fail
1796                     ; if { slave_get {{ }} != 2 } body end
1797             label601__1end:
1798                     ; if exp=` slave_get ## {{ }} != 2 ' empty false
1799                     ; Other expression=`{ slave_get {{ }} != 2 }' delay=-1
1800                     ; if { slave_get {{ }} != 2 } end
1801                     ; Do a clock pulse :
1802                     ;   call slave_send {{ 0xfb }}  
1803 33b 30fb            movlw 251
1804 33c 00ce            movwf slave_send__data
1805 33d 23bf            call slave_send
1806                     ; if { slave_get {{ }} != 0 } start
1807 33e 23b9            call slave_get
1808 33f 084d            movf slave_get__0return__byte,w
1809                     ; expression=`{ slave_get {{ }} != 0 }' exp_delay=0 true_delay=3  false_delay=0 true_size=5 false_size=0
1810 340 1903            btfsc z___byte,z___bit
1811 341 2b47            goto label607__0end
1812                     ; if { slave_get {{ }} != 0 } body start
1813                     ;   call master_fail {{ common_string , 0xca }}  
1814 342 3021            movlw LOW common_string+1
1815 343 00c8            movwf master_fail__test_name
1816 344 30ca            movlw 202
1817 345 00c9            movwf master_fail__test_number
1818 346 238f            call master_fail
1819                     ; if { slave_get {{ }} != 0 } body end
1820             label607__0end:
1821                     ; if exp=` slave_get ## {{ }} != 0 ' empty false
1822                     ; Other expression=`{ slave_get {{ }} != 0 }' delay=-1
1823                     ; if { slave_get {{ }} != 0 } end
1824                     ; Read clock :
1825                     ;   call slave_send {{ 0xfa }}  
1826 347 30fa            movlw 250
1827 348 00ce            movwf slave_send__data
1828 349 23bf            call slave_send
1829                     ;   actual := slave_get {{ }}  
1830 34a 23b9            call slave_get
1831 34b 084d            movf slave_get__0return__byte,w
1832 34c 00c1            movwf common_test__actual
1833                     ; Increment :
1834                     ;   call slave_send {{ 0xf9 }}  
1835 34d 30f9            movlw 249
1836 34e 00ce            movwf slave_send__data
1837 34f 23bf            call slave_send
1838                     ; Decrement :
1839                     ;   call slave_send {{ 0xf8 }}  
1840 350 30f8            movlw 248
1841 351 00ce            movwf slave_send__data
1842 352 23bf            call slave_send
1843                     ; Read clock again :
1844                     ;   call slave_send {{ 0xfa }}  
1845 353 30fa            movlw 250
1846 354 00ce            movwf slave_send__data
1847 355 23bf            call slave_send
1848                     ; if { actual != slave_get {{ }} } start
1849 356 23b9            call slave_get
1850 357 084d            movf slave_get__0return__byte,w
1851 358 0241            subwf common_test__actual,w
1852                     ; expression=`{ actual != slave_get {{ }} }' exp_delay=1 true_delay=3  false_delay=0 true_size=5 false_size=0
1853 359 1903            btfsc z___byte,z___bit
1854 35a 2b60            goto label619__0end
1855                     ; if { actual != slave_get {{ }} } body start
1856                     ;   call master_fail {{ common_string , 0xcb }}  
1857 35b 3021            movlw LOW common_string+1
1858 35c 00c8            movwf master_fail__test_name
1859 35d 30cb            movlw 203
1860 35e 00c9            movwf master_fail__test_number
1861 35f 238f            call master_fail
1862                     ; if { actual != slave_get {{ }} } body end
1863             label619__0end:
1864                     ; if exp=` actual != slave_get ## {{ }} ' empty false
1865                     ; Other expression=`{ actual != slave_get {{ }} }' delay=-1
1866                     ; if { actual != slave_get {{ }} } end
1867                     ; procedure common_test end
1868 360 3400            retlw 0
1869             
1870                     ; procedure common_test_id_match start
1871             common_test_id_match:
1872     0043    common_test_id_match__variables__base equ global__variables__bank0+35
1873     0043    common_test_id_match__bytes__base equ common_test_id_match__variables__base+0
1874     0045    common_test_id_match__bits__base equ common_test_id_match__variables__base+2
1875     0002    common_test_id_match__total__bytes equ 2
1876     0043    common_test_id_match__desired equ common_test_id_match__bytes__base+0
1877     0044    common_test_id_match__test_number equ common_test_id_match__bytes__base+1
1878                     ; This procedure will verify that the next byte in the id is < desired > .
1879                     ; if { desired != common_test_id_next {{ }} } start
1880 361 2381            call common_test_id_next
1881 362 0847            movf common_test_id_next__0return__byte,w
1882 363 0243            subwf common_test_id_match__desired,w
1883                     ; expression=`{ desired != common_test_id_next {{ }} }' exp_delay=1 true_delay=3  false_delay=0 true_size=5 false_size=0
1884 364 1903            btfsc z___byte,z___bit
1885 365 2b6b            goto label631__0end
1886                     ; if { desired != common_test_id_next {{ }} } body start
1887                     ;   call master_fail {{ common_string , test_number }}  
1888 366 3021            movlw LOW common_string+1
1889 367 00c8            movwf master_fail__test_name
1890 368 0844            movf common_test_id_match__test_number,w
1891 369 00c9            movwf master_fail__test_number
1892 36a 238f            call master_fail
1893                     ; if { desired != common_test_id_next {{ }} } body end
1894             label631__0end:
1895                     ; if exp=` desired != common_test_id_next ## {{ }} ' empty false
1896                     ; Other expression=`{ desired != common_test_id_next {{ }} }' delay=-1
1897                     ; if { desired != common_test_id_next {{ }} } end
1898                     ; procedure common_test_id_match end
1899 36b 3400            retlw 0
1900             
1901                     ; procedure common_test_id_bytes8 start
1902             common_test_id_bytes8:
1903     0045    common_test_id_bytes8__variables__base equ global__variables__bank0+37
1904     0045    common_test_id_bytes8__bytes__base equ common_test_id_bytes8__variables__base+0
1905     0046    common_test_id_bytes8__bits__base equ common_test_id_bytes8__variables__base+1
1906     0001    common_test_id_bytes8__total__bytes equ 1
1907                     ;   arguments_none  
1908                     ; This procedure will print out the next 8 bytes of the id in octal .
1909     0045    common_test_id_bytes8__count equ common_test_id_bytes8__bytes__base+0
1910                     ; `count_down count 8 ...' start
1911 36c 3008            movlw 8
1912 36d 00c5            movwf common_test_id_bytes8__count
1913             common_test_id_bytes8__644_loop:
1914                     ;   call master_octal {{ common_test_id_next {{ }} }}  
1915 36e 2381            call common_test_id_next
1916 36f 0847            movf common_test_id_next__0return__byte,w
1917 370 00cb            movwf master_octal__number
1918 371 23a0            call master_octal
1919 372 0bc5            decfsz common_test_id_bytes8__count,f
1920 373 2b6e            goto common_test_id_bytes8__644_loop
1921             common_test_id_bytes8__644_done:
1922                     ; `count_down count 8 ...' end
1923                     ;   call master_crlf {{ }}  
1924 374 2388            call master_crlf
1925                     ; procedure common_test_id_bytes8 end
1926 375 3400            retlw 0
1927             
1928                     ; procedure common_test_id_string start
1929             common_test_id_string:
1930     0046    common_test_id_string__variables__base equ global__variables__bank0+38
1931     0046    common_test_id_string__bytes__base equ common_test_id_string__variables__base+0
1932     0047    common_test_id_string__bits__base equ common_test_id_string__variables__base+1
1933     0001    common_test_id_string__total__bytes equ 1
1934                     ;   arguments_none  
1935                     ; This procedure will print out the next id string .
1936     0046    common_test_id_string__count equ common_test_id_string__bytes__base+0
1937                     ; `count_down count  common_test_id_next ## {{ }}  ...' start
1938 376 2381            call common_test_id_next
1939 377 0847            movf common_test_id_next__0return__byte,w
1940 378 00c6            movwf common_test_id_string__count
1941             common_test_id_string__658_loop:
1942                     ;   call master_send {{ common_test_id_next {{ }} }}  
1943 379 2381            call common_test_id_next
1944 37a 0847            movf common_test_id_next__0return__byte,w
1945 37b 00d7            movwf master_send__character
1946 37c 2413            call master_send
1947 37d 0bc6            decfsz common_test_id_string__count,f
1948 37e 2b79            goto common_test_id_string__658_loop
1949             common_test_id_string__658_done:
1950                     ; `count_down count  common_test_id_next ## {{ }}  ...' end
1951                     ;   call master_crlf {{ }}  
1952 37f 2388            call master_crlf
1953                     ; procedure common_test_id_string end
1954 380 3400            retlw 0
1955             
1956                     ; procedure common_test_id_next start
1957             common_test_id_next:
1958     0047    common_test_id_next__variables__base equ global__variables__bank0+39
1959     0047    common_test_id_next__bytes__base equ common_test_id_next__variables__base+0
1960     0048    common_test_id_next__bits__base equ common_test_id_next__variables__base+1
1961     0001    common_test_id_next__total__bytes equ 1
1962                     ;   arguments_none  
1963     0047    common_test_id_next__0return__byte equ common_test_id_next__bytes__base+0
1964                     ; This procedure returns the next byte from the identification string .
1965                     ;   call slave_send {{ 0xfc }}  
1966 381 30fc            movlw 252
1967 382 00ce            movwf slave_send__data
1968 383 23bf            call slave_send
1969                     ;   return slave_get {{ }}  
1970 384 23b9            call slave_get
1971 385 084d            movf slave_get__0return__byte,w
1972 386 00c7            movwf common_test_id_next__0return__byte
1973 387 3400            retlw 0
1974                     ; procedure common_test_id_next end
1975                     ; comment {The following procedures are used to communicate with the master :}
1976             
1977                     ; procedure master_crlf start
1978             master_crlf:
1979     0048    master_crlf__variables__base equ global__variables__bank0+40
1980     0048    master_crlf__bytes__base equ master_crlf__variables__base+0
1981     0048    master_crlf__bits__base equ master_crlf__variables__base+0
1982     0000    master_crlf__total__bytes equ 0
1983                     ;   arguments_none  
1984                     ; This procedure will output a carriage - return line - feed
1985                     ; to the master .
1986                     ;   call master_send {{ cr }}  
1987 388 300d            movlw 13
1988 389 00d7            movwf master_send__character
1989 38a 2413            call master_send
1990                     ;   call master_send {{ lf }}  
1991 38b 300a            movlw 10
1992 38c 00d7            movwf master_send__character
1993 38d 2413            call master_send
1994                     ; procedure master_crlf end
1995 38e 3400            retlw 0
1996             
1997                     ; procedure master_fail start
1998             master_fail:
1999     0048    master_fail__variables__base equ global__variables__bank0+40
2000     0048    master_fail__bytes__base equ master_fail__variables__base+0
2001     004a    master_fail__bits__base equ master_fail__variables__base+2
2002     0002    master_fail__total__bytes equ 2
2003     0048    master_fail__test_name equ master_fail__bytes__base+0
2004     0049    master_fail__test_number equ master_fail__bytes__base+1
2005                     ; This procedure will output ` fail ' followed by a carriage return
2006                     ; and line feed .
2007                     ;   call master_string {{ fail_string }}  
2008 38f 302f            movlw LOW fail_string+1
2009 390 00d8            movwf master_string__message
2010 391 2419            call master_string
2011                     ;   call master_string {{ test_name }}  
2012 392 0848            movf master_fail__test_name,w
2013 393 00d8            movwf master_string__message
2014 394 2419            call master_string
2015                     ;   call master_octal {{ test_number }}  
2016 395 0849            movf master_fail__test_number,w
2017 396 00cb            movwf master_octal__number
2018 397 23a0            call master_octal
2019                     ;   call master_crlf {{ }}  
2020 398 2388            call master_crlf
2021                     ; procedure master_fail end
2022 399 3400            retlw 0
2023             
2024                     ; procedure master_get start
2025             master_get:
2026     004a    master_get__variables__base equ global__variables__bank0+42
2027     004a    master_get__bytes__base equ master_get__variables__base+0
2028     004b    master_get__bits__base equ master_get__variables__base+1
2029     0001    master_get__total__bytes equ 1
2030                     ;   arguments_none  
2031     004a    master_get__0return__byte equ master_get__bytes__base+0
2032                     ; This procedure will get the next byte or return 0xfc if
2033                     ; no byte is forthcoming .
2034                     ;   return get_byte {{ rx_master_mask }}  
2035 39a 3002            movlw 2
2036 39b 00cf            movwf get_byte__mask
2037 39c 23c5            call get_byte
2038 39d 0850            movf get_byte__0return__byte,w
2039 39e 00ca            movwf master_get__0return__byte
2040 39f 3400            retlw 0
2041                     ; procedure master_get end
2042             
2043                     ; procedure master_octal start
2044             master_octal:
2045     004b    master_octal__variables__base equ global__variables__bank0+43
2046     004b    master_octal__bytes__base equ master_octal__variables__base+0
2047     004d    master_octal__bits__base equ master_octal__variables__base+2
2048     0002    master_octal__total__bytes equ 2
2049     004c    master_octal__718byte0 equ master_octal__bytes__base+1
2050     004c    master_octal__719byte0 equ master_octal__bytes__base+1
2051     004b    master_octal__number equ master_octal__bytes__base+0
2052                     ; This procedure will output < number > in octal to the tx port .
2053                     ; Output the character in octal :
2054                     ;   call master_send {{ {{ number >> 6 }} + 0c'0' }}  
2055 3a0 0e4b            swapf master_octal__number,w
2056 3a1 00cc            movwf master_octal__718byte0
2057 3a2 0ccc            rrf master_octal__718byte0,f
2058 3a3 0c4c            rrf master_octal__718byte0,w
2059 3a4 3903            andlw 3
2060 3a5 3e30            addlw 48
2061 3a6 00d7            movwf master_send__character
2062 3a7 2413            call master_send
2063                     ;   call master_send {{ {{ {{ number >> 3 }} & 7 }} + 0c'0' }}  
2064 3a8 0c4b            rrf master_octal__number,w
2065 3a9 00cc            movwf master_octal__719byte0
2066 3aa 0ccc            rrf master_octal__719byte0,f
2067 3ab 0c4c            rrf master_octal__719byte0,w
2068 3ac 3907            andlw 7
2069 3ad 3e30            addlw 48
2070 3ae 00d7            movwf master_send__character
2071 3af 2413            call master_send
2072                     ;   call master_send {{ {{ number & 7 }} + 0c'0' }}  
2073 3b0 3007            movlw 7
2074 3b1 054b            andwf master_octal__number,w
2075 3b2 3e30            addlw 48
2076 3b3 00d7            movwf master_send__character
2077 3b4 2413            call master_send
2078                     ;   call master_send {{ sp }}  
2079 3b5 3020            movlw 32
2080 3b6 00d7            movwf master_send__character
2081 3b7 2413            call master_send
2082                     ; procedure master_octal end
2083 3b8 3400            retlw 0
2084             
2085                     ; procedure slave_get start
2086             slave_get:
2087     004d    slave_get__variables__base equ global__variables__bank0+45
2088     004d    slave_get__bytes__base equ slave_get__variables__base+0
2089     004e    slave_get__bits__base equ slave_get__variables__base+1
2090     0001    slave_get__total__bytes equ 1
2091                     ;   arguments_none  
2092     004d    slave_get__0return__byte equ slave_get__bytes__base+0
2093                     ; This procedure will get a byte from the slave or return 0xfc
2094                     ; if no byte is forthcoming .
2095                     ;   return get_byte {{ rx_slave_mask }}  
2096 3b9 3020            movlw 32
2097 3ba 00cf            movwf get_byte__mask
2098 3bb 23c5            call get_byte
2099 3bc 0850            movf get_byte__0return__byte,w
2100 3bd 00cd            movwf slave_get__0return__byte
2101 3be 3400            retlw 0
2102                     ; procedure slave_get end
2103             
2104                     ; procedure slave_send start
2105             slave_send:
2106     004e    slave_send__variables__base equ global__variables__bank0+46
2107     004e    slave_send__bytes__base equ slave_send__variables__base+0
2108     004f    slave_send__bits__base equ slave_send__variables__base+1
2109     0001    slave_send__total__bytes equ 1
2110     004e    slave_send__data equ slave_send__bytes__base+0
2111                     ; This procedure will send one byte of < data > to the slave .
2112                     ;   call send_byte {{ data , tx_slave_mask }}  
2113 3bf 084e            movf slave_send__data,w
2114 3c0 00d3            movwf send_byte__char
2115 3c1 3010            movlw 16
2116 3c2 00d4            movwf send_byte__mask
2117 3c3 23ed            call send_byte
2118                     ; procedure slave_send end
2119 3c4 3400            retlw 0
2120                     ; comment {The last procedures do character sending and receiving :}
2121             
2122                     ; procedure get_byte start
2123             get_byte:
2124     004f    get_byte__variables__base equ global__variables__bank0+47
2125     004f    get_byte__bytes__base equ get_byte__variables__base+0
2126     0053    get_byte__bits__base equ get_byte__variables__base+4
2127     0004    get_byte__total__bytes equ 4
2128     004f    get_byte__mask equ get_byte__bytes__base+0
2129     0050    get_byte__0return__byte equ get_byte__bytes__base+1
2130                     ; Get an 8 - bit byte from < mask > bit of < portb > and return it .
2131                     ; If no character shows up in a while 0xfc is returned .
2132     0051    get_byte__count equ get_byte__bytes__base+2
2133     0052    get_byte__char equ get_byte__bytes__base+3
2134                     ; Wait until a start bit arrives :
2135                     ;   count := 0  
2136 3c5 01d1            clrf get_byte__count
2137                     ; `while  portb & mask != 0  ...' start
2138             get_byte__757while__continue:
2139 3c6 0806            movf portb,w
2140 3c7 054f            andwf get_byte__mask,w
2141                     ; expression=` portb & mask != 0 ' exp_delay=2 true_delay=1  false_delay=2 true_size=9 false_size=1
2142 3c8 1903            btfsc z___byte,z___bit
2143 3c9 2bd3            goto get_byte__757while__break
2144                     ;   count := count - 1  
2145 3ca 03d1            decf get_byte__count,f
2146                     ; if { count = 0 } start
2147 3cb 0851            movf get_byte__count,w
2148                     ; expression=`{ count = 0 }' exp_delay=1 true_delay=3  false_delay=0 true_size=3 false_size=0
2149 3cc 1d03            btfss z___byte,z___bit
2150 3cd 2bd1            goto label759__0end
2151                     ; if { count = 0 } body start
2152                     ;   return 0xfc  
2153 3ce 30fc            movlw 252
2154 3cf 00d0            movwf get_byte__0return__byte
2155 3d0 3400            retlw 0
2156                     ; if { count = 0 } body end
2157             label759__0end:
2158                     ; if exp=` count = 0 ' empty false
2159                     ; Other expression=`{ count = 0 }' delay=-1
2160                     ; if { count = 0 } end
2161                     ;   call delay {{ }}  
2162 3d1 242c            call delay
2163 3d2 2bc6            goto get_byte__757while__continue
2164                     ; if exp=` portb & mask != 0 ' false goto
2165                     ; Other expression=` portb & mask != 0 ' delay=-1
2166             get_byte__757while__break:
2167                     ; `while  portb & mask != 0  ...' end
2168                     ; Skip over the start bit :
2169                     ;   call delay {{ }}  
2170 3d3 242c            call delay
2171                     ;   call delay {{ }}  
2172 3d4 242c            call delay
2173                     ;   call delay {{ }}  
2174 3d5 242c            call delay
2175                     ; Sample in the middle third of each data bit :
2176                     ;   char := 0  
2177 3d6 01d2            clrf get_byte__char
2178                     ; `count_down count 8 ...' start
2179 3d7 3008            movlw 8
2180 3d8 00d1            movwf get_byte__count
2181             get_byte__772_loop:
2182                     ;   call delay {{ }}  
2183 3d9 242c            call delay
2184                     ; 2 instructions :
2185                     ;   char := char >> 1  
2186 3da 1003            bcf c___byte,c___bit
2187 3db 0cd2            rrf get_byte__char,f
2188                     ; 3 instruciions :
2189                     ; if { portb & mask != 0 } start
2190 3dc 0806            movf portb,w
2191 3dd 054f            andwf get_byte__mask,w
2192                     ; expression=`{ portb & mask != 0 }' exp_delay=2 true_delay=1  false_delay=0 true_size=1 false_size=0
2193 3de 1d03            btfss z___byte,z___bit
2194                     ; if { portb & mask != 0 } body start
2195                     ;   char @ 7 := 1  
2196                     ; Select char @ 7
2197     0052    get_byte__char__778select0 equ get_byte__char+0
2198     0052    get_byte__char__778select0__byte equ get_byte__char+0
2199     0007    get_byte__char__778select0__bit equ 7
2200 3df 17d2            bsf get_byte__char__778select0__byte,get_byte__char__778select0__bit
2201                     ; if { portb & mask != 0 } body end
2202                     ; if exp=` portb & mask != 0 ' false skip delay=4
2203                     ; Other expression=`{ portb & mask != 0 }' delay=4
2204                     ; if { portb & mask != 0 } end
2205                     ;   call delay {{ }}  
2206 3e0 242c            call delay
2207                     ;   call delay {{ }}  
2208 3e1 242c            call delay
2209                     ; 3 more instructions at the end of the loop :
2210                     ; 2 + 3 + 3 = 8
2211                     ; nop extra_instructions_per_bit - 8
2212                     ; Delay 4 cycles
2213 3e2 0000            nop
2214 3e3 0000            nop
2215 3e4 0000            nop
2216 3e5 0000            nop
2217 3e6 0bd1            decfsz get_byte__count,f
2218 3e7 2bd9            goto get_byte__772_loop
2219             get_byte__772_done:
2220                     ; `count_down count 8 ...' end
2221                     ; Skip over 2 / 3 of the stop bit :
2222                     ;   call delay {{ }}  
2223 3e8 242c            call delay
2224                     ;   call delay {{ }}  
2225 3e9 242c            call delay
2226                     ;   return char  
2227 3ea 0852            movf get_byte__char,w
2228 3eb 00d0            movwf get_byte__0return__byte
2229 3ec 3400            retlw 0
2230                     ; procedure get_byte end
2231             
2232                     ; procedure send_byte start
2233             send_byte:
2234     0053    send_byte__variables__base equ global__variables__bank0+51
2235     0053    send_byte__bytes__base equ send_byte__variables__base+0
2236     0057    send_byte__bits__base equ send_byte__variables__base+4
2237     0004    send_byte__total__bytes equ 4
2238     0053    send_byte__char equ send_byte__bytes__base+0
2239     0054    send_byte__mask equ send_byte__bytes__base+1
2240                     ; Send < char > to < mask > bit of < portb > .
2241     0055    send_byte__count equ send_byte__bytes__base+2
2242     0056    send_byte__mark equ send_byte__bytes__base+3
2243                     ; Send the start bit :
2244                     ; 2 instructions :
2245                     ;   mark := mask ^ space  
2246 3ed 30ff            movlw 255
2247 3ee 0654            xorwf send_byte__mask,w
2248 3ef 00d6            movwf send_byte__mark
2249                     ; 2 instructions :
2250                     ;   portb := mark  
2251 3f0 0086            movwf portb
2252                     ;   call delay {{ }}  
2253 3f1 242c            call delay
2254                     ;   call delay {{ }}  
2255 3f2 242c            call delay
2256                     ;   call delay {{ }}  
2257 3f3 242c            call delay
2258                     ; 2 instructions to set up loop :
2259                     ; 2 + 2 + 2 = 6
2260                     ; nop extra_instructions_per_bit - 6
2261                     ; Delay 6 cycles
2262 3f4 0000            nop
2263 3f5 0000            nop
2264 3f6 0000            nop
2265 3f7 0000            nop
2266 3f8 0000            nop
2267 3f9 0000            nop
2268                     ; Send the data :
2269                     ; `count_down count 8 ...' start
2270 3fa 3008            movlw 8
2271 3fb 00d5            movwf send_byte__count
2272             send_byte__818_loop:
2273                     ; 5 Instructions :
2274                     ; if { char @ 0 } start
2275                     ; Alias variable for select char @ 0
2276     0053    send_byte__char__820select0 equ send_byte__char+0
2277     0053    send_byte__char__820select0__byte equ send_byte__char+0
2278     0000    send_byte__char__820select0__bit equ 0
2279                     ; expression=`{ char @ 0 }' exp_delay=0 true_delay=1  false_delay=1 true_size=1 false_size=1
2280 3fc 1853            btfsc send_byte__char__820select0__byte,send_byte__char__820select0__bit
2281                     ; if { char @ 0 } body start
2282                     ;   portb := space  
2283 3fd 30ff            movlw 255
2284                     ; 1 instructions found for sharing
2285 3fe 1c53            btfss send_byte__char__820select0__byte,send_byte__char__820select0__bit
2286                     ; else body start
2287                     ;   portb := mark  
2288 3ff 0856            movf send_byte__mark,w
2289                     ; 1 instructions found for sharing
2290                     ; if exp=` char @ 0 ' single true and false skip delay=4
2291                     ; Other expression=`{ char @ 0 }' delay=4
2292                     ; 1 shared instructions follow
2293 400 0086            movwf portb
2294                     ; if { char @ 0 } end
2295                     ; 2 Instructions :
2296                     ;   char := char >> 1  
2297 401 1003            bcf c___byte,c___bit
2298 402 0cd3            rrf send_byte__char,f
2299                     ;   call delay {{ }}  
2300 403 242c            call delay
2301                     ;   call delay {{ }}  
2302 404 242c            call delay
2303                     ;   call delay {{ }}  
2304 405 242c            call delay
2305                     ; 3 instructions for test and jump at end of loop
2306                     ; 2 + 3 + 5 = 10
2307                     ; nop extra_instructions_per_bit - 10
2308                     ; Delay 2 cycles
2309 406 0000            nop
2310 407 0000            nop
2311 408 0bd5            decfsz send_byte__count,f
2312 409 2bfc            goto send_byte__818_loop
2313             send_byte__818_done:
2314                     ; `count_down count 8 ...' end
2315                     ; Send the stop bit :
2316                     ;   portb := space  
2317 40a 30ff            movlw 255
2318 40b 0086            movwf portb
2319                     ;   call delay {{ }}  
2320 40c 242c            call delay
2321                     ;   call delay {{ }}  
2322 40d 242c            call delay
2323                     ;   call delay {{ }}  
2324 40e 242c            call delay
2325                     ; + 1 = > NOP to finish loop
2326                     ; - 2 = > portb := space
2327                     ; - 4 = > call / return
2328                     ; - 4 = > two arguments .
2329                     ; nop extra_instructions_per_bit + 1 - 2 - 4 - 4
2330                     ; Delay 3 cycles
2331 40f 0000            nop
2332 410 0000            nop
2333 411 0000            nop
2334                     ; procedure send_byte end
2335 412 3400            retlw 0
2336             
2337                     ; procedure master_send start
2338             master_send:
2339     0057    master_send__variables__base equ global__variables__bank0+55
2340     0057    master_send__bytes__base equ master_send__variables__base+0
2341     0058    master_send__bits__base equ master_send__variables__base+1
2342     0001    master_send__total__bytes equ 1
2343     0057    master_send__character equ master_send__bytes__base+0
2344                     ; This procedure will output < character > to the master .
2345                     ;   call send_byte {{ character , tx_master_mask }}  
2346 413 0857            movf master_send__character,w
2347 414 00d3            movwf send_byte__char
2348 415 3004            movlw 4
2349 416 00d4            movwf send_byte__mask
2350 417 23ed            call send_byte
2351                     ; procedure master_send end
2352 418 3400            retlw 0
2353             
2354                     ; procedure master_string start
2355             master_string:
2356     0058    master_string__variables__base equ global__variables__bank0+56
2357     0058    master_string__bytes__base equ master_string__variables__base+0
2358     005b    master_string__bits__base equ master_string__variables__base+3
2359     0003    master_string__total__bytes equ 3
2360     0058    master_string__message equ master_string__bytes__base+0
2361                     ; This procedure will output < message > to the master .
2362     0059    master_string__size equ master_string__bytes__base+1
2363     005a    master_string__index equ master_string__bytes__base+2
2364                     ;   index := 0  
2365 419 01da            clrf master_string__index
2366                     ; `while  index < message . size  ...' start
2367             master_string__866while__continue:
2368 41a 018a            clrf pclath___register
2369 41b 0858            movf master_string__message,w
2370 41c 200e            call string___fetch
2371 41d 025a            subwf master_string__index,w
2372                     ; expression=` index < message . size ' exp_delay=4 true_delay=7  false_delay=2 true_size=8 false_size=1
2373 41e 1803            btfsc c___byte,c___bit
2374 41f 2c28            goto master_string__866while__break
2375                     ;   call master_send {{ message ~~ {{ index }} }}  
2376 420 0a5a            incf master_string__index,w
2377 421 0758            addwf master_string__message,w
2378 422 018a            clrf pclath___register
2379 423 200e            call string___fetch
2380 424 00d7            movwf master_send__character
2381 425 2413            call master_send
2382                     ;   index := index + 1  
2383 426 0ada            incf master_string__index,f
2384 427 2c1a            goto master_string__866while__continue
2385                     ; if exp=` index < message . size ' false goto
2386                     ; Other expression=` index < message . size ' delay=-1
2387             master_string__866while__break:
2388                     ; `while  index < message . size  ...' end
2389                     ;   call master_send {{ sp }}  
2390 428 3020            movlw 32
2391 429 00d7            movwf master_send__character
2392 42a 2413            call master_send
2393                     ; procedure master_string end
2394 42b 3400            retlw 0
2395             
2396                     ; procedure delay start
2397                     ; optimize 0
2398             delay:
2399     005b    delay__variables__base equ global__variables__bank0+59
2400     005b    delay__bytes__base equ delay__variables__base+0
2401     005c    delay__bits__base equ delay__variables__base+1
2402     0001    delay__total__bytes equ 1
2403     005b    delay__873byte1 equ delay__bytes__base+0
2404                     ;   arguments_none  
2405                     ;   uniform_delay delay_instructions  
2406                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2407                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2408                     ; Delay 1 third of a bit :
2409                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2410                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2411                     ; Soak up remaining 339 cycles
2412                     ; Delay 339 cycles
2413 42c 3070            movlw 112
2414 42d 00db            movwf delay__873byte1
2415             delay__873delay0:
2416 42e 0bdb            decfsz delay__873byte1,f
2417 42f 2c2e            goto delay__873delay0
2418 430 0000            nop
2419 431 0000            nop
2420                     ; procedure delay end
2421 432 3400            retlw 0
2422                     ; optimize 1
2423             
2424                     ; Register bank 0 used 60 bytes of 96 available bytes
2425                     ; Register bank 1 used 0 bytes of 80 available bytes
2426                     ; Register bank 2 used 0 bytes of 48 available bytes
2427                     ; Register bank 3 used 0 bytes of 0 available bytes
2428             
2429                     end

