  1                     radix dec
  2     0020    global__variables__bank0 equ 32
  3     00a0    global__variables__bank1 equ 160
  4     0120    global__variables__bank2 equ 288
  5     01f0    global__variables__bank3 equ 496
  6     0067    global__bit__variables__bank0 equ 103
  7     00a0    global__bit__variables__bank1 equ 160
  8     0120    global__bit__variables__bank2 equ 288
  9     01f0    global__bit__variables__bank3 equ 496
 10     0000    indf___register equ 0
 11     0002    pcl___register equ 2
 12     0003    c___byte equ 3
 13     0000    c___bit equ 0
 14     0003    z___byte equ 3
 15     0002    z___bit equ 2
 16     0003    rp0___byte equ 3
 17     0005    rp0___bit equ 5
 18     0003    rp1___byte equ 3
 19     0006    rp1___bit equ 6
 20     0003    irp___byte equ 3
 21     0007    irp___bit equ 7
 22     0085    trisa___register equ 0x85
 23     0086    trisb___register equ 0x86
 24     0004    fsr___register equ 4
 25     000a    pclath___register equ 10
 26                     org 0
 27             start:
 28 000 0000            nop
 29 001 0000            nop
 30 002 0000            nop
 31 003 2805            goto skip___interrupt
 32             interrupt___vector:
 33 004 0009            retfie
 34             skip___interrupt:
 35                     ; Initialize A/D system to allow digital I/O
 36 005 3007            movlw 7
 37 006 009f            movwf 31
 38                     ; Switch from register bank 0 to register bank 1 (which contains 159)
 39 007 1683            bsf rp0___byte,rp0___bit
 40                     ; Register bank is now 1
 41 008 019f            clrf 159
 42                     ; Initialize TRIS registers
 43 009 30eb            movlw 235
 44 00a 0086            movwf trisb___register
 45 00b 018a            clrf pclath___register
 46                     ; Switch from register bank 1 to register bank 0
 47 00c 1283            bcf rp0___byte,rp0___bit
 48                     ; Register bank is now 0
 49 00d 286e            goto main
 50                     ; comment #############################################################################
 51                     ; comment {}
 52                     ; comment {Copyright < c > 1999 - 2001 by Wayne C . Gramlich .}
 53                     ; comment {All rights reserved .}
 54                     ; comment {}
 55                     ; comment {Permission to use , copy , modify , distribute , and sell this software}
 56                     ; comment {for any purpose is hereby granted without fee provided that the above}
 57                     ; comment {copyright notice and this permission are retained . The author makes}
 58                     ; comment {no representations about the suitability of this software for any purpose .}
 59                     ; comment {It is provided { as is } without express or implied warranty .}
 60                     ; comment {}
 61                     ; comment {This is a test harness for testing the LED10 RoboBrick . See :}
 62                     ; comment {}
 63                     ; comment {http : / / web . gramlich . net / projects / robobricks / led10 / index . html}
 64                     ; comment {}
 65                     ; comment {for more details .}
 66                     ; comment {}
 67                     ; comment #############################################################################
 68                     ;   processor pic16f628 cp = off cpd = off lvp = off bowden = off mclre = on pwrte = off wdte = off fosc = xt  
 69                     ; 16169=0x3f29 8199=0x2007
 70                     __config 16169
 71     2007    configuration___address equ 8199
 72                     ;   constant clock_rate 10000000  
 73     989680    clock_rate equ 10000000
 74                     ;   constant clock_ticks_per_instruction 4  
 75     0004    clock_ticks_per_instruction equ 4
 76                     ;   constant instructions_per_second clock_rate / clock_ticks_per_instruction  
 77     2625a0    instructions_per_second equ 2500000
 78                     ;   constant baud_rate 2400  
 79     0960    baud_rate equ 2400
 80                     ;   constant instructions_per_bit clock_rate / {{ clock_ticks_per_instruction * baud_rate }}  
 81     0411    instructions_per_bit equ 1041
 82                     ;   constant delays_per_bit 3  
 83     0003    delays_per_bit equ 3
 84                     ;   constant instructions_per_delay instructions_per_bit / delays_per_bit  
 85     015b    instructions_per_delay equ 347
 86                     ;   constant extra_instructions_per_bit 12  
 87     000c    extra_instructions_per_bit equ 12
 88                     ;   constant extra_instructions_per_delay extra_instructions_per_bit / delays_per_bit  
 89     0004    extra_instructions_per_delay equ 4
 90                     ;   constant delay_instructions instructions_per_delay - extra_instructions_per_delay  
 91     0157    delay_instructions equ 343
 92                     ; comment {The null pulse that comes back from a clock pulse command is supposed to be}
 93                     ; comment {exactly 9 bits long . 9 bits at 2400 baud is 9 / 2400 = 3 . 75 mS . The number}
 94                     ; comment {iterations through the loop is 3 . 75 mS / < number of instructions per iteration . >}
 95                     ;   constant nine_bits_instructions {{ clock_rate * 9 }} / {{ clock_ticks_per_instruction * baud_rate }}  
 96     249f    nine_bits_instructions equ 9375
 97                     ;   constant instructions_per_iteration 7  
 98     0007    instructions_per_iteration equ 7
 99                     ;   constant iterations_for_nine_bits nine_bits_instructions / instructions_per_iteration  
100     053b    iterations_for_nine_bits equ 1339
101                     ;   constant iterations_high iterations_for_nine_bits / 256  
102     0005    iterations_high equ 5
103                     ;   constant iterations_low iterations_for_nine_bits - {{ iterations_high * 256 }}  
104     003b    iterations_low equ 59
105                     ; comment {Some character constants :}
106                     ;   constant sp 32  
107     0020    sp equ 32
108                     ;   constant cr 13  
109     000d    cr equ 13
110                     ;   constant lf 10  
111     000a    lf equ 10
112                     ; comment {Some bit definitions :}
113                     ;   constant rx_slave_bit 5  
114     0005    rx_slave_bit equ 5
115                     ;   constant tx_slave_bit 4  
116     0004    tx_slave_bit equ 4
117                     ;   constant rx_master_bit 1  
118     0001    rx_master_bit equ 1
119                     ;   constant tx_master_bit 2  
120     0002    tx_master_bit equ 2
121                     ;   constant rx_slave_mask 1 << rx_slave_bit  
122     0020    rx_slave_mask equ 32
123                     ;   constant tx_slave_mask 1 << tx_slave_bit  
124     0010    tx_slave_mask equ 16
125                     ;   constant rx_master_mask 1 << rx_master_bit  
126     0002    rx_master_mask equ 2
127                     ;   constant tx_master_mask 1 << tx_master_bit  
128     0004    tx_master_mask equ 4
129                     ; comment {Some register definitions :}
130     0003    status equ 3
131                     ;   bind c status @ 0  
132     0003    c equ status+0
133     0003    c__byte equ status+0
134     0000    c__bit equ 0
135                     ;   bind z status @ 2  
136     0003    z equ status+0
137     0003    z__byte equ status+0
138     0002    z__bit equ 2
139                     ; comment {Some port and pin definitions :}
140                     ; comment {port porta a unused none}
141     0006    portb equ 6
142     0006    tx_master_pin__byte equ 6
143     0002    tx_master_pin__bit equ 2
144     0006    rx_master_pin__byte equ 6
145     0001    rx_master_pin__bit equ 1
146     0006    tx_slave_pin__byte equ 6
147     0004    tx_slave_pin__bit equ 4
148     0006    rx_slave_pin__byte equ 6
149     0005    rx_slave_pin__bit equ 5
150                     ; comment {Miscellaneous definitions :}
151                     ;   constant space 0xff  
152     00ff    space equ 255
153                     ;   constant buffer_size 3  
154     0003    buffer_size equ 3
155                     ; string_constants Start
156             string___fetch:
157 00e 0082            movwf pcl___register
158                     ;   common_string = 0s'Common'  
159     0000    common_string___string equ 0
160             common_string:
161 00f 0782            addwf pcl___register,f
162                     ; Length = 6
163 010 3406            retlw 6
164                     ; `Common'
165 011 3443            retlw 67
166 012 346f            retlw 111
167 013 346d            retlw 109
168 014 346d            retlw 109
169 015 346f            retlw 111
170 016 346e            retlw 110
171                     ;   done_string = 0s'Done'  
172     0008    done_string___string equ 8
173             done_string:
174 017 0782            addwf pcl___register,f
175                     ; Length = 4
176 018 3404            retlw 4
177                     ; `Done'
178 019 3444            retlw 68
179 01a 346f            retlw 111
180 01b 346e            retlw 110
181 01c 3465            retlw 101
182                     ;   fail_string = 0s'Fail'  
183     000e    fail_string___string equ 14
184             fail_string:
185 01d 0782            addwf pcl___register,f
186                     ; Length = 4
187 01e 3404            retlw 4
188                     ; `Fail'
189 01f 3446            retlw 70
190 020 3461            retlw 97
191 021 3469            retlw 105
192 022 346c            retlw 108
193                     ;   hello_string = 0s'BIROD2_Test'  
194     0014    hello_string___string equ 20
195             hello_string:
196 023 0782            addwf pcl___register,f
197                     ; Length = 11
198 024 340b            retlw 11
199                     ; `BIROD2_Test'
200 025 3442            retlw 66
201 026 3449            retlw 73
202 027 3452            retlw 82
203 028 344f            retlw 79
204 029 3444            retlw 68
205 02a 3432            retlw 50
206 02b 345f            retlw 95
207 02c 3454            retlw 84
208 02d 3465            retlw 101
209 02e 3473            retlw 115
210 02f 3474            retlw 116
211                     ;   input_string = 0s'Input'  
212     0021    input_string___string equ 33
213             input_string:
214 030 0782            addwf pcl___register,f
215                     ; Length = 5
216 031 3405            retlw 5
217                     ; `Input'
218 032 3449            retlw 73
219 033 346e            retlw 110
220 034 3470            retlw 112
221 035 3475            retlw 117
222 036 3474            retlw 116
223                     ;   interrupt_string = 0s'Interrupt'  
224     0028    interrupt_string___string equ 40
225             interrupt_string:
226 037 0782            addwf pcl___register,f
227                     ; Length = 9
228 038 3409            retlw 9
229                     ; `Interrupt'
230 039 3449            retlw 73
231 03a 346e            retlw 110
232 03b 3474            retlw 116
233 03c 3465            retlw 101
234 03d 3472            retlw 114
235 03e 3472            retlw 114
236 03f 3475            retlw 117
237 040 3470            retlw 112
238 041 3474            retlw 116
239                     ;   enable_string = 0s'Enable and Alternate'  
240     0033    enable_string___string equ 51
241             enable_string:
242 042 0782            addwf pcl___register,f
243                     ; Length = 20
244 043 3414            retlw 20
245                     ; `Enable and Alternate'
246 044 3445            retlw 69
247 045 346e            retlw 110
248 046 3461            retlw 97
249 047 3462            retlw 98
250 048 346c            retlw 108
251 049 3465            retlw 101
252 04a 3420            retlw 32
253 04b 3461            retlw 97
254 04c 346e            retlw 110
255 04d 3464            retlw 100
256 04e 3420            retlw 32
257 04f 3441            retlw 65
258 050 346c            retlw 108
259 051 3474            retlw 116
260 052 3465            retlw 101
261 053 3472            retlw 114
262 054 346e            retlw 110
263 055 3461            retlw 97
264 056 3474            retlw 116
265 057 3465            retlw 101
266                     ;   read_string = 0s'Read'  
267     0049    read_string___string equ 73
268             read_string:
269 058 0782            addwf pcl___register,f
270                     ; Length = 4
271 059 3404            retlw 4
272                     ; `Read'
273 05a 3452            retlw 82
274 05b 3465            retlw 101
275 05c 3461            retlw 97
276 05d 3464            retlw 100
277                     ;   register_string = 0s'Register'  
278     004f    register_string___string equ 79
279             register_string:
280 05e 0782            addwf pcl___register,f
281                     ; Length = 8
282 05f 3408            retlw 8
283                     ; `Register'
284 060 3452            retlw 82
285 061 3465            retlw 101
286 062 3467            retlw 103
287 063 3469            retlw 105
288 064 3473            retlw 115
289 065 3474            retlw 116
290 066 3465            retlw 101
291 067 3472            retlw 114
292                     ;   test_string = 0s'Test'  
293     0059    test_string___string equ 89
294             test_string:
295 068 0782            addwf pcl___register,f
296                     ; Length = 4
297 069 3404            retlw 4
298                     ; `Test'
299 06a 3454            retlw 84
300 06b 3465            retlw 101
301 06c 3473            retlw 115
302 06d 3474            retlw 116
303                     ; string__constants End
304     0020    temp equ global__variables__bank0+0
305             
306                     ; procedure main start
307             main:
308     0021    main__variables__base equ global__variables__bank0+1
309     0021    main__bytes__base equ main__variables__base+0
310     0028    main__bits__base equ main__variables__base+7
311     0007    main__total__bytes equ 7
312     0027    main__119byte0 equ main__bytes__base+6
313     0027    main__147byte0 equ main__bytes__base+6
314                     ;   arguments_none  
315                     ; Read a byte .
316     0021    main__buffer equ main__bytes__base+0
317     0024    main__char equ main__bytes__base+3
318     0025    main__index equ main__bytes__base+4
319     0026    main__number equ main__bytes__base+5
320                     ; Print out a welcome message :
321                     ;   call master_crlf {{ }}  
322 06e 2407            call master_crlf
323                     ;   call master_string {{ hello_string }}  
324 06f 3024            movlw LOW hello_string+1
325 070 00e3            movwf master_string__message
326 071 24a7            call master_string
327                     ;   call master_crlf {{ }}  
328 072 2407            call master_crlf
329                     ; Main loop
330                     ;   number := 0  
331 073 01a6            clrf main__number
332                     ; loop_forever ... start
333             main__107loop__forever:
334                     ; Get a character :
335                     ;   tx_slave_pin := 1  
336 074 1606            bsf tx_slave_pin__byte,tx_slave_pin__bit
337                     ;   char := master_get {{ }}  
338 075 2419            call master_get
339 076 0853            movf master_get__0return__byte,w
340 077 00a4            movwf main__char
341                     ; Delay 2 / 3 ' s of bit make sure that get_byte is done .
342                     ;   call delay {{ }}  
343 078 24ba            call delay
344                     ;   call delay {{ }}  
345 079 24ba            call delay
346                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } start
347 07a 3030            movlw 48
348 07b 0224            subwf main__char,w
349                     ; expression=`0c'0' <= char' exp_delay=2 true_delay=-1  false_delay=1 true_size=127 false_size=1
350 07c 1c03            btfss c___byte,c___bit
351 07d 288e            goto and116__0false
352 07e 303a            movlw 58
353 07f 0224            subwf main__char,w
354                     ; expression=`char < {{ 0c'9' + 1 }}' exp_delay=2 true_delay=9  false_delay=-1 true_size=11 false_size=111
355 080 1803            btfsc c___byte,c___bit
356 081 288e            goto label116__1false
357             label116__1true:
358             and116__0true:
359                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } body start
360                     ; Do a multiply by 8 then add in digit :
361                     ;   call master_send {{ char }}  
362 082 0824            movf main__char,w
363 083 00e2            movwf master_send__character
364 084 24a1            call master_send
365                     ;   number := {{ number << 3 }} + char - 0c'0'  
366 085 0d26            rlf main__number,w
367 086 00a7            movwf main__119byte0
368 087 0da7            rlf main__119byte0,f
369 088 0d27            rlf main__119byte0,w
370 089 39f8            andlw 248
371 08a 0724            addwf main__char,w
372 08b 3ed0            addlw 208
373 08c 00a6            movwf main__number
374                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } body end
375 08d 28fd            goto label116__1end
376             label116__1false:
377             and116__0false:
378 08e 3073            movlw 115
379 08f 0224            subwf main__char,w
380                     ; expression=`{ char = 0c's' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=8 false_size=98
381 090 1d03            btfss z___byte,z___bit
382 091 289b            goto label120__0false
383             label120__0true:
384                     ; else_if { char = 0c's' } body start
385                     ; Send byte to brick , no wait :
386                     ; Echo command and send CRLF :
387                     ;   call master_send {{ char }}  
388 092 0824            movf main__char,w
389 093 00e2            movwf master_send__character
390 094 24a1            call master_send
391                     ;   call master_crlf {{ }}  
392 095 2407            call master_crlf
393                     ; Ship the byte down to the brick :
394                     ;   call slave_send {{ number }}  
395 096 0826            movf main__number,w
396 097 00d8            movwf slave_send__data
397 098 2447            call slave_send
398                     ;   number := 0  
399 099 01a6            clrf main__number
400                     ; else_if { char = 0c's' } body end
401 09a 28fd            goto label120__0end
402             label120__0false:
403 09b 3077            movlw 119
404 09c 0224            subwf main__char,w
405                     ; expression=`{ char = 0c'w' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=39 false_size=54
406 09d 1d03            btfss z___byte,z___bit
407 09e 28c7            goto label131__0false
408             label131__0true:
409                     ; else_if { char = 0c'w' } body start
410                     ; Send byte to brick , wait for results :
411                     ; Echo command and send CRLF :
412                     ;   call master_send {{ char }}  
413 09f 0824            movf main__char,w
414 0a0 00e2            movwf master_send__character
415 0a1 24a1            call master_send
416                     ;   call master_crlf {{ }}  
417 0a2 2407            call master_crlf
418                     ; Ship the byte down to the brick ...
419                     ;   call slave_send {{ number }}  
420 0a3 0826            movf main__number,w
421 0a4 00d8            movwf slave_send__data
422 0a5 2447            call slave_send
423                     ;   number := 0  
424 0a6 01a6            clrf main__number
425                     ; call delay < >
426                     ; ... and wait for a response :
427                     ;   index := 0  
428 0a7 01a5            clrf main__index
429                     ; `while  index < buffer_size  ...' start
430             main__146while__continue:
431 0a8 3003            movlw 3
432 0a9 0225            subwf main__index,w
433                     ; expression=` index < buffer_size ' exp_delay=2 true_delay=10  false_delay=2 true_size=11 false_size=1
434 0aa 1803            btfsc c___byte,c___bit
435 0ab 28b7            goto main__146while__break
436                     ;   buffer ~~ {{ index }} := slave_get {{ }}  
437 0ac 2441            call slave_get
438 0ad 0857            movf slave_get__0return__byte,w
439 0ae 00a7            movwf main__147byte0
440 0af 3021            movlw LOW main__buffer
441 0b0 0725            addwf main__index,w
442 0b1 0084            movwf fsr___register
443 0b2 0827            movf main__147byte0,w
444 0b3 1383            bcf irp___register,irp___bit
445 0b4 0080            movwf indf___register
446                     ;   index := index + 1  
447 0b5 0aa5            incf main__index,f
448 0b6 28a8            goto main__146while__continue
449                     ; if exp=` index < buffer_size ' false goto
450                     ; Other expression=` index < buffer_size ' delay=-1
451             main__146while__break:
452                     ; `while  index < buffer_size  ...' end
453                     ;   index := 0  
454 0b7 01a5            clrf main__index
455                     ; `while  index < buffer_size  ...' start
456             main__152while__continue:
457 0b8 3003            movlw 3
458 0b9 0225            subwf main__index,w
459                     ; expression=` index < buffer_size ' exp_delay=2 true_delay=8  false_delay=2 true_size=9 false_size=1
460 0ba 1803            btfsc c___byte,c___bit
461 0bb 28c5            goto main__152while__break
462                     ;   call master_octal {{ buffer ~~ {{ index }} }}  
463 0bc 3021            movlw LOW main__buffer
464 0bd 0725            addwf main__index,w
465 0be 0084            movwf fsr___register
466 0bf 1383            bcf irp___register,irp___bit
467 0c0 0800            movf indf___register,w
468 0c1 00d5            movwf master_octal__number
469 0c2 2428            call master_octal
470                     ;   index := index + 1  
471 0c3 0aa5            incf main__index,f
472 0c4 28b8            goto main__152while__continue
473                     ; if exp=` index < buffer_size ' false goto
474                     ; Other expression=` index < buffer_size ' delay=-1
475             main__152while__break:
476                     ; `while  index < buffer_size  ...' end
477                     ; Terminate the output list
478                     ;   call master_crlf {{ }}  
479 0c5 2407            call master_crlf
480                     ; else_if { char = 0c'w' } body end
481 0c6 28fd            goto label131__0end
482             label131__0false:
483 0c7 3069            movlw 105
484 0c8 0224            subwf main__char,w
485                     ; expression=`{ char = 0c'i' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=12 false_size=37
486 0c9 1d03            btfss z___byte,z___bit
487 0ca 28d8            goto label159__0false
488             label159__0true:
489                     ; else_if { char = 0c'i' } body start
490                     ; Interrogate the slave RoboBrick :
491                     ;   call master_send {{ char }}  
492 0cb 0824            movf main__char,w
493 0cc 00e2            movwf master_send__character
494 0cd 24a1            call master_send
495                     ;   call master_crlf {{ }}  
496 0ce 2407            call master_crlf
497                     ; Initialize the id index :
498                     ;   call slave_send {{ 0xfd }}  
499 0cf 30fd            movlw 253
500 0d0 00d8            movwf slave_send__data
501 0d1 2447            call slave_send
502                     ; Get the first 8 bytes :
503                     ;   call common_test_id_bytes8 {{ }}  
504 0d2 237a            call common_test_id_bytes8
505                     ; Get the next 8 bytes of random numbers :
506                     ;   call common_test_id_bytes8 {{ }}  
507 0d3 237a            call common_test_id_bytes8
508                     ; Get the next 8 bytes of random numbers :
509                     ;   call common_test_id_bytes8 {{ }}  
510 0d4 237a            call common_test_id_bytes8
511                     ; Get the slave brick name :
512                     ;   call common_test_id_string {{ }}  
513 0d5 2384            call common_test_id_string
514                     ; Get the vendor name :
515                     ;   call common_test_id_string {{ }}  
516 0d6 2384            call common_test_id_string
517                     ; else_if { char = 0c'i' } body end
518 0d7 28fd            goto label159__0end
519             label159__0false:
520 0d8 3074            movlw 116
521 0d9 0224            subwf main__char,w
522                     ; expression=`{ char = 0c't' }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=5 false_size=27
523 0da 1d03            btfss z___byte,z___bit
524 0db 28e2            goto label182__0false
525             label182__0true:
526                     ; else_if { char = 0c't' } body start
527                     ; Do testing :
528                     ;   call master_send {{ char }}  
529 0dc 0824            movf main__char,w
530 0dd 00e2            movwf master_send__character
531 0de 24a1            call master_send
532                     ;   call master_crlf {{ }}  
533 0df 2407            call master_crlf
534                     ;   call test {{ }}  
535 0e0 218d            call test
536                     ; else_if { char = 0c't' } body end
537 0e1 28fd            goto label182__0end
538             label182__0false:
539 0e2 3063            movlw 99
540 0e3 0224            subwf main__char,w
541                     ; expression=`{ char = 0c'c' }' exp_delay=2 true_delay=-2  false_delay=-2 true_size=7 false_size=14
542 0e4 1d03            btfss z___byte,z___bit
543 0e5 28ee            goto label187__0false
544             label187__0true:
545                     ; else_if { char = 0c'c' } body start
546                     ;   call master_send {{ char }}  
547 0e6 0824            movf main__char,w
548 0e7 00e2            movwf master_send__character
549 0e8 24a1            call master_send
550                     ;   call master_crlf {{ }}  
551 0e9 2407            call master_crlf
552                     ;   call clock_adjust {{ number }}  
553 0ea 0826            movf main__number,w
554 0eb 00a8            movwf clock_adjust__adjust
555 0ec 20fe            call clock_adjust
556                     ;   number := 0  
557                     ; 1 instructions found for sharing
558 0ed 28fc            goto label187__0end
559             label187__0false:
560                     ; else body start
561                     ; Just echo back the current number :
562                     ;   call master_send {{ 0c'<' }}  
563 0ee 303c            movlw 60
564 0ef 00e2            movwf master_send__character
565 0f0 24a1            call master_send
566                     ;   call master_octal {{ char }}  
567 0f1 0824            movf main__char,w
568 0f2 00d5            movwf master_octal__number
569 0f3 2428            call master_octal
570                     ;   call master_send {{ 0c'>' }}  
571 0f4 303e            movlw 62
572 0f5 00e2            movwf master_send__character
573 0f6 24a1            call master_send
574                     ; Send a carriage - return line - feed :
575                     ;   call master_crlf {{ }}  
576 0f7 2407            call master_crlf
577                     ; Output the character in octal :
578                     ;   call master_octal {{ number }}  
579 0f8 0826            movf main__number,w
580 0f9 00d5            movwf master_octal__number
581 0fa 2428            call master_octal
582                     ; Send a carriage - return line - feed :
583                     ;   call master_crlf {{ }}  
584 0fb 2407            call master_crlf
585                     ; Reset number
586                     ;   number := 0  
587                     ; 1 instructions found for sharing
588                     ; if exp=` char = 0c'c' ' generic
589             label187__0end:
590                     ; Other expression=`{ char = 0c'c' }' delay=-1
591                     ; 1 shared instructions follow
592 0fc 01a6            clrf main__number
593                     ; if exp=` char = 0c't' ' generic
594             label182__0end:
595                     ; Other expression=`{ char = 0c't' }' delay=-1
596                     ; if exp=` char = 0c'i' ' generic
597             label159__0end:
598                     ; Other expression=`{ char = 0c'i' }' delay=-1
599                     ; if exp=` char = 0c'w' ' generic
600             label131__0end:
601                     ; Other expression=`{ char = 0c'w' }' delay=-1
602                     ; if exp=` char = 0c's' ' generic
603             label120__0end:
604                     ; Other expression=`{ char = 0c's' }' delay=-1
605                     ; if exp=`char < {{ 0c'9' + 1 }}' generic
606             label116__1end:
607                     ; Other expression=`char < {{ 0c'9' + 1 }}' delay=-1
608                     ; if exp=`0c'0' <= char' false goto
609                     ; Other expression=`0c'0' <= char' delay=-1
610             and116__0end:
611                     ; if { 0c'0' <= char && char < {{ 0c'9' + 1 }} } end
612 0fd 2874            goto main__107loop__forever
613                     ; loop_forever ... end
614                     ; procedure main end
615             
616                     ; procedure clock_adjust start
617             clock_adjust:
618     0028    clock_adjust__variables__base equ global__variables__bank0+8
619     0028    clock_adjust__bytes__base equ clock_adjust__variables__base+0
620     0031    clock_adjust__bits__base equ clock_adjust__variables__base+9
621     0009    clock_adjust__total__bytes equ 9
622     0030    clock_adjust__228byte0 equ clock_adjust__bytes__base+8
623     0030    clock_adjust__270byte0 equ clock_adjust__bytes__base+8
624     0030    clock_adjust__280byte0 equ clock_adjust__bytes__base+8
625     0030    clock_adjust__284byte0 equ clock_adjust__bytes__base+8
626     0028    clock_adjust__adjust equ clock_adjust__bytes__base+0
627                     ; This procedure will adjust the clock to the slave .
628     0029    clock_adjust__command equ clock_adjust__bytes__base+1
629     002a    clock_adjust__count equ clock_adjust__bytes__base+2
630     002b    clock_adjust__error equ clock_adjust__bytes__base+3
631     002c    clock_adjust__error_minimum equ clock_adjust__bytes__base+4
632     002d    clock_adjust__high equ clock_adjust__bytes__base+5
633     002e    clock_adjust__low equ clock_adjust__bytes__base+6
634     002f    clock_adjust__target equ clock_adjust__bytes__base+7
635                     ;   target := iterations_low - adjust  
636 0fe 303b            movlw 59
637 0ff 00b0            movwf clock_adjust__228byte0
638 100 0828            movf clock_adjust__adjust,w
639 101 0230            subwf clock_adjust__228byte0,w
640 102 00af            movwf clock_adjust__target
641                     ;   count := 2  
642 103 3002            movlw 2
643 104 00aa            movwf clock_adjust__count
644                     ;   error := 0xff  
645 105 30ff            movlw 255
646 106 00ab            movwf clock_adjust__error
647                     ;   error_minimum := 0xf0  
648 107 30f0            movlw 240
649 108 00ac            movwf clock_adjust__error_minimum
650                     ; Print out the target :
651                     ;   call master_send {{ 0c'T' }}  
652 109 3054            movlw 84
653 10a 00e2            movwf master_send__character
654 10b 24a1            call master_send
655                     ;   call master_octal {{ iterations_high }}  
656 10c 3005            movlw 5
657 10d 00d5            movwf master_octal__number
658 10e 2428            call master_octal
659                     ;   call master_octal {{ target }}  
660 10f 082f            movf clock_adjust__target,w
661 110 00d5            movwf master_octal__number
662 111 2428            call master_octal
663                     ;   call master_crlf {{ }}  
664 112 2407            call master_crlf
665                     ; loop_forever ... start
666             clock_adjust__239loop__forever:
667                     ; Print out the clock value :
668                     ;   call master_send {{ 0c'C' }}  
669 113 3043            movlw 67
670 114 00e2            movwf master_send__character
671 115 24a1            call master_send
672                     ;   call slave_send {{ 0xfa }}  
673 116 30fa            movlw 250
674 117 00d8            movwf slave_send__data
675 118 2447            call slave_send
676                     ;   call master_octal {{ slave_get {{ }} }}  
677 119 2441            call slave_get
678 11a 0857            movf slave_get__0return__byte,w
679 11b 00d5            movwf master_octal__number
680 11c 2428            call master_octal
681                     ; Ask for a timing byte :
682                     ;   call slave_send {{ 0xfb }}  
683 11d 30fb            movlw 251
684 11e 00d8            movwf slave_send__data
685 11f 2447            call slave_send
686                     ;   low := 0  
687 120 01ae            clrf clock_adjust__low
688                     ;   high := 0  
689 121 01ad            clrf clock_adjust__high
690                     ; `while rx_slave_pin ...' start
691             clock_adjust__250while__continue:
692                     ; expression=`rx_slave_pin' exp_delay=0 true_delay=2  false_delay=2 true_size=1 false_size=1
693 122 1a86            btfsc rx_slave_pin__byte,rx_slave_pin__bit
694                     ; Do nothing :
695 123 2922            goto clock_adjust__250while__continue
696 124 2925            goto clock_adjust__250while__break
697                     ; if exp=`rx_slave_pin' true goto small true
698             clock_adjust__250while__break:
699                     ; `while rx_slave_pin ...' end
700                     ; `while  ! rx_slave_pin  ...' start
701             clock_adjust__253while__continue:
702                     ; expression=`rx_slave_pin' exp_delay=0 true_delay=2  false_delay=5 true_size=1 false_size=4
703 125 1a86            btfsc rx_slave_pin__byte,rx_slave_pin__bit
704 126 292b            goto clock_adjust__253while__break
705                     ;   low := low + 1  
706 127 0aae            incf clock_adjust__low,f
707                     ; if { z } start
708                     ; expression=`{ z }' exp_delay=0 true_delay=1  false_delay=0 true_size=1 false_size=0
709 128 1903            btfsc z__byte,z__bit
710                     ; if { z } body start
711                     ;   high := high + 1  
712 129 0aad            incf clock_adjust__high,f
713                     ; if { z } body end
714                     ; if exp=`z' false skip delay=2
715                     ; Other expression=`{ z }' delay=2
716                     ; if { z } end
717 12a 2925            goto clock_adjust__253while__continue
718                     ; if exp=`rx_slave_pin' true goto
719                     ; Other expression=`rx_slave_pin' delay=-1
720             clock_adjust__253while__break:
721                     ; `while  ! rx_slave_pin  ...' end
722                     ; Print out high and low :
723                     ;   call master_send {{ 0c'H' }}  
724 12b 3048            movlw 72
725 12c 00e2            movwf master_send__character
726 12d 24a1            call master_send
727                     ;   call master_octal {{ high }}  
728 12e 082d            movf clock_adjust__high,w
729 12f 00d5            movwf master_octal__number
730 130 2428            call master_octal
731                     ;   call master_send {{ 0c'L' }}  
732 131 304c            movlw 76
733 132 00e2            movwf master_send__character
734 133 24a1            call master_send
735                     ;   call master_octal {{ low }}  
736 134 082e            movf clock_adjust__low,w
737 135 00d5            movwf master_octal__number
738 136 2428            call master_octal
739                     ; Now think about adjusting clock .
740                     ; if { high > iterations_high } start
741 137 3006            movlw 6
742 138 022d            subwf clock_adjust__high,w
743                     ; expression=`{ high > iterations_high }' exp_delay=2 true_delay=7  false_delay=-1 true_size=7 false_size=36
744 139 1803            btfsc c___byte,c___bit
745 13a 2960            goto label267__0true
746             label267__0false:
747 13b 3005            movlw 5
748 13c 022d            subwf clock_adjust__high,w
749                     ; expression=`{ high < iterations_high }' exp_delay=2 true_delay=4  false_delay=-1 true_size=4 false_size=27
750 13d 1c03            btfss c___byte,c___bit
751 13e 295b            goto label271__0true
752             label271__0false:
753                     ; else body start
754                     ; The high 8 - bits are equal :
755                     ; if { low > target } start
756 13f 082e            movf clock_adjust__low,w
757 140 022f            subwf clock_adjust__target,w
758                     ; expression=`{ low > target }' exp_delay=2 true_delay=7  false_delay=-1 true_size=7 false_size=15
759 141 1c03            btfss c___byte,c___bit
760 142 2953            goto label277__0true
761             label277__0false:
762 143 082f            movf clock_adjust__target,w
763 144 022e            subwf clock_adjust__low,w
764                     ; expression=`{ low < target }' exp_delay=2 true_delay=7  false_delay=3 true_size=7 false_size=3
765 145 1c03            btfss c___byte,c___bit
766 146 294b            goto label281__0true
767             label281__0false:
768                     ; else body start
769                     ; Exact match ; we are done :
770                     ;   command := 0  
771 147 01a9            clrf clock_adjust__command
772                     ;   error := 0  
773 148 01ab            clrf clock_adjust__error
774                     ;   error_minimum := 0  
775 149 01ac            clrf clock_adjust__error_minimum
776                     ; else body end
777 14a 2952            goto label281__0end
778             label281__0true:
779                     ; else_if { low < target } body start
780                     ; Clock pulse is too short ; slave clock is too fast :
781                     ;   command := 0xf8  
782 14b 30f8            movlw 248
783 14c 00a9            movwf clock_adjust__command
784                     ;   error := target - low  
785 14d 082f            movf clock_adjust__target,w
786 14e 00b0            movwf clock_adjust__284byte0
787 14f 082e            movf clock_adjust__low,w
788 150 0230            subwf clock_adjust__284byte0,w
789 151 00ab            movwf clock_adjust__error
790                     ; else_if { low < target } body end
791                     ; if exp=` low < target ' generic
792             label281__0end:
793                     ; Other expression=`{ low < target }' delay=-1
794 152 295a            goto label277__0end
795             label277__0true:
796                     ; if { low > target } body start
797                     ; Clock pulse is too long ; slave clock is too slow :
798                     ;   command := 0xf9  
799 153 30f9            movlw 249
800 154 00a9            movwf clock_adjust__command
801                     ;   error := low - target  
802 155 082e            movf clock_adjust__low,w
803 156 00b0            movwf clock_adjust__280byte0
804 157 082f            movf clock_adjust__target,w
805 158 0230            subwf clock_adjust__280byte0,w
806 159 00ab            movwf clock_adjust__error
807                     ; if { low > target } body end
808                     ; if exp=` low > target ' generic
809             label277__0end:
810                     ; Other expression=`{ low > target }' delay=-1
811                     ; if { low > target } end
812                     ; else body end
813 15a 295f            goto label271__0end
814             label271__0true:
815                     ; else_if { high < iterations_high } body start
816                     ; Clock pulse is too short ; slave clock is too fast :
817                     ;   command := 0xf8  
818 15b 30f8            movlw 248
819 15c 00a9            movwf clock_adjust__command
820                     ;   error := target  
821 15d 082f            movf clock_adjust__target,w
822 15e 00ab            movwf clock_adjust__error
823                     ; else_if { high < iterations_high } body end
824                     ; if exp=` high < iterations_high ' generic
825             label271__0end:
826                     ; Other expression=`{ high < iterations_high }' delay=-1
827 15f 2967            goto label267__0end
828             label267__0true:
829                     ; if { high > iterations_high } body start
830                     ; Clock pulse is too long ; slave clock is too slow :
831                     ;   command := 0xf9  
832 160 30f9            movlw 249
833 161 00a9            movwf clock_adjust__command
834                     ;   error := 0xff - target  
835 162 30ff            movlw 255
836 163 00b0            movwf clock_adjust__270byte0
837 164 082f            movf clock_adjust__target,w
838 165 0230            subwf clock_adjust__270byte0,w
839 166 00ab            movwf clock_adjust__error
840                     ; if { high > iterations_high } body end
841                     ; if exp=` high > iterations_high ' generic
842             label267__0end:
843                     ; Other expression=`{ high > iterations_high }' delay=-1
844                     ; if { high > iterations_high } end
845                     ; Print out the error and error minimum :
846                     ;   call master_send {{ 0c'E' }}  
847 167 3045            movlw 69
848 168 00e2            movwf master_send__character
849 169 24a1            call master_send
850                     ;   call master_octal {{ error }}  
851 16a 082b            movf clock_adjust__error,w
852 16b 00d5            movwf master_octal__number
853 16c 2428            call master_octal
854                     ;   call master_send {{ 0c'M' }}  
855 16d 304d            movlw 77
856 16e 00e2            movwf master_send__character
857 16f 24a1            call master_send
858                     ;   call master_octal {{ error_minimum }}  
859 170 082c            movf clock_adjust__error_minimum,w
860 171 00d5            movwf master_octal__number
861 172 2428            call master_octal
862                     ; if { error = error_minimum } start
863 173 082b            movf clock_adjust__error,w
864 174 022c            subwf clock_adjust__error_minimum,w
865                     ; expression=`{ error = error_minimum }' exp_delay=2 true_delay=-1  false_delay=-1 true_size=2 false_size=14
866 175 1d03            btfss z___byte,z___bit
867 176 297a            goto label299__0false
868             label299__0true:
869                     ; if { error = error_minimum } body start
870                     ;   call master_crlf {{ }}  
871 177 2407            call master_crlf
872                     ;   return  
873 178 3400            retlw 0
874                     ; if { error = error_minimum } body end
875 179 2988            goto label299__0end
876             label299__0false:
877 17a 082c            movf clock_adjust__error_minimum,w
878 17b 022b            subwf clock_adjust__error,w
879                     ; expression=`{ error < error_minimum }' exp_delay=2 true_delay=3  false_delay=-1 true_size=3 false_size=6
880 17c 1c03            btfss c___byte,c___bit
881 17d 2985            goto label302__0true
882             label302__0false:
883                     ; else body start
884                     ;   count := count - 1  
885 17e 03aa            decf clock_adjust__count,f
886                     ; if { z } start
887                     ; expression=`{ z }' exp_delay=0 true_delay=3  false_delay=0 true_size=3 false_size=0
888 17f 1d03            btfss z__byte,z__bit
889 180 2984            goto label307__0end
890                     ; if { z } body start
891                     ;   error_minimum := error_minimum + 1  
892 181 0aac            incf clock_adjust__error_minimum,f
893                     ;   count := 2  
894 182 3002            movlw 2
895 183 00aa            movwf clock_adjust__count
896                     ; if { z } body end
897             label307__0end:
898                     ; if exp=`z' empty false
899                     ; Other expression=`{ z }' delay=-1
900                     ; if { z } end
901                     ; else body end
902 184 2988            goto label302__0end
903             label302__0true:
904                     ; else_if { error < error_minimum } body start
905                     ;   error_minimum := error  
906 185 082b            movf clock_adjust__error,w
907 186 00ac            movwf clock_adjust__error_minimum
908                     ;   error := error + 1  
909 187 0aab            incf clock_adjust__error,f
910                     ; else_if { error < error_minimum } body end
911                     ; if exp=` error < error_minimum ' generic
912             label302__0end:
913                     ; Other expression=`{ error < error_minimum }' delay=-1
914                     ; if exp=` error = error_minimum ' generic
915             label299__0end:
916                     ; Other expression=`{ error = error_minimum }' delay=-1
917                     ; if { error = error_minimum } end
918                     ; Now adjust the clock :
919                     ;   call slave_send {{ command }}  
920 188 0829            movf clock_adjust__command,w
921 189 00d8            movwf slave_send__data
922 18a 2447            call slave_send
923                     ;   call master_crlf {{ }}  
924 18b 2407            call master_crlf
925 18c 2913            goto clock_adjust__239loop__forever
926                     ; loop_forever ... end
927                     ; procedure clock_adjust end
928             
929                     ; procedure test start
930             test:
931     0031    test__variables__base equ global__variables__bank0+17
932     0031    test__bytes__base equ test__variables__base+0
933     0031    test__bits__base equ test__variables__base+0
934     0000    test__total__bytes equ 0
935                     ;   arguments_none  
936                     ; This procedure will test the Shaft2 RoboBrick :
937                     ; Verify that the common commands are working :
938                     ;   call common_test {{ }}  
939 18d 22fa            call common_test
940                     ; Verify that we can interrupt :
941                     ;   call interrupt_test {{ }}  
942 18e 2396            call interrupt_test
943                     ; Let ' s go test some registers :
944                     ;   call master_string {{ register_string }}  
945 18f 305f            movlw LOW register_string+1
946 190 00e3            movwf master_string__message
947 191 24a7            call master_string
948                     ;   call master_string {{ test_string }}  
949 192 3069            movlw LOW test_string+1
950 193 00e3            movwf master_string__message
951 194 24a7            call master_string
952                     ;   call master_crlf {{ }}  
953 195 2407            call master_crlf
954                     ; Enable / Complement :
955                     ;   call test_register {{ 0x10 , 3 , 0x30 }}  
956 196 3010            movlw 16
957 197 00c3            movwf test_register__set_command
958 198 3003            movlw 3
959 199 00c4            movwf test_register__read_command
960 19a 3030            movlw 48
961 19b 00c5            movwf test_register__error
962 19c 22da            call test_register
963                     ; High / Low :
964                     ;   call test_register {{ 0x20 , 4 , 0x31 }}  
965 19d 3020            movlw 32
966 19e 00c3            movwf test_register__set_command
967 19f 3004            movlw 4
968 1a0 00c4            movwf test_register__read_command
969 1a1 3031            movlw 49
970 1a2 00c5            movwf test_register__error
971 1a3 22da            call test_register
972                     ; Raising / Falling :
973                     ;   call test_register {{ 0x30 , 5 , 0x32 }}  
974 1a4 3030            movlw 48
975 1a5 00c3            movwf test_register__set_command
976 1a6 3005            movlw 5
977 1a7 00c4            movwf test_register__read_command
978 1a8 3032            movlw 50
979 1a9 00c5            movwf test_register__error
980 1aa 22da            call test_register
981                     ; Now test that the BIROD ' s are actually working :
982                     ;   call test_inputs {{ 0 }}  
983 1ab 01b1            clrf test_inputs__pattern
984 1ac 21e2            call test_inputs
985                     ;   call test_inputs {{ 1 }}  
986 1ad 3001            movlw 1
987 1ae 00b1            movwf test_inputs__pattern
988 1af 21e2            call test_inputs
989                     ;   call test_inputs {{ 2 }}  
990 1b0 3002            movlw 2
991 1b1 00b1            movwf test_inputs__pattern
992 1b2 21e2            call test_inputs
993                     ;   call test_inputs {{ 3 }}  
994 1b3 3003            movlw 3
995 1b4 00b1            movwf test_inputs__pattern
996 1b5 21e2            call test_inputs
997                     ; Test for interrupts :
998                     ;   call master_string {{ interrupt_string }}  
999 1b6 3038            movlw LOW interrupt_string+1
1000 1b7 00e3            movwf master_string__message
1001 1b8 24a7            call master_string
1002                     ;   call master_string {{ test_string }}  
1003 1b9 3069            movlw LOW test_string+1
1004 1ba 00e3            movwf master_string__message
1005 1bb 24a7            call master_string
1006                     ;   call master_crlf {{ }}  
1007 1bc 2407            call master_crlf
1008                     ; High interrupt :
1009                     ;   call test_interrupt {{ 0 , 1 , 0x20 , 4 }}  
1010 1bd 01bf            clrf test_interrupt__start_pattern
1011 1be 3001            movlw 1
1012 1bf 00c0            movwf test_interrupt__end_pattern
1013 1c0 3020            movlw 32
1014 1c1 00c1            movwf test_interrupt__set_command
1015 1c2 3004            movlw 4
1016 1c3 00c2            movwf test_interrupt__set_bits
1017 1c4 22bc            call test_interrupt
1018                     ; Low interrupt :
1019                     ;   call test_interrupt {{ 1 , 0 , 0x20 , 1 }}  
1020 1c5 3001            movlw 1
1021 1c6 00bf            movwf test_interrupt__start_pattern
1022 1c7 01c0            clrf test_interrupt__end_pattern
1023 1c8 3020            movlw 32
1024 1c9 00c1            movwf test_interrupt__set_command
1025 1ca 3001            movlw 1
1026 1cb 00c2            movwf test_interrupt__set_bits
1027 1cc 22bc            call test_interrupt
1028                     ; Raising interrupt :
1029                     ;   call test_interrupt {{ 0 , 1 , 0x30 , 4 }}  
1030 1cd 01bf            clrf test_interrupt__start_pattern
1031 1ce 3001            movlw 1
1032 1cf 00c0            movwf test_interrupt__end_pattern
1033 1d0 3030            movlw 48
1034 1d1 00c1            movwf test_interrupt__set_command
1035 1d2 3004            movlw 4
1036 1d3 00c2            movwf test_interrupt__set_bits
1037 1d4 22bc            call test_interrupt
1038                     ; Falling interrupt :
1039                     ;   call test_interrupt {{ 1 , 0 , 0x30 , 1 }}  
1040 1d5 3001            movlw 1
1041 1d6 00bf            movwf test_interrupt__start_pattern
1042 1d7 01c0            clrf test_interrupt__end_pattern
1043 1d8 3030            movlw 48
1044 1d9 00c1            movwf test_interrupt__set_command
1045 1da 3001            movlw 1
1046 1db 00c2            movwf test_interrupt__set_bits
1047 1dc 22bc            call test_interrupt
1048                     ; Announce we are done :
1049                     ;   call master_string {{ done_string }}  
1050 1dd 3018            movlw LOW done_string+1
1051 1de 00e3            movwf master_string__message
1052 1df 24a7            call master_string
1053                     ;   call master_crlf {{ }}  
1054 1e0 2407            call master_crlf
1055                     ; procedure test end
1056 1e1 3400            retlw 0
1057             
1058                     ; procedure test_inputs start
1059             test_inputs:
1060     0031    test_inputs__variables__base equ global__variables__bank0+17
1061     0031    test_inputs__bytes__base equ test_inputs__variables__base+0
1062     003b    test_inputs__bits__base equ test_inputs__variables__base+10
1063     000a    test_inputs__total__bytes equ 10
1064     003a    test_inputs__396byte0 equ test_inputs__bytes__base+9
1065     0031    test_inputs__pattern equ test_inputs__bytes__base+0
1066                     ; This procedure will verify that the inputs can be set to pattern .
1067     0032    test_inputs__sleep1 equ test_inputs__bytes__base+1
1068     0033    test_inputs__sleep2 equ test_inputs__bytes__base+2
1069     0034    test_inputs__counter equ test_inputs__bytes__base+3
1070     0035    test_inputs__test equ test_inputs__bytes__base+4
1071     0036    test_inputs__command equ test_inputs__bytes__base+5
1072     0037    test_inputs__mask equ test_inputs__bytes__base+6
1073     0038    test_inputs__masked_pattern equ test_inputs__bytes__base+7
1074     0039    test_inputs__alternate equ test_inputs__bytes__base+8
1075                     ; Enable the IROD ' s :
1076                     ;   call test_prompt {{ pattern }}  
1077 1e2 0831            movf test_inputs__pattern,w
1078 1e3 00bb            movwf test_prompt__pattern
1079 1e4 2285            call test_prompt
1080                     ; `count_down counter 8 ...' start
1081 1e5 3008            movlw 8
1082 1e6 00b4            movwf test_inputs__counter
1083             test_inputs__392_loop:
1084                     ; Set the enable bits :
1085                     ;   test := counter - 1  
1086 1e7 0334            decf test_inputs__counter,w
1087 1e8 00b5            movwf test_inputs__test
1088                     ;   mask := test & 3  
1089 1e9 3003            movlw 3
1090 1ea 0535            andwf test_inputs__test,w
1091 1eb 00b7            movwf test_inputs__mask
1092                     ;   command := 0x10 | {{ mask << 2 }}  
1093 1ec 0d37            rlf test_inputs__mask,w
1094 1ed 00ba            movwf test_inputs__396byte0
1095 1ee 0d3a            rlf test_inputs__396byte0,w
1096 1ef 39fc            andlw 252
1097 1f0 3810            iorlw 16
1098 1f1 00b6            movwf test_inputs__command
1099                     ;   call slave_send {{ command }}  
1100 1f2 00d8            movwf slave_send__data
1101 1f3 2447            call slave_send
1102                     ;   masked_pattern := mask & pattern  
1103 1f4 0837            movf test_inputs__mask,w
1104 1f5 0531            andwf test_inputs__pattern,w
1105 1f6 00b8            movwf test_inputs__masked_pattern
1106                     ; Set the alternate bit :
1107                     ;   alternate := test >> 2  
1108 1f7 0c35            rrf test_inputs__test,w
1109 1f8 00b9            movwf test_inputs__alternate
1110 1f9 0c39            rrf test_inputs__alternate,w
1111 1fa 393f            andlw 63
1112 1fb 00b9            movwf test_inputs__alternate
1113                     ;   call slave_send {{ 6 | alternate }}  
1114 1fc 3006            movlw 6
1115 1fd 0439            iorwf test_inputs__alternate,w
1116 1fe 00d8            movwf slave_send__data
1117 1ff 2447            call slave_send
1118                     ; Announce test :
1119                     ;   call master_octal {{ test }}  
1120 200 0835            movf test_inputs__test,w
1121 201 00d5            movwf master_octal__number
1122 202 2428            call master_octal
1123                     ;   call master_octal {{ masked_pattern }}  
1124 203 0838            movf test_inputs__masked_pattern,w
1125 204 00d5            movwf master_octal__number
1126 205 2428            call master_octal
1127                     ;   call master_string {{ enable_string }}  
1128 206 3043            movlw LOW enable_string+1
1129 207 00e3            movwf master_string__message
1130 208 24a7            call master_string
1131                     ;   call master_string {{ test_string }}  
1132 209 3069            movlw LOW test_string+1
1133 20a 00e3            movwf master_string__message
1134 20b 24a7            call master_string
1135                     ;   call master_crlf {{ }}  
1136 20c 2407            call master_crlf
1137                     ; Let the enables take hold :
1138                     ; `count_down sleep1 50 ...' start
1139 20d 3032            movlw 50
1140 20e 00b2            movwf test_inputs__sleep1
1141             test_inputs__412_loop:
1142                     ; 30 * 1 / 3 bit delays = 10 bit delays :
1143                     ; `count_down sleep2 30 ...' start
1144 20f 301e            movlw 30
1145 210 00b3            movwf test_inputs__sleep2
1146             test_inputs__414_loop:
1147                     ;   call delay {{ }}  
1148 211 24ba            call delay
1149 212 0bb3            decfsz test_inputs__sleep2,f
1150 213 2a11            goto test_inputs__414_loop
1151             test_inputs__414_done:
1152                     ; `count_down sleep2 30 ...' end
1153 214 0bb2            decfsz test_inputs__sleep1,f
1154 215 2a0f            goto test_inputs__412_loop
1155             test_inputs__412_done:
1156                     ; `count_down sleep1 50 ...' end
1157                     ; Verify that the alternate bit is set :
1158                     ;   call slave_send {{ 3 }}  
1159 216 3003            movlw 3
1160 217 00d8            movwf slave_send__data
1161 218 2447            call slave_send
1162                     ;   temp := slave_get {{ }}  
1163 219 2441            call slave_get
1164 21a 0857            movf slave_get__0return__byte,w
1165 21b 00a0            movwf temp
1166                     ; if { temp != command & 0xf } start
1167 21c 300f            movlw 15
1168 21d 0536            andwf test_inputs__command,w
1169 21e 0220            subwf temp,w
1170                     ; expression=`{ temp != command & 0xf }' exp_delay=3 true_delay=4  false_delay=0 true_size=8 false_size=0
1171 21f 1903            btfsc z___byte,z___bit
1172 220 2a29            goto label422__0end
1173                     ; if { temp != command & 0xf } body start
1174                     ;   call master_octal {{ temp }}  
1175 221 0820            movf temp,w
1176 222 00d5            movwf master_octal__number
1177 223 2428            call master_octal
1178                     ;   call master_fail {{ read_string , 0x40 }}  
1179 224 3059            movlw LOW read_string+1
1180 225 00d1            movwf master_fail__test_name
1181 226 3040            movlw 64
1182 227 00d2            movwf master_fail__test_number
1183 228 240e            call master_fail
1184                     ; if { temp != command & 0xf } body end
1185             label422__0end:
1186                     ; if exp=` temp != command & 0xf ' empty false
1187                     ; Other expression=`{ temp != command & 0xf }' delay=-1
1188                     ; if { temp != command & 0xf } end
1189                     ; Verify that the alternate bit is set :
1190                     ;   call slave_send {{ 2 }}  
1191 229 3002            movlw 2
1192 22a 00d8            movwf slave_send__data
1193 22b 2447            call slave_send
1194                     ;   temp := slave_get {{ }}  
1195 22c 2441            call slave_get
1196 22d 0857            movf slave_get__0return__byte,w
1197 22e 00a0            movwf temp
1198                     ; if { temp != alternate } start
1199 22f 0239            subwf test_inputs__alternate,w
1200                     ; expression=`{ temp != alternate }' exp_delay=2 true_delay=3  false_delay=0 true_size=5 false_size=0
1201 230 1903            btfsc z___byte,z___bit
1202 231 2a37            goto label430__0end
1203                     ; if { temp != alternate } body start
1204                     ; call master_octal < temp >
1205                     ;   call master_fail {{ read_string , 0x41 }}  
1206 232 3059            movlw LOW read_string+1
1207 233 00d1            movwf master_fail__test_name
1208 234 3041            movlw 65
1209 235 00d2            movwf master_fail__test_number
1210 236 240e            call master_fail
1211                     ; if { temp != alternate } body end
1212             label430__0end:
1213                     ; if exp=` temp != alternate ' empty false
1214                     ; Other expression=`{ temp != alternate }' delay=-1
1215                     ; if { temp != alternate } end
1216                     ; Regular read :
1217                     ;   call slave_send {{ 0 }}  
1218 237 01d8            clrf slave_send__data
1219 238 2447            call slave_send
1220                     ;   temp := slave_get {{ }}  
1221 239 2441            call slave_get
1222 23a 0857            movf slave_get__0return__byte,w
1223 23b 00a0            movwf temp
1224                     ; if { temp != masked_pattern } start
1225 23c 0238            subwf test_inputs__masked_pattern,w
1226                     ; expression=`{ temp != masked_pattern }' exp_delay=2 true_delay=4  false_delay=0 true_size=8 false_size=0
1227 23d 1903            btfsc z___byte,z___bit
1228 23e 2a47            goto label438__0end
1229                     ; if { temp != masked_pattern } body start
1230                     ;   call master_octal {{ temp }}  
1231 23f 0820            movf temp,w
1232 240 00d5            movwf master_octal__number
1233 241 2428            call master_octal
1234                     ;   call master_fail {{ read_string , 0x42 }}  
1235 242 3059            movlw LOW read_string+1
1236 243 00d1            movwf master_fail__test_name
1237 244 3042            movlw 66
1238 245 00d2            movwf master_fail__test_number
1239 246 240e            call master_fail
1240                     ; if { temp != masked_pattern } body end
1241             label438__0end:
1242                     ; if exp=` temp != masked_pattern ' empty false
1243                     ; Other expression=`{ temp != masked_pattern }' delay=-1
1244                     ; if { temp != masked_pattern } end
1245                     ; Read raw :
1246                     ;   call slave_send {{ 1 }}  
1247 247 3001            movlw 1
1248 248 00d8            movwf slave_send__data
1249 249 2447            call slave_send
1250                     ;   temp := slave_get {{ }}  
1251 24a 2441            call slave_get
1252 24b 0857            movf slave_get__0return__byte,w
1253 24c 00a0            movwf temp
1254                     ; if { temp != masked_pattern } start
1255 24d 0238            subwf test_inputs__masked_pattern,w
1256                     ; expression=`{ temp != masked_pattern }' exp_delay=2 true_delay=4  false_delay=0 true_size=8 false_size=0
1257 24e 1903            btfsc z___byte,z___bit
1258 24f 2a58            goto label446__0end
1259                     ; if { temp != masked_pattern } body start
1260                     ;   call master_octal {{ temp }}  
1261 250 0820            movf temp,w
1262 251 00d5            movwf master_octal__number
1263 252 2428            call master_octal
1264                     ;   call master_fail {{ read_string , 0x43 }}  
1265 253 3059            movlw LOW read_string+1
1266 254 00d1            movwf master_fail__test_name
1267 255 3043            movlw 67
1268 256 00d2            movwf master_fail__test_number
1269 257 240e            call master_fail
1270                     ; if { temp != masked_pattern } body end
1271             label446__0end:
1272                     ; if exp=` temp != masked_pattern ' empty false
1273                     ; Other expression=`{ temp != masked_pattern }' delay=-1
1274                     ; if { temp != masked_pattern } end
1275                     ; Now test complement :
1276                     ;   call slave_send {{ command | 3 }}  
1277 258 3003            movlw 3
1278 259 0436            iorwf test_inputs__command,w
1279 25a 00d8            movwf slave_send__data
1280 25b 2447            call slave_send
1281                     ;   call slave_send {{ 0 }}  
1282 25c 01d8            clrf slave_send__data
1283 25d 2447            call slave_send
1284                     ;   temp := slave_get {{ }}  
1285 25e 2441            call slave_get
1286 25f 0857            movf slave_get__0return__byte,w
1287 260 00a0            movwf temp
1288                     ; if { temp ^ 3 != masked_pattern } start
1289 261 3003            movlw 3
1290 262 0620            xorwf temp,w
1291 263 0238            subwf test_inputs__masked_pattern,w
1292                     ; expression=`{ temp ^ 3 != masked_pattern }' exp_delay=3 true_delay=4  false_delay=0 true_size=8 false_size=0
1293 264 1903            btfsc z___byte,z___bit
1294 265 2a6e            goto label455__0end
1295                     ; if { temp ^ 3 != masked_pattern } body start
1296                     ;   call master_octal {{ temp }}  
1297 266 0820            movf temp,w
1298 267 00d5            movwf master_octal__number
1299 268 2428            call master_octal
1300                     ;   call master_fail {{ read_string , 0x44 }}  
1301 269 3059            movlw LOW read_string+1
1302 26a 00d1            movwf master_fail__test_name
1303 26b 3044            movlw 68
1304 26c 00d2            movwf master_fail__test_number
1305 26d 240e            call master_fail
1306                     ; if { temp ^ 3 != masked_pattern } body end
1307             label455__0end:
1308                     ; if exp=` temp ^ 3 != masked_pattern ' empty false
1309                     ; Other expression=`{ temp ^ 3 != masked_pattern }' delay=-1
1310                     ; if { temp ^ 3 != masked_pattern } end
1311                     ; Verify that raw did not change :
1312                     ;   call slave_send {{ 1 }}  
1313 26e 3001            movlw 1
1314 26f 00d8            movwf slave_send__data
1315 270 2447            call slave_send
1316                     ;   temp := slave_get {{ }}  
1317 271 2441            call slave_get
1318 272 0857            movf slave_get__0return__byte,w
1319 273 00a0            movwf temp
1320                     ; if { temp != masked_pattern } start
1321 274 0238            subwf test_inputs__masked_pattern,w
1322                     ; expression=`{ temp != masked_pattern }' exp_delay=2 true_delay=4  false_delay=0 true_size=8 false_size=0
1323 275 1903            btfsc z___byte,z___bit
1324 276 2a7f            goto label463__0end
1325                     ; if { temp != masked_pattern } body start
1326                     ;   call master_octal {{ temp }}  
1327 277 0820            movf temp,w
1328 278 00d5            movwf master_octal__number
1329 279 2428            call master_octal
1330                     ;   call master_fail {{ read_string , 0x45 }}  
1331 27a 3059            movlw LOW read_string+1
1332 27b 00d1            movwf master_fail__test_name
1333 27c 3045            movlw 69
1334 27d 00d2            movwf master_fail__test_number
1335 27e 240e            call master_fail
1336                     ; if { temp != masked_pattern } body end
1337             label463__0end:
1338                     ; if exp=` temp != masked_pattern ' empty false
1339                     ; Other expression=`{ temp != masked_pattern }' delay=-1
1340                     ; if { temp != masked_pattern } end
1341                     ; Reset complement bits :
1342                     ;   call slave_send {{ command }}  
1343 27f 0836            movf test_inputs__command,w
1344 280 00d8            movwf slave_send__data
1345 281 2447            call slave_send
1346 282 0bb4            decfsz test_inputs__counter,f
1347 283 29e7            goto test_inputs__392_loop
1348             test_inputs__392_done:
1349                     ; `count_down counter 8 ...' end
1350                     ; procedure test_inputs end
1351 284 3400            retlw 0
1352             
1353                     ; procedure test_prompt start
1354             test_prompt:
1355     003b    test_prompt__variables__base equ global__variables__bank0+27
1356     003b    test_prompt__bytes__base equ test_prompt__variables__base+0
1357     003d    test_prompt__bits__base equ test_prompt__variables__base+2
1358     0002    test_prompt__total__bytes equ 2
1359     003b    test_prompt__pattern equ test_prompt__bytes__base+0
1360                     ; This procedure will prompt the user for pattern .
1361     003c    test_prompt__character equ test_prompt__bytes__base+1
1362                     ; Enable both sensors :
1363                     ;   call slave_send {{ 0x1c }}  
1364 285 301c            movlw 28
1365 286 00d8            movwf slave_send__data
1366 287 2447            call slave_send
1367                     ; Wait for the inputs to match :
1368                     ;   call master_crlf {{ }}  
1369 288 2407            call master_crlf
1370                     ;   temp := pattern + 1  
1371 289 0a3b            incf test_prompt__pattern,w
1372 28a 00a0            movwf temp
1373                     ; `while  temp != pattern  ...' start
1374             test_prompt__487while__continue:
1375 28b 0820            movf temp,w
1376 28c 023b            subwf test_prompt__pattern,w
1377                     ; expression=` temp != pattern ' exp_delay=2 true_delay=11  false_delay=2 true_size=28 false_size=1
1378 28d 1903            btfsc z___byte,z___bit
1379 28e 2aab            goto test_prompt__487while__break
1380                     ; Display the pattern :
1381                     ;   call master_send {{ cr }}  
1382 28f 300d            movlw 13
1383 290 00e2            movwf master_send__character
1384 291 24a1            call master_send
1385                     ;   call master_string {{ input_string }}  
1386 292 3031            movlw LOW input_string+1
1387 293 00e3            movwf master_string__message
1388 294 24a7            call master_string
1389                     ;   call test_show {{ pattern }}  
1390 295 083b            movf test_prompt__pattern,w
1391 296 00bd            movwf test_show__pattern
1392 297 22ad            call test_show
1393                     ;   call master_send {{ 0c'<' }}  
1394 298 303c            movlw 60
1395 299 00e2            movwf master_send__character
1396 29a 24a1            call master_send
1397                     ;   call test_show {{ temp }}  
1398 29b 0820            movf temp,w
1399 29c 00bd            movwf test_show__pattern
1400 29d 22ad            call test_show
1401                     ;   call master_send {{ 0c'>' }}  
1402 29e 303e            movlw 62
1403 29f 00e2            movwf master_send__character
1404 2a0 24a1            call master_send
1405                     ;   call master_send {{ 0c':' }}  
1406 2a1 303a            movlw 58
1407 2a2 00e2            movwf master_send__character
1408 2a3 24a1            call master_send
1409                     ; Read the raw inputs :
1410                     ;   call slave_send {{ 1 }}  
1411 2a4 3001            movlw 1
1412 2a5 00d8            movwf slave_send__data
1413 2a6 2447            call slave_send
1414                     ;   temp := slave_get {{ }}  
1415 2a7 2441            call slave_get
1416 2a8 0857            movf slave_get__0return__byte,w
1417 2a9 00a0            movwf temp
1418 2aa 2a8b            goto test_prompt__487while__continue
1419                     ; if exp=` temp != pattern ' false goto
1420                     ; Other expression=` temp != pattern ' delay=-1
1421             test_prompt__487while__break:
1422                     ; `while  temp != pattern  ...' end
1423                     ; Print a carraige - return line - feed :
1424                     ;   call master_crlf {{ }}  
1425 2ab 2407            call master_crlf
1426                     ; procedure test_prompt end
1427 2ac 3400            retlw 0
1428             
1429                     ; procedure test_show start
1430             test_show:
1431     003d    test_show__variables__base equ global__variables__bank0+29
1432     003d    test_show__bytes__base equ test_show__variables__base+0
1433     003f    test_show__bits__base equ test_show__variables__base+2
1434     0002    test_show__total__bytes equ 2
1435     003d    test_show__pattern equ test_show__bytes__base+0
1436                     ; This procedure will print out pattern :
1437     003e    test_show__character equ test_show__bytes__base+1
1438                     ; if { pattern @ 1 } start
1439                     ; Alias variable for select pattern @ 1
1440     003d    test_show__pattern__514select0 equ test_show__pattern+0
1441     003d    test_show__pattern__514select0__byte equ test_show__pattern+0
1442     0001    test_show__pattern__514select0__bit equ 1
1443                     ; expression=`{ pattern @ 1 }' exp_delay=0 true_delay=1  false_delay=1 true_size=1 false_size=1
1444 2ad 18bd            btfsc test_show__pattern__514select0__byte,test_show__pattern__514select0__bit
1445                     ; if { pattern @ 1 } body start
1446                     ;   character := 0c'1'  
1447 2ae 3031            movlw 49
1448                     ; 1 instructions found for sharing
1449 2af 1cbd            btfss test_show__pattern__514select0__byte,test_show__pattern__514select0__bit
1450                     ; else body start
1451                     ;   character := 0c'0'  
1452 2b0 3030            movlw 48
1453                     ; 1 instructions found for sharing
1454                     ; if exp=` pattern @ 1 ' single true and false skip delay=4
1455                     ; Other expression=`{ pattern @ 1 }' delay=4
1456                     ; 1 shared instructions follow
1457 2b1 00be            movwf test_show__character
1458                     ; if { pattern @ 1 } end
1459                     ;   call master_send {{ character }}  
1460 2b2 00e2            movwf master_send__character
1461 2b3 24a1            call master_send
1462                     ; if { pattern @ 0 } start
1463                     ; Alias variable for select pattern @ 0
1464     003d    test_show__pattern__520select0 equ test_show__pattern+0
1465     003d    test_show__pattern__520select0__byte equ test_show__pattern+0
1466     0000    test_show__pattern__520select0__bit equ 0
1467                     ; expression=`{ pattern @ 0 }' exp_delay=0 true_delay=1  false_delay=1 true_size=1 false_size=1
1468 2b4 183d            btfsc test_show__pattern__520select0__byte,test_show__pattern__520select0__bit
1469                     ; if { pattern @ 0 } body start
1470                     ;   character := 0c'1'  
1471 2b5 3031            movlw 49
1472                     ; 1 instructions found for sharing
1473 2b6 1c3d            btfss test_show__pattern__520select0__byte,test_show__pattern__520select0__bit
1474                     ; else body start
1475                     ;   character := 0c'0'  
1476 2b7 3030            movlw 48
1477                     ; 1 instructions found for sharing
1478                     ; if exp=` pattern @ 0 ' single true and false skip delay=4
1479                     ; Other expression=`{ pattern @ 0 }' delay=4
1480                     ; 1 shared instructions follow
1481 2b8 00be            movwf test_show__character
1482                     ; if { pattern @ 0 } end
1483                     ;   call master_send {{ character }}  
1484 2b9 00e2            movwf master_send__character
1485 2ba 24a1            call master_send
1486                     ; procedure test_show end
1487 2bb 3400            retlw 0
1488             
1489                     ; procedure test_interrupt start
1490             test_interrupt:
1491     003f    test_interrupt__variables__base equ global__variables__bank0+31
1492     003f    test_interrupt__bytes__base equ test_interrupt__variables__base+0
1493     0043    test_interrupt__bits__base equ test_interrupt__variables__base+4
1494     0004    test_interrupt__total__bytes equ 4
1495     003f    test_interrupt__start_pattern equ test_interrupt__bytes__base+0
1496     0040    test_interrupt__end_pattern equ test_interrupt__bytes__base+1
1497     0041    test_interrupt__set_command equ test_interrupt__bytes__base+2
1498     0042    test_interrupt__set_bits equ test_interrupt__bytes__base+3
1499                     ; This procedure will validate that an interrupt occurs .
1500                     ;   call test_prompt {{ start_pattern }}  
1501 2bc 083f            movf test_interrupt__start_pattern,w
1502 2bd 00bb            movwf test_prompt__pattern
1503 2be 2285            call test_prompt
1504                     ; Enable only one :
1505                     ;   call slave_send {{ 0x14 }}  
1506 2bf 3014            movlw 20
1507 2c0 00d8            movwf slave_send__data
1508 2c1 2447            call slave_send
1509                     ; Enable the mask :
1510                     ;   call slave_send {{ set_command | set_bits }}  
1511 2c2 0841            movf test_interrupt__set_command,w
1512 2c3 0442            iorwf test_interrupt__set_bits,w
1513 2c4 00d8            movwf slave_send__data
1514 2c5 2447            call slave_send
1515                     ; Let the tester know what we want :
1516                     ;   call test_show {{ end_pattern }}  
1517 2c6 0840            movf test_interrupt__end_pattern,w
1518 2c7 00bd            movwf test_show__pattern
1519 2c8 22ad            call test_show
1520                     ;   call master_send {{ 0c':' }}  
1521 2c9 303a            movlw 58
1522 2ca 00e2            movwf master_send__character
1523 2cb 24a1            call master_send
1524                     ; Wait for an interrupt :
1525                     ;   call test_interrupt_wait {{ }}  
1526 2cc 22d1            call test_interrupt_wait
1527                     ; Disable mask :
1528                     ;   call slave_send {{ set_command }}  
1529 2cd 0841            movf test_interrupt__set_command,w
1530 2ce 00d8            movwf slave_send__data
1531 2cf 2447            call slave_send
1532                     ; procedure test_interrupt end
1533 2d0 3400            retlw 0
1534             
1535                     ; procedure test_interrupt_wait start
1536             test_interrupt_wait:
1537     0043    test_interrupt_wait__variables__base equ global__variables__bank0+35
1538     0043    test_interrupt_wait__bytes__base equ test_interrupt_wait__variables__base+0
1539     0043    test_interrupt_wait__bits__base equ test_interrupt_wait__variables__base+0
1540     0000    test_interrupt_wait__total__bytes equ 0
1541                     ;   arguments_none  
1542                     ; This procedure will test an interrupt :
1543                     ; Now enable interrupts :
1544                     ;   call slave_send {{ 0xf2 }}  
1545 2d1 30f2            movlw 242
1546 2d2 00d8            movwf slave_send__data
1547 2d3 2447            call slave_send
1548                     ; Now wait for interrupt :
1549                     ; `while rx_slave_pin ...' start
1550             test_interrupt_wait__566while__continue:
1551                     ; expression=`rx_slave_pin' exp_delay=0 true_delay=1  false_delay=2 true_size=2 false_size=1
1552 2d4 1e86            btfss rx_slave_pin__byte,rx_slave_pin__bit
1553 2d5 2ad8            goto test_interrupt_wait__566while__break
1554                     ;   call delay {{ }}  
1555 2d6 24ba            call delay
1556 2d7 2ad4            goto test_interrupt_wait__566while__continue
1557                     ; if exp=`rx_slave_pin' false goto
1558                     ; Other expression=`rx_slave_pin' delay=-1
1559             test_interrupt_wait__566while__break:
1560                     ; `while rx_slave_pin ...' end
1561                     ;   call master_crlf {{ }}  
1562 2d8 2407            call master_crlf
1563                     ; procedure test_interrupt_wait end
1564 2d9 3400            retlw 0
1565             
1566                     ; procedure test_register start
1567             test_register:
1568     0043    test_register__variables__base equ global__variables__bank0+35
1569     0043    test_register__bytes__base equ test_register__variables__base+0
1570     0047    test_register__bits__base equ test_register__variables__base+4
1571     0004    test_register__total__bytes equ 4
1572     0043    test_register__set_command equ test_register__bytes__base+0
1573     0044    test_register__read_command equ test_register__bytes__base+1
1574     0045    test_register__error equ test_register__bytes__base+2
1575                     ; This procedure will test the ability to set and read back a byte register :
1576     0046    test_register__index equ test_register__bytes__base+3
1577                     ;   index := 16  
1578 2da 3010            movlw 16
1579 2db 00c6            movwf test_register__index
1580                     ; `while  index != 0  ...' start
1581             test_register__583while__continue:
1582 2dc 0846            movf test_register__index,w
1583                     ; expression=` index != 0 ' exp_delay=1 true_delay=1  false_delay=2 true_size=27 false_size=1
1584 2dd 1903            btfsc z___byte,z___bit
1585 2de 2af9            goto test_register__583while__break
1586                     ;   index := index - 1  
1587 2df 03c6            decf test_register__index,f
1588                     ;   call slave_send {{ set_command | index }}  
1589 2e0 0843            movf test_register__set_command,w
1590 2e1 0446            iorwf test_register__index,w
1591 2e2 00d8            movwf slave_send__data
1592 2e3 2447            call slave_send
1593                     ;   call slave_send {{ read_command }}  
1594 2e4 0844            movf test_register__read_command,w
1595 2e5 00d8            movwf slave_send__data
1596 2e6 2447            call slave_send
1597                     ;   temp := slave_get {{ }}  
1598 2e7 2441            call slave_get
1599 2e8 0857            movf slave_get__0return__byte,w
1600 2e9 00a0            movwf temp
1601                     ; if { temp != index } start
1602 2ea 0246            subwf test_register__index,w
1603                     ; expression=`{ temp != index }' exp_delay=2 true_delay=5  false_delay=0 true_size=11 false_size=0
1604 2eb 1903            btfsc z___byte,z___bit
1605 2ec 2af8            goto label589__0end
1606                     ; if { temp != index } body start
1607                     ;   call master_octal {{ index }}  
1608 2ed 0846            movf test_register__index,w
1609 2ee 00d5            movwf master_octal__number
1610 2ef 2428            call master_octal
1611                     ;   call master_octal {{ temp }}  
1612 2f0 0820            movf temp,w
1613 2f1 00d5            movwf master_octal__number
1614 2f2 2428            call master_octal
1615                     ;   call master_fail {{ register_string , error }}  
1616 2f3 305f            movlw LOW register_string+1
1617 2f4 00d1            movwf master_fail__test_name
1618 2f5 0845            movf test_register__error,w
1619 2f6 00d2            movwf master_fail__test_number
1620 2f7 240e            call master_fail
1621                     ; if { temp != index } body end
1622             label589__0end:
1623                     ; if exp=` temp != index ' empty false
1624                     ; Other expression=`{ temp != index }' delay=-1
1625                     ; if { temp != index } end
1626 2f8 2adc            goto test_register__583while__continue
1627                     ; if exp=` index != 0 ' false goto
1628                     ; Other expression=` index != 0 ' delay=-1
1629             test_register__583while__break:
1630                     ; `while  index != 0  ...' end
1631                     ; procedure test_register end
1632 2f9 3400            retlw 0
1633                     ; comment {The procedures below are used to test the common shared commands :}
1634             
1635                     ; procedure common_test start
1636             common_test:
1637     0047    common_test__variables__base equ global__variables__bank0+39
1638     0047    common_test__bytes__base equ common_test__variables__base+0
1639     0049    common_test__bits__base equ common_test__variables__base+2
1640     0002    common_test__total__bytes equ 2
1641     0048    common_test__642byte0 equ common_test__bytes__base+1
1642                     ;   arguments_none  
1643                     ; This procedure will verify that the common shared commands work .
1644     0047    common_test__actual equ common_test__bytes__base+0
1645                     ; Print the ID information :
1646                     ; ID reset :
1647                     ;   call slave_send {{ 0xfd }}  
1648 2fa 30fd            movlw 253
1649 2fb 00d8            movwf slave_send__data
1650 2fc 2447            call slave_send
1651                     ; Read the fixed bytes :
1652                     ;   call common_test_id_match {{ 1 , 0xc0 }}  
1653 2fd 3001            movlw 1
1654 2fe 00c9            movwf common_test_id_match__desired
1655 2ff 30c0            movlw 192
1656 300 00ca            movwf common_test_id_match__test_number
1657 301 236f            call common_test_id_match
1658                     ;   call common_test_id_match {{ 0 , 0xc1 }}  
1659 302 01c9            clrf common_test_id_match__desired
1660 303 30c1            movlw 193
1661 304 00ca            movwf common_test_id_match__test_number
1662 305 236f            call common_test_id_match
1663                     ;   call common_test_id_match {{ 28 , 0xc2 }}  
1664 306 301c            movlw 28
1665 307 00c9            movwf common_test_id_match__desired
1666 308 30c2            movlw 194
1667 309 00ca            movwf common_test_id_match__test_number
1668 30a 236f            call common_test_id_match
1669                     ;   call common_test_id_match {{ 0 , 0xc3 }}  
1670 30b 01c9            clrf common_test_id_match__desired
1671 30c 30c3            movlw 195
1672 30d 00ca            movwf common_test_id_match__test_number
1673 30e 236f            call common_test_id_match
1674                     ;   call common_test_id_match {{ 0 , 0xc4 }}  
1675 30f 01c9            clrf common_test_id_match__desired
1676 310 30c4            movlw 196
1677 311 00ca            movwf common_test_id_match__test_number
1678 312 236f            call common_test_id_match
1679                     ;   call common_test_id_match {{ 0 , 0xc5 }}  
1680 313 01c9            clrf common_test_id_match__desired
1681 314 30c5            movlw 197
1682 315 00ca            movwf common_test_id_match__test_number
1683 316 236f            call common_test_id_match
1684                     ;   call common_test_id_match {{ 0 , 0xc6 }}  
1685 317 01c9            clrf common_test_id_match__desired
1686 318 30c6            movlw 198
1687 319 00ca            movwf common_test_id_match__test_number
1688 31a 236f            call common_test_id_match
1689                     ;   call common_test_id_match {{ 0 , 0xc7 }}  
1690 31b 01c9            clrf common_test_id_match__desired
1691 31c 30c7            movlw 199
1692 31d 00ca            movwf common_test_id_match__test_number
1693 31e 236f            call common_test_id_match
1694                     ;   call master_crlf {{ }}  
1695 31f 2407            call master_crlf
1696                     ;   call common_test_id_bytes8 {{ }}  
1697 320 237a            call common_test_id_bytes8
1698                     ;   call common_test_id_bytes8 {{ }}  
1699 321 237a            call common_test_id_bytes8
1700                     ; Read the brick name :
1701                     ;   call common_test_id_string {{ }}  
1702 322 2384            call common_test_id_string
1703                     ; Read the vendor name :
1704                     ;   call common_test_id_string {{ }}  
1705 323 2384            call common_test_id_string
1706                     ; Verfify that we don ' t read off the end of the id and crash :
1707                     ;   call common_test_id_next {{ }}  
1708 324 238f            call common_test_id_next
1709 325 084d            movf common_test_id_next__0return__byte,w
1710                     ; Reset id :
1711                     ;   call slave_send {{ 0xfd }}  
1712 326 30fd            movlw 253
1713 327 00d8            movwf slave_send__data
1714 328 2447            call slave_send
1715                     ; Verify that we are still alive :
1716                     ;   call common_test_id_match {{ 1 , 0xc8 }}  
1717 329 3001            movlw 1
1718 32a 00c9            movwf common_test_id_match__desired
1719 32b 30c8            movlw 200
1720 32c 00ca            movwf common_test_id_match__test_number
1721 32d 236f            call common_test_id_match
1722                     ; Read glitch :
1723                     ; Clear glitch register :
1724                     ;   call slave_send {{ 0xfe }}  
1725 32e 30fe            movlw 254
1726 32f 00d8            movwf slave_send__data
1727 330 2447            call slave_send
1728                     ;   actual := slave_get {{ }}  
1729 331 2441            call slave_get
1730 332 0857            movf slave_get__0return__byte,w
1731 333 00c7            movwf common_test__actual
1732                     ; Send a couple of glitches :
1733                     ;   call slave_send {{ 0xff }}  
1734 334 30ff            movlw 255
1735 335 00d8            movwf slave_send__data
1736 336 2447            call slave_send
1737                     ;   call slave_send {{ 0xff }}  
1738 337 30ff            movlw 255
1739 338 00d8            movwf slave_send__data
1740 339 2447            call slave_send
1741                     ; Read the glitch register :
1742                     ;   call slave_send {{ 0xfe }}  
1743 33a 30fe            movlw 254
1744 33b 00d8            movwf slave_send__data
1745 33c 2447            call slave_send
1746                     ; if { slave_get {{ }} != 2 } start
1747 33d 2441            call slave_get
1748 33e 0857            movf slave_get__0return__byte,w
1749 33f 00c8            movwf common_test__642byte0
1750 340 3002            movlw 2
1751 341 0248            subwf common_test__642byte0,w
1752                     ; expression=`{ slave_get {{ }} != 2 }' exp_delay=3 true_delay=3  false_delay=0 true_size=5 false_size=0
1753 342 1903            btfsc z___byte,z___bit
1754 343 2b49            goto label642__1end
1755                     ; if { slave_get {{ }} != 2 } body start
1756                     ;   call master_fail {{ common_string , 0xc9 }}  
1757 344 3010            movlw LOW common_string+1
1758 345 00d1            movwf master_fail__test_name
1759 346 30c9            movlw 201
1760 347 00d2            movwf master_fail__test_number
1761 348 240e            call master_fail
1762                     ; if { slave_get {{ }} != 2 } body end
1763             label642__1end:
1764                     ; if exp=` slave_get ## {{ }} != 2 ' empty false
1765                     ; Other expression=`{ slave_get {{ }} != 2 }' delay=-1
1766                     ; if { slave_get {{ }} != 2 } end
1767                     ; Do a clock pulse :
1768                     ;   call slave_send {{ 0xfb }}  
1769 349 30fb            movlw 251
1770 34a 00d8            movwf slave_send__data
1771 34b 2447            call slave_send
1772                     ; if { slave_get {{ }} != 0 } start
1773 34c 2441            call slave_get
1774 34d 0857            movf slave_get__0return__byte,w
1775                     ; expression=`{ slave_get {{ }} != 0 }' exp_delay=0 true_delay=3  false_delay=0 true_size=5 false_size=0
1776 34e 1903            btfsc z___byte,z___bit
1777 34f 2b55            goto label648__0end
1778                     ; if { slave_get {{ }} != 0 } body start
1779                     ;   call master_fail {{ common_string , 0xca }}  
1780 350 3010            movlw LOW common_string+1
1781 351 00d1            movwf master_fail__test_name
1782 352 30ca            movlw 202
1783 353 00d2            movwf master_fail__test_number
1784 354 240e            call master_fail
1785                     ; if { slave_get {{ }} != 0 } body end
1786             label648__0end:
1787                     ; if exp=` slave_get ## {{ }} != 0 ' empty false
1788                     ; Other expression=`{ slave_get {{ }} != 0 }' delay=-1
1789                     ; if { slave_get {{ }} != 0 } end
1790                     ; Read clock :
1791                     ;   call slave_send {{ 0xfa }}  
1792 355 30fa            movlw 250
1793 356 00d8            movwf slave_send__data
1794 357 2447            call slave_send
1795                     ;   actual := slave_get {{ }}  
1796 358 2441            call slave_get
1797 359 0857            movf slave_get__0return__byte,w
1798 35a 00c7            movwf common_test__actual
1799                     ; Increment :
1800                     ;   call slave_send {{ 0xf9 }}  
1801 35b 30f9            movlw 249
1802 35c 00d8            movwf slave_send__data
1803 35d 2447            call slave_send
1804                     ; Decrement :
1805                     ;   call slave_send {{ 0xf8 }}  
1806 35e 30f8            movlw 248
1807 35f 00d8            movwf slave_send__data
1808 360 2447            call slave_send
1809                     ; Read clock again :
1810                     ;   call slave_send {{ 0xfa }}  
1811 361 30fa            movlw 250
1812 362 00d8            movwf slave_send__data
1813 363 2447            call slave_send
1814                     ; if { actual != slave_get {{ }} } start
1815 364 2441            call slave_get
1816 365 0857            movf slave_get__0return__byte,w
1817 366 0247            subwf common_test__actual,w
1818                     ; expression=`{ actual != slave_get {{ }} }' exp_delay=1 true_delay=3  false_delay=0 true_size=5 false_size=0
1819 367 1903            btfsc z___byte,z___bit
1820 368 2b6e            goto label660__0end
1821                     ; if { actual != slave_get {{ }} } body start
1822                     ;   call master_fail {{ common_string , 0xcb }}  
1823 369 3010            movlw LOW common_string+1
1824 36a 00d1            movwf master_fail__test_name
1825 36b 30cb            movlw 203
1826 36c 00d2            movwf master_fail__test_number
1827 36d 240e            call master_fail
1828                     ; if { actual != slave_get {{ }} } body end
1829             label660__0end:
1830                     ; if exp=` actual != slave_get ## {{ }} ' empty false
1831                     ; Other expression=`{ actual != slave_get {{ }} }' delay=-1
1832                     ; if { actual != slave_get {{ }} } end
1833                     ; procedure common_test end
1834 36e 3400            retlw 0
1835             
1836                     ; procedure common_test_id_match start
1837             common_test_id_match:
1838     0049    common_test_id_match__variables__base equ global__variables__bank0+41
1839     0049    common_test_id_match__bytes__base equ common_test_id_match__variables__base+0
1840     004b    common_test_id_match__bits__base equ common_test_id_match__variables__base+2
1841     0002    common_test_id_match__total__bytes equ 2
1842     0049    common_test_id_match__desired equ common_test_id_match__bytes__base+0
1843     004a    common_test_id_match__test_number equ common_test_id_match__bytes__base+1
1844                     ; This procedure will verify that the next byte in the id is < desired > .
1845                     ; if { desired != common_test_id_next {{ }} } start
1846 36f 238f            call common_test_id_next
1847 370 084d            movf common_test_id_next__0return__byte,w
1848 371 0249            subwf common_test_id_match__desired,w
1849                     ; expression=`{ desired != common_test_id_next {{ }} }' exp_delay=1 true_delay=3  false_delay=0 true_size=5 false_size=0
1850 372 1903            btfsc z___byte,z___bit
1851 373 2b79            goto label672__0end
1852                     ; if { desired != common_test_id_next {{ }} } body start
1853                     ;   call master_fail {{ common_string , test_number }}  
1854 374 3010            movlw LOW common_string+1
1855 375 00d1            movwf master_fail__test_name
1856 376 084a            movf common_test_id_match__test_number,w
1857 377 00d2            movwf master_fail__test_number
1858 378 240e            call master_fail
1859                     ; if { desired != common_test_id_next {{ }} } body end
1860             label672__0end:
1861                     ; if exp=` desired != common_test_id_next ## {{ }} ' empty false
1862                     ; Other expression=`{ desired != common_test_id_next {{ }} }' delay=-1
1863                     ; if { desired != common_test_id_next {{ }} } end
1864                     ; procedure common_test_id_match end
1865 379 3400            retlw 0
1866             
1867                     ; procedure common_test_id_bytes8 start
1868             common_test_id_bytes8:
1869     004b    common_test_id_bytes8__variables__base equ global__variables__bank0+43
1870     004b    common_test_id_bytes8__bytes__base equ common_test_id_bytes8__variables__base+0
1871     004c    common_test_id_bytes8__bits__base equ common_test_id_bytes8__variables__base+1
1872     0001    common_test_id_bytes8__total__bytes equ 1
1873                     ;   arguments_none  
1874                     ; This procedure will print out the next 8 bytes of the id in octal .
1875     004b    common_test_id_bytes8__count equ common_test_id_bytes8__bytes__base+0
1876                     ; `count_down count 8 ...' start
1877 37a 3008            movlw 8
1878 37b 00cb            movwf common_test_id_bytes8__count
1879             common_test_id_bytes8__685_loop:
1880                     ;   call master_octal {{ common_test_id_next {{ }} }}  
1881 37c 238f            call common_test_id_next
1882 37d 084d            movf common_test_id_next__0return__byte,w
1883 37e 00d5            movwf master_octal__number
1884 37f 2428            call master_octal
1885 380 0bcb            decfsz common_test_id_bytes8__count,f
1886 381 2b7c            goto common_test_id_bytes8__685_loop
1887             common_test_id_bytes8__685_done:
1888                     ; `count_down count 8 ...' end
1889                     ;   call master_crlf {{ }}  
1890 382 2407            call master_crlf
1891                     ; procedure common_test_id_bytes8 end
1892 383 3400            retlw 0
1893             
1894                     ; procedure common_test_id_string start
1895             common_test_id_string:
1896     004c    common_test_id_string__variables__base equ global__variables__bank0+44
1897     004c    common_test_id_string__bytes__base equ common_test_id_string__variables__base+0
1898     004d    common_test_id_string__bits__base equ common_test_id_string__variables__base+1
1899     0001    common_test_id_string__total__bytes equ 1
1900                     ;   arguments_none  
1901                     ; This procedure will print out the next id string .
1902     004c    common_test_id_string__count equ common_test_id_string__bytes__base+0
1903                     ; `count_down count  common_test_id_next ## {{ }}  ...' start
1904 384 238f            call common_test_id_next
1905 385 084d            movf common_test_id_next__0return__byte,w
1906 386 00cc            movwf common_test_id_string__count
1907             common_test_id_string__699_loop:
1908                     ;   call master_send {{ common_test_id_next {{ }} }}  
1909 387 238f            call common_test_id_next
1910 388 084d            movf common_test_id_next__0return__byte,w
1911 389 00e2            movwf master_send__character
1912 38a 24a1            call master_send
1913 38b 0bcc            decfsz common_test_id_string__count,f
1914 38c 2b87            goto common_test_id_string__699_loop
1915             common_test_id_string__699_done:
1916                     ; `count_down count  common_test_id_next ## {{ }}  ...' end
1917                     ;   call master_crlf {{ }}  
1918 38d 2407            call master_crlf
1919                     ; procedure common_test_id_string end
1920 38e 3400            retlw 0
1921             
1922                     ; procedure common_test_id_next start
1923             common_test_id_next:
1924     004d    common_test_id_next__variables__base equ global__variables__bank0+45
1925     004d    common_test_id_next__bytes__base equ common_test_id_next__variables__base+0
1926     004e    common_test_id_next__bits__base equ common_test_id_next__variables__base+1
1927     0001    common_test_id_next__total__bytes equ 1
1928                     ;   arguments_none  
1929     004d    common_test_id_next__0return__byte equ common_test_id_next__bytes__base+0
1930                     ; This procedure returns the next byte from the identification string .
1931                     ;   call slave_send {{ 0xfc }}  
1932 38f 30fc            movlw 252
1933 390 00d8            movwf slave_send__data
1934 391 2447            call slave_send
1935                     ;   return slave_get {{ }}  
1936 392 2441            call slave_get
1937 393 0857            movf slave_get__0return__byte,w
1938 394 00cd            movwf common_test_id_next__0return__byte
1939 395 3400            retlw 0
1940                     ; procedure common_test_id_next end
1941                     ; comment {The procedures below are used to test the shared interrupt commands :}
1942             
1943                     ; procedure interrupt_test start
1944             interrupt_test:
1945     004e    interrupt_test__variables__base equ global__variables__bank0+46
1946     004e    interrupt_test__bytes__base equ interrupt_test__variables__base+0
1947     004f    interrupt_test__bits__base equ interrupt_test__variables__base+1
1948     0001    interrupt_test__total__bytes equ 1
1949                     ;   arguments_none  
1950                     ; This procedure tests the common shared interrupt commands .
1951     004e    interrupt_test__counter equ interrupt_test__bytes__base+0
1952                     ; Clear interrupt bits :
1953                     ;   call slave_send {{ 0xf0 }}  
1954 396 30f0            movlw 240
1955 397 00d8            movwf slave_send__data
1956 398 2447            call slave_send
1957                     ;   call interrupt_read {{ 0 , 0xd0 }}  
1958 399 01cf            clrf interrupt_read__desired
1959 39a 30d0            movlw 208
1960 39b 00d0            movwf interrupt_read__test_number
1961 39c 23f5            call interrupt_read
1962                     ; Set / clear interrupt pending bit only :
1963                     ;   call slave_send {{ 0xf5 }}  
1964 39d 30f5            movlw 245
1965 39e 00d8            movwf slave_send__data
1966 39f 2447            call slave_send
1967                     ;   call interrupt_read {{ 1 , 0xd1 }}  
1968 3a0 3001            movlw 1
1969 3a1 00cf            movwf interrupt_read__desired
1970 3a2 30d1            movlw 209
1971 3a3 00d0            movwf interrupt_read__test_number
1972 3a4 23f5            call interrupt_read
1973                     ;   call slave_send {{ 0xf4 }}  
1974 3a5 30f4            movlw 244
1975 3a6 00d8            movwf slave_send__data
1976 3a7 2447            call slave_send
1977                     ;   call interrupt_read {{ 0 , 0xd2 }}  
1978 3a8 01cf            clrf interrupt_read__desired
1979 3a9 30d2            movlw 210
1980 3aa 00d0            movwf interrupt_read__test_number
1981 3ab 23f5            call interrupt_read
1982                     ;   call slave_send {{ 0xf1 }}  
1983 3ac 30f1            movlw 241
1984 3ad 00d8            movwf slave_send__data
1985 3ae 2447            call slave_send
1986                     ;   call interrupt_read {{ 1 , 0xd3 }}  
1987 3af 3001            movlw 1
1988 3b0 00cf            movwf interrupt_read__desired
1989 3b1 30d3            movlw 211
1990 3b2 00d0            movwf interrupt_read__test_number
1991 3b3 23f5            call interrupt_read
1992                     ;   call slave_send {{ 0xf0 }}  
1993 3b4 30f0            movlw 240
1994 3b5 00d8            movwf slave_send__data
1995 3b6 2447            call slave_send
1996                     ;   call interrupt_read {{ 0 , 0xd4 }}  
1997 3b7 01cf            clrf interrupt_read__desired
1998 3b8 30d4            movlw 212
1999 3b9 00d0            movwf interrupt_read__test_number
2000 3ba 23f5            call interrupt_read
2001                     ; Set / clear interrupt enable bit only :
2002                     ;   call slave_send {{ 0xf7 }}  
2003 3bb 30f7            movlw 247
2004 3bc 00d8            movwf slave_send__data
2005 3bd 2447            call slave_send
2006                     ;   call interrupt_read {{ 2 , 0xd5 }}  
2007 3be 3002            movlw 2
2008 3bf 00cf            movwf interrupt_read__desired
2009 3c0 30d5            movlw 213
2010 3c1 00d0            movwf interrupt_read__test_number
2011 3c2 23f5            call interrupt_read
2012                     ;   call slave_send {{ 0xf6 }}  
2013 3c3 30f6            movlw 246
2014 3c4 00d8            movwf slave_send__data
2015 3c5 2447            call slave_send
2016                     ;   call interrupt_read {{ 0 , 0xd6 }}  
2017 3c6 01cf            clrf interrupt_read__desired
2018 3c7 30d6            movlw 214
2019 3c8 00d0            movwf interrupt_read__test_number
2020 3c9 23f5            call interrupt_read
2021                     ;   call slave_send {{ 0xf2 }}  
2022 3ca 30f2            movlw 242
2023 3cb 00d8            movwf slave_send__data
2024 3cc 2447            call slave_send
2025                     ;   call interrupt_read {{ 2 , 0xd7 }}  
2026 3cd 3002            movlw 2
2027 3ce 00cf            movwf interrupt_read__desired
2028 3cf 30d7            movlw 215
2029 3d0 00d0            movwf interrupt_read__test_number
2030 3d1 23f5            call interrupt_read
2031                     ;   call slave_send {{ 0xf0 }}  
2032 3d2 30f0            movlw 240
2033 3d3 00d8            movwf slave_send__data
2034 3d4 2447            call slave_send
2035                     ;   call interrupt_read {{ 0 , 0xd8 }}  
2036 3d5 01cf            clrf interrupt_read__desired
2037 3d6 30d8            movlw 216
2038 3d7 00d0            movwf interrupt_read__test_number
2039 3d8 23f5            call interrupt_read
2040                     ; Now set both the interrupt enable and pending bit .
2041                     ; This must trigger an interrupt .
2042                     ;   call slave_send {{ 0xf3 }}  
2043 3d9 30f3            movlw 243
2044 3da 00d8            movwf slave_send__data
2045 3db 2447            call slave_send
2046                     ; `count_down counter 3 ...' start
2047 3dc 3003            movlw 3
2048 3dd 00ce            movwf interrupt_test__counter
2049             interrupt_test__753_loop:
2050                     ;   call delay {{ }}  
2051 3de 24ba            call delay
2052 3df 0bce            decfsz interrupt_test__counter,f
2053 3e0 2bde            goto interrupt_test__753_loop
2054             interrupt_test__753_done:
2055                     ; `count_down counter 3 ...' end
2056                     ; if { rx_slave_pin } start
2057                     ; expression=`{ rx_slave_pin }' exp_delay=0 true_delay=3  false_delay=0 true_size=5 false_size=0
2058 3e1 1e86            btfss rx_slave_pin__byte,rx_slave_pin__bit
2059 3e2 2be8            goto label756__0end
2060                     ; if { rx_slave_pin } body start
2061                     ; No interrupt detected :
2062                     ;   call master_fail {{ interrupt_string , 0xd9 }}  
2063 3e3 3038            movlw LOW interrupt_string+1
2064 3e4 00d1            movwf master_fail__test_name
2065 3e5 30d9            movlw 217
2066 3e6 00d2            movwf master_fail__test_number
2067 3e7 240e            call master_fail
2068                     ; if { rx_slave_pin } body end
2069             label756__0end:
2070                     ; if exp=`rx_slave_pin' empty false
2071                     ; Other expression=`{ rx_slave_pin }' delay=-1
2072                     ; if { rx_slave_pin } end
2073                     ; Read the interrupt enable bit is cleared as a side effect
2074                     ; of reading the bit .
2075                     ;   call interrupt_read {{ 1 , 0xda }}  
2076 3e8 3001            movlw 1
2077 3e9 00cf            movwf interrupt_read__desired
2078 3ea 30da            movlw 218
2079 3eb 00d0            movwf interrupt_read__test_number
2080 3ec 23f5            call interrupt_read
2081                     ; Clear the interrupt pending bit :
2082                     ;   call slave_send {{ 0xf0 }}  
2083 3ed 30f0            movlw 240
2084 3ee 00d8            movwf slave_send__data
2085 3ef 2447            call slave_send
2086                     ;   call interrupt_read {{ 0 , 0xdb }}  
2087 3f0 01cf            clrf interrupt_read__desired
2088 3f1 30db            movlw 219
2089 3f2 00d0            movwf interrupt_read__test_number
2090 3f3 23f5            call interrupt_read
2091                     ; procedure interrupt_test end
2092 3f4 3400            retlw 0
2093             
2094                     ; procedure interrupt_read start
2095             interrupt_read:
2096     004f    interrupt_read__variables__base equ global__variables__bank0+47
2097     004f    interrupt_read__bytes__base equ interrupt_read__variables__base+0
2098     0051    interrupt_read__bits__base equ interrupt_read__variables__base+2
2099     0002    interrupt_read__total__bytes equ 2
2100     004f    interrupt_read__desired equ interrupt_read__bytes__base+0
2101     0050    interrupt_read__test_number equ interrupt_read__bytes__base+1
2102                     ; This procedure will verify that the interrupt bits match < desired > .
2103                     ;   call slave_send {{ 0xef }}  
2104 3f5 30ef            movlw 239
2105 3f6 00d8            movwf slave_send__data
2106 3f7 2447            call slave_send
2107                     ;   temp := slave_get {{ }}  
2108 3f8 2441            call slave_get
2109 3f9 0857            movf slave_get__0return__byte,w
2110 3fa 00a0            movwf temp
2111                     ; if { temp != desired } start
2112 3fb 024f            subwf interrupt_read__desired,w
2113                     ; expression=`{ temp != desired }' exp_delay=2 true_delay=4  false_delay=0 true_size=8 false_size=0
2114 3fc 1903            btfsc z___byte,z___bit
2115 3fd 2c06            goto label778__0end
2116                     ; if { temp != desired } body start
2117                     ;   call master_octal {{ temp }}  
2118 3fe 0820            movf temp,w
2119 3ff 00d5            movwf master_octal__number
2120 400 2428            call master_octal
2121                     ;   call master_fail {{ interrupt_string , test_number }}  
2122 401 3038            movlw LOW interrupt_string+1
2123 402 00d1            movwf master_fail__test_name
2124 403 0850            movf interrupt_read__test_number,w
2125 404 00d2            movwf master_fail__test_number
2126 405 240e            call master_fail
2127                     ; if { temp != desired } body end
2128             label778__0end:
2129                     ; if exp=` temp != desired ' empty false
2130                     ; Other expression=`{ temp != desired }' delay=-1
2131                     ; if { temp != desired } end
2132                     ; procedure interrupt_read end
2133 406 3400            retlw 0
2134                     ; comment {The following procedures are used to communicate with the master :}
2135             
2136                     ; procedure master_crlf start
2137             master_crlf:
2138     0051    master_crlf__variables__base equ global__variables__bank0+49
2139     0051    master_crlf__bytes__base equ master_crlf__variables__base+0
2140     0051    master_crlf__bits__base equ master_crlf__variables__base+0
2141     0000    master_crlf__total__bytes equ 0
2142                     ;   arguments_none  
2143                     ; This procedure will output a carriage - return line - feed
2144                     ; to the master .
2145                     ;   call master_send {{ cr }}  
2146 407 300d            movlw 13
2147 408 00e2            movwf master_send__character
2148 409 24a1            call master_send
2149                     ;   call master_send {{ lf }}  
2150 40a 300a            movlw 10
2151 40b 00e2            movwf master_send__character
2152 40c 24a1            call master_send
2153                     ; procedure master_crlf end
2154 40d 3400            retlw 0
2155             
2156                     ; procedure master_fail start
2157             master_fail:
2158     0051    master_fail__variables__base equ global__variables__bank0+49
2159     0051    master_fail__bytes__base equ master_fail__variables__base+0
2160     0053    master_fail__bits__base equ master_fail__variables__base+2
2161     0002    master_fail__total__bytes equ 2
2162     0051    master_fail__test_name equ master_fail__bytes__base+0
2163     0052    master_fail__test_number equ master_fail__bytes__base+1
2164                     ; This procedure will output ` fail ' followed by a carriage return
2165                     ; and line feed .
2166                     ;   call master_string {{ fail_string }}  
2167 40e 301e            movlw LOW fail_string+1
2168 40f 00e3            movwf master_string__message
2169 410 24a7            call master_string
2170                     ;   call master_string {{ test_name }}  
2171 411 0851            movf master_fail__test_name,w
2172 412 00e3            movwf master_string__message
2173 413 24a7            call master_string
2174                     ;   call master_octal {{ test_number }}  
2175 414 0852            movf master_fail__test_number,w
2176 415 00d5            movwf master_octal__number
2177 416 2428            call master_octal
2178                     ;   call master_crlf {{ }}  
2179 417 2407            call master_crlf
2180                     ; procedure master_fail end
2181 418 3400            retlw 0
2182             
2183                     ; procedure master_get start
2184             master_get:
2185     0053    master_get__variables__base equ global__variables__bank0+51
2186     0053    master_get__bytes__base equ master_get__variables__base+0
2187     0055    master_get__bits__base equ master_get__variables__base+2
2188     0002    master_get__total__bytes equ 2
2189                     ;   arguments_none  
2190     0053    master_get__0return__byte equ master_get__bytes__base+0
2191                     ; This procedure will get the next character from the master .
2192     0054    master_get__character equ master_get__bytes__base+1
2193                     ;   character := 0xfc  
2194 419 30fc            movlw 252
2195 41a 00d4            movwf master_get__character
2196                     ; `while  character = 0xfc  ...' start
2197             master_get__820while__continue:
2198 41b 30fc            movlw 252
2199 41c 0254            subwf master_get__character,w
2200                     ; expression=` character = 0xfc ' exp_delay=2 true_delay=5  false_delay=2 true_size=6 false_size=1
2201 41d 1d03            btfss z___byte,z___bit
2202 41e 2c25            goto master_get__820while__break
2203                     ;   character := get_byte {{ rx_master_mask }}  
2204 41f 3002            movlw 2
2205 420 00d9            movwf get_byte__mask
2206 421 244d            call get_byte
2207 422 085a            movf get_byte__0return__byte,w
2208 423 00d4            movwf master_get__character
2209 424 2c1b            goto master_get__820while__continue
2210                     ; if exp=` character = 0xfc ' false goto
2211                     ; Other expression=` character = 0xfc ' delay=-1
2212             master_get__820while__break:
2213                     ; `while  character = 0xfc  ...' end
2214                     ;   return character  
2215 425 0854            movf master_get__character,w
2216 426 00d3            movwf master_get__0return__byte
2217 427 3400            retlw 0
2218                     ; procedure master_get end
2219             
2220                     ; procedure master_octal start
2221             master_octal:
2222     0055    master_octal__variables__base equ global__variables__bank0+53
2223     0055    master_octal__bytes__base equ master_octal__variables__base+0
2224     0057    master_octal__bits__base equ master_octal__variables__base+2
2225     0002    master_octal__total__bytes equ 2
2226     0056    master_octal__833byte0 equ master_octal__bytes__base+1
2227     0056    master_octal__834byte0 equ master_octal__bytes__base+1
2228     0055    master_octal__number equ master_octal__bytes__base+0
2229                     ; This procedure will output < number > in octal to the tx port .
2230                     ; Output the character in octal :
2231                     ;   call master_send {{ {{ number >> 6 }} + 0c'0' }}  
2232 428 0e55            swapf master_octal__number,w
2233 429 00d6            movwf master_octal__833byte0
2234 42a 0cd6            rrf master_octal__833byte0,f
2235 42b 0c56            rrf master_octal__833byte0,w
2236 42c 3903            andlw 3
2237 42d 3e30            addlw 48
2238 42e 00e2            movwf master_send__character
2239 42f 24a1            call master_send
2240                     ;   call master_send {{ {{ {{ number >> 3 }} & 7 }} + 0c'0' }}  
2241 430 0c55            rrf master_octal__number,w
2242 431 00d6            movwf master_octal__834byte0
2243 432 0cd6            rrf master_octal__834byte0,f
2244 433 0c56            rrf master_octal__834byte0,w
2245 434 3907            andlw 7
2246 435 3e30            addlw 48
2247 436 00e2            movwf master_send__character
2248 437 24a1            call master_send
2249                     ;   call master_send {{ {{ number & 7 }} + 0c'0' }}  
2250 438 3007            movlw 7
2251 439 0555            andwf master_octal__number,w
2252 43a 3e30            addlw 48
2253 43b 00e2            movwf master_send__character
2254 43c 24a1            call master_send
2255                     ;   call master_send {{ sp }}  
2256 43d 3020            movlw 32
2257 43e 00e2            movwf master_send__character
2258 43f 24a1            call master_send
2259                     ; procedure master_octal end
2260 440 3400            retlw 0
2261             
2262                     ; procedure slave_get start
2263             slave_get:
2264     0057    slave_get__variables__base equ global__variables__bank0+55
2265     0057    slave_get__bytes__base equ slave_get__variables__base+0
2266     0058    slave_get__bits__base equ slave_get__variables__base+1
2267     0001    slave_get__total__bytes equ 1
2268                     ;   arguments_none  
2269     0057    slave_get__0return__byte equ slave_get__bytes__base+0
2270                     ; This procedure will get a byte from the slave or return 0xfc
2271                     ; if no byte is forthcoming .
2272                     ;   return get_byte {{ rx_slave_mask }}  
2273 441 3020            movlw 32
2274 442 00d9            movwf get_byte__mask
2275 443 244d            call get_byte
2276 444 085a            movf get_byte__0return__byte,w
2277 445 00d7            movwf slave_get__0return__byte
2278 446 3400            retlw 0
2279                     ; procedure slave_get end
2280             
2281                     ; procedure slave_send start
2282             slave_send:
2283     0058    slave_send__variables__base equ global__variables__bank0+56
2284     0058    slave_send__bytes__base equ slave_send__variables__base+0
2285     0059    slave_send__bits__base equ slave_send__variables__base+1
2286     0001    slave_send__total__bytes equ 1
2287     0058    slave_send__data equ slave_send__bytes__base+0
2288                     ; This procedure will send one byte of < data > to the slave .
2289                     ;   call send_byte {{ data , tx_slave_mask }}  
2290 447 0858            movf slave_send__data,w
2291 448 00de            movwf send_byte__char
2292 449 3010            movlw 16
2293 44a 00df            movwf send_byte__mask
2294 44b 247b            call send_byte
2295                     ; procedure slave_send end
2296 44c 3400            retlw 0
2297                     ; comment {The last procedures do character sending and receiving :}
2298             
2299                     ; procedure get_byte start
2300             get_byte:
2301     0059    get_byte__variables__base equ global__variables__bank0+57
2302     0059    get_byte__bytes__base equ get_byte__variables__base+0
2303     005e    get_byte__bits__base equ get_byte__variables__base+5
2304     0005    get_byte__total__bytes equ 5
2305     005d    get_byte__890byte1 equ get_byte__bytes__base+4
2306     0059    get_byte__mask equ get_byte__bytes__base+0
2307     005a    get_byte__0return__byte equ get_byte__bytes__base+1
2308                     ; Get an 8 - bit byte from < mask > bit of < portb > and return it .
2309                     ; If no character shows up in a while 0xfc is returned .
2310     005b    get_byte__count equ get_byte__bytes__base+2
2311     005c    get_byte__char equ get_byte__bytes__base+3
2312                     ; Wait until a start bit arrives :
2313                     ;   count := 0  
2314 44d 01db            clrf get_byte__count
2315                     ; `while  portb & mask != 0  ...' start
2316             get_byte__872while__continue:
2317 44e 0806            movf portb,w
2318 44f 0559            andwf get_byte__mask,w
2319                     ; expression=` portb & mask != 0 ' exp_delay=2 true_delay=1  false_delay=2 true_size=9 false_size=1
2320 450 1903            btfsc z___byte,z___bit
2321 451 2c5b            goto get_byte__872while__break
2322                     ;   count := count - 1  
2323 452 03db            decf get_byte__count,f
2324                     ; if { count = 0 } start
2325 453 085b            movf get_byte__count,w
2326                     ; expression=`{ count = 0 }' exp_delay=1 true_delay=3  false_delay=0 true_size=3 false_size=0
2327 454 1d03            btfss z___byte,z___bit
2328 455 2c59            goto label874__0end
2329                     ; if { count = 0 } body start
2330                     ;   return 0xfc  
2331 456 30fc            movlw 252
2332 457 00da            movwf get_byte__0return__byte
2333 458 3400            retlw 0
2334                     ; if { count = 0 } body end
2335             label874__0end:
2336                     ; if exp=` count = 0 ' empty false
2337                     ; Other expression=`{ count = 0 }' delay=-1
2338                     ; if { count = 0 } end
2339                     ;   call delay {{ }}  
2340 459 24ba            call delay
2341 45a 2c4e            goto get_byte__872while__continue
2342                     ; if exp=` portb & mask != 0 ' false goto
2343                     ; Other expression=` portb & mask != 0 ' delay=-1
2344             get_byte__872while__break:
2345                     ; `while  portb & mask != 0  ...' end
2346                     ; Skip over the start bit :
2347                     ;   call delay {{ }}  
2348 45b 24ba            call delay
2349                     ;   call delay {{ }}  
2350 45c 24ba            call delay
2351                     ;   call delay {{ }}  
2352 45d 24ba            call delay
2353                     ; Sample in the middle third of each data bit :
2354                     ; 1 cycle :
2355                     ;   char := 0  
2356 45e 01dc            clrf get_byte__char
2357                     ; 2 cylces for loop setup :
2358                     ; 1 + 2 = 3
2359                     ; nop extra_instructions_per_bit - 3
2360                     ; Delay 9 cycles
2361 45f 3002            movlw 2
2362 460 00dd            movwf get_byte__890byte1
2363             get_byte__890delay0:
2364 461 0bdd            decfsz get_byte__890byte1,f
2365 462 2c61            goto get_byte__890delay0
2366 463 0000            nop
2367 464 0000            nop
2368                     ; `count_down count 8 ...' start
2369 465 3008            movlw 8
2370 466 00db            movwf get_byte__count
2371             get_byte__891_loop:
2372                     ;   call delay {{ }}  
2373 467 24ba            call delay
2374                     ; 2 cycles :
2375                     ;   char := char >> 1  
2376 468 1003            bcf c___byte,c___bit
2377 469 0cdc            rrf get_byte__char,f
2378                     ; 3 cycles :
2379                     ; if { portb & mask != 0 } start
2380 46a 0806            movf portb,w
2381 46b 0559            andwf get_byte__mask,w
2382                     ; expression=`{ portb & mask != 0 }' exp_delay=2 true_delay=1  false_delay=0 true_size=1 false_size=0
2383 46c 1d03            btfss z___byte,z___bit
2384                     ; if { portb & mask != 0 } body start
2385                     ;   char @ 7 := 1  
2386                     ; Select char @ 7
2387     005c    get_byte__char__897select0 equ get_byte__char+0
2388     005c    get_byte__char__897select0__byte equ get_byte__char+0
2389     0007    get_byte__char__897select0__bit equ 7
2390 46d 17dc            bsf get_byte__char__897select0__byte,get_byte__char__897select0__bit
2391                     ; if { portb & mask != 0 } body end
2392                     ; if exp=` portb & mask != 0 ' false skip delay=4
2393                     ; Other expression=`{ portb & mask != 0 }' delay=4
2394                     ; if { portb & mask != 0 } end
2395                     ;   call delay {{ }}  
2396 46e 24ba            call delay
2397                     ;   call delay {{ }}  
2398 46f 24ba            call delay
2399                     ; 3 cycles at end of loop :
2400                     ; 2 + 3 + 3 = 8
2401                     ; nop extra_instructions_per_bit - 8
2402                     ; Delay 4 cycles
2403 470 0000            nop
2404 471 0000            nop
2405 472 0000            nop
2406 473 0000            nop
2407 474 0bdb            decfsz get_byte__count,f
2408 475 2c67            goto get_byte__891_loop
2409             get_byte__891_done:
2410                     ; `count_down count 8 ...' end
2411                     ; Skip over 2 / 3 of the stop bit :
2412                     ;   call delay {{ }}  
2413 476 24ba            call delay
2414                     ;   call delay {{ }}  
2415 477 24ba            call delay
2416                     ;   return char  
2417 478 085c            movf get_byte__char,w
2418 479 00da            movwf get_byte__0return__byte
2419 47a 3400            retlw 0
2420                     ; procedure get_byte end
2421             
2422                     ; procedure send_byte start
2423             send_byte:
2424     005e    send_byte__variables__base equ global__variables__bank0+62
2425     005e    send_byte__bytes__base equ send_byte__variables__base+0
2426     0062    send_byte__bits__base equ send_byte__variables__base+4
2427     0004    send_byte__total__bytes equ 4
2428     005e    send_byte__char equ send_byte__bytes__base+0
2429     005f    send_byte__mask equ send_byte__bytes__base+1
2430                     ; Send < char > to < mask > bit of < portb > .
2431     0060    send_byte__count equ send_byte__bytes__base+2
2432     0061    send_byte__mark equ send_byte__bytes__base+3
2433                     ; Send the start bit :
2434                     ; 3 cycles :
2435                     ;   mark := mask ^ space  
2436 47b 30ff            movlw 255
2437 47c 065f            xorwf send_byte__mask,w
2438 47d 00e1            movwf send_byte__mark
2439                     ; 1 cycles < mark is already in W > :
2440                     ;   portb := mark  
2441 47e 0086            movwf portb
2442                     ;   call delay {{ }}  
2443 47f 24ba            call delay
2444                     ;   call delay {{ }}  
2445 480 24ba            call delay
2446                     ;   call delay {{ }}  
2447 481 24ba            call delay
2448                     ; 2 cylces for loop setup :
2449                     ; 3 + 1 + 2 = 6
2450                     ; nop extra_instructions_per_bit - 6
2451                     ; Delay 6 cycles
2452 482 0000            nop
2453 483 0000            nop
2454 484 0000            nop
2455 485 0000            nop
2456 486 0000            nop
2457 487 0000            nop
2458                     ; Send the data :
2459                     ; `count_down count 8 ...' start
2460 488 3008            movlw 8
2461 489 00e0            movwf send_byte__count
2462             send_byte__936_loop:
2463                     ; 5 cylces :
2464                     ; if { char @ 0 } start
2465                     ; Alias variable for select char @ 0
2466     005e    send_byte__char__938select0 equ send_byte__char+0
2467     005e    send_byte__char__938select0__byte equ send_byte__char+0
2468     0000    send_byte__char__938select0__bit equ 0
2469                     ; expression=`{ char @ 0 }' exp_delay=0 true_delay=1  false_delay=1 true_size=1 false_size=1
2470 48a 185e            btfsc send_byte__char__938select0__byte,send_byte__char__938select0__bit
2471                     ; if { char @ 0 } body start
2472                     ;   portb := space  
2473 48b 30ff            movlw 255
2474                     ; 1 instructions found for sharing
2475 48c 1c5e            btfss send_byte__char__938select0__byte,send_byte__char__938select0__bit
2476                     ; else body start
2477                     ;   portb := mark  
2478 48d 0861            movf send_byte__mark,w
2479                     ; 1 instructions found for sharing
2480                     ; if exp=` char @ 0 ' single true and false skip delay=4
2481                     ; Other expression=`{ char @ 0 }' delay=4
2482                     ; 1 shared instructions follow
2483 48e 0086            movwf portb
2484                     ; if { char @ 0 } end
2485                     ; 2 cycles :
2486                     ;   char := char >> 1  
2487 48f 1003            bcf c___byte,c___bit
2488 490 0cde            rrf send_byte__char,f
2489                     ;   call delay {{ }}  
2490 491 24ba            call delay
2491                     ;   call delay {{ }}  
2492 492 24ba            call delay
2493                     ;   call delay {{ }}  
2494 493 24ba            call delay
2495                     ; 3 cycles at end of loop :
2496                     ; 5 + 2 + 3 = 10
2497                     ; nop extra_instructions_per_bit - 10
2498                     ; Delay 2 cycles
2499 494 0000            nop
2500 495 0000            nop
2501 496 0be0            decfsz send_byte__count,f
2502 497 2c8a            goto send_byte__936_loop
2503             send_byte__936_done:
2504                     ; `count_down count 8 ...' end
2505                     ; Send the stop bit :
2506                     ; 1 cycle to finish off previous loop :
2507                     ; nop 1
2508                     ; Delay 1 cycles
2509 498 0000            nop
2510                     ; 2 cycles :
2511                     ;   portb := space  
2512 499 30ff            movlw 255
2513 49a 0086            movwf portb
2514                     ;   call delay {{ }}  
2515 49b 24ba            call delay
2516                     ;   call delay {{ }}  
2517 49c 24ba            call delay
2518                     ;   call delay {{ }}  
2519 49d 24ba            call delay
2520                     ; 4 cycles for call / return :
2521                     ; 4 cycles for to arguments :
2522                     ; 2 + 4 + 4 = 10
2523                     ; nop extra_instructions_per_bit - 10
2524                     ; Delay 2 cycles
2525 49e 0000            nop
2526 49f 0000            nop
2527                     ; procedure send_byte end
2528 4a0 3400            retlw 0
2529             
2530                     ; procedure master_send start
2531             master_send:
2532     0062    master_send__variables__base equ global__variables__bank0+66
2533     0062    master_send__bytes__base equ master_send__variables__base+0
2534     0063    master_send__bits__base equ master_send__variables__base+1
2535     0001    master_send__total__bytes equ 1
2536     0062    master_send__character equ master_send__bytes__base+0
2537                     ; This procedure will output < character > to the master .
2538                     ;   call send_byte {{ character , tx_master_mask }}  
2539 4a1 0862            movf master_send__character,w
2540 4a2 00de            movwf send_byte__char
2541 4a3 3004            movlw 4
2542 4a4 00df            movwf send_byte__mask
2543 4a5 247b            call send_byte
2544                     ; procedure master_send end
2545 4a6 3400            retlw 0
2546             
2547                     ; procedure master_string start
2548             master_string:
2549     0063    master_string__variables__base equ global__variables__bank0+67
2550     0063    master_string__bytes__base equ master_string__variables__base+0
2551     0066    master_string__bits__base equ master_string__variables__base+3
2552     0003    master_string__total__bytes equ 3
2553     0063    master_string__message equ master_string__bytes__base+0
2554                     ; This procedure will output < message > to the master .
2555     0064    master_string__size equ master_string__bytes__base+1
2556     0065    master_string__index equ master_string__bytes__base+2
2557                     ;   index := 0  
2558 4a7 01e5            clrf master_string__index
2559                     ; `while  index < message . size  ...' start
2560             master_string__986while__continue:
2561 4a8 018a            clrf pclath___register
2562 4a9 0863            movf master_string__message,w
2563 4aa 200e            call string___fetch
2564 4ab 0265            subwf master_string__index,w
2565                     ; expression=` index < message . size ' exp_delay=4 true_delay=7  false_delay=2 true_size=8 false_size=1
2566 4ac 1803            btfsc c___byte,c___bit
2567 4ad 2cb6            goto master_string__986while__break
2568                     ;   call master_send {{ message ~~ {{ index }} }}  
2569 4ae 0a65            incf master_string__index,w
2570 4af 0763            addwf master_string__message,w
2571 4b0 018a            clrf pclath___register
2572 4b1 200e            call string___fetch
2573 4b2 00e2            movwf master_send__character
2574 4b3 24a1            call master_send
2575                     ;   index := index + 1  
2576 4b4 0ae5            incf master_string__index,f
2577 4b5 2ca8            goto master_string__986while__continue
2578                     ; if exp=` index < message . size ' false goto
2579                     ; Other expression=` index < message . size ' delay=-1
2580             master_string__986while__break:
2581                     ; `while  index < message . size  ...' end
2582                     ;   call master_send {{ sp }}  
2583 4b6 3020            movlw 32
2584 4b7 00e2            movwf master_send__character
2585 4b8 24a1            call master_send
2586                     ; procedure master_string end
2587 4b9 3400            retlw 0
2588             
2589                     ; procedure delay start
2590                     ; optimize 0
2591             delay:
2592     0066    delay__variables__base equ global__variables__bank0+70
2593     0066    delay__bytes__base equ delay__variables__base+0
2594     0067    delay__bits__base equ delay__variables__base+1
2595     0001    delay__total__bytes equ 1
2596     0066    delay__993byte1 equ delay__bytes__base+0
2597                     ;   arguments_none  
2598                     ;   uniform_delay delay_instructions  
2599                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2600                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2601                     ; Delay 1 third of a bit :
2602                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2603                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2604                     ; Kick the dog :
2605                     ; Uniform delay remaining = 339 Accumulated Delay = 0
2606                     ;   watch_dog_reset  
2607 4ba 0064            clrwdt
2608                     ; Uniform delay remaining = 338 Accumulated Delay = 1
2609                     ; Uniform delay remaining = 338 Accumulated Delay = 1
2610                     ; Soak up remaining 338 cycles
2611                     ; Delay 338 cycles
2612 4bb 3070            movlw 112
2613 4bc 00e6            movwf delay__993byte1
2614             delay__993delay0:
2615 4bd 0be6            decfsz delay__993byte1,f
2616 4be 2cbd            goto delay__993delay0
2617 4bf 0000            nop
2618                     ; procedure delay end
2619 4c0 3400            retlw 0
2620                     ; optimize 1
2621             
2622                     ; Register bank 0 used 71 bytes of 96 available bytes
2623                     ; Register bank 1 used 0 bytes of 80 available bytes
2624                     ; Register bank 2 used 0 bytes of 48 available bytes
2625                     ; Register bank 3 used 0 bytes of 0 available bytes
2626             
2627                     end

