Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
2 kaklik 1
CCS PCM C Compiler, Version 3.221, 27853               26-IV-05 01:36
2
 
3
               Filename: D:\KAKLIK\programy\PIC_C\roboti\merkur\PIC16F88\tank.LST
4
 
5
               ROM used: 2140 words (52%)
6
                         Largest free fragment is 1570
7
               RAM used: 89 (51%) at main() level
8
                         101 (58%) worst case
9
               Stack:    4 worst case (3 in main + 1 for interrupts)
10
 
11
*
12
0000:  MOVLW  08
13
0001:  MOVWF  0A
14
0002:  GOTO   000
15
0003:  NOP
16
0004:  MOVWF  7F
17
0005:  SWAPF  03,W
18
0006:  CLRF   03
19
0007:  MOVWF  21
20
0008:  MOVF   7F,W
21
0009:  MOVWF  20
22
000A:  MOVF   0A,W
23
000B:  MOVWF  28
24
000C:  CLRF   0A
25
000D:  SWAPF  20,F
26
000E:  MOVF   04,W
27
000F:  MOVWF  22
28
0010:  MOVF   77,W
29
0011:  MOVWF  23
30
0012:  MOVF   78,W
31
0013:  MOVWF  24
32
0014:  MOVF   79,W
33
0015:  MOVWF  25
34
0016:  MOVF   7A,W
35
0017:  MOVWF  26
36
0018:  MOVF   7B,W
37
0019:  MOVWF  27
38
001A:  BCF    03.7
39
001B:  BCF    03.5
40
001C:  MOVLW  8C
41
001D:  MOVWF  04
42
001E:  BTFSS  00.1
43
001F:  GOTO   022
44
0020:  BTFSC  0C.1
45
0021:  GOTO   035
46
0022:  MOVF   22,W
47
0023:  MOVWF  04
48
0024:  MOVF   23,W
49
0025:  MOVWF  77
50
0026:  MOVF   24,W
51
0027:  MOVWF  78
52
0028:  MOVF   25,W
53
0029:  MOVWF  79
54
002A:  MOVF   26,W
55
002B:  MOVWF  7A
56
002C:  MOVF   27,W
57
002D:  MOVWF  7B
58
002E:  MOVF   28,W
59
002F:  MOVWF  0A
60
0030:  SWAPF  21,W
61
0031:  MOVWF  03
62
0032:  SWAPF  7F,F
63
0033:  SWAPF  7F,W
64
0034:  RETFIE
65
0035:  BCF    0A.3
66
0036:  GOTO   049
67
....................  #include "tank.h" 
68
....................  #include <16F88.h> 
69
....................  //////// Standard Header file for the PIC16F88 device ////////////////  
70
.................... #device PIC16F88  
71
.................... #list  
72
....................  
73
.................... #device adc=8  
74
.................... #fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, NOFCMEN, NOIESO  
75
.................... #use delay(clock=4000000)  
76
*
77
005C:  MOVLW  12
78
005D:  BSF    03.5
79
005E:  SUBWF  24,F
80
005F:  BTFSS  03.0
81
0060:  GOTO   06F
82
0061:  MOVLW  A4
83
0062:  MOVWF  04
84
0063:  MOVLW  FC
85
0064:  ANDWF  00,F
86
0065:  BCF    03.0
87
0066:  RRF    00,F
88
0067:  RRF    00,F
89
0068:  MOVF   00,W
90
0069:  BTFSC  03.2
91
006A:  GOTO   06F
92
006B:  GOTO   06D
93
006C:  NOP
94
006D:  DECFSZ 00,F
95
006E:  GOTO   06C
96
006F:  BCF    03.5
97
0070:  RETLW  00
98
*
99
009D:  MOVLW  7D
100
009E:  MOVWF  04
101
009F:  MOVF   00,W
102
00A0:  BTFSC  03.2
103
00A1:  GOTO   0B1
104
00A2:  MOVLW  01
105
00A3:  MOVWF  78
106
00A4:  CLRF   77
107
00A5:  DECFSZ 77,F
108
00A6:  GOTO   0A5
109
00A7:  DECFSZ 78,F
110
00A8:  GOTO   0A4
111
00A9:  MOVLW  4A
112
00AA:  MOVWF  77
113
00AB:  DECFSZ 77,F
114
00AC:  GOTO   0AB
115
00AD:  NOP
116
00AE:  NOP
117
00AF:  DECFSZ 00,F
118
00B0:  GOTO   0A2
119
00B1:  RETLW  00
120
....................   
121
....................  
122
....................   
123
.................... #define DEBUG  
124
....................   
125
.................... #define  TXo PIN_A3           // To the transmitter modulator  
126
.................... #include "AX25.c"             // podprogram pro prenos telemetrie 
127
.................... #list  
128
....................  
129
....................   
130
.................... unsigned int8 sensors;        // pomocna promenna pro cteni cidel na caru  
131
.................... unsigned int8 line;           // na ktere strane byla detekovana cara  
132
.................... unsigned int8 speed;          // rychlost zataceni  
133
.................... unsigned int8 rovinka;        // pocitadlo pro zjisteni rovneho useku  
134
.................... unsigned int8 last;           // kde byla cara, kdyz byly minule cidla mimo  
135
.................... unsigned int8 movement;       // obsahuje aktualni smer zataceni  
136
.................... unsigned int8 dira;           // pocita dobu po kterou je ztracena cara  
137
.................... unsigned int8 cihla;          // urcuje za jak dlouho muze byt znova detekovana cihla  
138
....................   
139
.................... // Konstanty pro dynamiku pohybu  
140
.................... #define T_DIRA       85      // po jakem case zataceni se detekuje dira  
141
.................... #define INC_SPEED    1        // prirustek rychlosti v jednom kroku  
142
.................... #define FW_POMALU    230      // trochu mimo caru vnitrni pas  
143
.................... #define FW_ZATACKA   200      // rychlost vnejsiho kola pri zataceni  
144
.................... #define FW_STREDNE   240      // trochu mimo caru vnejsi pas  
145
.................... #define COUVANI      600      // couvnuti zpet na caru, po detekci diry  
146
.................... #define PRES_DIRU    150  
147
.................... #define MAX_ROVINKA  (255-FW_STREDNE)  
148
.................... #define TRESHOLD     10        // rozhodovaci uroven komparatoru, 0xF = 0.75*Vdd  
149
.................... #define BUMPER_TRESHOLD 128  
150
.................... #define CIK_CAK      20000  
151
.................... #define T_CIHLA      100      // perioda detekce cihly  
152
....................   
153
.................... //motory            //Napred vypnout potom zapnout!  
154
.................... #define FR         output_low(PIN_B5); output_high(PIN_B4)  // Vpred  
155
.................... #define FL         output_low(PIN_B7); output_high(PIN_B6)  
156
.................... #define BR         output_low(PIN_B4); output_high(PIN_B5)  // Vzad  
157
.................... #define BL         output_low(PIN_B6); output_high(PIN_B7)  
158
.................... #define STOPR      output_low(PIN_B4);output_low(PIN_B5)    // Zastav  
159
.................... #define STOPL      output_low(PIN_B6);output_low(PIN_B7)  
160
....................   
161
.................... #define L 0b10  // left  
162
.................... #define R 0b01  // right  
163
.................... #define S 0b11  // straight  
164
....................   
165
.................... //cidla  
166
.................... #define RSENSOR    C2OUT      // Senzory na caru  
167
.................... #define LSENSOR    C1OUT  
168
.................... #define BUMPER     PIN_A4     // Senzor na cihlu  
169
....................   
170
.................... #define DIAG_SERVO      PIN_B3   // Propojka pro diagnosticky mod  
171
.................... #define DIAG_SENSORS    PIN_B2   // Propojka pro diagnosticky mod  
172
....................   
173
.................... #DEFINE SOUND_HI   PIN_A6     // komplementarni vystupy pro piezo pipak  
174
.................... #DEFINE SOUND_LO   PIN_A7  
175
....................   
176
.................... char AXstring[40];   // Buffer pro prenos telemetrie  
177
....................   
178
.................... // makro pro PWM  
179
.................... #define GO(motor, direction, power) if(get_timer0()<=power) \  
180
.................... {direction##motor;} else {stop##motor;}  
181
....................   
182
.................... #int_TIMER2  
183
.................... void TIMER2_isr()  
184
.................... {  
185
....................    if (speed<255) speed+=INC_SPEED;  
186
*
187
0049:  INCFSZ 42,W
188
004A:  GOTO   04C
189
004B:  GOTO   04E
190
004C:  MOVLW  01
191
004D:  ADDWF  42,F
192
....................    if (rovinka<MAX_ROVINKA) rovinka++;  
193
004E:  MOVF   43,W
194
004F:  SUBLW  0E
195
0050:  BTFSC  03.0
196
0051:  INCF   43,F
197
....................    if (dira<=T_DIRA) dira++;  
198
0052:  MOVF   46,W
199
0053:  SUBLW  55
200
0054:  BTFSC  03.0
201
0055:  INCF   46,F
202
....................    if (cihla>0) cihla--;  
203
0056:  MOVF   47,F
204
0057:  BTFSS  03.2
205
0058:  DECF   47,F
206
.................... }  
207
.................... // Primitivni Pipani  
208
0059:  BCF    0C.1
209
005A:  BCF    0A.3
210
005B:  GOTO   022
211
.................... void beep(unsigned int16 period, unsigned int16 length)  
212
.................... {  
213
....................    unsigned int16 nn;  
214
....................   
215
....................    for(nn=length; nn>0; nn--)  
216
*
217
0071:  BSF    03.5
218
0072:  MOVF   21,W
219
0073:  MOVWF  23
220
0074:  MOVF   20,W
221
0075:  MOVWF  22
222
0076:  MOVF   22,F
223
0077:  BTFSS  03.2
224
0078:  GOTO   07C
225
0079:  MOVF   23,F
226
007A:  BTFSC  03.2
227
007B:  GOTO   09B
228
....................    {  
229
....................      output_high(SOUND_HI);output_low(SOUND_LO);  
230
007C:  BCF    05.6
231
007D:  BCF    03.5
232
007E:  BSF    05.6
233
007F:  BSF    03.5
234
0080:  BCF    05.7
235
0081:  BCF    03.5
236
0082:  BCF    05.7
237
....................      delay_us(period);  
238
0083:  MOVF   7C,W
239
0084:  BSF    03.5
240
0085:  MOVWF  24
241
0086:  BCF    03.5
242
0087:  CALL   05C
243
....................      output_high(SOUND_LO);output_low(SOUND_HI);  
244
0088:  BSF    03.5
245
0089:  BCF    05.7
246
008A:  BCF    03.5
247
008B:  BSF    05.7
248
008C:  BSF    03.5
249
008D:  BCF    05.6
250
008E:  BCF    03.5
251
008F:  BCF    05.6
252
....................      delay_us(period);  
253
0090:  MOVF   7C,W
254
0091:  BSF    03.5
255
0092:  MOVWF  24
256
0093:  BCF    03.5
257
0094:  CALL   05C
258
....................    }  
259
0095:  BSF    03.5
260
0096:  MOVF   22,W
261
0097:  BTFSC  03.2
262
0098:  DECF   23,F
263
0099:  DECF   22,F
264
009A:  GOTO   076
265
.................... }  
266
009B:  BCF    03.5
267
009C:  RETLW  00
268
.................... /******************************************************************************/  
269
.................... void diagnostika()  
270
.................... {  
271
....................    unsigned int16 n;  
272
....................   
273
....................    while (input(DIAG_SERVO))   // Propojka, ktera spousti diagnostiku  
274
....................    {  
275
*
276
01D1:  BSF    03.5
277
01D2:  BSF    06.3
278
01D3:  BCF    03.5
279
01D4:  BTFSS  06.3
280
01D5:  GOTO   302
281
....................       for (n=500; n<800; n+=100)  
282
01D6:  MOVLW  01
283
01D7:  MOVWF  74
284
01D8:  MOVLW  F4
285
01D9:  MOVWF  73
286
01DA:  MOVF   74,W
287
01DB:  SUBLW  03
288
01DC:  BTFSS  03.0
289
01DD:  GOTO   1F4
290
01DE:  BTFSS  03.2
291
01DF:  GOTO   1E4
292
01E0:  MOVF   73,W
293
01E1:  SUBLW  1F
294
01E2:  BTFSS  03.0
295
01E3:  GOTO   1F4
296
....................       {  
297
....................          beep(n,n); //beep UP  
298
01E4:  MOVF   74,W
299
01E5:  MOVWF  7D
300
01E6:  MOVF   73,W
301
01E7:  MOVWF  7C
302
01E8:  MOVF   74,W
303
01E9:  BSF    03.5
304
01EA:  MOVWF  21
305
01EB:  MOVF   73,W
306
01EC:  MOVWF  20
307
01ED:  BCF    03.5
308
01EE:  CALL   071
309
....................       };  
310
01EF:  MOVLW  64
311
01F0:  ADDWF  73,F
312
01F1:  BTFSC  03.0
313
01F2:  INCF   74,F
314
01F3:  GOTO   1DA
315
....................       Delay_ms(1000);  
316
01F4:  MOVLW  04
317
01F5:  MOVWF  7C
318
01F6:  MOVLW  FA
319
01F7:  MOVWF  7D
320
01F8:  CALL   09D
321
01F9:  DECFSZ 7C,F
322
01FA:  GOTO   1F6
323
....................       //zastav vse  
324
....................       STOPL; STOPR;  
325
01FB:  BSF    03.5
326
01FC:  BCF    06.6
327
01FD:  BCF    03.5
328
01FE:  BCF    06.6
329
01FF:  BSF    03.5
330
0200:  BCF    06.7
331
0201:  BCF    03.5
332
0202:  BCF    06.7
333
0203:  BSF    03.5
334
0204:  BCF    06.4
335
0205:  BCF    03.5
336
0206:  BCF    06.4
337
0207:  BSF    03.5
338
0208:  BCF    06.5
339
0209:  BCF    03.5
340
020A:  BCF    06.5
341
....................       //pravy pas  
342
....................       FR; Delay_ms(1000); STOPR; Delay_ms(1000);  
343
020B:  BSF    03.5
344
020C:  BCF    06.5
345
020D:  BCF    03.5
346
020E:  BCF    06.5
347
020F:  BSF    03.5
348
0210:  BCF    06.4
349
0211:  BCF    03.5
350
0212:  BSF    06.4
351
0213:  MOVLW  04
352
0214:  MOVWF  7C
353
0215:  MOVLW  FA
354
0216:  MOVWF  7D
355
0217:  CALL   09D
356
0218:  DECFSZ 7C,F
357
0219:  GOTO   215
358
021A:  BSF    03.5
359
021B:  BCF    06.4
360
021C:  BCF    03.5
361
021D:  BCF    06.4
362
021E:  BSF    03.5
363
021F:  BCF    06.5
364
0220:  BCF    03.5
365
0221:  BCF    06.5
366
0222:  MOVLW  04
367
0223:  MOVWF  7C
368
0224:  MOVLW  FA
369
0225:  MOVWF  7D
370
0226:  CALL   09D
371
0227:  DECFSZ 7C,F
372
0228:  GOTO   224
373
....................       BR; Delay_ms(1000); STOPR; Delay_ms(1000);  
374
0229:  BSF    03.5
375
022A:  BCF    06.4
376
022B:  BCF    03.5
377
022C:  BCF    06.4
378
022D:  BSF    03.5
379
022E:  BCF    06.5
380
022F:  BCF    03.5
381
0230:  BSF    06.5
382
0231:  MOVLW  04
383
0232:  MOVWF  7C
384
0233:  MOVLW  FA
385
0234:  MOVWF  7D
386
0235:  CALL   09D
387
0236:  DECFSZ 7C,F
388
0237:  GOTO   233
389
0238:  BSF    03.5
390
0239:  BCF    06.4
391
023A:  BCF    03.5
392
023B:  BCF    06.4
393
023C:  BSF    03.5
394
023D:  BCF    06.5
395
023E:  BCF    03.5
396
023F:  BCF    06.5
397
0240:  MOVLW  04
398
0241:  MOVWF  7C
399
0242:  MOVLW  FA
400
0243:  MOVWF  7D
401
0244:  CALL   09D
402
0245:  DECFSZ 7C,F
403
0246:  GOTO   242
404
....................       Beep(880,100); Delay_ms(1000);  
405
0247:  MOVLW  03
406
0248:  MOVWF  7D
407
0249:  MOVLW  70
408
024A:  MOVWF  7C
409
024B:  BSF    03.5
410
024C:  CLRF   21
411
024D:  MOVLW  64
412
024E:  MOVWF  20
413
024F:  BCF    03.5
414
0250:  CALL   071
415
0251:  MOVLW  04
416
0252:  MOVWF  7C
417
0253:  MOVLW  FA
418
0254:  MOVWF  7D
419
0255:  CALL   09D
420
0256:  DECFSZ 7C,F
421
0257:  GOTO   253
422
....................       //levy pas  
423
....................       FL; Delay_ms(1000); STOPL; Delay_ms(1000);  
424
0258:  BSF    03.5
425
0259:  BCF    06.7
426
025A:  BCF    03.5
427
025B:  BCF    06.7
428
025C:  BSF    03.5
429
025D:  BCF    06.6
430
025E:  BCF    03.5
431
025F:  BSF    06.6
432
0260:  MOVLW  04
433
0261:  MOVWF  7C
434
0262:  MOVLW  FA
435
0263:  MOVWF  7D
436
0264:  CALL   09D
437
0265:  DECFSZ 7C,F
438
0266:  GOTO   262
439
0267:  BSF    03.5
440
0268:  BCF    06.6
441
0269:  BCF    03.5
442
026A:  BCF    06.6
443
026B:  BSF    03.5
444
026C:  BCF    06.7
445
026D:  BCF    03.5
446
026E:  BCF    06.7
447
026F:  MOVLW  04
448
0270:  MOVWF  7C
449
0271:  MOVLW  FA
450
0272:  MOVWF  7D
451
0273:  CALL   09D
452
0274:  DECFSZ 7C,F
453
0275:  GOTO   271
454
....................       BL; Delay_ms(1000); STOPL; Delay_ms(1000);  
455
0276:  BSF    03.5
456
0277:  BCF    06.6
457
0278:  BCF    03.5
458
0279:  BCF    06.6
459
027A:  BSF    03.5
460
027B:  BCF    06.7
461
027C:  BCF    03.5
462
027D:  BSF    06.7
463
027E:  MOVLW  04
464
027F:  MOVWF  7C
465
0280:  MOVLW  FA
466
0281:  MOVWF  7D
467
0282:  CALL   09D
468
0283:  DECFSZ 7C,F
469
0284:  GOTO   280
470
0285:  BSF    03.5
471
0286:  BCF    06.6
472
0287:  BCF    03.5
473
0288:  BCF    06.6
474
0289:  BSF    03.5
475
028A:  BCF    06.7
476
028B:  BCF    03.5
477
028C:  BCF    06.7
478
028D:  MOVLW  04
479
028E:  MOVWF  7C
480
028F:  MOVLW  FA
481
0290:  MOVWF  7D
482
0291:  CALL   09D
483
0292:  DECFSZ 7C,F
484
0293:  GOTO   28F
485
....................       Beep(880,100); Delay_ms(1000);  
486
0294:  MOVLW  03
487
0295:  MOVWF  7D
488
0296:  MOVLW  70
489
0297:  MOVWF  7C
490
0298:  BSF    03.5
491
0299:  CLRF   21
492
029A:  MOVLW  64
493
029B:  MOVWF  20
494
029C:  BCF    03.5
495
029D:  CALL   071
496
029E:  MOVLW  04
497
029F:  MOVWF  7C
498
02A0:  MOVLW  FA
499
02A1:  MOVWF  7D
500
02A2:  CALL   09D
501
02A3:  DECFSZ 7C,F
502
02A4:  GOTO   2A0
503
....................       //oba pasy  
504
....................       FL; FR; Delay_ms(1000); STOPL; STOPR; Delay_ms(1000);  
505
02A5:  BSF    03.5
506
02A6:  BCF    06.7
507
02A7:  BCF    03.5
508
02A8:  BCF    06.7
509
02A9:  BSF    03.5
510
02AA:  BCF    06.6
511
02AB:  BCF    03.5
512
02AC:  BSF    06.6
513
02AD:  BSF    03.5
514
02AE:  BCF    06.5
515
02AF:  BCF    03.5
516
02B0:  BCF    06.5
517
02B1:  BSF    03.5
518
02B2:  BCF    06.4
519
02B3:  BCF    03.5
520
02B4:  BSF    06.4
521
02B5:  MOVLW  04
522
02B6:  MOVWF  7C
523
02B7:  MOVLW  FA
524
02B8:  MOVWF  7D
525
02B9:  CALL   09D
526
02BA:  DECFSZ 7C,F
527
02BB:  GOTO   2B7
528
02BC:  BSF    03.5
529
02BD:  BCF    06.6
530
02BE:  BCF    03.5
531
02BF:  BCF    06.6
532
02C0:  BSF    03.5
533
02C1:  BCF    06.7
534
02C2:  BCF    03.5
535
02C3:  BCF    06.7
536
02C4:  BSF    03.5
537
02C5:  BCF    06.4
538
02C6:  BCF    03.5
539
02C7:  BCF    06.4
540
02C8:  BSF    03.5
541
02C9:  BCF    06.5
542
02CA:  BCF    03.5
543
02CB:  BCF    06.5
544
02CC:  MOVLW  04
545
02CD:  MOVWF  7C
546
02CE:  MOVLW  FA
547
02CF:  MOVWF  7D
548
02D0:  CALL   09D
549
02D1:  DECFSZ 7C,F
550
02D2:  GOTO   2CE
551
....................       BL; BR; Delay_ms(1000); STOPL; STOPR; Delay_ms(1000);  
552
02D3:  BSF    03.5
553
02D4:  BCF    06.6
554
02D5:  BCF    03.5
555
02D6:  BCF    06.6
556
02D7:  BSF    03.5
557
02D8:  BCF    06.7
558
02D9:  BCF    03.5
559
02DA:  BSF    06.7
560
02DB:  BSF    03.5
561
02DC:  BCF    06.4
562
02DD:  BCF    03.5
563
02DE:  BCF    06.4
564
02DF:  BSF    03.5
565
02E0:  BCF    06.5
566
02E1:  BCF    03.5
567
02E2:  BSF    06.5
568
02E3:  MOVLW  04
569
02E4:  MOVWF  7C
570
02E5:  MOVLW  FA
571
02E6:  MOVWF  7D
572
02E7:  CALL   09D
573
02E8:  DECFSZ 7C,F
574
02E9:  GOTO   2E5
575
02EA:  BSF    03.5
576
02EB:  BCF    06.6
577
02EC:  BCF    03.5
578
02ED:  BCF    06.6
579
02EE:  BSF    03.5
580
02EF:  BCF    06.7
581
02F0:  BCF    03.5
582
02F1:  BCF    06.7
583
02F2:  BSF    03.5
584
02F3:  BCF    06.4
585
02F4:  BCF    03.5
586
02F5:  BCF    06.4
587
02F6:  BSF    03.5
588
02F7:  BCF    06.5
589
02F8:  BCF    03.5
590
02F9:  BCF    06.5
591
02FA:  MOVLW  04
592
02FB:  MOVWF  7C
593
02FC:  MOVLW  FA
594
02FD:  MOVWF  7D
595
02FE:  CALL   09D
596
02FF:  DECFSZ 7C,F
597
0300:  GOTO   2FC
598
....................    };  
599
0301:  GOTO   1D1
600
....................    while (input(DIAG_SENSORS))  
601
....................    {  
602
0302:  BSF    03.5
603
0303:  BSF    06.2
604
0304:  BCF    03.5
605
0305:  BTFSS  06.2
606
0306:  GOTO   3C2
607
....................       int ls, rs;  
608
.................... 		while(!input(BUMPER)){beep(1100,100); Delay_ms(50);}  
609
0307:  BSF    03.5
610
0308:  BSF    05.4
611
0309:  BCF    03.5
612
030A:  BTFSC  05.4
613
030B:  GOTO   31A
614
030C:  MOVLW  04
615
030D:  MOVWF  7D
616
030E:  MOVLW  4C
617
030F:  MOVWF  7C
618
0310:  BSF    03.5
619
0311:  CLRF   21
620
0312:  MOVLW  64
621
0313:  MOVWF  20
622
0314:  BCF    03.5
623
0315:  CALL   071
624
0316:  MOVLW  32
625
0317:  MOVWF  7D
626
0318:  CALL   09D
627
0319:  GOTO   307
628
....................       set_adc_channel(RSENSOR);  
629
031A:  MOVLW  00
630
031B:  BSF    03.5
631
031C:  BTFSC  1C.7
632
031D:  MOVLW  01
633
031E:  MOVWF  7C
634
031F:  RLF    7C,W
635
0320:  MOVWF  77
636
0321:  RLF    77,F
637
0322:  RLF    77,F
638
0323:  MOVLW  F8
639
0324:  ANDWF  77,F
640
0325:  BCF    03.5
641
0326:  MOVF   1F,W
642
0327:  ANDLW  C7
643
0328:  IORWF  77,W
644
0329:  MOVWF  1F
645
....................       Delay_us(20);  
646
032A:  MOVLW  06
647
032B:  MOVWF  77
648
032C:  DECFSZ 77,F
649
032D:  GOTO   32C
650
032E:  NOP
651
....................       rs=read_adc();  
652
032F:  BSF    1F.2
653
0330:  BTFSC  1F.2
654
0331:  GOTO   330
655
0332:  MOVF   1E,W
656
0333:  MOVWF  76
657
....................       set_adc_channel(LSENSOR);  
658
0334:  MOVLW  00
659
0335:  BSF    03.5
660
0336:  BTFSC  1C.6
661
0337:  MOVLW  01
662
0338:  MOVWF  7C
663
0339:  RLF    7C,W
664
033A:  MOVWF  77
665
033B:  RLF    77,F
666
033C:  RLF    77,F
667
033D:  MOVLW  F8
668
033E:  ANDWF  77,F
669
033F:  BCF    03.5
670
0340:  MOVF   1F,W
671
0341:  ANDLW  C7
672
0342:  IORWF  77,W
673
0343:  MOVWF  1F
674
....................       Delay_us(20);  
675
0344:  MOVLW  06
676
0345:  MOVWF  77
677
0346:  DECFSZ 77,F
678
0347:  GOTO   346
679
0348:  NOP
680
....................       ls=read_adc();  
681
0349:  BSF    1F.2
682
034A:  BTFSC  1F.2
683
034B:  GOTO   34A
684
034C:  MOVF   1E,W
685
034D:  MOVWF  75
686
....................       sprintf(AXstring,"L: %U  R: %U\0", ls, rs);  // Convert DATA to String.  
687
034E:  MOVLW  48
688
034F:  MOVWF  70
689
0350:  MOVLW  4C
690
0351:  BSF    03.5
691
0352:  MOVWF  20
692
0353:  BCF    03.5
693
0354:  CALL   0B2
694
0355:  MOVLW  3A
695
0356:  BSF    03.5
696
0357:  MOVWF  20
697
0358:  BCF    03.5
698
0359:  CALL   0B2
699
035A:  MOVLW  20
700
035B:  BSF    03.5
701
035C:  MOVWF  20
702
035D:  BCF    03.5
703
035E:  CALL   0B2
704
035F:  MOVF   75,W
705
0360:  MOVWF  7D
706
0361:  MOVLW  18
707
0362:  MOVWF  7E
708
0363:  CALL   0D3
709
0364:  MOVLW  05
710
0365:  MOVWF  7C
711
0366:  MOVF   7C,W
712
0367:  CALL   037
713
0368:  INCF   7C,F
714
0369:  MOVWF  77
715
036A:  BSF    03.5
716
036B:  MOVWF  20
717
036C:  BCF    03.5
718
036D:  CALL   0B2
719
036E:  MOVLW  0A
720
036F:  SUBWF  7C,W
721
0370:  BTFSS  03.2
722
0371:  GOTO   366
723
0372:  MOVF   76,W
724
0373:  MOVWF  7D
725
0374:  MOVLW  18
726
0375:  MOVWF  7E
727
0376:  CALL   0D3
728
*
729
082D:  CLRF   70
730
....................       SendPacket(&AXstring[0]);  
731
*
732
0377:  MOVLW  48
733
0378:  MOVWF  7C
734
....................       delay_ms(1000);  
735
*
736
03BA:  MOVLW  04
737
03BB:  MOVWF  7C
738
03BC:  MOVLW  FA
739
03BD:  MOVWF  7D
740
03BE:  CALL   09D
741
03BF:  DECFSZ 7C,F
742
03C0:  GOTO   3BC
743
....................    };  
744
03C1:  GOTO   302
745
.................... }  
746
03C2:  BSF    0A.3
747
03C3:  GOTO   0BA (RETURN)
748
.................... ///////////////////////////////////////////////////////////////////////////////  
749
.................... void cikcak()  
750
.................... {  
751
.................... unsigned int16 n;  
752
....................   
753
....................    line = RSENSOR;         // cteni senzoru na caru  
754
03C4:  CLRF   41
755
03C5:  BSF    03.5
756
03C6:  BTFSS  1C.7
757
03C7:  GOTO   3CB
758
03C8:  BCF    03.5
759
03C9:  INCF   41,F
760
03CA:  BSF    03.5
761
....................    line |= LSENSOR << 1;  
762
03CB:  MOVLW  00
763
03CC:  BTFSC  1C.6
764
03CD:  MOVLW  01
765
03CE:  MOVWF  77
766
03CF:  BCF    03.0
767
03D0:  RLF    77,F
768
03D1:  MOVF   77,W
769
03D2:  BCF    03.5
770
03D3:  IORWF  41,F
771
....................    if (line!=0) return;  
772
03D4:  MOVF   41,F
773
03D5:  BTFSS  03.2
774
03D6:  GOTO   4B1
775
....................   
776
....................    n=0;  
777
03D7:  CLRF   76
778
03D8:  CLRF   75
779
.................... 	switch(movement)									// podivej se na druhou stranu nez se jelo  
780
.................... 	{  
781
03D9:  MOVF   45,W
782
03DA:  XORLW  02
783
03DB:  BTFSC  03.2
784
03DC:  GOTO   3E4
785
03DD:  XORLW  03
786
03DE:  BTFSC  03.2
787
03DF:  GOTO   3F7
788
03E0:  XORLW  02
789
03E1:  BTFSC  03.2
790
03E2:  GOTO   40A
791
03E3:  GOTO   421
792
.................... 	case L:  
793
.................... 				FL;BR;  
794
03E4:  BSF    03.5
795
03E5:  BCF    06.7
796
03E6:  BCF    03.5
797
03E7:  BCF    06.7
798
03E8:  BSF    03.5
799
03E9:  BCF    06.6
800
03EA:  BCF    03.5
801
03EB:  BSF    06.6
802
03EC:  BSF    03.5
803
03ED:  BCF    06.4
804
03EE:  BCF    03.5
805
03EF:  BCF    06.4
806
03F0:  BSF    03.5
807
03F1:  BCF    06.5
808
03F2:  BCF    03.5
809
03F3:  BSF    06.5
810
.................... 				movement=R;  
811
03F4:  MOVLW  01
812
03F5:  MOVWF  45
813
.................... 			break;  
814
03F6:  GOTO   421
815
.................... 	case R:  
816
.................... 				FR;BL;  
817
03F7:  BSF    03.5
818
03F8:  BCF    06.5
819
03F9:  BCF    03.5
820
03FA:  BCF    06.5
821
03FB:  BSF    03.5
822
03FC:  BCF    06.4
823
03FD:  BCF    03.5
824
03FE:  BSF    06.4
825
03FF:  BSF    03.5
826
0400:  BCF    06.6
827
0401:  BCF    03.5
828
0402:  BCF    06.6
829
0403:  BSF    03.5
830
0404:  BCF    06.7
831
0405:  BCF    03.5
832
0406:  BSF    06.7
833
.................... 				movement=L;  
834
0407:  MOVLW  02
835
0408:  MOVWF  45
836
.................... 			break;  
837
0409:  GOTO   421
838
.................... 	case S:  
839
.................... 				FL;BR;  
840
040A:  BSF    03.5
841
040B:  BCF    06.7
842
040C:  BCF    03.5
843
040D:  BCF    06.7
844
040E:  BSF    03.5
845
040F:  BCF    06.6
846
0410:  BCF    03.5
847
0411:  BSF    06.6
848
0412:  BSF    03.5
849
0413:  BCF    06.4
850
0414:  BCF    03.5
851
0415:  BCF    06.4
852
0416:  BSF    03.5
853
0417:  BCF    06.5
854
0418:  BCF    03.5
855
0419:  BSF    06.5
856
.................... 				movement=R;  
857
041A:  MOVLW  01
858
041B:  MOVWF  45
859
....................             n=CIK_CAK/2;  
860
041C:  MOVLW  27
861
041D:  MOVWF  76
862
041E:  MOVLW  10
863
041F:  MOVWF  75
864
.................... 			break;  
865
0420:  GOTO   421
866
.................... 	}  
867
.................... 	while (0==(RSENSOR|LSENSOR))       // zkontroluj caru  
868
.................... 	{  
869
0421:  MOVLW  00
870
0422:  BSF    03.5
871
0423:  BTFSC  1C.7
872
0424:  MOVLW  01
873
0425:  MOVWF  7C
874
0426:  MOVLW  00
875
0427:  BTFSC  1C.6
876
0428:  MOVLW  01
877
0429:  IORWF  7C,W
878
042A:  XORLW  00
879
042B:  BTFSS  03.2
880
042C:  GOTO   46D
881
.................... 		if (n==CIK_CAK)							// zmen smer zataceni  
882
042D:  MOVF   75,W
883
042E:  SUBLW  20
884
042F:  BTFSS  03.2
885
0430:  GOTO   467
886
0431:  MOVF   76,W
887
0432:  SUBLW  4E
888
0433:  BTFSS  03.2
889
0434:  GOTO   467
890
.................... 		{  
891
.................... 			n=0;  
892
0435:  CLRF   76
893
0436:  CLRF   75
894
.................... 			switch(movement)  
895
.................... 			{  
896
0437:  BCF    03.5
897
0438:  MOVF   45,W
898
0439:  XORLW  02
899
043A:  BTFSC  03.2
900
043B:  GOTO   440
901
043C:  XORLW  03
902
043D:  BTFSC  03.2
903
043E:  GOTO   453
904
043F:  GOTO   466
905
.................... 			case L:  
906
.................... 						FL;BR;  
907
0440:  BSF    03.5
908
0441:  BCF    06.7
909
0442:  BCF    03.5
910
0443:  BCF    06.7
911
0444:  BSF    03.5
912
0445:  BCF    06.6
913
0446:  BCF    03.5
914
0447:  BSF    06.6
915
0448:  BSF    03.5
916
0449:  BCF    06.4
917
044A:  BCF    03.5
918
044B:  BCF    06.4
919
044C:  BSF    03.5
920
044D:  BCF    06.5
921
044E:  BCF    03.5
922
044F:  BSF    06.5
923
.................... 						movement=R;  
924
0450:  MOVLW  01
925
0451:  MOVWF  45
926
.................... 					break;  
927
0452:  GOTO   466
928
.................... 			case R:  
929
.................... 						FR;BL;  
930
0453:  BSF    03.5
931
0454:  BCF    06.5
932
0455:  BCF    03.5
933
0456:  BCF    06.5
934
0457:  BSF    03.5
935
0458:  BCF    06.4
936
0459:  BCF    03.5
937
045A:  BSF    06.4
938
045B:  BSF    03.5
939
045C:  BCF    06.6
940
045D:  BCF    03.5
941
045E:  BCF    06.6
942
045F:  BSF    03.5
943
0460:  BCF    06.7
944
0461:  BCF    03.5
945
0462:  BSF    06.7
946
.................... 						movement=L;  
947
0463:  MOVLW  02
948
0464:  MOVWF  45
949
.................... 					break;  
950
0465:  GOTO   466
951
0466:  BSF    03.5
952
.................... 			}  
953
.................... 		}  
954
.................... 		n++;  
955
0467:  INCF   75,F
956
0468:  BTFSC  03.2
957
0469:  INCF   76,F
958
.................... 	}  
959
046A:  BCF    03.5
960
046B:  GOTO   421
961
046C:  BSF    03.5
962
....................    switch(movement)  
963
....................    {  
964
046D:  BCF    03.5
965
046E:  MOVF   45,W
966
046F:  XORLW  02
967
0470:  BTFSC  03.2
968
0471:  GOTO   476
969
0472:  XORLW  03
970
0473:  BTFSC  03.2
971
0474:  GOTO   489
972
0475:  GOTO   49C
973
....................    case L:  
974
....................             FL;BR;  
975
0476:  BSF    03.5
976
0477:  BCF    06.7
977
0478:  BCF    03.5
978
0479:  BCF    06.7
979
047A:  BSF    03.5
980
047B:  BCF    06.6
981
047C:  BCF    03.5
982
047D:  BSF    06.6
983
047E:  BSF    03.5
984
047F:  BCF    06.4
985
0480:  BCF    03.5
986
0481:  BCF    06.4
987
0482:  BSF    03.5
988
0483:  BCF    06.5
989
0484:  BCF    03.5
990
0485:  BSF    06.5
991
....................             movement=R;  
992
0486:  MOVLW  01
993
0487:  MOVWF  45
994
....................          break;  
995
0488:  GOTO   49C
996
....................    case R:  
997
....................             FR;BL;  
998
0489:  BSF    03.5
999
048A:  BCF    06.5
1000
048B:  BCF    03.5
1001
048C:  BCF    06.5
1002
048D:  BSF    03.5
1003
048E:  BCF    06.4
1004
048F:  BCF    03.5
1005
0490:  BSF    06.4
1006
0491:  BSF    03.5
1007
0492:  BCF    06.6
1008
0493:  BCF    03.5
1009
0494:  BCF    06.6
1010
0495:  BSF    03.5
1011
0496:  BCF    06.7
1012
0497:  BCF    03.5
1013
0498:  BSF    06.7
1014
....................             movement=L;  
1015
0499:  MOVLW  02
1016
049A:  MOVWF  45
1017
....................          break;  
1018
049B:  GOTO   49C
1019
....................    }  
1020
....................    Delay_ms(50);  
1021
049C:  MOVLW  32
1022
049D:  MOVWF  7D
1023
049E:  CALL   09D
1024
.................... 	STOPL;STOPR;												// nasli jsme caru  
1025
049F:  BSF    03.5
1026
04A0:  BCF    06.6
1027
04A1:  BCF    03.5
1028
04A2:  BCF    06.6
1029
04A3:  BSF    03.5
1030
04A4:  BCF    06.7
1031
04A5:  BCF    03.5
1032
04A6:  BCF    06.7
1033
04A7:  BSF    03.5
1034
04A8:  BCF    06.4
1035
04A9:  BCF    03.5
1036
04AA:  BCF    06.4
1037
04AB:  BSF    03.5
1038
04AC:  BCF    06.5
1039
04AD:  BCF    03.5
1040
04AE:  BCF    06.5
1041
.................... 	line=S;  
1042
04AF:  MOVLW  03
1043
04B0:  MOVWF  41
1044
.................... }  
1045
04B1:  RETLW  00
1046
.................... ///////////////////////////////////////////////////////////////////////////////  
1047
.................... void objizdka()                     // objede cihlu  
1048
.................... {  
1049
.................... unsigned int16 n;  
1050
....................   
1051
.................... 	BL;BR;Delay_ms(200);  
1052
04B2:  BSF    03.5
1053
04B3:  BCF    06.6
1054
04B4:  BCF    03.5
1055
04B5:  BCF    06.6
1056
04B6:  BSF    03.5
1057
04B7:  BCF    06.7
1058
04B8:  BCF    03.5
1059
04B9:  BSF    06.7
1060
04BA:  BSF    03.5
1061
04BB:  BCF    06.4
1062
04BC:  BCF    03.5
1063
04BD:  BCF    06.4
1064
04BE:  BSF    03.5
1065
04BF:  BCF    06.5
1066
04C0:  BCF    03.5
1067
04C1:  BSF    06.5
1068
04C2:  MOVLW  C8
1069
04C3:  MOVWF  7D
1070
04C4:  CALL   09D
1071
.................... 	STOPR;STOPL;  
1072
04C5:  BSF    03.5
1073
04C6:  BCF    06.4
1074
04C7:  BCF    03.5
1075
04C8:  BCF    06.4
1076
04C9:  BSF    03.5
1077
04CA:  BCF    06.5
1078
04CB:  BCF    03.5
1079
04CC:  BCF    06.5
1080
04CD:  BSF    03.5
1081
04CE:  BCF    06.6
1082
04CF:  BCF    03.5
1083
04D0:  BCF    06.6
1084
04D1:  BSF    03.5
1085
04D2:  BCF    06.7
1086
04D3:  BCF    03.5
1087
04D4:  BCF    06.7
1088
.................... 	beep(900,1000);  
1089
04D5:  MOVLW  03
1090
04D6:  MOVWF  7D
1091
04D7:  MOVLW  84
1092
04D8:  MOVWF  7C
1093
04D9:  MOVLW  03
1094
04DA:  BSF    03.5
1095
04DB:  MOVWF  21
1096
04DC:  MOVLW  E8
1097
04DD:  MOVWF  20
1098
04DE:  BCF    03.5
1099
04DF:  CALL   071
1100
....................    movement=S;  
1101
04E0:  MOVLW  03
1102
04E1:  MOVWF  45
1103
....................    cikcak();  
1104
04E2:  CALL   3C4
1105
....................   
1106
....................    BR; FL; Delay_ms(215);           // otoc se 70° do prava  
1107
04E3:  BSF    03.5
1108
04E4:  BCF    06.4
1109
04E5:  BCF    03.5
1110
04E6:  BCF    06.4
1111
04E7:  BSF    03.5
1112
04E8:  BCF    06.5
1113
04E9:  BCF    03.5
1114
04EA:  BSF    06.5
1115
04EB:  BSF    03.5
1116
04EC:  BCF    06.7
1117
04ED:  BCF    03.5
1118
04EE:  BCF    06.7
1119
04EF:  BSF    03.5
1120
04F0:  BCF    06.6
1121
04F1:  BCF    03.5
1122
04F2:  BSF    06.6
1123
04F3:  MOVLW  D7
1124
04F4:  MOVWF  7D
1125
04F5:  CALL   09D
1126
....................   
1127
....................    FR; FL; Delay_ms(600);           // popojed rovne  
1128
04F6:  BSF    03.5
1129
04F7:  BCF    06.5
1130
04F8:  BCF    03.5
1131
04F9:  BCF    06.5
1132
04FA:  BSF    03.5
1133
04FB:  BCF    06.4
1134
04FC:  BCF    03.5
1135
04FD:  BSF    06.4
1136
04FE:  BSF    03.5
1137
04FF:  BCF    06.7
1138
0500:  BCF    03.5
1139
0501:  BCF    06.7
1140
0502:  BSF    03.5
1141
0503:  BCF    06.6
1142
0504:  BCF    03.5
1143
0505:  BSF    06.6
1144
0506:  MOVLW  03
1145
0507:  MOVWF  75
1146
0508:  MOVLW  C8
1147
0509:  MOVWF  7D
1148
050A:  CALL   09D
1149
050B:  DECFSZ 75,F
1150
050C:  GOTO   508
1151
....................   
1152
....................    BL; Delay_ms(50);               // otoc se 90° do leva  
1153
050D:  BSF    03.5
1154
050E:  BCF    06.6
1155
050F:  BCF    03.5
1156
0510:  BCF    06.6
1157
0511:  BSF    03.5
1158
0512:  BCF    06.7
1159
0513:  BCF    03.5
1160
0514:  BSF    06.7
1161
0515:  MOVLW  32
1162
0516:  MOVWF  7D
1163
0517:  CALL   09D
1164
....................    STOPL; FR; Delay_ms(550);  
1165
0518:  BSF    03.5
1166
0519:  BCF    06.6
1167
051A:  BCF    03.5
1168
051B:  BCF    06.6
1169
051C:  BSF    03.5
1170
051D:  BCF    06.7
1171
051E:  BCF    03.5
1172
051F:  BCF    06.7
1173
0520:  BSF    03.5
1174
0521:  BCF    06.5
1175
0522:  BCF    03.5
1176
0523:  BCF    06.5
1177
0524:  BSF    03.5
1178
0525:  BCF    06.4
1179
0526:  BCF    03.5
1180
0527:  BSF    06.4
1181
0528:  MOVLW  05
1182
0529:  MOVWF  75
1183
052A:  MOVLW  6E
1184
052B:  MOVWF  7D
1185
052C:  CALL   09D
1186
052D:  DECFSZ 75,F
1187
052E:  GOTO   52A
1188
....................   
1189
....................    FR; FL; Delay_ms(100);           // popojed rovne na slepo  
1190
052F:  BSF    03.5
1191
0530:  BCF    06.5
1192
0531:  BCF    03.5
1193
0532:  BCF    06.5
1194
0533:  BSF    03.5
1195
0534:  BCF    06.4
1196
0535:  BCF    03.5
1197
0536:  BSF    06.4
1198
0537:  BSF    03.5
1199
0538:  BCF    06.7
1200
0539:  BCF    03.5
1201
053A:  BCF    06.7
1202
053B:  BSF    03.5
1203
053C:  BCF    06.6
1204
053D:  BCF    03.5
1205
053E:  BSF    06.6
1206
053F:  MOVLW  64
1207
0540:  MOVWF  7D
1208
0541:  CALL   09D
1209
....................    for(n=600;n>0;n--)               // popojed rovne ale kontroluj caru  
1210
0542:  MOVLW  02
1211
0543:  MOVWF  74
1212
0544:  MOVLW  58
1213
0545:  MOVWF  73
1214
0546:  MOVF   73,F
1215
0547:  BTFSS  03.2
1216
0548:  GOTO   54C
1217
0549:  MOVF   74,F
1218
054A:  BTFSC  03.2
1219
054B:  GOTO   56B
1220
....................    {  
1221
....................       line = RSENSOR;         // cteni senzoru na caru  
1222
054C:  CLRF   41
1223
054D:  BSF    03.5
1224
054E:  BTFSS  1C.7
1225
054F:  GOTO   553
1226
0550:  BCF    03.5
1227
0551:  INCF   41,F
1228
0552:  BSF    03.5
1229
....................       line |= LSENSOR << 1;  
1230
0553:  MOVLW  00
1231
0554:  BTFSC  1C.6
1232
0555:  MOVLW  01
1233
0556:  MOVWF  77
1234
0557:  BCF    03.0
1235
0558:  RLF    77,F
1236
0559:  MOVF   77,W
1237
055A:  BCF    03.5
1238
055B:  IORWF  41,F
1239
....................       if (line!=0) {Delay_ms(50); break;}  
1240
055C:  MOVF   41,F
1241
055D:  BTFSC  03.2
1242
055E:  GOTO   563
1243
055F:  MOVLW  32
1244
0560:  MOVWF  7D
1245
0561:  CALL   09D
1246
0562:  GOTO   56B
1247
....................       Delay_ms(1);  
1248
0563:  MOVLW  01
1249
0564:  MOVWF  7D
1250
0565:  CALL   09D
1251
....................    }  
1252
0566:  MOVF   73,W
1253
0567:  BTFSC  03.2
1254
0568:  DECF   74,F
1255
0569:  DECF   73,F
1256
056A:  GOTO   546
1257
....................   
1258
....................    BR;                              // otoc se 60° do prava  
1259
056B:  BSF    03.5
1260
056C:  BCF    06.4
1261
056D:  BCF    03.5
1262
056E:  BCF    06.4
1263
056F:  BSF    03.5
1264
0570:  BCF    06.5
1265
0571:  BCF    03.5
1266
0572:  BSF    06.5
1267
....................    for(n=600;n>0;n--)  
1268
0573:  MOVLW  02
1269
0574:  MOVWF  74
1270
0575:  MOVLW  58
1271
0576:  MOVWF  73
1272
0577:  MOVF   73,F
1273
0578:  BTFSS  03.2
1274
0579:  GOTO   57D
1275
057A:  MOVF   74,F
1276
057B:  BTFSC  03.2
1277
057C:  GOTO   598
1278
....................    {  
1279
....................       line = RSENSOR;         // cteni senzoru na caru  
1280
057D:  CLRF   41
1281
057E:  BSF    03.5
1282
057F:  BTFSS  1C.7
1283
0580:  GOTO   584
1284
0581:  BCF    03.5
1285
0582:  INCF   41,F
1286
0583:  BSF    03.5
1287
....................       line |= LSENSOR << 1;  
1288
0584:  MOVLW  00
1289
0585:  BTFSC  1C.6
1290
0586:  MOVLW  01
1291
0587:  MOVWF  77
1292
0588:  BCF    03.0
1293
0589:  RLF    77,F
1294
058A:  MOVF   77,W
1295
058B:  BCF    03.5
1296
058C:  IORWF  41,F
1297
....................       if (line!=0) break;  
1298
058D:  MOVF   41,F
1299
058E:  BTFSS  03.2
1300
058F:  GOTO   598
1301
....................       Delay_ms(1);  
1302
0590:  MOVLW  01
1303
0591:  MOVWF  7D
1304
0592:  CALL   09D
1305
....................    }  
1306
0593:  MOVF   73,W
1307
0594:  BTFSC  03.2
1308
0595:  DECF   74,F
1309
0596:  DECF   73,F
1310
0597:  GOTO   577
1311
....................    STOPR; STOPL;  
1312
0598:  BSF    03.5
1313
0599:  BCF    06.4
1314
059A:  BCF    03.5
1315
059B:  BCF    06.4
1316
059C:  BSF    03.5
1317
059D:  BCF    06.5
1318
059E:  BCF    03.5
1319
059F:  BCF    06.5
1320
05A0:  BSF    03.5
1321
05A1:  BCF    06.6
1322
05A2:  BCF    03.5
1323
05A3:  BCF    06.6
1324
05A4:  BSF    03.5
1325
05A5:  BCF    06.7
1326
05A6:  BCF    03.5
1327
05A7:  BCF    06.7
1328
....................   
1329
....................    movement=R;  
1330
05A8:  MOVLW  01
1331
05A9:  MOVWF  45
1332
....................    cikcak();  
1333
05AA:  CALL   3C4
1334
....................    cihla=T_DIRA;  
1335
05AB:  MOVLW  55
1336
05AC:  MOVWF  47
1337
....................    dira=0;  
1338
05AD:  CLRF   46
1339
.................... }  
1340
05AE:  BSF    0A.3
1341
05AF:  GOTO   0F7 (RETURN)
1342
.................... ///////////////////////////////////////////////////////////////////////////////  
1343
.................... void prejeddiru()                    // vyresi diru  
1344
.................... {  
1345
.................... unsigned int16 n;  
1346
....................   
1347
....................    STOPL;STOPR;  
1348
05B0:  BSF    03.5
1349
05B1:  BCF    06.6
1350
05B2:  BCF    03.5
1351
05B3:  BCF    06.6
1352
05B4:  BSF    03.5
1353
05B5:  BCF    06.7
1354
05B6:  BCF    03.5
1355
05B7:  BCF    06.7
1356
05B8:  BSF    03.5
1357
05B9:  BCF    06.4
1358
05BA:  BCF    03.5
1359
05BB:  BCF    06.4
1360
05BC:  BSF    03.5
1361
05BD:  BCF    06.5
1362
05BE:  BCF    03.5
1363
05BF:  BCF    06.5
1364
....................    beep(800,500);  
1365
05C0:  MOVLW  03
1366
05C1:  MOVWF  7D
1367
05C2:  MOVLW  20
1368
05C3:  MOVWF  7C
1369
05C4:  MOVLW  01
1370
05C5:  BSF    03.5
1371
05C6:  MOVWF  21
1372
05C7:  MOVLW  F4
1373
05C8:  MOVWF  20
1374
05C9:  BCF    03.5
1375
05CA:  CALL   071
1376
....................    switch (movement)                            //vrat se zpet na caru  
1377
....................    {  
1378
05CB:  MOVF   45,W
1379
05CC:  XORLW  02
1380
05CD:  BTFSC  03.2
1381
05CE:  GOTO   5D6
1382
05CF:  XORLW  03
1383
05D0:  BTFSC  03.2
1384
05D1:  GOTO   60E
1385
05D2:  XORLW  02
1386
05D3:  BTFSC  03.2
1387
05D4:  GOTO   646
1388
05D5:  GOTO   648
1389
....................    case L:  
1390
....................          for (n=COUVANI;n>0;n--) {GO(R,B,speed); Delay_ms(1);}  
1391
05D6:  MOVLW  02
1392
05D7:  MOVWF  74
1393
05D8:  MOVLW  58
1394
05D9:  MOVWF  73
1395
05DA:  MOVF   73,F
1396
05DB:  BTFSS  03.2
1397
05DC:  GOTO   5E0
1398
05DD:  MOVF   74,F
1399
05DE:  BTFSC  03.2
1400
05DF:  GOTO   5FD
1401
05E0:  MOVF   01,W
1402
05E1:  SUBWF  42,W
1403
05E2:  BTFSS  03.0
1404
05E3:  GOTO   5ED
1405
05E4:  BSF    03.5
1406
05E5:  BCF    06.4
1407
05E6:  BCF    03.5
1408
05E7:  BCF    06.4
1409
05E8:  BSF    03.5
1410
05E9:  BCF    06.5
1411
05EA:  BCF    03.5
1412
05EB:  BSF    06.5
1413
05EC:  GOTO   5F5
1414
05ED:  BSF    03.5
1415
05EE:  BCF    06.4
1416
05EF:  BCF    03.5
1417
05F0:  BCF    06.4
1418
05F1:  BSF    03.5
1419
05F2:  BCF    06.5
1420
05F3:  BCF    03.5
1421
05F4:  BCF    06.5
1422
05F5:  MOVLW  01
1423
05F6:  MOVWF  7D
1424
05F7:  CALL   09D
1425
05F8:  MOVF   73,W
1426
05F9:  BTFSC  03.2
1427
05FA:  DECF   74,F
1428
05FB:  DECF   73,F
1429
05FC:  GOTO   5DA
1430
....................          STOPL;STOPR;  
1431
05FD:  BSF    03.5
1432
05FE:  BCF    06.6
1433
05FF:  BCF    03.5
1434
0600:  BCF    06.6
1435
0601:  BSF    03.5
1436
0602:  BCF    06.7
1437
0603:  BCF    03.5
1438
0604:  BCF    06.7
1439
0605:  BSF    03.5
1440
0606:  BCF    06.4
1441
0607:  BCF    03.5
1442
0608:  BCF    06.4
1443
0609:  BSF    03.5
1444
060A:  BCF    06.5
1445
060B:  BCF    03.5
1446
060C:  BCF    06.5
1447
....................       break;  
1448
060D:  GOTO   648
1449
....................    case R:  
1450
....................          for (n=COUVANI;n>0;n--) {GO(L,B,speed); Delay_ms(1);}  
1451
060E:  MOVLW  02
1452
060F:  MOVWF  74
1453
0610:  MOVLW  58
1454
0611:  MOVWF  73
1455
0612:  MOVF   73,F
1456
0613:  BTFSS  03.2
1457
0614:  GOTO   618
1458
0615:  MOVF   74,F
1459
0616:  BTFSC  03.2
1460
0617:  GOTO   635
1461
0618:  MOVF   01,W
1462
0619:  SUBWF  42,W
1463
061A:  BTFSS  03.0
1464
061B:  GOTO   625
1465
061C:  BSF    03.5
1466
061D:  BCF    06.6
1467
061E:  BCF    03.5
1468
061F:  BCF    06.6
1469
0620:  BSF    03.5
1470
0621:  BCF    06.7
1471
0622:  BCF    03.5
1472
0623:  BSF    06.7
1473
0624:  GOTO   62D
1474
0625:  BSF    03.5
1475
0626:  BCF    06.6
1476
0627:  BCF    03.5
1477
0628:  BCF    06.6
1478
0629:  BSF    03.5
1479
062A:  BCF    06.7
1480
062B:  BCF    03.5
1481
062C:  BCF    06.7
1482
062D:  MOVLW  01
1483
062E:  MOVWF  7D
1484
062F:  CALL   09D
1485
0630:  MOVF   73,W
1486
0631:  BTFSC  03.2
1487
0632:  DECF   74,F
1488
0633:  DECF   73,F
1489
0634:  GOTO   612
1490
....................          STOPL;STOPR;  
1491
0635:  BSF    03.5
1492
0636:  BCF    06.6
1493
0637:  BCF    03.5
1494
0638:  BCF    06.6
1495
0639:  BSF    03.5
1496
063A:  BCF    06.7
1497
063B:  BCF    03.5
1498
063C:  BCF    06.7
1499
063D:  BSF    03.5
1500
063E:  BCF    06.4
1501
063F:  BCF    03.5
1502
0640:  BCF    06.4
1503
0641:  BSF    03.5
1504
0642:  BCF    06.5
1505
0643:  BCF    03.5
1506
0644:  BCF    06.5
1507
....................       break;  
1508
0645:  GOTO   648
1509
....................    case S:  
1510
....................          goto sem;  
1511
0646:  GOTO   666
1512
....................       break;  
1513
0647:  GOTO   648
1514
....................    }  
1515
....................    beep(800,500);  
1516
0648:  MOVLW  03
1517
0649:  MOVWF  7D
1518
064A:  MOVLW  20
1519
064B:  MOVWF  7C
1520
064C:  MOVLW  01
1521
064D:  BSF    03.5
1522
064E:  MOVWF  21
1523
064F:  MOVLW  F4
1524
0650:  MOVWF  20
1525
0651:  BCF    03.5
1526
0652:  CALL   071
1527
....................    FR;FL; Delay_ms(PRES_DIRU);   // popojedem dopredu mozna tam bude cara  
1528
0653:  BSF    03.5
1529
0654:  BCF    06.5
1530
0655:  BCF    03.5
1531
0656:  BCF    06.5
1532
0657:  BSF    03.5
1533
0658:  BCF    06.4
1534
0659:  BCF    03.5
1535
065A:  BSF    06.4
1536
065B:  BSF    03.5
1537
065C:  BCF    06.7
1538
065D:  BCF    03.5
1539
065E:  BCF    06.7
1540
065F:  BSF    03.5
1541
0660:  BCF    06.6
1542
0661:  BCF    03.5
1543
0662:  BSF    06.6
1544
0663:  MOVLW  96
1545
0664:  MOVWF  7D
1546
0665:  CALL   09D
1547
.................... sem:  
1548
....................    STOPL; STOPR;  
1549
0666:  BSF    03.5
1550
0667:  BCF    06.6
1551
0668:  BCF    03.5
1552
0669:  BCF    06.6
1553
066A:  BSF    03.5
1554
066B:  BCF    06.7
1555
066C:  BCF    03.5
1556
066D:  BCF    06.7
1557
066E:  BSF    03.5
1558
066F:  BCF    06.4
1559
0670:  BCF    03.5
1560
0671:  BCF    06.4
1561
0672:  BSF    03.5
1562
0673:  BCF    06.5
1563
0674:  BCF    03.5
1564
0675:  BCF    06.5
1565
....................    movement=S;  
1566
0676:  MOVLW  03
1567
0677:  MOVWF  45
1568
....................    cikcak();                                    // najdi caru  
1569
0678:  CALL   3C4
1570
....................    cihla=T_DIRA;  
1571
0679:  MOVLW  55
1572
067A:  MOVWF  47
1573
....................    dira=0;  
1574
067B:  CLRF   46
1575
.................... }  
1576
067C:  BSF    0A.3
1577
067D:  GOTO   190 (RETURN)
1578
.................... ///////////////////////////////////////////////////////////////////////////////  
1579
.................... void main()  
1580
.................... {  
1581
*
1582
0800:  CLRF   04
1583
0801:  MOVLW  1F
1584
0802:  ANDWF  03,F
1585
0803:  BSF    03.5
1586
0804:  BCF    1F.4
1587
0805:  BCF    1F.5
1588
0806:  MOVF   1B,W
1589
0807:  ANDLW  80
1590
0808:  MOVWF  1B
1591
0809:  MOVLW  07
1592
080A:  MOVWF  1C
1593
080B:  MOVF   1C,W
1594
080C:  BCF    03.5
1595
080D:  BCF    0D.6
1596
080E:  MOVLW  60
1597
080F:  BSF    03.5
1598
0810:  MOVWF  0F
1599
....................    unsigned int16 n; // pro FOR  
1600
....................   
1601
....................    STOPL; STOPR;     // prepne vystupy na ovladani motoru na output a zastavi  
1602
*
1603
082E:  BSF    03.5
1604
082F:  BCF    06.6
1605
0830:  BCF    03.5
1606
0831:  BCF    06.6
1607
0832:  BSF    03.5
1608
0833:  BCF    06.7
1609
0834:  BCF    03.5
1610
0835:  BCF    06.7
1611
0836:  BSF    03.5
1612
0837:  BCF    06.4
1613
0838:  BCF    03.5
1614
0839:  BCF    06.4
1615
083A:  BSF    03.5
1616
083B:  BCF    06.5
1617
083C:  BCF    03.5
1618
083D:  BCF    06.5
1619
....................   
1620
....................    setup_oscillator(OSC_4MHZ|OSC_INTRC);     // 4 MHz interni RC oscilator  
1621
083E:  MOVLW  62
1622
083F:  BSF    03.5
1623
0840:  MOVWF  0F
1624
....................   
1625
....................    port_b_pullups(TRUE);      // pullups pro piano na diagnostiku  
1626
0841:  BCF    01.7
1627
....................    setup_spi(FALSE);  
1628
0842:  BCF    03.5
1629
0843:  BCF    14.5
1630
0844:  BSF    03.5
1631
0845:  BCF    06.2
1632
0846:  BSF    06.1
1633
0847:  BCF    06.4
1634
0848:  MOVLW  00
1635
0849:  BCF    03.5
1636
084A:  MOVWF  14
1637
084B:  BSF    03.5
1638
084C:  MOVWF  14
1639
....................    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);  // Casovac pro PWM  
1640
084D:  MOVF   01,W
1641
084E:  ANDLW  C7
1642
084F:  IORLW  08
1643
0850:  MOVWF  01
1644
....................   
1645
....................    setup_timer_2(T2_DIV_BY_4,255,10);    // Casovac pro regulaci  
1646
0851:  MOVLW  48
1647
0852:  MOVWF  78
1648
0853:  IORLW  05
1649
0854:  BCF    03.5
1650
0855:  MOVWF  12
1651
0856:  MOVLW  FF
1652
0857:  BSF    03.5
1653
0858:  MOVWF  12
1654
....................                                          // preruseni kazdych 10ms  
1655
....................    setup_adc_ports(sAN2|VSS_VDD);      // nastaveni A/D prevodniku pro naraznik  
1656
0859:  BCF    1F.4
1657
085A:  BCF    1F.5
1658
085B:  MOVF   1B,W
1659
085C:  ANDLW  80
1660
085D:  IORLW  04
1661
085E:  MOVWF  1B
1662
....................    setup_adc(ADC_CLOCK_INTERNAL);  
1663
085F:  BCF    1F.6
1664
0860:  BCF    03.5
1665
0861:  BSF    1F.6
1666
0862:  BSF    1F.7
1667
0863:  BSF    03.5
1668
0864:  BCF    1F.7
1669
0865:  BCF    03.5
1670
0866:  BSF    1F.0
1671
....................    set_adc_channel(2);  
1672
0867:  MOVLW  10
1673
0868:  MOVWF  78
1674
0869:  MOVF   1F,W
1675
086A:  ANDLW  C7
1676
086B:  IORWF  78,W
1677
086C:  MOVWF  1F
1678
....................    setup_timer_1(T1_INTERNAL|T1_DIV_BY_1);   // Casovac pro naraznik  
1679
086D:  MOVLW  85
1680
086E:  MOVWF  10
1681
....................    setup_ccp1(CCP_COMPARE_RESET_TIMER);  
1682
086F:  BSF    03.5
1683
0870:  BSF    06.3
1684
0871:  MOVLW  0B
1685
0872:  BCF    03.5
1686
0873:  MOVWF  17
1687
....................    CCP_1=(2^10)-1;                        // prevod kazdou 1ms  
1688
0874:  CLRF   16
1689
0875:  MOVLW  07
1690
0876:  MOVWF  15
1691
....................   
1692
....................    setup_comparator(A0_VR_A1_VR);   // inicializace komparatoru pro cidla cary  
1693
0877:  MOVLW  02
1694
0878:  BSF    03.5
1695
0879:  MOVWF  1C
1696
087A:  MOVF   05,W
1697
087B:  IORLW  03
1698
087C:  MOVWF  05
1699
087D:  MOVLW  03
1700
087E:  MOVWF  77
1701
087F:  DECFSZ 77,F
1702
0880:  GOTO   07F
1703
0881:  MOVF   1C,W
1704
0882:  BCF    03.5
1705
0883:  BCF    0D.6
1706
....................    setup_vref(VREF_HIGH|TRESHOLD);        // 32 kroku od 0.25 do 0.75 Vdd  
1707
0884:  MOVLW  8A
1708
0885:  BSF    03.5
1709
0886:  MOVWF  1D
1710
....................   
1711
....................    Beep(1000,200);     //double beep  
1712
0887:  MOVLW  03
1713
0888:  MOVWF  7D
1714
0889:  MOVLW  E8
1715
088A:  MOVWF  7C
1716
088B:  CLRF   21
1717
088C:  MOVLW  C8
1718
088D:  MOVWF  20
1719
088E:  BCF    0A.3
1720
088F:  BCF    03.5
1721
0890:  CALL   071
1722
0891:  BSF    0A.3
1723
....................    Delay_ms(50);  
1724
0892:  MOVLW  32
1725
0893:  MOVWF  7D
1726
0894:  BCF    0A.3
1727
0895:  CALL   09D
1728
0896:  BSF    0A.3
1729
....................    Beep(1000,200);  
1730
0897:  MOVLW  03
1731
0898:  MOVWF  7D
1732
0899:  MOVLW  E8
1733
089A:  MOVWF  7C
1734
089B:  BSF    03.5
1735
089C:  CLRF   21
1736
089D:  MOVLW  C8
1737
089E:  MOVWF  20
1738
089F:  BCF    0A.3
1739
08A0:  BCF    03.5
1740
08A1:  CALL   071
1741
08A2:  BSF    0A.3
1742
....................    Delay_ms(1000);      // 1s  
1743
08A3:  MOVLW  04
1744
08A4:  MOVWF  73
1745
08A5:  MOVLW  FA
1746
08A6:  MOVWF  7D
1747
08A7:  BCF    0A.3
1748
08A8:  CALL   09D
1749
08A9:  BSF    0A.3
1750
08AA:  DECFSZ 73,F
1751
08AB:  GOTO   0A5
1752
....................   
1753
....................          // povoleni rizeni rychlosti zataceni pres preruseni  
1754
....................    enable_interrupts(INT_TIMER2);  
1755
08AC:  BSF    03.5
1756
08AD:  BSF    0C.1
1757
....................    enable_interrupts(GLOBAL);  
1758
08AE:  MOVLW  C0
1759
08AF:  BCF    03.5
1760
08B0:  IORWF  0B,F
1761
....................   
1762
.................... /*---------------------------------------------------------------------------*/  
1763
....................    sensors=S;  
1764
08B1:  MOVLW  03
1765
08B2:  MOVWF  40
1766
....................    line=S;  
1767
08B3:  MOVWF  41
1768
....................    last=S;  
1769
08B4:  MOVWF  44
1770
....................    movement=S;  
1771
08B5:  MOVWF  45
1772
....................    speed=FW_POMALU;  
1773
08B6:  MOVLW  E6
1774
08B7:  MOVWF  42
1775
....................   
1776
....................    diagnostika();  
1777
08B8:  BCF    0A.3
1778
08B9:  GOTO   1D1
1779
08BA:  BSF    0A.3
1780
....................    cikcak();     // toc se, abys nasel caru  
1781
08BB:  BCF    0A.3
1782
08BC:  CALL   3C4
1783
08BD:  BSF    0A.3
1784
....................    Delay_ms(500);  
1785
08BE:  MOVLW  02
1786
08BF:  MOVWF  73
1787
08C0:  MOVLW  FA
1788
08C1:  MOVWF  7D
1789
08C2:  BCF    0A.3
1790
08C3:  CALL   09D
1791
08C4:  BSF    0A.3
1792
08C5:  DECFSZ 73,F
1793
08C6:  GOTO   0C0
1794
....................    Beep(1000,200);  
1795
08C7:  MOVLW  03
1796
08C8:  MOVWF  7D
1797
08C9:  MOVLW  E8
1798
08CA:  MOVWF  7C
1799
08CB:  BSF    03.5
1800
08CC:  CLRF   21
1801
08CD:  MOVLW  C8
1802
08CE:  MOVWF  20
1803
08CF:  BCF    0A.3
1804
08D0:  BCF    03.5
1805
08D1:  CALL   071
1806
08D2:  BSF    0A.3
1807
....................    Delay_ms(500);  
1808
08D3:  MOVLW  02
1809
08D4:  MOVWF  73
1810
08D5:  MOVLW  FA
1811
08D6:  MOVWF  7D
1812
08D7:  BCF    0A.3
1813
08D8:  CALL   09D
1814
08D9:  BSF    0A.3
1815
08DA:  DECFSZ 73,F
1816
08DB:  GOTO   0D5
1817
....................   
1818
....................    while(true)       // hlavni smycka (jizda podle cary)  
1819
....................    {  
1820
....................       sensors = RSENSOR;         // cteni senzoru na caru  
1821
08DC:  CLRF   40
1822
08DD:  BSF    03.5
1823
08DE:  BTFSS  1C.7
1824
08DF:  GOTO   0E3
1825
08E0:  BCF    03.5
1826
08E1:  INCF   40,F
1827
08E2:  BSF    03.5
1828
....................       sensors |= LSENSOR << 1;  
1829
08E3:  MOVLW  00
1830
08E4:  BTFSC  1C.6
1831
08E5:  MOVLW  01
1832
08E6:  MOVWF  77
1833
08E7:  BCF    03.0
1834
08E8:  RLF    77,F
1835
08E9:  MOVF   77,W
1836
08EA:  BCF    03.5
1837
08EB:  IORWF  40,F
1838
....................   
1839
....................       if ((read_adc(ADC_READ_ONLY)<BUMPER_TRESHOLD) && (cihla==0)) objizdka();  
1840
08EC:  BTFSC  1F.2
1841
08ED:  GOTO   0EC
1842
08EE:  MOVF   1E,W
1843
08EF:  SUBLW  7F
1844
08F0:  BTFSS  03.0
1845
08F1:  GOTO   0F8
1846
08F2:  MOVF   47,F
1847
08F3:  BTFSS  03.2
1848
08F4:  GOTO   0F8
1849
08F5:  BCF    0A.3
1850
08F6:  GOTO   4B2
1851
08F7:  BSF    0A.3
1852
....................   
1853
....................       switch (sensors)  // zatacej podle toho, kde vidis caru  
1854
....................       {  
1855
08F8:  MOVF   40,W
1856
08F9:  XORLW  03
1857
08FA:  BTFSC  03.2
1858
08FB:  GOTO   103
1859
08FC:  XORLW  01
1860
08FD:  BTFSC  03.2
1861
08FE:  GOTO   117
1862
08FF:  XORLW  03
1863
0900:  BTFSC  03.2
1864
0901:  GOTO   150
1865
0902:  GOTO   189
1866
....................          case S:                          // rovne  
1867
....................             FL; FR;  // pokud se jede dlouho rovne, tak pridej  
1868
0903:  BSF    03.5
1869
0904:  BCF    06.7
1870
0905:  BCF    03.5
1871
0906:  BCF    06.7
1872
0907:  BSF    03.5
1873
0908:  BCF    06.6
1874
0909:  BCF    03.5
1875
090A:  BSF    06.6
1876
090B:  BSF    03.5
1877
090C:  BCF    06.5
1878
090D:  BCF    03.5
1879
090E:  BCF    06.5
1880
090F:  BSF    03.5
1881
0910:  BCF    06.4
1882
0911:  BCF    03.5
1883
0912:  BSF    06.4
1884
....................             dira=0;  
1885
0913:  CLRF   46
1886
....................             movement=S;  
1887
0914:  MOVLW  03
1888
0915:  MOVWF  45
1889
....................             continue;  
1890
0916:  GOTO   0DC
1891
....................          case L:                          // trochu vlevo  
1892
....................             GO(L, F, FW_POMALU+rovinka); GO(R, F, FW_STREDNE+rovinka);  
1893
0917:  MOVF   01,W
1894
0918:  MOVWF  73
1895
0919:  MOVLW  E6
1896
091A:  ADDWF  43,W
1897
091B:  SUBWF  73,W
1898
091C:  BTFSC  03.2
1899
091D:  GOTO   120
1900
091E:  BTFSC  03.0
1901
091F:  GOTO   129
1902
0920:  BSF    03.5
1903
0921:  BCF    06.7
1904
0922:  BCF    03.5
1905
0923:  BCF    06.7
1906
0924:  BSF    03.5
1907
0925:  BCF    06.6
1908
0926:  BCF    03.5
1909
0927:  BSF    06.6
1910
0928:  GOTO   131
1911
0929:  BSF    03.5
1912
092A:  BCF    06.6
1913
092B:  BCF    03.5
1914
092C:  BCF    06.6
1915
092D:  BSF    03.5
1916
092E:  BCF    06.7
1917
092F:  BCF    03.5
1918
0930:  BCF    06.7
1919
0931:  MOVF   01,W
1920
0932:  MOVWF  73
1921
0933:  MOVLW  F0
1922
0934:  ADDWF  43,W
1923
0935:  SUBWF  73,W
1924
0936:  BTFSC  03.2
1925
0937:  GOTO   13A
1926
0938:  BTFSC  03.0
1927
0939:  GOTO   143
1928
093A:  BSF    03.5
1929
093B:  BCF    06.5
1930
093C:  BCF    03.5
1931
093D:  BCF    06.5
1932
093E:  BSF    03.5
1933
093F:  BCF    06.4
1934
0940:  BCF    03.5
1935
0941:  BSF    06.4
1936
0942:  GOTO   14B
1937
0943:  BSF    03.5
1938
0944:  BCF    06.4
1939
0945:  BCF    03.5
1940
0946:  BCF    06.4
1941
0947:  BSF    03.5
1942
0948:  BCF    06.5
1943
0949:  BCF    03.5
1944
094A:  BCF    06.5
1945
....................             line=L;  
1946
094B:  MOVLW  02
1947
094C:  MOVWF  41
1948
....................             dira=0;  
1949
094D:  CLRF   46
1950
....................             movement=L;  
1951
094E:  MOVWF  45
1952
....................             continue;  
1953
094F:  GOTO   0DC
1954
....................          case R:                          // trochu vpravo  
1955
....................             GO(R, F, FW_POMALU+rovinka); GO(L, F, FW_STREDNE+rovinka);  
1956
0950:  MOVF   01,W
1957
0951:  MOVWF  73
1958
0952:  MOVLW  E6
1959
0953:  ADDWF  43,W
1960
0954:  SUBWF  73,W
1961
0955:  BTFSC  03.2
1962
0956:  GOTO   159
1963
0957:  BTFSC  03.0
1964
0958:  GOTO   162
1965
0959:  BSF    03.5
1966
095A:  BCF    06.5
1967
095B:  BCF    03.5
1968
095C:  BCF    06.5
1969
095D:  BSF    03.5
1970
095E:  BCF    06.4
1971
095F:  BCF    03.5
1972
0960:  BSF    06.4
1973
0961:  GOTO   16A
1974
0962:  BSF    03.5
1975
0963:  BCF    06.4
1976
0964:  BCF    03.5
1977
0965:  BCF    06.4
1978
0966:  BSF    03.5
1979
0967:  BCF    06.5
1980
0968:  BCF    03.5
1981
0969:  BCF    06.5
1982
096A:  MOVF   01,W
1983
096B:  MOVWF  73
1984
096C:  MOVLW  F0
1985
096D:  ADDWF  43,W
1986
096E:  SUBWF  73,W
1987
096F:  BTFSC  03.2
1988
0970:  GOTO   173
1989
0971:  BTFSC  03.0
1990
0972:  GOTO   17C
1991
0973:  BSF    03.5
1992
0974:  BCF    06.7
1993
0975:  BCF    03.5
1994
0976:  BCF    06.7
1995
0977:  BSF    03.5
1996
0978:  BCF    06.6
1997
0979:  BCF    03.5
1998
097A:  BSF    06.6
1999
097B:  GOTO   184
2000
097C:  BSF    03.5
2001
097D:  BCF    06.6
2002
097E:  BCF    03.5
2003
097F:  BCF    06.6
2004
0980:  BSF    03.5
2005
0981:  BCF    06.7
2006
0982:  BCF    03.5
2007
0983:  BCF    06.7
2008
....................             line=R;  
2009
0984:  MOVLW  01
2010
0985:  MOVWF  41
2011
....................             dira=0;  
2012
0986:  CLRF   46
2013
....................             movement=R;  
2014
0987:  MOVWF  45
2015
....................             continue;  
2016
0988:  GOTO   0DC
2017
....................          default:       // kdyz jsou obe cidla mimo caru, tak pokracuj dal  
2018
....................       }  
2019
....................    rovinka=0;  
2020
0989:  CLRF   43
2021
....................       if (dira>=T_DIRA) prejeddiru();  
2022
098A:  MOVF   46,W
2023
098B:  SUBLW  54
2024
098C:  BTFSC  03.0
2025
098D:  GOTO   191
2026
098E:  BCF    0A.3
2027
098F:  GOTO   5B0
2028
0990:  BSF    0A.3
2029
....................       if (last!=line)     // pokud si prejel caru z jedne strany na druhou stranu, tak zabrzdi  
2030
0991:  MOVF   41,W
2031
0992:  SUBWF  44,W
2032
0993:  BTFSC  03.2
2033
0994:  GOTO   199
2034
....................       {  
2035
....................          last=line;  
2036
0995:  MOVF   41,W
2037
0996:  MOVWF  44
2038
....................          speed=FW_ZATACKA;  
2039
0997:  MOVLW  C8
2040
0998:  MOVWF  42
2041
....................       }  
2042
....................       if (L==line)  // kdyz jsou obe cidla mimo caru, zatoc na caru  
2043
0999:  MOVF   41,W
2044
099A:  SUBLW  02
2045
099B:  BTFSS  03.2
2046
099C:  GOTO   1BD
2047
....................       {  
2048
....................          STOPL;  
2049
099D:  BSF    03.5
2050
099E:  BCF    06.6
2051
099F:  BCF    03.5
2052
09A0:  BCF    06.6
2053
09A1:  BSF    03.5
2054
09A2:  BCF    06.7
2055
09A3:  BCF    03.5
2056
09A4:  BCF    06.7
2057
....................          GO(R, F, speed);  
2058
09A5:  MOVF   01,W
2059
09A6:  SUBWF  42,W
2060
09A7:  BTFSS  03.0
2061
09A8:  GOTO   1B2
2062
09A9:  BSF    03.5
2063
09AA:  BCF    06.5
2064
09AB:  BCF    03.5
2065
09AC:  BCF    06.5
2066
09AD:  BSF    03.5
2067
09AE:  BCF    06.4
2068
09AF:  BCF    03.5
2069
09B0:  BSF    06.4
2070
09B1:  GOTO   1BA
2071
09B2:  BSF    03.5
2072
09B3:  BCF    06.4
2073
09B4:  BCF    03.5
2074
09B5:  BCF    06.4
2075
09B6:  BSF    03.5
2076
09B7:  BCF    06.5
2077
09B8:  BCF    03.5
2078
09B9:  BCF    06.5
2079
....................          movement=L;  
2080
09BA:  MOVLW  02
2081
09BB:  MOVWF  45
2082
....................       }  
2083
....................       else  
2084
09BC:  GOTO   1DC
2085
....................       {  
2086
....................          STOPR;  
2087
09BD:  BSF    03.5
2088
09BE:  BCF    06.4
2089
09BF:  BCF    03.5
2090
09C0:  BCF    06.4
2091
09C1:  BSF    03.5
2092
09C2:  BCF    06.5
2093
09C3:  BCF    03.5
2094
09C4:  BCF    06.5
2095
....................          GO(L, F, speed);  
2096
09C5:  MOVF   01,W
2097
09C6:  SUBWF  42,W
2098
09C7:  BTFSS  03.0
2099
09C8:  GOTO   1D2
2100
09C9:  BSF    03.5
2101
09CA:  BCF    06.7
2102
09CB:  BCF    03.5
2103
09CC:  BCF    06.7
2104
09CD:  BSF    03.5
2105
09CE:  BCF    06.6
2106
09CF:  BCF    03.5
2107
09D0:  BSF    06.6
2108
09D1:  GOTO   1DA
2109
09D2:  BSF    03.5
2110
09D3:  BCF    06.6
2111
09D4:  BCF    03.5
2112
09D5:  BCF    06.6
2113
09D6:  BSF    03.5
2114
09D7:  BCF    06.7
2115
09D8:  BCF    03.5
2116
09D9:  BCF    06.7
2117
....................          movement=R;  
2118
09DA:  MOVLW  01
2119
09DB:  MOVWF  45
2120
....................       }  
2121
....................    } // while(true)  
2122
09DC:  GOTO   0DC
2123
.................... }  
2124
....................   
2125
....................  
2126
09DD:  SLEEP
2127
 
2128
Configuration Fuses:
2129
   Word  1: 3F38   NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC_IO
2130
   Word  2: 3FFC   NOFCMEN NOIESO