  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     0059    global__bit__variables__bank0 equ 89
  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 2851            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 LED4 RoboBrick . See :}
 62                     ; comment {}
 63                     ; comment {http : / / web . gramlich . net / projects / robobricks / led4 / 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 {Some timing constants :}
 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                     ;   constant extra_instructions_per_delay extra_instructions_per_bit / delays_per_bit  
 90     0004    extra_instructions_per_delay equ 4
 91                     ;   constant delay_instructions instructions_per_delay - extra_instructions_per_delay  
 92     0157    delay_instructions equ 343
 93                     ; comment {The null pulse that comes back from a clock pulse command is supposed to be}
 94                     ; comment {exactly 9 bits long . 9 bits at 2400 baud is 9 / 2400 = 3 . 75 mS . The number}
 95                     ; comment {iterations through the loop is 3 . 75 mS / < number of instructions per iteration . >}
 96                     ;   constant nine_bits_instructions {{ clock_rate * 9 }} / {{ clock_ticks_per_instruction * baud_rate }}  
 97     249f    nine_bits_instructions equ 9375
 98                     ;   constant instructions_per_iteration 7  
 99     0007    instructions_per_iteration equ 7
100                     ;   constant iterations_for_nine_bits nine_bits_instructions / instructions_per_iteration  
101     053b    iterations_for_nine_bits equ 1339
102                     ;   constant iterations_high iterations_for_nine_bits / 256  
103     0005    iterations_high equ 5
104                     ;   constant iterations_low iterations_for_nine_bits - {{ iterations_high * 256 }}  
105     003b    iterations_low equ 59
106                     ;   constant sp 32  
107     0020    sp equ 32
108                     ;   constant cr 13  
109     000d    cr equ 13
110                     ;   constant lf 10  
111     000a    lf equ 10
112                     ; comment {Some bit definitions < see schematic > :}
113                     ;   constant rx_slave_bit 5  
114     0005    rx_slave_bit equ 5
115                     ;   constant tx_slave_bit 4  
116     0004    tx_slave_bit equ 4
117                     ;   constant rx_master_bit 1  
118     0001    rx_master_bit equ 1
119                     ;   constant tx_master_bit 2  
120     0002    tx_master_bit equ 2
121                     ;   constant rx_slave_mask 1 << rx_slave_bit  
122     0020    rx_slave_mask equ 32
123                     ;   constant tx_slave_mask 1 << tx_slave_bit  
124     0010    tx_slave_mask equ 16
125                     ;   constant rx_master_mask 1 << rx_master_bit  
126     0002    rx_master_mask equ 2
127                     ;   constant tx_master_mask 1 << tx_master_bit  
128     0004    tx_master_mask equ 4
129                     ; comment {Some port and pin definitions :}
130                     ; comment {port porta a unused none}
131     0006    portb equ 6
132     0006    tx_master_pin__byte equ 6
133     0002    tx_master_pin__bit equ 2
134     0006    rx_master_pin__byte equ 6
135     0001    rx_master_pin__bit equ 1
136     0006    tx_slave_pin__byte equ 6
137     0004    tx_slave_pin__bit equ 4
138     0006    rx_slave_pin__byte equ 6
139     0005    rx_slave_pin__bit equ 5
140                     ; comment {Some register and bit declarations :}
141     0003    status equ 3
142                     ;   bind c status @ 0  
143     0003    c equ status+0
144     0003    c__byte equ status+0
145     0000    c__bit equ 0
146                     ;   bind z status @ 2  
147     0003    z equ status+0
148     0003    z__byte equ status+0
149     0002    z__bit equ 2
150                     ; comment {Some miscellaneous declarations :}
151                     ;   constant space 0xff  
152     00ff    space equ 255
153                     ;   constant buffer_size 5  
154     0005    buffer_size equ 5
155                     ; string_constants Start
156             string___fetch:
157 00e 0082            movwf pcl___register
158                     ;   bit_string = 0s'Bit'  
159     0000    bit_string___string equ 0
160             bit_string:
161 00f 0782            addwf pcl___register,f
162                     ; Length = 3
163 010 3403            retlw 3
164                     ; `Bit'
165 011 3442            retlw 66
166 012 3469            retlw 105
167 013 3474            retlw 116
168                     ;   blink_string = 0s'Blink'  
169     0005    blink_string___string equ 5
170             blink_string:
171 014 0782            addwf pcl___register,f
172                     ; Length = 5
173 015 3405            retlw 5
174                     ; `Blink'
175 016 3442            retlw 66
176 017 346c            retlw 108
177 018 3469            retlw 105
178 019 346e            retlw 110
179 01a 346b            retlw 107
180                     ;   clock_string = 0s'Clk'  
181     000c    clock_string___string equ 12
182             clock_string:
183 01b 0782            addwf pcl___register,f
184                     ; Length = 3
185 01c 3403            retlw 3
186                     ; `Clk'
187 01d 3443            retlw 67
188 01e 346c            retlw 108
189 01f 346b            retlw 107
190                     ;   common_string = 0s'Common'  
191     0011    common_string___string equ 17
192             common_string:
193 020 0782            addwf pcl___register,f
194                     ; Length = 6
195 021 3406            retlw 6
196                     ; `Common'
197 022 3443            retlw 67
198 023 346f            retlw 111
199 024 346d            retlw 109
200 025 346d            retlw 109
201 026 346f            retlw 111
202 027 346e            retlw 110
203                     ;   done_string = 0s'Done'  
204     0019    done_string___string equ 25
205             done_string:
206 028 0782            addwf pcl___register,f
207                     ; Length = 4
208 029 3404            retlw 4
209                     ; `Done'
210 02a 3444            retlw 68
211 02b 346f            retlw 111
212 02c 346e            retlw 110
213 02d 3465            retlw 101
214                     ;   fail_string = 0s'Fail'  
215     001f    fail_string___string equ 31
216             fail_string:
217 02e 0782            addwf pcl___register,f
218                     ; Length = 4
219 02f 3404            retlw 4
220                     ; `Fail'
221 030 3446            retlw 70
222 031 3461            retlw 97
223 032 3469            retlw 105
224 033 346c            retlw 108
225                     ;   hello_string = 0s'LED4_Test'  
226     0025    hello_string___string equ 37
227             hello_string:
228 034 0782            addwf pcl___register,f
229                     ; Length = 9
230 035 3409            retlw 9
231                     ; `LED4_Test'
232 036 344c            retlw 76
233 037 3445            retlw 69
234 038 3444            retlw 68
235 039 3434            retlw 52
236 03a 345f            retlw 95
237 03b 3454            retlw 84
238 03c 3465            retlw 101
239 03d 3473            retlw 115
240 03e 3474            retlw 116
241                     ;   ramps = 0 , 1 , 0x10 , 0x80 , 0xff  
242     0030    ramps___string equ 48
243             ramps:
244 03f 0782            addwf pcl___register,f
245                     ; Length = 5
246 040 3405            retlw 5
247                     ; 0
248 041 3400            retlw 0
249                     ; 1
250 042 3401            retlw 1
251                     ; 0x10
252 043 3410            retlw 16
253                     ; 0x80
254 044 3480            retlw 128
255                     ; 0xff
256 045 34ff            retlw 255
257                     ;   read_string = 0s'Read'  
258     0037    read_string___string equ 55
259             read_string:
260 046 0782            addwf pcl___register,f
261                     ; Length = 4
262 047 3404            retlw 4
263                     ; `Read'
264 048 3452            retlw 82
265 049 3465            retlw 101
266 04a 3461            retlw 97
267 04b 3464            retlw 100
268                     ;   register_string = 0s'Reg'  
269     003d    register_string___string equ 61
270             register_string:
271 04c 0782            addwf pcl___register,f
272                     ; Length = 3
273 04d 3403            retlw 3
274                     ; `Reg'
275 04e 3452            retlw 82
276 04f 3465            retlw 101
277 050 3467            retlw 103
278                     ; string__constants End
279             
280                     ; procedure main start
281             main:
282     0020    main__variables__base equ global__variables__bank0+0
283     0020    main__bytes__base equ main__variables__base+0
284     002a    main__bits__base equ main__variables__base+10
285     000a    main__total__bytes equ 10
286     0029    main__119byte0 equ main__bytes__base+9
287     0029    main__147byte0 equ main__bytes__base+9
288                     ;   arguments_none  
289                     ; The main procedure prints out a hello string and goes into
290                     ; a loop waiting for commands . The ` t ' command actually
291                     ; performs the test .
292     0020    main__buffer equ main__bytes__base+0
293     0025    main__char equ main__bytes__base+5
294     0026    main__count equ main__bytes__base+6
295     0027    main__index equ main__bytes__base+7
296     0028    main__number equ main__bytes__base+8
297                     ; Print out a welcome message :
298                     ;   call master_crlf {{ }}  
299 051 230c            call master_crlf
300                     ;   call master_string {{ hello_string }}  
301 052 3035            movlw LOW hello_string+1
302 053 00d5            movwf master_string__message
303 054 239d            call master_string
304                     ;   call master_crlf {{ }}  
305 055 230c            call master_crlf
306                     ; Main loop
307                     ;   number := 0  
308 056 01a8            clrf main__number
309                     ; loop_forever ... start
310             main__107loop__forever:
311                     ; Get a character :
312                     ;   tx_slave_pin := 1  
313 057 1606            bsf tx_slave_pin__byte,tx_slave_pin__bit
314                     ;   char := master_get {{ }}  
315 058 231e            call master_get
316 059 0847            movf master_get__0return__byte,w
317 05a 00a5            movwf main__char
318                     ; Delay 2 / 3 ' s of bit make sure that get_byte is done .
319                     ;   call delay {{ }}  
320 05b 23b0            call delay
321                     ;   call delay {{ }}  
322 05c 23b0            call delay
323                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } start
324 05d 3030            movlw 48
325 05e 0225            subwf main__char,w
326                     ; expression=`0c'0' <= char' exp_delay=2 true_delay=-1  false_delay=1 true_size=132 false_size=1
327 05f 1c03            btfss c___byte,c___bit
328 060 2871            goto and116__0false
329 061 303a            movlw 58
330 062 0225            subwf main__char,w
331                     ; expression=`char < {{ 0c'9' + 1 }}' exp_delay=2 true_delay=9  false_delay=-1 true_size=11 false_size=116
332 063 1803            btfsc c___byte,c___bit
333 064 2871            goto label116__1false
334             label116__1true:
335             and116__0true:
336                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } body start
337                     ; Do a multiply by 8 then add in digit :
338                     ;   call master_send {{ char }}  
339 065 0825            movf main__char,w
340 066 00d4            movwf master_send__character
341 067 2397            call master_send
342                     ;   number := {{ number << 3 }} + char - 0c'0'  
343 068 0d28            rlf main__number,w
344 069 00a9            movwf main__119byte0
345 06a 0da9            rlf main__119byte0,f
346 06b 0d29            rlf main__119byte0,w
347 06c 39f8            andlw 248
348 06d 0725            addwf main__char,w
349 06e 3ed0            addlw 208
350 06f 00a8            movwf main__number
351                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } body end
352 070 28e5            goto label116__1end
353             label116__1false:
354             and116__0false:
355 071 3073            movlw 115
356 072 0225            subwf main__char,w
357                     ; expression=`{ char = 0c's' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=8 false_size=103
358 073 1d03            btfss z___byte,z___bit
359 074 287e            goto label120__0false
360             label120__0true:
361                     ; else_if { char = 0c's' } body start
362                     ; Send byte to brick , no wait :
363                     ; Echo command and send CRLF :
364                     ;   call master_send {{ char }}  
365 075 0825            movf main__char,w
366 076 00d4            movwf master_send__character
367 077 2397            call master_send
368                     ;   call master_crlf {{ }}  
369 078 230c            call master_crlf
370                     ; Ship the byte down to the brick :
371                     ;   call slave_send {{ number }}  
372 079 0828            movf main__number,w
373 07a 00cb            movwf slave_send__data
374 07b 2343            call slave_send
375                     ;   number := 0  
376 07c 01a8            clrf main__number
377                     ; else_if { char = 0c's' } body end
378 07d 28e5            goto label120__0end
379             label120__0false:
380 07e 3077            movlw 119
381 07f 0225            subwf main__char,w
382                     ; expression=`{ char = 0c'w' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=39 false_size=59
383 080 1d03            btfss z___byte,z___bit
384 081 28aa            goto label131__0false
385             label131__0true:
386                     ; else_if { char = 0c'w' } body start
387                     ; Send byte to brick , wait for results :
388                     ; Echo command and send CRLF :
389                     ;   call master_send {{ char }}  
390 082 0825            movf main__char,w
391 083 00d4            movwf master_send__character
392 084 2397            call master_send
393                     ;   call master_crlf {{ }}  
394 085 230c            call master_crlf
395                     ; Ship the byte down to the brick ...
396                     ;   call slave_send {{ number }}  
397 086 0828            movf main__number,w
398 087 00cb            movwf slave_send__data
399 088 2343            call slave_send
400                     ;   number := 0  
401 089 01a8            clrf main__number
402                     ; call delay < >
403                     ; ... and wait for a response :
404                     ;   index := 0  
405 08a 01a7            clrf main__index
406                     ; `while  index < buffer_size  ...' start
407             main__146while__continue:
408 08b 3005            movlw 5
409 08c 0227            subwf main__index,w
410                     ; expression=` index < buffer_size ' exp_delay=2 true_delay=10  false_delay=2 true_size=11 false_size=1
411 08d 1803            btfsc c___byte,c___bit
412 08e 289a            goto main__146while__break
413                     ;   buffer ~~ {{ index }} := slave_get {{ }}  
414 08f 233d            call slave_get
415 090 084a            movf slave_get__0return__byte,w
416 091 00a9            movwf main__147byte0
417 092 3020            movlw LOW main__buffer
418 093 0727            addwf main__index,w
419 094 0084            movwf fsr___register
420 095 0829            movf main__147byte0,w
421 096 1383            bcf irp___register,irp___bit
422 097 0080            movwf indf___register
423                     ;   index := index + 1  
424 098 0aa7            incf main__index,f
425 099 288b            goto main__146while__continue
426                     ; if exp=` index < buffer_size ' false goto
427                     ; Other expression=` index < buffer_size ' delay=-1
428             main__146while__break:
429                     ; `while  index < buffer_size  ...' end
430                     ;   index := 0  
431 09a 01a7            clrf main__index
432                     ; `while  index < buffer_size  ...' start
433             main__152while__continue:
434 09b 3005            movlw 5
435 09c 0227            subwf main__index,w
436                     ; expression=` index < buffer_size ' exp_delay=2 true_delay=8  false_delay=2 true_size=9 false_size=1
437 09d 1803            btfsc c___byte,c___bit
438 09e 28a8            goto main__152while__break
439                     ;   call master_octal {{ buffer ~~ {{ index }} }}  
440 09f 3020            movlw LOW main__buffer
441 0a0 0727            addwf main__index,w
442 0a1 0084            movwf fsr___register
443 0a2 1383            bcf irp___register,irp___bit
444 0a3 0800            movf indf___register,w
445 0a4 00c8            movwf master_octal__number
446 0a5 2324            call master_octal
447                     ;   index := index + 1  
448 0a6 0aa7            incf main__index,f
449 0a7 289b            goto main__152while__continue
450                     ; if exp=` index < buffer_size ' false goto
451                     ; Other expression=` index < buffer_size ' delay=-1
452             main__152while__break:
453                     ; `while  index < buffer_size  ...' end
454                     ; Terminate the output list
455                     ;   call master_crlf {{ }}  
456 0a8 230c            call master_crlf
457                     ; else_if { char = 0c'w' } body end
458 0a9 28e5            goto label131__0end
459             label131__0false:
460 0aa 3069            movlw 105
461 0ab 0225            subwf main__char,w
462                     ; expression=`{ char = 0c'i' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=12 false_size=42
463 0ac 1d03            btfss z___byte,z___bit
464 0ad 28bb            goto label159__0false
465             label159__0true:
466                     ; else_if { char = 0c'i' } body start
467                     ; Interrogate the slave RoboBrick :
468                     ;   call master_send {{ char }}  
469 0ae 0825            movf main__char,w
470 0af 00d4            movwf master_send__character
471 0b0 2397            call master_send
472                     ;   call master_crlf {{ }}  
473 0b1 230c            call master_crlf
474                     ; Initialize the id index :
475                     ;   call slave_send {{ 0xfd }}  
476 0b2 30fd            movlw 253
477 0b3 00cb            movwf slave_send__data
478 0b4 2343            call slave_send
479                     ; Get the first 8 bytes :
480                     ;   call common_test_id_bytes8 {{ }}  
481 0b5 22f0            call common_test_id_bytes8
482                     ; Get the next 8 bytes of random numbers :
483                     ;   call common_test_id_bytes8 {{ }}  
484 0b6 22f0            call common_test_id_bytes8
485                     ; Get the next 8 bytes of random numbers :
486                     ;   call common_test_id_bytes8 {{ }}  
487 0b7 22f0            call common_test_id_bytes8
488                     ; Get the slave brick name :
489                     ;   call common_test_id_string {{ }}  
490 0b8 22fa            call common_test_id_string
491                     ; Get the vendor name :
492                     ;   call common_test_id_string {{ }}  
493 0b9 22fa            call common_test_id_string
494                     ; else_if { char = 0c'i' } body end
495 0ba 28e5            goto label159__0end
496             label159__0false:
497 0bb 3074            movlw 116
498 0bc 0225            subwf main__char,w
499                     ; expression=`{ char = 0c't' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=5 false_size=32
500 0bd 1d03            btfss z___byte,z___bit
501 0be 28c5            goto label182__0false
502             label182__0true:
503                     ; else_if { char = 0c't' } body start
504                     ; Do testing :
505                     ;   call master_send {{ char }}  
506 0bf 0825            movf main__char,w
507 0c0 00d4            movwf master_send__character
508 0c1 2397            call master_send
509                     ;   call master_crlf {{ }}  
510 0c2 230c            call master_crlf
511                     ;   call test {{ }}  
512 0c3 2175            call test
513                     ; else_if { char = 0c't' } body end
514 0c4 28e5            goto label182__0end
515             label182__0false:
516 0c5 3063            movlw 99
517 0c6 0225            subwf main__char,w
518                     ; expression=`{ char = 0c'c' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=8 false_size=19
519 0c7 1d03            btfss z___byte,z___bit
520 0c8 28d2            goto label187__0false
521             label187__0true:
522                     ; else_if { char = 0c'c' } body start
523                     ; Clock adjust :
524                     ;   call master_send {{ char }}  
525 0c9 0825            movf main__char,w
526 0ca 00d4            movwf master_send__character
527 0cb 2397            call master_send
528                     ;   call master_crlf {{ }}  
529 0cc 230c            call master_crlf
530                     ;   call clock_adjust {{ number }}  
531 0cd 0828            movf main__number,w
532 0ce 00aa            movwf clock_adjust__adjust
533 0cf 20e6            call clock_adjust
534                     ;   number := 0  
535 0d0 01a8            clrf main__number
536                     ; else_if { char = 0c'c' } body end
537 0d1 28e5            goto label187__0end
538             label187__0false:
539 0d2 30fc            movlw 252
540 0d3 0225            subwf main__char,w
541                     ; expression=`{ char != 0xfc }' exp_delay=2 true_delay=-1  false_delay=0 true_size=15 false_size=0
542 0d4 1903            btfsc z___byte,z___bit
543 0d5 28e5            goto label193__0end
544                     ; else_if { char != 0xfc } body start
545                     ; Just echo back the current number :
546                     ;   call master_send {{ 0c'<' }}  
547 0d6 303c            movlw 60
548 0d7 00d4            movwf master_send__character
549 0d8 2397            call master_send
550                     ;   call master_octal {{ char }}  
551 0d9 0825            movf main__char,w
552 0da 00c8            movwf master_octal__number
553 0db 2324            call master_octal
554                     ;   call master_send {{ 0c'>' }}  
555 0dc 303e            movlw 62
556 0dd 00d4            movwf master_send__character
557 0de 2397            call master_send
558                     ; Send a carriage - return line - feed :
559                     ;   call master_crlf {{ }}  
560 0df 230c            call master_crlf
561                     ; Output the character in octal :
562                     ;   call master_octal {{ number }}  
563 0e0 0828            movf main__number,w
564 0e1 00c8            movwf master_octal__number
565 0e2 2324            call master_octal
566                     ; Send a carriage - return line - feed :
567                     ;   call master_crlf {{ }}  
568 0e3 230c            call master_crlf
569                     ; Reset number
570                     ;   number := 0  
571 0e4 01a8            clrf main__number
572                     ; else_if { char != 0xfc } body end
573             label193__0end:
574                     ; if exp=` char != 0xfc ' empty false
575                     ; Other expression=`{ char != 0xfc }' delay=-1
576                     ; if exp=` char = 0c'c' ' generic
577             label187__0end:
578                     ; Other expression=`{ char = 0c'c' }' delay=-1
579                     ; if exp=` char = 0c't' ' generic
580             label182__0end:
581                     ; Other expression=`{ char = 0c't' }' delay=-1
582                     ; if exp=` char = 0c'i' ' generic
583             label159__0end:
584                     ; Other expression=`{ char = 0c'i' }' delay=-1
585                     ; if exp=` char = 0c'w' ' generic
586             label131__0end:
587                     ; Other expression=`{ char = 0c'w' }' delay=-1
588                     ; if exp=` char = 0c's' ' generic
589             label120__0end:
590                     ; Other expression=`{ char = 0c's' }' delay=-1
591                     ; if exp=`char < {{ 0c'9' + 1 }}' generic
592             label116__1end:
593                     ; Other expression=`char < {{ 0c'9' + 1 }}' delay=-1
594                     ; if exp=`0c'0' <= char' false goto
595                     ; Other expression=`0c'0' <= char' delay=-1
596             and116__0end:
597                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } end
598 0e5 2857            goto main__107loop__forever
599                     ; loop_forever ... end
600                     ; procedure main end
601             
602                     ; procedure clock_adjust start
603             clock_adjust:
604     002a    clock_adjust__variables__base equ global__variables__bank0+10
605     002a    clock_adjust__bytes__base equ clock_adjust__variables__base+0
606     0033    clock_adjust__bits__base equ clock_adjust__variables__base+9
607     0009    clock_adjust__total__bytes equ 9
608     0032    clock_adjust__229byte0 equ clock_adjust__bytes__base+8
609     0032    clock_adjust__271byte0 equ clock_adjust__bytes__base+8
610     0032    clock_adjust__281byte0 equ clock_adjust__bytes__base+8
611     0032    clock_adjust__285byte0 equ clock_adjust__bytes__base+8
612     002a    clock_adjust__adjust equ clock_adjust__bytes__base+0
613                     ; This procedure will adjust the clock to the slave .
614     002b    clock_adjust__command equ clock_adjust__bytes__base+1
615     002c    clock_adjust__count equ clock_adjust__bytes__base+2
616     002d    clock_adjust__error equ clock_adjust__bytes__base+3
617     002e    clock_adjust__error_minimum equ clock_adjust__bytes__base+4
618     002f    clock_adjust__high equ clock_adjust__bytes__base+5
619     0030    clock_adjust__low equ clock_adjust__bytes__base+6
620     0031    clock_adjust__target equ clock_adjust__bytes__base+7
621                     ;   target := iterations_low - adjust  
622 0e6 303b            movlw 59
623 0e7 00b2            movwf clock_adjust__229byte0
624 0e8 082a            movf clock_adjust__adjust,w
625 0e9 0232            subwf clock_adjust__229byte0,w
626 0ea 00b1            movwf clock_adjust__target
627                     ;   count := 2  
628 0eb 3002            movlw 2
629 0ec 00ac            movwf clock_adjust__count
630                     ;   error := 0xff  
631 0ed 30ff            movlw 255
632 0ee 00ad            movwf clock_adjust__error
633                     ;   error_minimum := 0xf0  
634 0ef 30f0            movlw 240
635 0f0 00ae            movwf clock_adjust__error_minimum
636                     ; Print out the target :
637                     ;   call master_send {{ 0c'T' }}  
638 0f1 3054            movlw 84
639 0f2 00d4            movwf master_send__character
640 0f3 2397            call master_send
641                     ;   call master_octal {{ iterations_high }}  
642 0f4 3005            movlw 5
643 0f5 00c8            movwf master_octal__number
644 0f6 2324            call master_octal
645                     ;   call master_octal {{ target }}  
646 0f7 0831            movf clock_adjust__target,w
647 0f8 00c8            movwf master_octal__number
648 0f9 2324            call master_octal
649                     ;   call master_crlf {{ }}  
650 0fa 230c            call master_crlf
651                     ; loop_forever ... start
652             clock_adjust__240loop__forever:
653                     ; Print out the clock value :
654                     ;   call master_send {{ 0c'C' }}  
655 0fb 3043            movlw 67
656 0fc 00d4            movwf master_send__character
657 0fd 2397            call master_send
658                     ;   call slave_send {{ 0xfa }}  
659 0fe 30fa            movlw 250
660 0ff 00cb            movwf slave_send__data
661 100 2343            call slave_send
662                     ;   call master_octal {{ slave_get {{ }} }}  
663 101 233d            call slave_get
664 102 084a            movf slave_get__0return__byte,w
665 103 00c8            movwf master_octal__number
666 104 2324            call master_octal
667                     ; Ask for a timing byte :
668                     ;   call slave_send {{ 0xfb }}  
669 105 30fb            movlw 251
670 106 00cb            movwf slave_send__data
671 107 2343            call slave_send
672                     ;   low := 0  
673 108 01b0            clrf clock_adjust__low
674                     ;   high := 0  
675 109 01af            clrf clock_adjust__high
676                     ; `while rx_slave_pin ...' start
677             clock_adjust__251while__continue:
678                     ; expression=`rx_slave_pin' exp_delay=0 true_delay=2  false_delay=2 true_size=1 false_size=1
679 10a 1a86            btfsc rx_slave_pin__byte,rx_slave_pin__bit
680                     ; Do nothing :
681 10b 290a            goto clock_adjust__251while__continue
682 10c 290d            goto clock_adjust__251while__break
683                     ; if exp=`rx_slave_pin' true goto small true
684             clock_adjust__251while__break:
685                     ; `while rx_slave_pin ...' end
686                     ; `while  ! rx_slave_pin  ...' start
687             clock_adjust__254while__continue:
688                     ; expression=`rx_slave_pin' exp_delay=0 true_delay=2  false_delay=5 true_size=1 false_size=4
689 10d 1a86            btfsc rx_slave_pin__byte,rx_slave_pin__bit
690 10e 2913            goto clock_adjust__254while__break
691                     ;   low := low + 1  
692 10f 0ab0            incf clock_adjust__low,f
693                     ; if { z } start
694                     ; expression=`{ z }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
695 110 1903            btfsc z__byte,z__bit
696                     ; if { z } body start
697                     ;   high := high + 1  
698 111 0aaf            incf clock_adjust__high,f
699                     ; if { z } body end
700                     ; if exp=`z' false skip delay=2
701                     ; Other expression=`{ z }' delay=2
702                     ; if { z } end
703 112 290d            goto clock_adjust__254while__continue
704                     ; if exp=`rx_slave_pin' true goto
705                     ; Other expression=`rx_slave_pin' delay=-1
706             clock_adjust__254while__break:
707                     ; `while  ! rx_slave_pin  ...' end
708                     ; Print out high and low :
709                     ;   call master_send {{ 0c'H' }}  
710 113 3048            movlw 72
711 114 00d4            movwf master_send__character
712 115 2397            call master_send
713                     ;   call master_octal {{ high }}  
714 116 082f            movf clock_adjust__high,w
715 117 00c8            movwf master_octal__number
716 118 2324            call master_octal
717                     ;   call master_send {{ 0c'L' }}  
718 119 304c            movlw 76
719 11a 00d4            movwf master_send__character
720 11b 2397            call master_send
721                     ;   call master_octal {{ low }}  
722 11c 0830            movf clock_adjust__low,w
723 11d 00c8            movwf master_octal__number
724 11e 2324            call master_octal
725                     ; Now think about adjusting clock .
726                     ; if { high > iterations_high } start
727 11f 3006            movlw 6
728 120 022f            subwf clock_adjust__high,w
729                     ; expression=`{ high > iterations_high }' exp_delay=2 true_delay=7  false_delay=-1 true_size=7 false_size=36
730 121 1803            btfsc c___byte,c___bit
731 122 2948            goto label268__0true
732             label268__0false:
733 123 3005            movlw 5
734 124 022f            subwf clock_adjust__high,w
735                     ; expression=`{ high < iterations_high }' exp_delay=2 true_delay=4  false_delay=-1 true_size=4 false_size=27
736 125 1c03            btfss c___byte,c___bit
737 126 2943            goto label272__0true
738             label272__0false:
739                     ; else body start
740                     ; The high 8 - bits are equal :
741                     ; if { low > target } start
742 127 0830            movf clock_adjust__low,w
743 128 0231            subwf clock_adjust__target,w
744                     ; expression=`{ low > target }' exp_delay=2 true_delay=7  false_delay=-1 true_size=7 false_size=15
745 129 1c03            btfss c___byte,c___bit
746 12a 293b            goto label278__0true
747             label278__0false:
748 12b 0831            movf clock_adjust__target,w
749 12c 0230            subwf clock_adjust__low,w
750                     ; expression=`{ low < target }' exp_delay=2 true_delay=7  false_delay=3 true_size=7 false_size=3
751 12d 1c03            btfss c___byte,c___bit
752 12e 2933            goto label282__0true
753             label282__0false:
754                     ; else body start
755                     ; Exact match ; we are done :
756                     ;   command := 0  
757 12f 01ab            clrf clock_adjust__command
758                     ;   error := 0  
759 130 01ad            clrf clock_adjust__error
760                     ;   error_minimum := 0  
761 131 01ae            clrf clock_adjust__error_minimum
762                     ; else body end
763 132 293a            goto label282__0end
764             label282__0true:
765                     ; else_if { low < target } body start
766                     ; Clock pulse is too short ; slave clock is too fast :
767                     ;   command := 0xf8  
768 133 30f8            movlw 248
769 134 00ab            movwf clock_adjust__command
770                     ;   error := target - low  
771 135 0831            movf clock_adjust__target,w
772 136 00b2            movwf clock_adjust__285byte0
773 137 0830            movf clock_adjust__low,w
774 138 0232            subwf clock_adjust__285byte0,w
775 139 00ad            movwf clock_adjust__error
776                     ; else_if { low < target } body end
777                     ; if exp=` low < target ' generic
778             label282__0end:
779                     ; Other expression=`{ low < target }' delay=-1
780 13a 2942            goto label278__0end
781             label278__0true:
782                     ; if { low > target } body start
783                     ; Clock pulse is too long ; slave clock is too slow :
784                     ;   command := 0xf9  
785 13b 30f9            movlw 249
786 13c 00ab            movwf clock_adjust__command
787                     ;   error := low - target  
788 13d 0830            movf clock_adjust__low,w
789 13e 00b2            movwf clock_adjust__281byte0
790 13f 0831            movf clock_adjust__target,w
791 140 0232            subwf clock_adjust__281byte0,w
792 141 00ad            movwf clock_adjust__error
793                     ; if { low > target } body end
794                     ; if exp=` low > target ' generic
795             label278__0end:
796                     ; Other expression=`{ low > target }' delay=-1
797                     ; if { low > target } end
798                     ; else body end
799 142 2947            goto label272__0end
800             label272__0true:
801                     ; else_if { high < iterations_high } body start
802                     ; Clock pulse is too short ; slave clock is too fast :
803                     ;   command := 0xf8  
804 143 30f8            movlw 248
805 144 00ab            movwf clock_adjust__command
806                     ;   error := target  
807 145 0831            movf clock_adjust__target,w
808 146 00ad            movwf clock_adjust__error
809                     ; else_if { high < iterations_high } body end
810                     ; if exp=` high < iterations_high ' generic
811             label272__0end:
812                     ; Other expression=`{ high < iterations_high }' delay=-1
813 147 294f            goto label268__0end
814             label268__0true:
815                     ; if { high > iterations_high } body start
816                     ; Clock pulse is too long ; slave clock is too slow :
817                     ;   command := 0xf9  
818 148 30f9            movlw 249
819 149 00ab            movwf clock_adjust__command
820                     ;   error := 0xff - target  
821 14a 30ff            movlw 255
822 14b 00b2            movwf clock_adjust__271byte0
823 14c 0831            movf clock_adjust__target,w
824 14d 0232            subwf clock_adjust__271byte0,w
825 14e 00ad            movwf clock_adjust__error
826                     ; if { high > iterations_high } body end
827                     ; if exp=` high > iterations_high ' generic
828             label268__0end:
829                     ; Other expression=`{ high > iterations_high }' delay=-1
830                     ; if { high > iterations_high } end
831                     ; Print out the error and error minimum :
832                     ;   call master_send {{ 0c'E' }}  
833 14f 3045            movlw 69
834 150 00d4            movwf master_send__character
835 151 2397            call master_send
836                     ;   call master_octal {{ error }}  
837 152 082d            movf clock_adjust__error,w
838 153 00c8            movwf master_octal__number
839 154 2324            call master_octal
840                     ;   call master_send {{ 0c'M' }}  
841 155 304d            movlw 77
842 156 00d4            movwf master_send__character
843 157 2397            call master_send
844                     ;   call master_octal {{ error_minimum }}  
845 158 082e            movf clock_adjust__error_minimum,w
846 159 00c8            movwf master_octal__number
847 15a 2324            call master_octal
848                     ; if { error = error_minimum } start
849 15b 082d            movf clock_adjust__error,w
850 15c 022e            subwf clock_adjust__error_minimum,w
851                     ; expression=`{ error = error_minimum }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=2 false_size=14
852 15d 1d03            btfss z___byte,z___bit
853 15e 2962            goto label300__0false
854             label300__0true:
855                     ; if { error = error_minimum } body start
856                     ;   call master_crlf {{ }}  
857 15f 230c            call master_crlf
858                     ;   return  
859 160 3400            retlw 0
860                     ; if { error = error_minimum } body end
861 161 2970            goto label300__0end
862             label300__0false:
863 162 082e            movf clock_adjust__error_minimum,w
864 163 022d            subwf clock_adjust__error,w
865                     ; expression=`{ error < error_minimum }' exp_delay=2 true_delay=3  false_delay=-1 true_size=3 false_size=6
866 164 1c03            btfss c___byte,c___bit
867 165 296d            goto label303__0true
868             label303__0false:
869                     ; else body start
870                     ;   count := count - 1  
871 166 03ac            decf clock_adjust__count,f
872                     ; if { z } start
873                     ; expression=`{ z }' exp_delay=0 true_delay=3  false_delay=0 true_size=3 false_size=0
874 167 1d03            btfss z__byte,z__bit
875 168 296c            goto label308__0end
876                     ; if { z } body start
877                     ;   error_minimum := error_minimum + 1  
878 169 0aae            incf clock_adjust__error_minimum,f
879                     ;   count := 2  
880 16a 3002            movlw 2
881 16b 00ac            movwf clock_adjust__count
882                     ; if { z } body end
883             label308__0end:
884                     ; if exp=`z' empty false
885                     ; Other expression=`{ z }' delay=-1
886                     ; if { z } end
887                     ; else body end
888 16c 2970            goto label303__0end
889             label303__0true:
890                     ; else_if { error < error_minimum } body start
891                     ;   error_minimum := error  
892 16d 082d            movf clock_adjust__error,w
893 16e 00ae            movwf clock_adjust__error_minimum
894                     ;   error := error + 1  
895 16f 0aad            incf clock_adjust__error,f
896                     ; else_if { error < error_minimum } body end
897                     ; if exp=` error < error_minimum ' generic
898             label303__0end:
899                     ; Other expression=`{ error < error_minimum }' delay=-1
900                     ; if exp=` error = error_minimum ' generic
901             label300__0end:
902                     ; Other expression=`{ error = error_minimum }' delay=-1
903                     ; if { error = error_minimum } end
904                     ; Now adjust the clock :
905                     ;   call slave_send {{ command }}  
906 170 082b            movf clock_adjust__command,w
907 171 00cb            movwf slave_send__data
908 172 2343            call slave_send
909                     ;   call master_crlf {{ }}  
910 173 230c            call master_crlf
911 174 28fb            goto clock_adjust__240loop__forever
912                     ; loop_forever ... end
913                     ; procedure clock_adjust end
914             
915                     ; procedure test start
916             test:
917     0033    test__variables__base equ global__variables__bank0+19
918     0033    test__bytes__base equ test__variables__base+0
919     0038    test__bits__base equ test__variables__base+5
920     0005    test__total__bytes equ 5
921     0037    test__407byte0 equ test__bytes__base+4
922                     ;   arguments_none  
923                     ; This procedure will test the LED4 RoboBrick :
924     0033    test__bit equ test__bytes__base+0
925     0034    test__leds equ test__bytes__base+1
926     0035    test__temp equ test__bytes__base+2
927     0036    test__pattern equ test__bytes__base+3
928                     ; Adjust the clock :
929                     ; call clock_adjust < 0 >
930                     ; Verify that the common commands are working :
931                     ;   call common_test {{ }}  
932 175 2270            call common_test
933                     ; Clear the LEDS :
934                     ;   call slave_send {{ 0 }}  
935 176 01cb            clrf slave_send__data
936 177 2343            call slave_send
937                     ;   call test_prompt {{ 0 }}  
938 178 01ba            clrf test_prompt__leds
939 179 2254            call test_prompt
940                     ; Let ' s do some simple testing first :
941                     ;   leds := 1  
942 17a 3001            movlw 1
943 17b 00b4            movwf test__leds
944                     ; `while  ! {{ leds @ 4 }}  ...' start
945             test__344while__continue:
946                     ; Alias variable for select leds @ 4
947     0034    test__leds__344select0 equ test__leds+0
948     0034    test__leds__344select0__byte equ test__leds+0
949     0004    test__leds__344select0__bit equ 4
950                     ; expression=`{{ leds @ 4 }}' exp_delay=0 true_delay=2  false_delay=7 true_size=1 false_size=12
951 17c 1a34            btfsc test__leds__344select0__byte,test__leds__344select0__bit
952 17d 298a            goto test__344while__break
953                     ; Set the bits :
954                     ;   call slave_send {{ leds }}  
955 17e 0834            movf test__leds,w
956 17f 00cb            movwf slave_send__data
957 180 2343            call slave_send
958                     ;   call test_prompt {{ leds }}  
959 181 0834            movf test__leds,w
960 182 00ba            movwf test_prompt__leds
961 183 2254            call test_prompt
962                     ;   call test_verify {{ leds }}  
963 184 0834            movf test__leds,w
964 185 00b8            movwf test_verify__leds
965 186 223f            call test_verify
966                     ;   leds := leds << 1  
967 187 1003            bcf c___byte,c___bit
968 188 0db4            rlf test__leds,f
969 189 297c            goto test__344while__continue
970                     ; if exp=` leds @ 4 ' true goto
971                     ; Other expression=`{{ leds @ 4 }}' delay=-1
972             test__344while__break:
973                     ; `while  ! {{ leds @ 4 }}  ...' end
974                     ; Clear the leds :
975                     ;   call slave_send {{ 0 }}  
976 18a 01cb            clrf slave_send__data
977 18b 2343            call slave_send
978                     ; Let ' s test out the bit twiddle commands :
979                     ;   call master_string {{ bit_string }}  
980 18c 3010            movlw LOW bit_string+1
981 18d 00d5            movwf master_string__message
982 18e 239d            call master_string
983                     ;   call master_crlf {{ }}  
984 18f 230c            call master_crlf
985                     ;   bit := 0  
986 190 01b3            clrf test__bit
987                     ;   leds := 1  
988 191 3001            movlw 1
989 192 00b4            movwf test__leds
990                     ; `while  bit < 4  ...' start
991             test__360while__continue:
992 193 3004            movlw 4
993 194 0233            subwf test__bit,w
994                     ; expression=` bit < 4 ' exp_delay=2 true_delay=1  false_delay=2 true_size=72 false_size=1
995 195 1803            btfsc c___byte,c___bit
996 196 29de            goto test__360while__break
997                     ; Bit set :
998                     ;   call slave_send {{ 0x14 | bit }}  
999 197 3014            movlw 20
1000 198 0433            iorwf test__bit,w
1001 199 00cb            movwf slave_send__data
1002 19a 2343            call slave_send
1003                     ;   call test_verify {{ leds }}  
1004 19b 0834            movf test__leds,w
1005 19c 00b8            movwf test_verify__leds
1006 19d 223f            call test_verify
1007                     ; Read the bit :
1008                     ;   call slave_send {{ 0x1c | bit }}  
1009 19e 301c            movlw 28
1010 19f 0433            iorwf test__bit,w
1011 1a0 00cb            movwf slave_send__data
1012 1a1 2343            call slave_send
1013                     ;   temp := slave_get {{ }}  
1014 1a2 233d            call slave_get
1015 1a3 084a            movf slave_get__0return__byte,w
1016 1a4 00b5            movwf test__temp
1017                     ; if { temp != 1 } start
1018 1a5 0335            decf test__temp,w
1019                     ; expression=`{ temp != 1 }' exp_delay=1 true_delay=5  false_delay=0 true_size=11 false_size=0
1020 1a6 1903            btfsc z___byte,z___bit
1021 1a7 29b3            goto label368__0end
1022                     ; if { temp != 1 } body start
1023                     ;   call master_octal {{ bit }}  
1024 1a8 0833            movf test__bit,w
1025 1a9 00c8            movwf master_octal__number
1026 1aa 2324            call master_octal
1027                     ;   call master_octal {{ temp }}  
1028 1ab 0835            movf test__temp,w
1029 1ac 00c8            movwf master_octal__number
1030 1ad 2324            call master_octal
1031                     ;   call master_fail {{ bit_string , 0x30 }}  
1032 1ae 3010            movlw LOW bit_string+1
1033 1af 00c5            movwf master_fail__test_name
1034 1b0 3030            movlw 48
1035 1b1 00c6            movwf master_fail__test_number
1036 1b2 2313            call master_fail
1037                     ; if { temp != 1 } body end
1038             label368__0end:
1039                     ; if exp=` temp != 1 ' empty false
1040                     ; Other expression=`{ temp != 1 }' delay=-1
1041                     ; if { temp != 1 } end
1042                     ; Bit clear :
1043                     ;   call slave_send {{ 0x10 | bit }}  
1044 1b3 3010            movlw 16
1045 1b4 0433            iorwf test__bit,w
1046 1b5 00cb            movwf slave_send__data
1047 1b6 2343            call slave_send
1048                     ;   call test_verify {{ 0 }}  
1049 1b7 01b8            clrf test_verify__leds
1050 1b8 223f            call test_verify
1051                     ; Read the bit again :
1052                     ;   call slave_send {{ 0x1c | bit }}  
1053 1b9 301c            movlw 28
1054 1ba 0433            iorwf test__bit,w
1055 1bb 00cb            movwf slave_send__data
1056 1bc 2343            call slave_send
1057                     ;   temp := slave_get {{ }}  
1058 1bd 233d            call slave_get
1059 1be 084a            movf slave_get__0return__byte,w
1060 1bf 00b5            movwf test__temp
1061                     ; if { temp != 0 } start
1062                     ; expression=`{ temp != 0 }' exp_delay=1 true_delay=5  false_delay=0 true_size=11 false_size=0
1063 1c0 1903            btfsc z___byte,z___bit
1064 1c1 29cd            goto label381__0end
1065                     ; if { temp != 0 } body start
1066                     ;   call master_octal {{ bit }}  
1067 1c2 0833            movf test__bit,w
1068 1c3 00c8            movwf master_octal__number
1069 1c4 2324            call master_octal
1070                     ;   call master_octal {{ temp }}  
1071 1c5 0835            movf test__temp,w
1072 1c6 00c8            movwf master_octal__number
1073 1c7 2324            call master_octal
1074                     ;   call master_fail {{ bit_string , 0x31 }}  
1075 1c8 3010            movlw LOW bit_string+1
1076 1c9 00c5            movwf master_fail__test_name
1077 1ca 3031            movlw 49
1078 1cb 00c6            movwf master_fail__test_number
1079 1cc 2313            call master_fail
1080                     ; if { temp != 0 } body end
1081             label381__0end:
1082                     ; if exp=` temp != 0 ' empty false
1083                     ; Other expression=`{ temp != 0 }' delay=-1
1084                     ; if { temp != 0 } end
1085                     ; Bit toggle :
1086                     ;   call slave_send {{ 0x18 | bit }}  
1087 1cd 3018            movlw 24
1088 1ce 0433            iorwf test__bit,w
1089 1cf 00cb            movwf slave_send__data
1090 1d0 2343            call slave_send
1091                     ;   call test_verify {{ leds }}  
1092 1d1 0834            movf test__leds,w
1093 1d2 00b8            movwf test_verify__leds
1094 1d3 223f            call test_verify
1095                     ; Bit toggle again :
1096                     ;   call slave_send {{ 0x18 | bit }}  
1097 1d4 3018            movlw 24
1098 1d5 0433            iorwf test__bit,w
1099 1d6 00cb            movwf slave_send__data
1100 1d7 2343            call slave_send
1101                     ;   call test_verify {{ 0 }}  
1102 1d8 01b8            clrf test_verify__leds
1103 1d9 223f            call test_verify
1104                     ;   leds := leds << 1  
1105 1da 1003            bcf c___byte,c___bit
1106 1db 0db4            rlf test__leds,f
1107                     ;   bit := bit + 1  
1108 1dc 0ab3            incf test__bit,f
1109 1dd 2993            goto test__360while__continue
1110                     ; if exp=` bit < 4 ' false goto
1111                     ; Other expression=` bit < 4 ' delay=-1
1112             test__360while__break:
1113                     ; `while  bit < 4  ...' end
1114                     ; Now do some blink rate tests :
1115                     ;   call master_string {{ blink_string }}  
1116 1de 3015            movlw LOW blink_string+1
1117 1df 00d5            movwf master_string__message
1118 1e0 239d            call master_string
1119                     ;   call master_crlf {{ }}  
1120 1e1 230c            call master_crlf
1121                     ; First turn the bits on :
1122                     ;   call slave_send {{ 0xf }}  
1123 1e2 300f            movlw 15
1124 1e3 00cb            movwf slave_send__data
1125 1e4 2343            call slave_send
1126                     ;   bit := 0  
1127 1e5 01b3            clrf test__bit
1128                     ; `while  bit < 4  ...' start
1129             test__405while__continue:
1130 1e6 3004            movlw 4
1131 1e7 0233            subwf test__bit,w
1132                     ; expression=` bit < 4 ' exp_delay=2 true_delay=1  false_delay=2 true_size=36 false_size=1
1133 1e8 1803            btfsc c___byte,c___bit
1134 1e9 2a0e            goto test__405while__break
1135                     ; Set the blink rate :
1136                     ;   call slave_send {{ 0x30 | {{ bit << 2 }} | bit }}  
1137 1ea 0d33            rlf test__bit,w
1138 1eb 00b7            movwf test__407byte0
1139 1ec 0d37            rlf test__407byte0,w
1140 1ed 39fc            andlw 252
1141 1ee 0433            iorwf test__bit,w
1142 1ef 3830            iorlw 48
1143 1f0 00cb            movwf slave_send__data
1144 1f1 2343            call slave_send
1145                     ; Read the blink rate back :
1146                     ;   call slave_send {{ 0x1c | bit }}  
1147 1f2 301c            movlw 28
1148 1f3 0433            iorwf test__bit,w
1149 1f4 00cb            movwf slave_send__data
1150 1f5 2343            call slave_send
1151                     ;   temp := slave_get {{ }}  
1152 1f6 233d            call slave_get
1153 1f7 084a            movf slave_get__0return__byte,w
1154 1f8 00b5            movwf test__temp
1155                     ;   pattern := {{ bit << 1 }} | 9  
1156 1f9 1003            bcf c___byte,c___bit
1157 1fa 0d33            rlf test__bit,w
1158 1fb 3809            iorlw 9
1159 1fc 00b6            movwf test__pattern
1160                     ; if { temp != pattern } start
1161 1fd 0835            movf test__temp,w
1162 1fe 0236            subwf test__pattern,w
1163                     ; expression=`{ temp != pattern }' exp_delay=2 true_delay=5  false_delay=0 true_size=11 false_size=0
1164 1ff 1903            btfsc z___byte,z___bit
1165 200 2a0c            goto label413__0end
1166                     ; if { temp != pattern } body start
1167                     ;   call master_octal {{ temp }}  
1168 201 0835            movf test__temp,w
1169 202 00c8            movwf master_octal__number
1170 203 2324            call master_octal
1171                     ;   call master_octal {{ pattern }}  
1172 204 0836            movf test__pattern,w
1173 205 00c8            movwf master_octal__number
1174 206 2324            call master_octal
1175                     ;   call master_fail {{ blink_string , 0x32 }}  
1176 207 3015            movlw LOW blink_string+1
1177 208 00c5            movwf master_fail__test_name
1178 209 3032            movlw 50
1179 20a 00c6            movwf master_fail__test_number
1180 20b 2313            call master_fail
1181                     ; if { temp != pattern } body end
1182             label413__0end:
1183                     ; if exp=` temp != pattern ' empty false
1184                     ; Other expression=`{ temp != pattern }' delay=-1
1185                     ; if { temp != pattern } end
1186                     ;   bit := bit + 1  
1187 20c 0ab3            incf test__bit,f
1188 20d 29e6            goto test__405while__continue
1189                     ; if exp=` bit < 4 ' false goto
1190                     ; Other expression=` bit < 4 ' delay=-1
1191             test__405while__break:
1192                     ; `while  bit < 4  ...' end
1193                     ; Now turn the bits on and let them blink :
1194                     ;   call test_prompt {{ 0xf }}  
1195 20e 300f            movlw 15
1196 20f 00ba            movwf test_prompt__leds
1197 210 2254            call test_prompt
1198                     ; Now clear the blink rates :
1199                     ;   bit := 0  
1200 211 01b3            clrf test__bit
1201                     ; `while  bit < 4  ...' start
1202             test__425while__continue:
1203 212 3004            movlw 4
1204 213 0233            subwf test__bit,w
1205                     ; expression=` bit < 4 ' exp_delay=2 true_delay=5  false_delay=2 true_size=6 false_size=1
1206 214 1803            btfsc c___byte,c___bit
1207 215 2a1c            goto test__425while__break
1208                     ; Clear the blink rate :
1209                     ;   call slave_send {{ 0x20 | bit }}  
1210 216 3020            movlw 32
1211 217 0433            iorwf test__bit,w
1212 218 00cb            movwf slave_send__data
1213 219 2343            call slave_send
1214                     ;   bit := bit + 1  
1215 21a 0ab3            incf test__bit,f
1216 21b 2a12            goto test__425while__continue
1217                     ; if exp=` bit < 4 ' false goto
1218                     ; Other expression=` bit < 4 ' delay=-1
1219             test__425while__break:
1220                     ; `while  bit < 4  ...' end
1221                     ;   call slave_send {{ 0 }}  
1222 21c 01cb            clrf slave_send__data
1223 21d 2343            call slave_send
1224                     ; Now test increment :
1225                     ;   leds := 0  
1226 21e 01b4            clrf test__leds
1227                     ; `while  leds < 0x10  ...' start
1228             test__434while__continue:
1229 21f 3010            movlw 16
1230 220 0234            subwf test__leds,w
1231                     ; expression=` leds < 0x10 ' exp_delay=2 true_delay=5  false_delay=2 true_size=8 false_size=1
1232 221 1803            btfsc c___byte,c___bit
1233 222 2a2b            goto test__434while__break
1234                     ;   call test_verify {{ leds }}  
1235 223 0834            movf test__leds,w
1236 224 00b8            movwf test_verify__leds
1237 225 223f            call test_verify
1238                     ; Now increment the LED ' s :
1239                     ;   call slave_send {{ 0x44 }}  
1240 226 3044            movlw 68
1241 227 00cb            movwf slave_send__data
1242 228 2343            call slave_send
1243                     ;   leds := leds + 1  
1244 229 0ab4            incf test__leds,f
1245 22a 2a1f            goto test__434while__continue
1246                     ; if exp=` leds < 0x10 ' false goto
1247                     ; Other expression=` leds < 0x10 ' delay=-1
1248             test__434while__break:
1249                     ; `while  leds < 0x10  ...' end
1250                     ; Now test decrement :
1251                     ;   leds := 0x10  
1252 22b 3010            movlw 16
1253 22c 00b4            movwf test__leds
1254                     ; `while  leds != 0  ...' start
1255             test__444while__continue:
1256 22d 0834            movf test__leds,w
1257                     ; expression=` leds != 0 ' exp_delay=1 true_delay=5  false_delay=2 true_size=8 false_size=1
1258 22e 1903            btfsc z___byte,z___bit
1259 22f 2a38            goto test__444while__break
1260                     ;   leds := leds - 1  
1261 230 03b4            decf test__leds,f
1262                     ; Now decrement the LED ' s :
1263                     ;   call slave_send {{ 0x48 }}  
1264 231 3048            movlw 72
1265 232 00cb            movwf slave_send__data
1266 233 2343            call slave_send
1267                     ; Now verify :
1268                     ;   call test_verify {{ leds }}  
1269 234 0834            movf test__leds,w
1270 235 00b8            movwf test_verify__leds
1271 236 223f            call test_verify
1272 237 2a2d            goto test__444while__continue
1273                     ; if exp=` leds != 0 ' false goto
1274                     ; Other expression=` leds != 0 ' delay=-1
1275             test__444while__break:
1276                     ; `while  leds != 0  ...' end
1277                     ; Let ' s clear the LED ' s :
1278                     ;   call slave_send {{ 0 }}  
1279 238 01cb            clrf slave_send__data
1280 239 2343            call slave_send
1281                     ; Announce that we are done :
1282                     ;   call master_string {{ done_string }}  
1283 23a 3029            movlw LOW done_string+1
1284 23b 00d5            movwf master_string__message
1285 23c 239d            call master_string
1286                     ;   call master_crlf {{ }}  
1287 23d 230c            call master_crlf
1288                     ; procedure test end
1289 23e 3400            retlw 0
1290             
1291                     ; procedure test_verify start
1292             test_verify:
1293     0038    test_verify__variables__base equ global__variables__bank0+24
1294     0038    test_verify__bytes__base equ test_verify__variables__base+0
1295     003a    test_verify__bits__base equ test_verify__variables__base+2
1296     0002    test_verify__total__bytes equ 2
1297     0038    test_verify__leds equ test_verify__bytes__base+0
1298                     ; This procedure will verify that the registers contain high and low .
1299     0039    test_verify__temp equ test_verify__bytes__base+1
1300                     ; Read leds register :
1301                     ;   call slave_send {{ 0x40 }}  
1302 23f 3040            movlw 64
1303 240 00cb            movwf slave_send__data
1304 241 2343            call slave_send
1305                     ;   temp := slave_get {{ }}  
1306 242 233d            call slave_get
1307 243 084a            movf slave_get__0return__byte,w
1308 244 00b9            movwf test_verify__temp
1309                     ; if { temp != leds } start
1310 245 0238            subwf test_verify__leds,w
1311                     ; expression=`{ temp != leds }' exp_delay=2 true_delay=5  false_delay=0 true_size=11 false_size=0
1312 246 1903            btfsc z___byte,z___bit
1313 247 2a53            goto label473__0end
1314                     ; if { temp != leds } body start
1315                     ;   call master_octal {{ temp }}  
1316 248 0839            movf test_verify__temp,w
1317 249 00c8            movwf master_octal__number
1318 24a 2324            call master_octal
1319                     ;   call master_octal {{ leds }}  
1320 24b 0838            movf test_verify__leds,w
1321 24c 00c8            movwf master_octal__number
1322 24d 2324            call master_octal
1323                     ;   call master_fail {{ read_string , 0x50 }}  
1324 24e 3047            movlw LOW read_string+1
1325 24f 00c5            movwf master_fail__test_name
1326 250 3050            movlw 80
1327 251 00c6            movwf master_fail__test_number
1328 252 2313            call master_fail
1329                     ; if { temp != leds } body end
1330             label473__0end:
1331                     ; if exp=` temp != leds ' empty false
1332                     ; Other expression=`{ temp != leds }' delay=-1
1333                     ; if { temp != leds } end
1334                     ; procedure test_verify end
1335 253 3400            retlw 0
1336             
1337                     ; procedure test_prompt start
1338             test_prompt:
1339     003a    test_prompt__variables__base equ global__variables__bank0+26
1340     003a    test_prompt__bytes__base equ test_prompt__variables__base+0
1341     003e    test_prompt__bits__base equ test_prompt__variables__base+4
1342     0004    test_prompt__total__bytes equ 4
1343     003d    test_prompt__500byte0 equ test_prompt__bytes__base+3
1344     003a    test_prompt__leds equ test_prompt__bytes__base+0
1345                     ; This procedure will prompt the user to input a paticular pattern :
1346     003b    test_prompt__count equ test_prompt__bytes__base+1
1347     003c    test_prompt__char equ test_prompt__bytes__base+2
1348                     ; Print high order pattern :
1349                     ; `count_down count 4 ...' start
1350 254 3004            movlw 4
1351 255 00bb            movwf test_prompt__count
1352             test_prompt__490_loop:
1353                     ;   char := 0c'.'  
1354 256 302e            movlw 46
1355 257 00bc            movwf test_prompt__char
1356                     ; if { leds @ 3 } start
1357                     ; Alias variable for select leds @ 3
1358     003a    test_prompt__leds__492select0 equ test_prompt__leds+0
1359     003a    test_prompt__leds__492select0__byte equ test_prompt__leds+0
1360     0003    test_prompt__leds__492select0__bit equ 3
1361                     ; expression=`{ leds @ 3 }' exp_delay=0 true_delay=2  false_delay=0 true_size=2 false_size=0
1362 258 1dba            btfss test_prompt__leds__492select0__byte,test_prompt__leds__492select0__bit
1363 259 2a5c            goto label492__1end
1364                     ; if { leds @ 3 } body start
1365                     ;   char := 0c'*'  
1366 25a 302a            movlw 42
1367 25b 00bc            movwf test_prompt__char
1368                     ; if { leds @ 3 } body end
1369             label492__1end:
1370                     ; if exp=` leds @ 3 ' empty false
1371                     ; Other expression=`{ leds @ 3 }' delay=-1
1372                     ; if { leds @ 3 } end
1373                     ;   call master_send {{ char }}  
1374 25c 083c            movf test_prompt__char,w
1375 25d 00d4            movwf master_send__character
1376 25e 2397            call master_send
1377                     ;   leds := leds << 1  
1378 25f 1003            bcf c___byte,c___bit
1379 260 0dba            rlf test_prompt__leds,f
1380 261 0bbb            decfsz test_prompt__count,f
1381 262 2a56            goto test_prompt__490_loop
1382             test_prompt__490_done:
1383                     ; `count_down count 4 ...' end
1384                     ;   call master_send {{ 0c':' }}  
1385 263 303a            movlw 58
1386 264 00d4            movwf master_send__character
1387 265 2397            call master_send
1388                     ; `while  master_get ## {{ }} = 0xfc  ...' start
1389             test_prompt__500while__continue:
1390 266 231e            call master_get
1391 267 0847            movf master_get__0return__byte,w
1392 268 00bd            movwf test_prompt__500byte0
1393 269 30fc            movlw 252
1394 26a 023d            subwf test_prompt__500byte0,w
1395                     ; expression=` master_get ## {{ }} = 0xfc ' exp_delay=3 true_delay=2  false_delay=2 true_size=1 false_size=1
1396 26b 1903            btfsc z___byte,z___bit
1397                     ; Do nothing :
1398 26c 2a66            goto test_prompt__500while__continue
1399 26d 2a6e            goto test_prompt__500while__break
1400                     ; if exp=` master_get ## {{ }} = 0xfc ' true goto small true
1401             test_prompt__500while__break:
1402                     ; `while  master_get ## {{ }} = 0xfc  ...' end
1403                     ;   call master_crlf {{ }}  
1404 26e 230c            call master_crlf
1405                     ; procedure test_prompt end
1406 26f 3400            retlw 0
1407                     ; comment {The procedures below are used to test the common shared commands :}
1408             
1409                     ; procedure common_test start
1410             common_test:
1411     003e    common_test__variables__base equ global__variables__bank0+30
1412     003e    common_test__bytes__base equ common_test__variables__base+0
1413     0040    common_test__bits__base equ common_test__variables__base+2
1414     0002    common_test__total__bytes equ 2
1415     003f    common_test__551byte0 equ common_test__bytes__base+1
1416                     ;   arguments_none  
1417                     ; This procedure will verify that the common shared commands work .
1418     003e    common_test__actual equ common_test__bytes__base+0
1419                     ; Print the ID information :
1420                     ; ID reset :
1421                     ;   call slave_send {{ 0xfd }}  
1422 270 30fd            movlw 253
1423 271 00cb            movwf slave_send__data
1424 272 2343            call slave_send
1425                     ; Read the fixed bytes :
1426                     ;   call common_test_id_match {{ 1 , 0xc0 }}  
1427 273 3001            movlw 1
1428 274 00c0            movwf common_test_id_match__desired
1429 275 30c0            movlw 192
1430 276 00c1            movwf common_test_id_match__test_number
1431 277 22e5            call common_test_id_match
1432                     ;   call common_test_id_match {{ 0 , 0xc1 }}  
1433 278 01c0            clrf common_test_id_match__desired
1434 279 30c1            movlw 193
1435 27a 00c1            movwf common_test_id_match__test_number
1436 27b 22e5            call common_test_id_match
1437                     ;   call common_test_id_match {{ 8 , 0xc2 }}  
1438 27c 3008            movlw 8
1439 27d 00c0            movwf common_test_id_match__desired
1440 27e 30c2            movlw 194
1441 27f 00c1            movwf common_test_id_match__test_number
1442 280 22e5            call common_test_id_match
1443                     ;   call common_test_id_match {{ 0 , 0xc3 }}  
1444 281 01c0            clrf common_test_id_match__desired
1445 282 30c3            movlw 195
1446 283 00c1            movwf common_test_id_match__test_number
1447 284 22e5            call common_test_id_match
1448                     ;   call common_test_id_match {{ 0 , 0xc4 }}  
1449 285 01c0            clrf common_test_id_match__desired
1450 286 30c4            movlw 196
1451 287 00c1            movwf common_test_id_match__test_number
1452 288 22e5            call common_test_id_match
1453                     ;   call common_test_id_match {{ 0 , 0xc5 }}  
1454 289 01c0            clrf common_test_id_match__desired
1455 28a 30c5            movlw 197
1456 28b 00c1            movwf common_test_id_match__test_number
1457 28c 22e5            call common_test_id_match
1458                     ;   call common_test_id_match {{ 0 , 0xc6 }}  
1459 28d 01c0            clrf common_test_id_match__desired
1460 28e 30c6            movlw 198
1461 28f 00c1            movwf common_test_id_match__test_number
1462 290 22e5            call common_test_id_match
1463                     ;   call common_test_id_match {{ 0 , 0xc7 }}  
1464 291 01c0            clrf common_test_id_match__desired
1465 292 30c7            movlw 199
1466 293 00c1            movwf common_test_id_match__test_number
1467 294 22e5            call common_test_id_match
1468                     ;   call master_crlf {{ }}  
1469 295 230c            call master_crlf
1470                     ;   call common_test_id_bytes8 {{ }}  
1471 296 22f0            call common_test_id_bytes8
1472                     ;   call common_test_id_bytes8 {{ }}  
1473 297 22f0            call common_test_id_bytes8
1474                     ; Read the brick name :
1475                     ;   call common_test_id_string {{ }}  
1476 298 22fa            call common_test_id_string
1477                     ; Read the vendor name :
1478                     ;   call common_test_id_string {{ }}  
1479 299 22fa            call common_test_id_string
1480                     ; Verfify that we don ' t read off the end of the id and crash :
1481                     ;   call common_test_id_next {{ }}  
1482 29a 2305            call common_test_id_next
1483 29b 0844            movf common_test_id_next__0return__byte,w
1484                     ; Reset id :
1485                     ;   call slave_send {{ 0xfd }}  
1486 29c 30fd            movlw 253
1487 29d 00cb            movwf slave_send__data
1488 29e 2343            call slave_send
1489                     ; Verify that we are still alive :
1490                     ;   call common_test_id_match {{ 1 , 0xc8 }}  
1491 29f 3001            movlw 1
1492 2a0 00c0            movwf common_test_id_match__desired
1493 2a1 30c8            movlw 200
1494 2a2 00c1            movwf common_test_id_match__test_number
1495 2a3 22e5            call common_test_id_match
1496                     ; Read glitch :
1497                     ; Clear glitch register :
1498                     ;   call slave_send {{ 0xfe }}  
1499 2a4 30fe            movlw 254
1500 2a5 00cb            movwf slave_send__data
1501 2a6 2343            call slave_send
1502                     ;   actual := slave_get {{ }}  
1503 2a7 233d            call slave_get
1504 2a8 084a            movf slave_get__0return__byte,w
1505 2a9 00be            movwf common_test__actual
1506                     ; Send a couple of glitches :
1507                     ;   call slave_send {{ 0xff }}  
1508 2aa 30ff            movlw 255
1509 2ab 00cb            movwf slave_send__data
1510 2ac 2343            call slave_send
1511                     ;   call slave_send {{ 0xff }}  
1512 2ad 30ff            movlw 255
1513 2ae 00cb            movwf slave_send__data
1514 2af 2343            call slave_send
1515                     ; Read the glitch register :
1516                     ;   call slave_send {{ 0xfe }}  
1517 2b0 30fe            movlw 254
1518 2b1 00cb            movwf slave_send__data
1519 2b2 2343            call slave_send
1520                     ; if { slave_get {{ }} != 2 } start
1521 2b3 233d            call slave_get
1522 2b4 084a            movf slave_get__0return__byte,w
1523 2b5 00bf            movwf common_test__551byte0
1524 2b6 3002            movlw 2
1525 2b7 023f            subwf common_test__551byte0,w
1526                     ; expression=`{ slave_get {{ }} != 2 }' exp_delay=3 true_delay=3  false_delay=0 true_size=5 false_size=0
1527 2b8 1903            btfsc z___byte,z___bit
1528 2b9 2abf            goto label551__1end
1529                     ; if { slave_get {{ }} != 2 } body start
1530                     ;   call master_fail {{ common_string , 0xc9 }}  
1531 2ba 3021            movlw LOW common_string+1
1532 2bb 00c5            movwf master_fail__test_name
1533 2bc 30c9            movlw 201
1534 2bd 00c6            movwf master_fail__test_number
1535 2be 2313            call master_fail
1536                     ; if { slave_get {{ }} != 2 } body end
1537             label551__1end:
1538                     ; if exp=` slave_get ## {{ }} != 2 ' empty false
1539                     ; Other expression=`{ slave_get {{ }} != 2 }' delay=-1
1540                     ; if { slave_get {{ }} != 2 } end
1541                     ; Do a clock pulse :
1542                     ;   call slave_send {{ 0xfb }}  
1543 2bf 30fb            movlw 251
1544 2c0 00cb            movwf slave_send__data
1545 2c1 2343            call slave_send
1546                     ; if { slave_get {{ }} != 0 } start
1547 2c2 233d            call slave_get
1548 2c3 084a            movf slave_get__0return__byte,w
1549                     ; expression=`{ slave_get {{ }} != 0 }' exp_delay=0 true_delay=3  false_delay=0 true_size=5 false_size=0
1550 2c4 1903            btfsc z___byte,z___bit
1551 2c5 2acb            goto label557__0end
1552                     ; if { slave_get {{ }} != 0 } body start
1553                     ;   call master_fail {{ common_string , 0xca }}  
1554 2c6 3021            movlw LOW common_string+1
1555 2c7 00c5            movwf master_fail__test_name
1556 2c8 30ca            movlw 202
1557 2c9 00c6            movwf master_fail__test_number
1558 2ca 2313            call master_fail
1559                     ; if { slave_get {{ }} != 0 } body end
1560             label557__0end:
1561                     ; if exp=` slave_get ## {{ }} != 0 ' empty false
1562                     ; Other expression=`{ slave_get {{ }} != 0 }' delay=-1
1563                     ; if { slave_get {{ }} != 0 } end
1564                     ; Read clock :
1565                     ;   call slave_send {{ 0xfa }}  
1566 2cb 30fa            movlw 250
1567 2cc 00cb            movwf slave_send__data
1568 2cd 2343            call slave_send
1569                     ;   actual := slave_get {{ }}  
1570 2ce 233d            call slave_get
1571 2cf 084a            movf slave_get__0return__byte,w
1572 2d0 00be            movwf common_test__actual
1573                     ; Increment :
1574                     ;   call slave_send {{ 0xf9 }}  
1575 2d1 30f9            movlw 249
1576 2d2 00cb            movwf slave_send__data
1577 2d3 2343            call slave_send
1578                     ; Decrement :
1579                     ;   call slave_send {{ 0xf8 }}  
1580 2d4 30f8            movlw 248
1581 2d5 00cb            movwf slave_send__data
1582 2d6 2343            call slave_send
1583                     ; Read clock again :
1584                     ;   call slave_send {{ 0xfa }}  
1585 2d7 30fa            movlw 250
1586 2d8 00cb            movwf slave_send__data
1587 2d9 2343            call slave_send
1588                     ; if { actual != slave_get {{ }} } start
1589 2da 233d            call slave_get
1590 2db 084a            movf slave_get__0return__byte,w
1591 2dc 023e            subwf common_test__actual,w
1592                     ; expression=`{ actual != slave_get {{ }} }' exp_delay=1 true_delay=3  false_delay=0 true_size=5 false_size=0
1593 2dd 1903            btfsc z___byte,z___bit
1594 2de 2ae4            goto label569__0end
1595                     ; if { actual != slave_get {{ }} } body start
1596                     ;   call master_fail {{ common_string , 0xcb }}  
1597 2df 3021            movlw LOW common_string+1
1598 2e0 00c5            movwf master_fail__test_name
1599 2e1 30cb            movlw 203
1600 2e2 00c6            movwf master_fail__test_number
1601 2e3 2313            call master_fail
1602                     ; if { actual != slave_get {{ }} } body end
1603             label569__0end:
1604                     ; if exp=` actual != slave_get ## {{ }} ' empty false
1605                     ; Other expression=`{ actual != slave_get {{ }} }' delay=-1
1606                     ; if { actual != slave_get {{ }} } end
1607                     ; procedure common_test end
1608 2e4 3400            retlw 0
1609             
1610                     ; procedure common_test_id_match start
1611             common_test_id_match:
1612     0040    common_test_id_match__variables__base equ global__variables__bank0+32
1613     0040    common_test_id_match__bytes__base equ common_test_id_match__variables__base+0
1614     0042    common_test_id_match__bits__base equ common_test_id_match__variables__base+2
1615     0002    common_test_id_match__total__bytes equ 2
1616     0040    common_test_id_match__desired equ common_test_id_match__bytes__base+0
1617     0041    common_test_id_match__test_number equ common_test_id_match__bytes__base+1
1618                     ; This procedure will verify that the next byte in the id is < desired > .
1619                     ; if { desired != common_test_id_next {{ }} } start
1620 2e5 2305            call common_test_id_next
1621 2e6 0844            movf common_test_id_next__0return__byte,w
1622 2e7 0240            subwf common_test_id_match__desired,w
1623                     ; expression=`{ desired != common_test_id_next {{ }} }' exp_delay=1 true_delay=3  false_delay=0 true_size=5 false_size=0
1624 2e8 1903            btfsc z___byte,z___bit
1625 2e9 2aef            goto label581__0end
1626                     ; if { desired != common_test_id_next {{ }} } body start
1627                     ;   call master_fail {{ common_string , test_number }}  
1628 2ea 3021            movlw LOW common_string+1
1629 2eb 00c5            movwf master_fail__test_name
1630 2ec 0841            movf common_test_id_match__test_number,w
1631 2ed 00c6            movwf master_fail__test_number
1632 2ee 2313            call master_fail
1633                     ; if { desired != common_test_id_next {{ }} } body end
1634             label581__0end:
1635                     ; if exp=` desired != common_test_id_next ## {{ }} ' empty false
1636                     ; Other expression=`{ desired != common_test_id_next {{ }} }' delay=-1
1637                     ; if { desired != common_test_id_next {{ }} } end
1638                     ; procedure common_test_id_match end
1639 2ef 3400            retlw 0
1640             
1641                     ; procedure common_test_id_bytes8 start
1642             common_test_id_bytes8:
1643     0042    common_test_id_bytes8__variables__base equ global__variables__bank0+34
1644     0042    common_test_id_bytes8__bytes__base equ common_test_id_bytes8__variables__base+0
1645     0043    common_test_id_bytes8__bits__base equ common_test_id_bytes8__variables__base+1
1646     0001    common_test_id_bytes8__total__bytes equ 1
1647                     ;   arguments_none  
1648                     ; This procedure will print out the next 8 bytes of the id in octal .
1649     0042    common_test_id_bytes8__count equ common_test_id_bytes8__bytes__base+0
1650                     ; `count_down count 8 ...' start
1651 2f0 3008            movlw 8
1652 2f1 00c2            movwf common_test_id_bytes8__count
1653             common_test_id_bytes8__594_loop:
1654                     ;   call master_octal {{ common_test_id_next {{ }} }}  
1655 2f2 2305            call common_test_id_next
1656 2f3 0844            movf common_test_id_next__0return__byte,w
1657 2f4 00c8            movwf master_octal__number
1658 2f5 2324            call master_octal
1659 2f6 0bc2            decfsz common_test_id_bytes8__count,f
1660 2f7 2af2            goto common_test_id_bytes8__594_loop
1661             common_test_id_bytes8__594_done:
1662                     ; `count_down count 8 ...' end
1663                     ;   call master_crlf {{ }}  
1664 2f8 230c            call master_crlf
1665                     ; procedure common_test_id_bytes8 end
1666 2f9 3400            retlw 0
1667             
1668                     ; procedure common_test_id_string start
1669             common_test_id_string:
1670     0043    common_test_id_string__variables__base equ global__variables__bank0+35
1671     0043    common_test_id_string__bytes__base equ common_test_id_string__variables__base+0
1672     0044    common_test_id_string__bits__base equ common_test_id_string__variables__base+1
1673     0001    common_test_id_string__total__bytes equ 1
1674                     ;   arguments_none  
1675                     ; This procedure will print out the next id string .
1676     0043    common_test_id_string__count equ common_test_id_string__bytes__base+0
1677                     ; `count_down count  common_test_id_next ## {{ }}  ...' start
1678 2fa 2305            call common_test_id_next
1679 2fb 0844            movf common_test_id_next__0return__byte,w
1680 2fc 00c3            movwf common_test_id_string__count
1681             common_test_id_string__608_loop:
1682                     ;   call master_send {{ common_test_id_next {{ }} }}  
1683 2fd 2305            call common_test_id_next
1684 2fe 0844            movf common_test_id_next__0return__byte,w
1685 2ff 00d4            movwf master_send__character
1686 300 2397            call master_send
1687 301 0bc3            decfsz common_test_id_string__count,f
1688 302 2afd            goto common_test_id_string__608_loop
1689             common_test_id_string__608_done:
1690                     ; `count_down count  common_test_id_next ## {{ }}  ...' end
1691                     ;   call master_crlf {{ }}  
1692 303 230c            call master_crlf
1693                     ; procedure common_test_id_string end
1694 304 3400            retlw 0
1695             
1696                     ; procedure common_test_id_next start
1697             common_test_id_next:
1698     0044    common_test_id_next__variables__base equ global__variables__bank0+36
1699     0044    common_test_id_next__bytes__base equ common_test_id_next__variables__base+0
1700     0045    common_test_id_next__bits__base equ common_test_id_next__variables__base+1
1701     0001    common_test_id_next__total__bytes equ 1
1702                     ;   arguments_none  
1703     0044    common_test_id_next__0return__byte equ common_test_id_next__bytes__base+0
1704                     ; This procedure returns the next byte from the identification string .
1705                     ;   call slave_send {{ 0xfc }}  
1706 305 30fc            movlw 252
1707 306 00cb            movwf slave_send__data
1708 307 2343            call slave_send
1709                     ;   return slave_get {{ }}  
1710 308 233d            call slave_get
1711 309 084a            movf slave_get__0return__byte,w
1712 30a 00c4            movwf common_test_id_next__0return__byte
1713 30b 3400            retlw 0
1714                     ; procedure common_test_id_next end
1715                     ; comment {The following procedures are used to communicate with the master :}
1716             
1717                     ; procedure master_crlf start
1718             master_crlf:
1719     0045    master_crlf__variables__base equ global__variables__bank0+37
1720     0045    master_crlf__bytes__base equ master_crlf__variables__base+0
1721     0045    master_crlf__bits__base equ master_crlf__variables__base+0
1722     0000    master_crlf__total__bytes equ 0
1723                     ;   arguments_none  
1724                     ; This procedure will output a carriage - return line - feed
1725                     ; to the master .
1726                     ;   call master_send {{ cr }}  
1727 30c 300d            movlw 13
1728 30d 00d4            movwf master_send__character
1729 30e 2397            call master_send
1730                     ;   call master_send {{ lf }}  
1731 30f 300a            movlw 10
1732 310 00d4            movwf master_send__character
1733 311 2397            call master_send
1734                     ; procedure master_crlf end
1735 312 3400            retlw 0
1736             
1737                     ; procedure master_fail start
1738             master_fail:
1739     0045    master_fail__variables__base equ global__variables__bank0+37
1740     0045    master_fail__bytes__base equ master_fail__variables__base+0
1741     0047    master_fail__bits__base equ master_fail__variables__base+2
1742     0002    master_fail__total__bytes equ 2
1743     0045    master_fail__test_name equ master_fail__bytes__base+0
1744     0046    master_fail__test_number equ master_fail__bytes__base+1
1745                     ; This procedure will output ` fail ' followed by a carriage return
1746                     ; and line feed .
1747                     ;   call master_string {{ fail_string }}  
1748 313 302f            movlw LOW fail_string+1
1749 314 00d5            movwf master_string__message
1750 315 239d            call master_string
1751                     ;   call master_string {{ test_name }}  
1752 316 0845            movf master_fail__test_name,w
1753 317 00d5            movwf master_string__message
1754 318 239d            call master_string
1755                     ;   call master_octal {{ test_number }}  
1756 319 0846            movf master_fail__test_number,w
1757 31a 00c8            movwf master_octal__number
1758 31b 2324            call master_octal
1759                     ;   call master_crlf {{ }}  
1760 31c 230c            call master_crlf
1761                     ; procedure master_fail end
1762 31d 3400            retlw 0
1763             
1764                     ; procedure master_get start
1765             master_get:
1766     0047    master_get__variables__base equ global__variables__bank0+39
1767     0047    master_get__bytes__base equ master_get__variables__base+0
1768     0048    master_get__bits__base equ master_get__variables__base+1
1769     0001    master_get__total__bytes equ 1
1770                     ;   arguments_none  
1771     0047    master_get__0return__byte equ master_get__bytes__base+0
1772                     ; This procedure will get the next byte or return 0xfc if
1773                     ; no byte is forthcoming .
1774                     ;   return get_byte {{ rx_master_mask }}  
1775 31e 3002            movlw 2
1776 31f 00cc            movwf get_byte__mask
1777 320 2349            call get_byte
1778 321 084d            movf get_byte__0return__byte,w
1779 322 00c7            movwf master_get__0return__byte
1780 323 3400            retlw 0
1781                     ; procedure master_get end
1782             
1783                     ; procedure master_octal start
1784             master_octal:
1785     0048    master_octal__variables__base equ global__variables__bank0+40
1786     0048    master_octal__bytes__base equ master_octal__variables__base+0
1787     004a    master_octal__bits__base equ master_octal__variables__base+2
1788     0002    master_octal__total__bytes equ 2
1789     0049    master_octal__668byte0 equ master_octal__bytes__base+1
1790     0049    master_octal__669byte0 equ master_octal__bytes__base+1
1791     0048    master_octal__number equ master_octal__bytes__base+0
1792                     ; This procedure will output < number > in octal to the tx port .
1793                     ; Output the character in octal :
1794                     ;   call master_send {{ {{ number >> 6 }} + 0c'0' }}  
1795 324 0e48            swapf master_octal__number,w
1796 325 00c9            movwf master_octal__668byte0
1797 326 0cc9            rrf master_octal__668byte0,f
1798 327 0c49            rrf master_octal__668byte0,w
1799 328 3903            andlw 3
1800 329 3e30            addlw 48
1801 32a 00d4            movwf master_send__character
1802 32b 2397            call master_send
1803                     ;   call master_send {{ {{ {{ number >> 3 }} & 7 }} + 0c'0' }}  
1804 32c 0c48            rrf master_octal__number,w
1805 32d 00c9            movwf master_octal__669byte0
1806 32e 0cc9            rrf master_octal__669byte0,f
1807 32f 0c49            rrf master_octal__669byte0,w
1808 330 3907            andlw 7
1809 331 3e30            addlw 48
1810 332 00d4            movwf master_send__character
1811 333 2397            call master_send
1812                     ;   call master_send {{ {{ number & 7 }} + 0c'0' }}  
1813 334 3007            movlw 7
1814 335 0548            andwf master_octal__number,w
1815 336 3e30            addlw 48
1816 337 00d4            movwf master_send__character
1817 338 2397            call master_send
1818                     ;   call master_send {{ sp }}  
1819 339 3020            movlw 32
1820 33a 00d4            movwf master_send__character
1821 33b 2397            call master_send
1822                     ; procedure master_octal end
1823 33c 3400            retlw 0
1824             
1825                     ; procedure slave_get start
1826             slave_get:
1827     004a    slave_get__variables__base equ global__variables__bank0+42
1828     004a    slave_get__bytes__base equ slave_get__variables__base+0
1829     004b    slave_get__bits__base equ slave_get__variables__base+1
1830     0001    slave_get__total__bytes equ 1
1831                     ;   arguments_none  
1832     004a    slave_get__0return__byte equ slave_get__bytes__base+0
1833                     ; This procedure will get a byte from the slave or return 0xfc
1834                     ; if no byte is forthcoming .
1835                     ;   return get_byte {{ rx_slave_mask }}  
1836 33d 3020            movlw 32
1837 33e 00cc            movwf get_byte__mask
1838 33f 2349            call get_byte
1839 340 084d            movf get_byte__0return__byte,w
1840 341 00ca            movwf slave_get__0return__byte
1841 342 3400            retlw 0
1842                     ; procedure slave_get end
1843             
1844                     ; procedure slave_send start
1845             slave_send:
1846     004b    slave_send__variables__base equ global__variables__bank0+43
1847     004b    slave_send__bytes__base equ slave_send__variables__base+0
1848     004c    slave_send__bits__base equ slave_send__variables__base+1
1849     0001    slave_send__total__bytes equ 1
1850     004b    slave_send__data equ slave_send__bytes__base+0
1851                     ; This procedure will send one byte of < data > to the slave .
1852                     ;   call send_byte {{ data , tx_slave_mask }}  
1853 343 084b            movf slave_send__data,w
1854 344 00d0            movwf send_byte__char
1855 345 3010            movlw 16
1856 346 00d1            movwf send_byte__mask
1857 347 2371            call send_byte
1858                     ; procedure slave_send end
1859 348 3400            retlw 0
1860                     ; comment {The last procedures do character sending and receiving :}
1861             
1862                     ; procedure get_byte start
1863             get_byte:
1864     004c    get_byte__variables__base equ global__variables__bank0+44
1865     004c    get_byte__bytes__base equ get_byte__variables__base+0
1866     0050    get_byte__bits__base equ get_byte__variables__base+4
1867     0004    get_byte__total__bytes equ 4
1868     004c    get_byte__mask equ get_byte__bytes__base+0
1869     004d    get_byte__0return__byte equ get_byte__bytes__base+1
1870                     ; Get an 8 - bit byte from < mask > bit of < porta > and return it .
1871                     ; If no character shows up in a while 0xfc is returned .
1872     004e    get_byte__count equ get_byte__bytes__base+2
1873     004f    get_byte__char equ get_byte__bytes__base+3
1874                     ; Wait until a start bit arrives :
1875                     ;   count := 0  
1876 349 01ce            clrf get_byte__count
1877                     ; `while  portb & mask != 0  ...' start
1878             get_byte__707while__continue:
1879 34a 0806            movf portb,w
1880 34b 054c            andwf get_byte__mask,w
1881                     ; expression=` portb & mask != 0 ' exp_delay=2 true_delay=1  false_delay=2 true_size=9 false_size=1
1882 34c 1903            btfsc z___byte,z___bit
1883 34d 2b57            goto get_byte__707while__break
1884                     ;   count := count - 1  
1885 34e 03ce            decf get_byte__count,f
1886                     ; if { count = 0 } start
1887 34f 084e            movf get_byte__count,w
1888                     ; expression=`{ count = 0 }' exp_delay=1 true_delay=3  false_delay=0 true_size=3 false_size=0
1889 350 1d03            btfss z___byte,z___bit
1890 351 2b55            goto label709__0end
1891                     ; if { count = 0 } body start
1892                     ;   return 0xfc  
1893 352 30fc            movlw 252
1894 353 00cd            movwf get_byte__0return__byte
1895 354 3400            retlw 0
1896                     ; if { count = 0 } body end
1897             label709__0end:
1898                     ; if exp=` count = 0 ' empty false
1899                     ; Other expression=`{ count = 0 }' delay=-1
1900                     ; if { count = 0 } end
1901                     ;   call delay {{ }}  
1902 355 23b0            call delay
1903 356 2b4a            goto get_byte__707while__continue
1904                     ; if exp=` portb & mask != 0 ' false goto
1905                     ; Other expression=` portb & mask != 0 ' delay=-1
1906             get_byte__707while__break:
1907                     ; `while  portb & mask != 0  ...' end
1908                     ; Skip over the start bit :
1909                     ;   call delay {{ }}  
1910 357 23b0            call delay
1911                     ;   call delay {{ }}  
1912 358 23b0            call delay
1913                     ;   call delay {{ }}  
1914 359 23b0            call delay
1915                     ; Sample in the middle third of each data bit :
1916                     ;   char := 0  
1917 35a 01cf            clrf get_byte__char
1918                     ; `count_down count 8 ...' start
1919 35b 3008            movlw 8
1920 35c 00ce            movwf get_byte__count
1921             get_byte__722_loop:
1922                     ;   call delay {{ }}  
1923 35d 23b0            call delay
1924                     ; 2 instructions :
1925                     ;   char := char >> 1  
1926 35e 1003            bcf c___byte,c___bit
1927 35f 0ccf            rrf get_byte__char,f
1928                     ; 3 instructions :
1929                     ; if { portb & mask != 0 } start
1930 360 0806            movf portb,w
1931 361 054c            andwf get_byte__mask,w
1932                     ; expression=`{ portb & mask != 0 }' exp_delay=2 true_delay=1  false_delay=0 true_size=1 false_size=0
1933 362 1d03            btfss z___byte,z___bit
1934                     ; if { portb & mask != 0 } body start
1935                     ;   char @ 7 := 1  
1936                     ; Select char @ 7
1937     004f    get_byte__char__728select0 equ get_byte__char+0
1938     004f    get_byte__char__728select0__byte equ get_byte__char+0
1939     0007    get_byte__char__728select0__bit equ 7
1940 363 17cf            bsf get_byte__char__728select0__byte,get_byte__char__728select0__bit
1941                     ; if { portb & mask != 0 } body end
1942                     ; if exp=` portb & mask != 0 ' false skip delay=4
1943                     ; Other expression=`{ portb & mask != 0 }' delay=4
1944                     ; if { portb & mask != 0 } end
1945                     ; 3 more instructions at the end of the loop :
1946                     ; 2 + 3 + 3 = 8
1947                     ;   call delay {{ }}  
1948 364 23b0            call delay
1949                     ;   call delay {{ }}  
1950 365 23b0            call delay
1951                     ; nop extra_instructions_per_bit - 8
1952                     ; Delay 4 cycles
1953 366 0000            nop
1954 367 0000            nop
1955 368 0000            nop
1956 369 0000            nop
1957 36a 0bce            decfsz get_byte__count,f
1958 36b 2b5d            goto get_byte__722_loop
1959             get_byte__722_done:
1960                     ; `count_down count 8 ...' end
1961                     ; Skip over 2 / 3 of the stop bit :
1962                     ;   call delay {{ }}  
1963 36c 23b0            call delay
1964                     ;   call delay {{ }}  
1965 36d 23b0            call delay
1966                     ;   return char  
1967 36e 084f            movf get_byte__char,w
1968 36f 00cd            movwf get_byte__0return__byte
1969 370 3400            retlw 0
1970                     ; procedure get_byte end
1971             
1972                     ; procedure send_byte start
1973             send_byte:
1974     0050    send_byte__variables__base equ global__variables__bank0+48
1975     0050    send_byte__bytes__base equ send_byte__variables__base+0
1976     0054    send_byte__bits__base equ send_byte__variables__base+4
1977     0004    send_byte__total__bytes equ 4
1978     0050    send_byte__char equ send_byte__bytes__base+0
1979     0051    send_byte__mask equ send_byte__bytes__base+1
1980                     ; Send < char > to < mask > bit of < porta > .
1981     0052    send_byte__count equ send_byte__bytes__base+2
1982     0053    send_byte__mark equ send_byte__bytes__base+3
1983                     ; Send the start bit :
1984                     ; 3 instructions :
1985                     ;   mark := mask ^ space  
1986 371 30ff            movlw 255
1987 372 0651            xorwf send_byte__mask,w
1988 373 00d3            movwf send_byte__mark
1989                     ; 1 instruction < mark is already in W > :
1990                     ;   portb := mark  
1991 374 0086            movwf portb
1992                     ;   call delay {{ }}  
1993 375 23b0            call delay
1994                     ;   call delay {{ }}  
1995 376 23b0            call delay
1996                     ;   call delay {{ }}  
1997 377 23b0            call delay
1998                     ; 2 instructions to set up loop :
1999                     ; 2 + 2 + 2 = 6
2000                     ; nop extra_instructions_per_bit - 6
2001                     ; Delay 6 cycles
2002 378 0000            nop
2003 379 0000            nop
2004 37a 0000            nop
2005 37b 0000            nop
2006 37c 0000            nop
2007 37d 0000            nop
2008                     ; Send the data :
2009                     ; `count_down count 8 ...' start
2010 37e 3008            movlw 8
2011 37f 00d2            movwf send_byte__count
2012             send_byte__767_loop:
2013                     ; 5 Instructions :
2014                     ; if { char @ 0 } start
2015                     ; Alias variable for select char @ 0
2016     0050    send_byte__char__769select0 equ send_byte__char+0
2017     0050    send_byte__char__769select0__byte equ send_byte__char+0
2018     0000    send_byte__char__769select0__bit equ 0
2019                     ; expression=`{ char @ 0 }' exp_delay=0 true_delay=1  false_delay=1 true_size=1 false_size=1
2020 380 1850            btfsc send_byte__char__769select0__byte,send_byte__char__769select0__bit
2021                     ; if { char @ 0 } body start
2022                     ;   portb := space  
2023 381 30ff            movlw 255
2024                     ; 1 instructions found for sharing
2025 382 1c50            btfss send_byte__char__769select0__byte,send_byte__char__769select0__bit
2026                     ; else body start
2027                     ;   portb := mark  
2028 383 0853            movf send_byte__mark,w
2029                     ; 1 instructions found for sharing
2030                     ; if exp=` char @ 0 ' single true and false skip delay=4
2031                     ; Other expression=`{ char @ 0 }' delay=4
2032                     ; 1 shared instructions follow
2033 384 0086            movwf portb
2034                     ; if { char @ 0 } end
2035                     ; 2 Instructions
2036                     ;   char := char >> 1  
2037 385 1003            bcf c___byte,c___bit
2038 386 0cd0            rrf send_byte__char,f
2039                     ;   call delay {{ }}  
2040 387 23b0            call delay
2041                     ;   call delay {{ }}  
2042 388 23b0            call delay
2043                     ;   call delay {{ }}  
2044 389 23b0            call delay
2045                     ; 3 instructions for test and jump at end of loop
2046                     ; 2 + 3 + 5 = 10
2047                     ; nop extra_instructions_per_bit - 10
2048                     ; Delay 2 cycles
2049 38a 0000            nop
2050 38b 0000            nop
2051 38c 0bd2            decfsz send_byte__count,f
2052 38d 2b80            goto send_byte__767_loop
2053             send_byte__767_done:
2054                     ; `count_down count 8 ...' end
2055                     ; Send the stop bit :
2056                     ;   portb := space  
2057 38e 30ff            movlw 255
2058 38f 0086            movwf portb
2059                     ;   call delay {{ }}  
2060 390 23b0            call delay
2061                     ;   call delay {{ }}  
2062 391 23b0            call delay
2063                     ;   call delay {{ }}  
2064 392 23b0            call delay
2065                     ; + 1 = > NOP to finish looop
2066                     ; - 2 = > portb := space
2067                     ; - 4 = > call / return
2068                     ; - 4 = > two arguments
2069                     ; nop extra_instructions_per_bit + 1 - 2 - 4 - 4
2070                     ; Delay 3 cycles
2071 393 0000            nop
2072 394 0000            nop
2073 395 0000            nop
2074                     ; procedure send_byte end
2075 396 3400            retlw 0
2076             
2077                     ; procedure master_send start
2078             master_send:
2079     0054    master_send__variables__base equ global__variables__bank0+52
2080     0054    master_send__bytes__base equ master_send__variables__base+0
2081     0055    master_send__bits__base equ master_send__variables__base+1
2082     0001    master_send__total__bytes equ 1
2083     0054    master_send__character equ master_send__bytes__base+0
2084                     ; This procedure will output < character > to the master .
2085                     ;   call send_byte {{ character , tx_master_mask }}  
2086 397 0854            movf master_send__character,w
2087 398 00d0            movwf send_byte__char
2088 399 3004            movlw 4
2089 39a 00d1            movwf send_byte__mask
2090 39b 2371            call send_byte
2091                     ; procedure master_send end
2092 39c 3400            retlw 0
2093             
2094                     ; procedure master_string start
2095             master_string:
2096     0055    master_string__variables__base equ global__variables__bank0+53
2097     0055    master_string__bytes__base equ master_string__variables__base+0
2098     0058    master_string__bits__base equ master_string__variables__base+3
2099     0003    master_string__total__bytes equ 3
2100     0055    master_string__message equ master_string__bytes__base+0
2101                     ; This procedure will output < message > to the master .
2102     0056    master_string__size equ master_string__bytes__base+1
2103     0057    master_string__index equ master_string__bytes__base+2
2104                     ;   index := 0  
2105 39d 01d7            clrf master_string__index
2106                     ; `while  index < message . size  ...' start
2107             master_string__815while__continue:
2108 39e 018a            clrf pclath___register
2109 39f 0855            movf master_string__message,w
2110 3a0 200e            call string___fetch
2111 3a1 0257            subwf master_string__index,w
2112                     ; expression=` index < message . size ' exp_delay=4 true_delay=7  false_delay=2 true_size=8 false_size=1
2113 3a2 1803            btfsc c___byte,c___bit
2114 3a3 2bac            goto master_string__815while__break
2115                     ;   call master_send {{ message ~~ {{ index }} }}  
2116 3a4 0a57            incf master_string__index,w
2117 3a5 0755            addwf master_string__message,w
2118 3a6 018a            clrf pclath___register
2119 3a7 200e            call string___fetch
2120 3a8 00d4            movwf master_send__character
2121 3a9 2397            call master_send
2122                     ;   index := index + 1  
2123 3aa 0ad7            incf master_string__index,f
2124 3ab 2b9e            goto master_string__815while__continue
2125                     ; if exp=` index < message . size ' false goto
2126                     ; Other expression=` index < message . size ' delay=-1
2127             master_string__815while__break:
2128                     ; `while  index < message . size  ...' end
2129                     ;   call master_send {{ sp }}  
2130 3ac 3020            movlw 32
2131 3ad 00d4            movwf master_send__character
2132 3ae 2397            call master_send
2133                     ; procedure master_string end
2134 3af 3400            retlw 0
2135             
2136                     ; procedure delay start
2137                     ; optimize 0
2138             delay:
2139     0058    delay__variables__base equ global__variables__bank0+56
2140     0058    delay__bytes__base equ delay__variables__base+0
2141     0059    delay__bits__base equ delay__variables__base+1
2142     0001    delay__total__bytes equ 1
2143     0058    delay__822byte1 equ delay__bytes__base+0
2144                     ;   arguments_none  
2145                     ;   uniform_delay delay_instructions  
2146                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2147                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2148                     ; Delay 1 third of a bit :
2149                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2150                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2151                     ; Soak up remaining 339 cycles
2152                     ; Delay 339 cycles
2153 3b0 3070            movlw 112
2154 3b1 00d8            movwf delay__822byte1
2155             delay__822delay0:
2156 3b2 0bd8            decfsz delay__822byte1,f
2157 3b3 2bb2            goto delay__822delay0
2158 3b4 0000            nop
2159 3b5 0000            nop
2160                     ; procedure delay end
2161 3b6 3400            retlw 0
2162                     ; optimize 1
2163             
2164                     ; Register bank 0 used 57 bytes of 96 available bytes
2165                     ; Register bank 1 used 0 bytes of 80 available bytes
2166                     ; Register bank 2 used 0 bytes of 48 available bytes
2167                     ; Register bank 3 used 0 bytes of 0 available bytes
2168             
2169                     end

