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

