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

