Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
2 kaklik 1
CCS PCW C Compiler, Version 3.110, 15448
2
 
3
               Filename: d:\kaklik\programy\pic_c\roboti\merkur\main.LST
4
 
5
               ROM used: 1572 (38%)
6
                         Largest free fragment is 2048
7
               RAM used: 79 (41%) at main() level
8
                         90 (47%) worst case
9
               Stack:    3 locations
10
 
11
*
12
0000:  MOVLW  00
13
0001:  MOVWF  0A
14
0002:  GOTO   41D
15
0003:  NOP
16
....................  #include "main.h" 
17
....................  #include <16F873.h> 
18
....................  //////// Standard Header file for the PIC16F873 device ////////////////  
19
.................... #device PIC16F873  
20
.................... #list  
21
....................  
22
.................... #device adc=8  
23
.................... #use delay(clock=4000000)  
24
*
25
0016:  MOVLW  78
26
0017:  MOVWF  04
27
0018:  MOVLW  FC
28
0019:  ANDWF  00,F
29
001A:  RRF    00,F
30
001B:  RRF    00,F
31
001C:  MOVF   00,W
32
001D:  BTFSC  03.2
33
001E:  GOTO   023
34
001F:  GOTO   021
35
0020:  NOP
36
0021:  DECFSZ 00,F
37
0022:  GOTO   020
38
0023:  RETLW  00
39
*
40
004A:  MOVLW  73
41
004B:  MOVWF  04
42
004C:  MOVF   00,W
43
004D:  BTFSC  03.2
44
004E:  GOTO   05E
45
004F:  MOVLW  01
46
0050:  MOVWF  21
47
0051:  CLRF   20
48
0052:  DECFSZ 20,F
49
0053:  GOTO   052
50
0054:  DECFSZ 21,F
51
0055:  GOTO   051
52
0056:  MOVLW  4A
53
0057:  MOVWF  20
54
0058:  DECFSZ 20,F
55
0059:  GOTO   058
56
005A:  NOP
57
005B:  NOP
58
005C:  DECFSZ 00,F
59
005D:  GOTO   04F
60
005E:  RETLW  00
61
.................... #fuses XT,NOWDT,NOLVP  
62
....................   
63
....................  
64
....................   
65
.................... #define  TXo PIN_C3                 // To the transmitter modulator  
66
.................... #include "AX25.c"             // podprogram pro prenos telemetrie 
67
....................  //#define  PTT PIN_A2                 // PTT control  
68
.................... //#define  TXo PIN_C0                 // To the transmitter modulator  
69
.................... #define  PERIODAH delay_us(222)     // Halfperiod H 222;78/1200     500;430/500  
70
.................... #define  TAILH delay_us(78)  
71
.................... #define  PERIODAL delay_us(412)     // Halfperiod L 412;345/1200    1000;880/500  
72
.................... #define  TAILL delay_us(345)  
73
.................... #byte    STATUS = 3                 // CPUs status register  
74
....................   
75
.................... byte SendData[16] = {'A'<<1, 'L'<<1, 'L'<<1, ' '<<1, ' '<<1, ' '<<1,  0x60,  
76
....................                      'C'<<1, 'Z'<<1, '0'<<1, 'R'<<1, 'R'<<1, 'R'<<1, 0x61,  
77
....................                      0x03, 0xF0};  
78
....................   
79
.................... boolean bit;  
80
.................... int fcslo, fcshi;    // variabloes for calculating FCS (CRC)  
81
.................... int stuff;           // stuff counter for extra 0  
82
.................... int flag_flag;       // if it is sending flag (7E)  
83
.................... int fcs_flag;        // if it is sending Frame Check Sequence  
84
.................... int i;               // for for  
85
....................   
86
.................... void flipout()       //flips the state of output pin a_1  
87
.................... {  
88
.................... 	stuff = 0;        //since this is a 0, reset the stuff counter  
89
*
90
00AE:  CLRF   38
91
.................... 	if (bit)  
92
00AF:  BTFSS  35.0
93
00B0:  GOTO   0B3
94
....................    {  
95
....................      bit=FALSE;      //if the state of the pin was low, make it high.  
96
00B1:  BCF    35.0
97
....................    }  
98
....................    else  
99
00B2:  GOTO   0B4
100
....................    {  
101
....................      bit=TRUE;	  	   //if the state of the pin was high make it low  
102
00B3:  BSF    35.0
103
....................    }  
104
00B4:  RETLW  00
105
.................... }  
106
....................   
107
.................... void fcsbit(byte tbyte)  
108
.................... {  
109
.................... #asm  
110
....................    BCF    STATUS,0  
111
*
112
011A:  BCF    03.0
113
....................    RRF    fcshi,F             // rotates the entire 16 bits  
114
011B:  RRF    37,F
115
....................    RRF    fcslo,F			      // to the right  
116
.................... #endasm  
117
011C:  RRF    36,F
118
....................    if (((STATUS & 0x01)^(tbyte)) ==0x01)  
119
011D:  MOVF   03,W
120
011E:  ANDLW  01
121
011F:  XORWF  77,W
122
0120:  SUBLW  01
123
0121:  BTFSS  03.2
124
0122:  GOTO   127
125
....................    {  
126
....................          fcshi = fcshi^0x84;  
127
0123:  MOVLW  84
128
0124:  XORWF  37,F
129
....................          fcslo = fcslo^0x08;  
130
0125:  MOVLW  08
131
0126:  XORWF  36,F
132
....................    }  
133
.................... }  
134
....................   
135
.................... void SendBit ()  
136
.................... {  
137
.................... 	if (bit)  
138
*
139
00B5:  BTFSS  35.0
140
00B6:  GOTO   0E8
141
....................    {  
142
....................       output_high(TXo);  
143
00B7:  BCF    3C.3
144
00B8:  MOVF   3C,W
145
00B9:  BSF    03.5
146
00BA:  MOVWF  07
147
00BB:  BCF    03.5
148
00BC:  BSF    07.3
149
....................       PERIODAH;  
150
00BD:  MOVLW  49
151
00BE:  MOVWF  20
152
00BF:  DECFSZ 20,F
153
00C0:  GOTO   0BF
154
00C1:  NOP
155
00C2:  NOP
156
....................       output_low(TXo);  
157
00C3:  BCF    3C.3
158
00C4:  MOVF   3C,W
159
00C5:  BSF    03.5
160
00C6:  MOVWF  07
161
00C7:  BCF    03.5
162
00C8:  BCF    07.3
163
....................       PERIODAH;  
164
00C9:  MOVLW  49
165
00CA:  MOVWF  20
166
00CB:  DECFSZ 20,F
167
00CC:  GOTO   0CB
168
00CD:  NOP
169
00CE:  NOP
170
....................       output_high(TXo);  
171
00CF:  BCF    3C.3
172
00D0:  MOVF   3C,W
173
00D1:  BSF    03.5
174
00D2:  MOVWF  07
175
00D3:  BCF    03.5
176
00D4:  BSF    07.3
177
....................       PERIODAH;  
178
00D5:  MOVLW  49
179
00D6:  MOVWF  20
180
00D7:  DECFSZ 20,F
181
00D8:  GOTO   0D7
182
00D9:  NOP
183
00DA:  NOP
184
....................       output_low(TXo);  
185
00DB:  BCF    3C.3
186
00DC:  MOVF   3C,W
187
00DD:  BSF    03.5
188
00DE:  MOVWF  07
189
00DF:  BCF    03.5
190
00E0:  BCF    07.3
191
....................       TAILH;  
192
00E1:  MOVLW  19
193
00E2:  MOVWF  20
194
00E3:  DECFSZ 20,F
195
00E4:  GOTO   0E3
196
00E5:  NOP
197
00E6:  NOP
198
....................     }  
199
....................     else  
200
00E7:  GOTO   0FE
201
....................     {  
202
....................       output_high(TXo);  
203
00E8:  BCF    3C.3
204
00E9:  MOVF   3C,W
205
00EA:  BSF    03.5
206
00EB:  MOVWF  07
207
00EC:  BCF    03.5
208
00ED:  BSF    07.3
209
....................       PERIODAL;  
210
00EE:  MOVLW  89
211
00EF:  MOVWF  20
212
00F0:  DECFSZ 20,F
213
00F1:  GOTO   0F0
214
....................       output_low(TXo);  
215
00F2:  BCF    3C.3
216
00F3:  MOVF   3C,W
217
00F4:  BSF    03.5
218
00F5:  MOVWF  07
219
00F6:  BCF    03.5
220
00F7:  BCF    07.3
221
....................       TAILL;  
222
00F8:  MOVLW  72
223
00F9:  MOVWF  20
224
00FA:  DECFSZ 20,F
225
00FB:  GOTO   0FA
226
00FC:  NOP
227
00FD:  NOP
228
....................     };  
229
00FE:  RETLW  00
230
.................... }  
231
....................   
232
.................... void SendByte (byte inbyte)  
233
.................... {  
234
....................    int k, bt;  
235
....................   
236
....................    for (k=0;k<8;k++)    //do the following for each of the 8 bits in the byte  
237
00FF:  CLRF   75
238
0100:  MOVF   75,W
239
0101:  SUBLW  07
240
0102:  BTFSS  03.0
241
0103:  GOTO   149
242
....................    {  
243
....................      bt = inbyte & 0x01;            //strip off the rightmost bit of the byte to be sent (inbyte)  
244
0104:  MOVF   74,W
245
0105:  ANDLW  01
246
0106:  MOVWF  76
247
....................      if ((fcs_flag == FALSE) & (flag_flag == FALSE)) fcsbit(bt);    //do FCS calc, but only if this  
248
0107:  MOVF   3A,F
249
0108:  BTFSC  03.2
250
0109:  GOTO   10C
251
010A:  MOVLW  00
252
010B:  GOTO   10D
253
010C:  MOVLW  01
254
010D:  MOVWF  77
255
010E:  MOVF   39,F
256
010F:  BTFSC  03.2
257
0110:  GOTO   113
258
0111:  MOVLW  00
259
0112:  GOTO   114
260
0113:  MOVLW  01
261
0114:  ANDWF  77,W
262
0115:  XORLW  00
263
0116:  BTFSC  03.2
264
0117:  GOTO   127
265
0118:  MOVF   76,W
266
0119:  MOVWF  77
267
.................... 						                                                //is not a flag or fcs byte  
268
....................      if (bt == 0)  
269
*
270
0127:  MOVF   76,F
271
0128:  BTFSS  03.2
272
0129:  GOTO   12C
273
....................      {  
274
....................        flipout();  
275
012A:  CALL   0AE
276
....................      }  			               // if this bit is a zero, flip the output state  
277
....................      else  
278
012B:  GOTO   144
279
....................      {                          			      //otherwise if it is a 1, do the following:  
280
....................        if (flag_flag == FALSE) stuff++;      //increment the count of consequtive 1's  
281
012C:  MOVF   39,F
282
012D:  BTFSS  03.2
283
012E:  GOTO   130
284
012F:  INCF   38,F
285
....................        if ((flag_flag == FALSE) & (stuff == 5))  
286
0130:  MOVF   39,F
287
0131:  BTFSC  03.2
288
0132:  GOTO   135
289
0133:  MOVLW  00
290
0134:  GOTO   136
291
0135:  MOVLW  01
292
0136:  MOVWF  77
293
0137:  MOVF   38,W
294
0138:  SUBLW  05
295
0139:  BTFSC  03.2
296
013A:  GOTO   13D
297
013B:  MOVLW  00
298
013C:  GOTO   13E
299
013D:  MOVLW  01
300
013E:  ANDWF  77,W
301
013F:  XORLW  00
302
0140:  BTFSC  03.2
303
0141:  GOTO   144
304
....................        {       //stuff an extra 0, if 5 1's in a row  
305
....................          SendBit();  
306
0142:  CALL   0B5
307
....................          flipout();               //flip the output state to stuff a 0  
308
0143:  CALL   0AE
309
....................        }//end of if  
310
....................      }//end of else  
311
....................      // delay_us(850);				 //introduces a delay that creates 1200 baud  
312
....................      SendBit();  
313
0144:  CALL   0B5
314
....................      inbyte = inbyte>>1;          //go to the next bit in the byte  
315
0145:  BCF    03.0
316
0146:  RRF    74,F
317
....................    }//end of for  
318
0147:  INCF   75,F
319
0148:  GOTO   100
320
0149:  RETLW  00
321
.................... }//end of SendByte  
322
....................   
323
.................... void SendPacket(char *data)  
324
.................... {  
325
....................     bit=FALSE;  
326
*
327
02CF:  BCF    35.0
328
....................   
329
....................    fcslo=fcshi=0xFF;       //The 2 FCS Bytes are initialized to FF  
330
02D0:  MOVLW  FF
331
02D1:  MOVWF  37
332
02D2:  MOVWF  36
333
....................    stuff = 0;              //The variable stuff counts the number of 1's in a row. When it gets to 5  
334
02D3:  CLRF   38
335
.................... 		                     // it is time to stuff a 0.  
336
....................   
337
.................... //   output_low(PTT);        // Blinking LED  
338
.................... //   delay_ms(1000);  
339
.................... //   output_high(PTT);  
340
....................   
341
....................    flag_flag = TRUE;       //The variable flag is true if you are transmitted flags (7E's) false otherwise.  
342
02D4:  MOVLW  01
343
02D5:  MOVWF  39
344
....................    fcs_flag = FALSE;       //The variable fcsflag is true if you are transmitting FCS bytes, false otherwise.  
345
02D6:  CLRF   3A
346
....................   
347
....................    for(i=0; i<10; i++) SendByte(0x7E); //Sends flag bytes.  Adjust length for txdelay  
348
02D7:  CLRF   3B
349
02D8:  MOVF   3B,W
350
02D9:  SUBLW  09
351
02DA:  BTFSS  03.0
352
02DB:  GOTO   2E1
353
02DC:  MOVLW  7E
354
02DD:  MOVWF  74
355
02DE:  CALL   0FF
356
02DF:  INCF   3B,F
357
02E0:  GOTO   2D8
358
....................                                        //each flag takes approx 6.7 ms  
359
....................    flag_flag = FALSE;      //done sending flags  
360
02E1:  CLRF   39
361
....................   
362
....................    for(i=0; i<16; i++) SendByte(SendData[i]);      //send the packet bytes  
363
02E2:  CLRF   3B
364
02E3:  MOVF   3B,W
365
02E4:  SUBLW  0F
366
02E5:  BTFSS  03.0
367
02E6:  GOTO   2F0
368
02E7:  MOVLW  25
369
02E8:  ADDWF  3B,W
370
02E9:  MOVWF  04
371
02EA:  MOVF   00,W
372
02EB:  MOVWF  73
373
02EC:  MOVWF  74
374
02ED:  CALL   0FF
375
02EE:  INCF   3B,F
376
02EF:  GOTO   2E3
377
....................   
378
....................    for(i=0; 0 != *data; i++)  
379
02F0:  CLRF   3B
380
02F1:  MOVF   72,W
381
02F2:  MOVWF  04
382
02F3:  MOVF   00,W
383
02F4:  XORLW  00
384
02F5:  BTFSC  03.2
385
02F6:  GOTO   300
386
....................    {  
387
....................       SendByte(*data);     //send the packet bytes  
388
02F7:  MOVF   72,W
389
02F8:  MOVWF  04
390
02F9:  MOVF   00,W
391
02FA:  MOVWF  73
392
02FB:  MOVWF  74
393
02FC:  CALL   0FF
394
....................       data++;  
395
02FD:  INCF   72,F
396
....................    };  
397
02FE:  INCF   3B,F
398
02FF:  GOTO   2F1
399
....................   
400
....................    fcs_flag = TRUE;       	//about to send the FCS bytes  
401
0300:  MOVLW  01
402
0301:  MOVWF  3A
403
....................    fcslo =fcslo^0xff;      //must XOR them with FF before sending  
404
0302:  MOVLW  FF
405
0303:  XORWF  36,F
406
....................    fcshi = fcshi^0xff;  
407
0304:  XORWF  37,F
408
....................    SendByte(fcslo);        //send the low byte of fcs  
409
0305:  MOVF   36,W
410
0306:  MOVWF  74
411
0307:  CALL   0FF
412
....................    SendByte(fcshi);        //send the high byte of fcs  
413
0308:  MOVF   37,W
414
0309:  MOVWF  74
415
030A:  CALL   0FF
416
....................    fcs_flag = FALSE;		   //done sending FCS  
417
030B:  CLRF   3A
418
....................    flag_flag = TRUE;  		//about to send flags  
419
030C:  MOVLW  01
420
030D:  MOVWF  39
421
....................    SendByte(0x7e);         // Send a flag to end packet  
422
030E:  MOVLW  7E
423
030F:  MOVWF  74
424
0310:  CALL   0FF
425
.................... }  
426
....................   
427
....................   
428
....................   
429
....................  
430
....................   
431
.................... //motory            //Napred vypnout potom zapnout!  
432
.................... #define FR         output_low(PIN_B5); output_high(PIN_B4)  // Vpred  
433
.................... #define FL         output_low(PIN_B7); output_high(PIN_B6)  
434
.................... #define BR         output_low(PIN_B4); output_high(PIN_B5)  // Vzad  
435
.................... #define BL         output_low(PIN_B6); output_high(PIN_B7)  
436
.................... #define STOPR      output_low(PIN_B4);output_low(PIN_B5)  
437
.................... #define STOPL      output_low(PIN_B6);output_low(PIN_B7)  
438
....................   
439
.................... #define 	L 0b10  // left  
440
.................... #define 	R 0b01  // right  
441
.................... #define 	S 0b11  // straight  
442
....................   
443
.................... #define 	COUVANI		1600					// couvnuti po zjisteni diry  
444
.................... #define 	MEZERA		5400					// za jak dlouho bude ztracena cara  
445
.................... #define 	PRES_DIRU	400					// velikost mezery v care  
446
.................... #define 	ODEZVA		1						// za jak dlouho po opusteni cary se ma zacit zatacet  
447
.................... #define	BRZDENI		100					// doba (v ms) ptrebna k zastaveni jednoho motoru  
448
....................   
449
.................... //cidla  
450
.................... #define 	RSENSOR    1       // Senzory na caru  
451
.................... #define 	LSENSOR    0  
452
.................... #define	BUMPER	PIN_C4		// sensor na cihlu  
453
....................   
454
.................... #define DIAG_SERVO      PIN_B0   // Propojka pro diagnosticky mod  
455
.................... #define DIAG_SENSORS    PIN_B1   // Propojka pro diagnosticky mod  
456
....................   
457
.................... #DEFINE SOUND_HI   PIN_B3  
458
.................... #DEFINE SOUND_LO   PIN_B2  
459
....................   
460
.................... char AXstring[40];   // Buffer pro prenos telemetrie  
461
....................   
462
.................... int tresholdL;		// rozhodovaci uroven pro prave cidlo  
463
.................... int tresholdR;		// rozhodovaci uroven pro prave cidlo  
464
.................... int movement;     // smer minuleho pohybu  
465
.................... int line;         // na ktere strane byla detekovana cara  
466
.................... unsigned int16 dira;			// pocitadlo pro nalezeni preruseni cary  
467
....................   
468
.................... // Primitivni Pipani  
469
.................... void beep(unsigned int16 period, unsigned int16 length)  
470
.................... {  
471
....................    unsigned int16 nn;  
472
....................   
473
....................    for(nn=length; nn>0; nn--)  
474
*
475
0024:  MOVF   75,W
476
0025:  MOVWF  77
477
0026:  MOVF   74,W
478
0027:  MOVWF  76
479
0028:  MOVF   76,F
480
0029:  BTFSS  03.2
481
002A:  GOTO   02E
482
002B:  MOVF   77,F
483
002C:  BTFSC  03.2
484
002D:  GOTO   049
485
....................    {  
486
....................      output_high(SOUND_HI);output_low(SOUND_LO);  
487
002E:  BSF    03.5
488
002F:  BCF    06.3
489
0030:  BCF    03.5
490
0031:  BSF    06.3
491
0032:  BSF    03.5
492
0033:  BCF    06.2
493
0034:  BCF    03.5
494
0035:  BCF    06.2
495
....................      delay_us(period);  
496
0036:  MOVF   72,W
497
0037:  MOVWF  78
498
0038:  CALL   016
499
....................      output_high(SOUND_LO);output_low(SOUND_HI);  
500
0039:  BSF    03.5
501
003A:  BCF    06.2
502
003B:  BCF    03.5
503
003C:  BSF    06.2
504
003D:  BSF    03.5
505
003E:  BCF    06.3
506
003F:  BCF    03.5
507
0040:  BCF    06.3
508
....................      delay_us(period);  
509
0041:  MOVF   72,W
510
0042:  MOVWF  78
511
0043:  CALL   016
512
....................    }  
513
0044:  MOVF   76,W
514
0045:  BTFSC  03.2
515
0046:  DECF   77,F
516
0047:  DECF   76,F
517
0048:  GOTO   028
518
0049:  RETLW  00
519
.................... }  
520
....................   
521
.................... // Diagnostika pohonu, hejbne vsema motorama ve vsech smerech  
522
.................... void diagnostika()  
523
.................... {  
524
....................    unsigned int16 n;  
525
....................   
526
....................    while (input(DIAG_SERVO))   // Propojka, ktera spousti diagnostiku  
527
*
528
014A:  BSF    03.5
529
014B:  BSF    06.0
530
014C:  BCF    03.5
531
014D:  BTFSS  06.0
532
014E:  GOTO   275
533
....................    {  
534
....................       for (n=500; n<800; n+=100)  
535
014F:  MOVLW  01
536
0150:  MOVWF  6F
537
0151:  MOVLW  F4
538
0152:  MOVWF  6E
539
0153:  MOVF   6F,W
540
0154:  SUBLW  03
541
0155:  BTFSS  03.0
542
0156:  GOTO   16B
543
0157:  BTFSS  03.2
544
0158:  GOTO   15D
545
0159:  MOVF   6E,W
546
015A:  SUBLW  1F
547
015B:  BTFSS  03.0
548
015C:  GOTO   16B
549
....................       {  
550
....................          beep(n,n); //beep UP  
551
015D:  MOVF   6F,W
552
015E:  MOVWF  73
553
015F:  MOVF   6E,W
554
0160:  MOVWF  72
555
0161:  MOVF   6F,W
556
0162:  MOVWF  75
557
0163:  MOVF   6E,W
558
0164:  MOVWF  74
559
0165:  CALL   024
560
....................       };  
561
0166:  MOVLW  64
562
0167:  ADDWF  6E,F
563
0168:  BTFSC  03.0
564
0169:  INCF   6F,F
565
016A:  GOTO   153
566
....................       Delay_ms(1000);  
567
016B:  MOVLW  04
568
016C:  MOVWF  72
569
016D:  MOVLW  FA
570
016E:  MOVWF  73
571
016F:  CALL   04A
572
0170:  DECFSZ 72,F
573
0171:  GOTO   16D
574
....................       //zastav vse  
575
....................       STOPL; STOPR;  
576
0172:  BSF    03.5
577
0173:  BCF    06.6
578
0174:  BCF    03.5
579
0175:  BCF    06.6
580
0176:  BSF    03.5
581
0177:  BCF    06.7
582
0178:  BCF    03.5
583
0179:  BCF    06.7
584
017A:  BSF    03.5
585
017B:  BCF    06.4
586
017C:  BCF    03.5
587
017D:  BCF    06.4
588
017E:  BSF    03.5
589
017F:  BCF    06.5
590
0180:  BCF    03.5
591
0181:  BCF    06.5
592
....................       //pravy pas  
593
....................       FR; Delay_ms(1000); STOPR; Delay_ms(1000);  
594
0182:  BSF    03.5
595
0183:  BCF    06.5
596
0184:  BCF    03.5
597
0185:  BCF    06.5
598
0186:  BSF    03.5
599
0187:  BCF    06.4
600
0188:  BCF    03.5
601
0189:  BSF    06.4
602
018A:  MOVLW  04
603
018B:  MOVWF  72
604
018C:  MOVLW  FA
605
018D:  MOVWF  73
606
018E:  CALL   04A
607
018F:  DECFSZ 72,F
608
0190:  GOTO   18C
609
0191:  BSF    03.5
610
0192:  BCF    06.4
611
0193:  BCF    03.5
612
0194:  BCF    06.4
613
0195:  BSF    03.5
614
0196:  BCF    06.5
615
0197:  BCF    03.5
616
0198:  BCF    06.5
617
0199:  MOVLW  04
618
019A:  MOVWF  72
619
019B:  MOVLW  FA
620
019C:  MOVWF  73
621
019D:  CALL   04A
622
019E:  DECFSZ 72,F
623
019F:  GOTO   19B
624
....................       BR; Delay_ms(1000); STOPR; Delay_ms(1000);  
625
01A0:  BSF    03.5
626
01A1:  BCF    06.4
627
01A2:  BCF    03.5
628
01A3:  BCF    06.4
629
01A4:  BSF    03.5
630
01A5:  BCF    06.5
631
01A6:  BCF    03.5
632
01A7:  BSF    06.5
633
01A8:  MOVLW  04
634
01A9:  MOVWF  72
635
01AA:  MOVLW  FA
636
01AB:  MOVWF  73
637
01AC:  CALL   04A
638
01AD:  DECFSZ 72,F
639
01AE:  GOTO   1AA
640
01AF:  BSF    03.5
641
01B0:  BCF    06.4
642
01B1:  BCF    03.5
643
01B2:  BCF    06.4
644
01B3:  BSF    03.5
645
01B4:  BCF    06.5
646
01B5:  BCF    03.5
647
01B6:  BCF    06.5
648
01B7:  MOVLW  04
649
01B8:  MOVWF  72
650
01B9:  MOVLW  FA
651
01BA:  MOVWF  73
652
01BB:  CALL   04A
653
01BC:  DECFSZ 72,F
654
01BD:  GOTO   1B9
655
....................       Beep(880,100); Delay_ms(1000);  
656
01BE:  MOVLW  03
657
01BF:  MOVWF  73
658
01C0:  MOVLW  70
659
01C1:  MOVWF  72
660
01C2:  CLRF   75
661
01C3:  MOVLW  64
662
01C4:  MOVWF  74
663
01C5:  CALL   024
664
01C6:  MOVLW  04
665
01C7:  MOVWF  72
666
01C8:  MOVLW  FA
667
01C9:  MOVWF  73
668
01CA:  CALL   04A
669
01CB:  DECFSZ 72,F
670
01CC:  GOTO   1C8
671
....................       //levy pas  
672
....................       FL; Delay_ms(1000); STOPL; Delay_ms(1000);  
673
01CD:  BSF    03.5
674
01CE:  BCF    06.7
675
01CF:  BCF    03.5
676
01D0:  BCF    06.7
677
01D1:  BSF    03.5
678
01D2:  BCF    06.6
679
01D3:  BCF    03.5
680
01D4:  BSF    06.6
681
01D5:  MOVLW  04
682
01D6:  MOVWF  72
683
01D7:  MOVLW  FA
684
01D8:  MOVWF  73
685
01D9:  CALL   04A
686
01DA:  DECFSZ 72,F
687
01DB:  GOTO   1D7
688
01DC:  BSF    03.5
689
01DD:  BCF    06.6
690
01DE:  BCF    03.5
691
01DF:  BCF    06.6
692
01E0:  BSF    03.5
693
01E1:  BCF    06.7
694
01E2:  BCF    03.5
695
01E3:  BCF    06.7
696
01E4:  MOVLW  04
697
01E5:  MOVWF  72
698
01E6:  MOVLW  FA
699
01E7:  MOVWF  73
700
01E8:  CALL   04A
701
01E9:  DECFSZ 72,F
702
01EA:  GOTO   1E6
703
....................       BL; Delay_ms(1000); STOPL; Delay_ms(1000);  
704
01EB:  BSF    03.5
705
01EC:  BCF    06.6
706
01ED:  BCF    03.5
707
01EE:  BCF    06.6
708
01EF:  BSF    03.5
709
01F0:  BCF    06.7
710
01F1:  BCF    03.5
711
01F2:  BSF    06.7
712
01F3:  MOVLW  04
713
01F4:  MOVWF  72
714
01F5:  MOVLW  FA
715
01F6:  MOVWF  73
716
01F7:  CALL   04A
717
01F8:  DECFSZ 72,F
718
01F9:  GOTO   1F5
719
01FA:  BSF    03.5
720
01FB:  BCF    06.6
721
01FC:  BCF    03.5
722
01FD:  BCF    06.6
723
01FE:  BSF    03.5
724
01FF:  BCF    06.7
725
0200:  BCF    03.5
726
0201:  BCF    06.7
727
0202:  MOVLW  04
728
0203:  MOVWF  72
729
0204:  MOVLW  FA
730
0205:  MOVWF  73
731
0206:  CALL   04A
732
0207:  DECFSZ 72,F
733
0208:  GOTO   204
734
....................       Beep(880,100); Delay_ms(1000);  
735
0209:  MOVLW  03
736
020A:  MOVWF  73
737
020B:  MOVLW  70
738
020C:  MOVWF  72
739
020D:  CLRF   75
740
020E:  MOVLW  64
741
020F:  MOVWF  74
742
0210:  CALL   024
743
0211:  MOVLW  04
744
0212:  MOVWF  72
745
0213:  MOVLW  FA
746
0214:  MOVWF  73
747
0215:  CALL   04A
748
0216:  DECFSZ 72,F
749
0217:  GOTO   213
750
....................       //oba pasy  
751
....................       FL; FR; Delay_ms(1000); STOPL; STOPR; Delay_ms(1000);  
752
0218:  BSF    03.5
753
0219:  BCF    06.7
754
021A:  BCF    03.5
755
021B:  BCF    06.7
756
021C:  BSF    03.5
757
021D:  BCF    06.6
758
021E:  BCF    03.5
759
021F:  BSF    06.6
760
0220:  BSF    03.5
761
0221:  BCF    06.5
762
0222:  BCF    03.5
763
0223:  BCF    06.5
764
0224:  BSF    03.5
765
0225:  BCF    06.4
766
0226:  BCF    03.5
767
0227:  BSF    06.4
768
0228:  MOVLW  04
769
0229:  MOVWF  72
770
022A:  MOVLW  FA
771
022B:  MOVWF  73
772
022C:  CALL   04A
773
022D:  DECFSZ 72,F
774
022E:  GOTO   22A
775
022F:  BSF    03.5
776
0230:  BCF    06.6
777
0231:  BCF    03.5
778
0232:  BCF    06.6
779
0233:  BSF    03.5
780
0234:  BCF    06.7
781
0235:  BCF    03.5
782
0236:  BCF    06.7
783
0237:  BSF    03.5
784
0238:  BCF    06.4
785
0239:  BCF    03.5
786
023A:  BCF    06.4
787
023B:  BSF    03.5
788
023C:  BCF    06.5
789
023D:  BCF    03.5
790
023E:  BCF    06.5
791
023F:  MOVLW  04
792
0240:  MOVWF  72
793
0241:  MOVLW  FA
794
0242:  MOVWF  73
795
0243:  CALL   04A
796
0244:  DECFSZ 72,F
797
0245:  GOTO   241
798
....................       BL; BR; Delay_ms(1000); STOPL; STOPR; Delay_ms(1000);  
799
0246:  BSF    03.5
800
0247:  BCF    06.6
801
0248:  BCF    03.5
802
0249:  BCF    06.6
803
024A:  BSF    03.5
804
024B:  BCF    06.7
805
024C:  BCF    03.5
806
024D:  BSF    06.7
807
024E:  BSF    03.5
808
024F:  BCF    06.4
809
0250:  BCF    03.5
810
0251:  BCF    06.4
811
0252:  BSF    03.5
812
0253:  BCF    06.5
813
0254:  BCF    03.5
814
0255:  BSF    06.5
815
0256:  MOVLW  04
816
0257:  MOVWF  72
817
0258:  MOVLW  FA
818
0259:  MOVWF  73
819
025A:  CALL   04A
820
025B:  DECFSZ 72,F
821
025C:  GOTO   258
822
025D:  BSF    03.5
823
025E:  BCF    06.6
824
025F:  BCF    03.5
825
0260:  BCF    06.6
826
0261:  BSF    03.5
827
0262:  BCF    06.7
828
0263:  BCF    03.5
829
0264:  BCF    06.7
830
0265:  BSF    03.5
831
0266:  BCF    06.4
832
0267:  BCF    03.5
833
0268:  BCF    06.4
834
0269:  BSF    03.5
835
026A:  BCF    06.5
836
026B:  BCF    03.5
837
026C:  BCF    06.5
838
026D:  MOVLW  04
839
026E:  MOVWF  72
840
026F:  MOVLW  FA
841
0270:  MOVWF  73
842
0271:  CALL   04A
843
0272:  DECFSZ 72,F
844
0273:  GOTO   26F
845
....................    };  
846
0274:  GOTO   14A
847
....................   
848
....................    while (input(DIAG_SENSORS))  
849
0275:  BSF    03.5
850
0276:  BSF    06.1
851
0277:  BCF    03.5
852
0278:  BTFSS  06.1
853
0279:  GOTO   319
854
....................    {  
855
....................       int ls, rs;  
856
.................... 		while(!input(BUMPER)){beep(1100,100); Delay_ms(50);}  
857
027A:  BSF    3C.4
858
027B:  MOVF   3C,W
859
027C:  BSF    03.5
860
027D:  MOVWF  07
861
027E:  BCF    03.5
862
027F:  BTFSC  07.4
863
0280:  GOTO   28D
864
0281:  MOVLW  04
865
0282:  MOVWF  73
866
0283:  MOVLW  4C
867
0284:  MOVWF  72
868
0285:  CLRF   75
869
0286:  MOVLW  64
870
0287:  MOVWF  74
871
0288:  CALL   024
872
0289:  MOVLW  32
873
028A:  MOVWF  73
874
028B:  CALL   04A
875
028C:  GOTO   27A
876
....................       set_adc_channel(RSENSOR);  
877
028D:  MOVLW  08
878
028E:  MOVWF  21
879
028F:  MOVF   1F,W
880
0290:  ANDLW  C7
881
0291:  IORWF  21,W
882
0292:  MOVWF  1F
883
....................       Delay_us(20);  
884
0293:  MOVLW  06
885
0294:  MOVWF  20
886
0295:  DECFSZ 20,F
887
0296:  GOTO   295
888
0297:  NOP
889
....................       rs=read_adc();  
890
0298:  BSF    1F.2
891
0299:  BTFSC  1F.2
892
029A:  GOTO   299
893
029B:  MOVF   1E,W
894
029C:  MOVWF  71
895
....................       set_adc_channel(LSENSOR);  
896
029D:  MOVLW  00
897
029E:  MOVWF  21
898
029F:  MOVF   1F,W
899
02A0:  ANDLW  C7
900
02A1:  IORWF  21,W
901
02A2:  MOVWF  1F
902
....................       Delay_us(20);  
903
02A3:  MOVLW  06
904
02A4:  MOVWF  20
905
02A5:  DECFSZ 20,F
906
02A6:  GOTO   2A5
907
02A7:  NOP
908
....................       ls=read_adc();  
909
02A8:  BSF    1F.2
910
02A9:  BTFSC  1F.2
911
02AA:  GOTO   2A9
912
02AB:  MOVF   1E,W
913
02AC:  MOVWF  70
914
....................       sprintf(AXstring,"L: %U  R: %U\0", ls, rs);  // Convert DATA to String.  
915
*
916
0004:  BCF    0A.0
917
0005:  BCF    0A.1
918
0006:  BCF    0A.2
919
0007:  ADDWF  02,F
920
0008:  RETLW  4C
921
0009:  RETLW  3A
922
000A:  RETLW  20
923
000B:  RETLW  25
924
000C:  RETLW  55
925
000D:  RETLW  20
926
000E:  RETLW  20
927
000F:  RETLW  52
928
0010:  RETLW  3A
929
0011:  RETLW  20
930
0012:  RETLW  25
931
0013:  RETLW  55
932
0014:  RETLW  00
933
0015:  RETLW  00
934
*
935
007C:  MOVF   21,W
936
007D:  MOVF   73,W
937
007E:  MOVWF  75
938
007F:  MOVLW  64
939
0080:  MOVWF  76
940
0081:  CALL   067
941
0082:  MOVF   20,W
942
0083:  MOVWF  73
943
0084:  MOVF   21,W
944
0085:  MOVLW  30
945
0086:  BTFSS  03.2
946
0087:  GOTO   08F
947
0088:  BTFSC  74.0
948
0089:  BSF    74.3
949
008A:  BTFSC  74.3
950
008B:  GOTO   095
951
008C:  BTFSC  74.4
952
008D:  MOVLW  20
953
008E:  GOTO   091
954
008F:  BCF    74.3
955
0090:  BCF    74.4
956
0091:  ADDWF  21,F
957
0092:  MOVF   21,W
958
0093:  MOVWF  75
959
0094:  CALL   05F
960
0095:  MOVF   73,W
961
0096:  MOVWF  75
962
0097:  MOVLW  0A
963
0098:  MOVWF  76
964
0099:  CALL   067
965
009A:  MOVF   20,W
966
009B:  MOVWF  73
967
009C:  MOVF   21,W
968
009D:  MOVLW  30
969
009E:  BTFSS  03.2
970
009F:  GOTO   0A4
971
00A0:  BTFSC  74.3
972
00A1:  GOTO   0A8
973
00A2:  BTFSC  74.4
974
00A3:  MOVLW  20
975
00A4:  ADDWF  21,F
976
00A5:  MOVF   21,W
977
00A6:  MOVWF  75
978
00A7:  CALL   05F
979
00A8:  MOVLW  30
980
00A9:  ADDWF  73,F
981
00AA:  MOVF   73,W
982
00AB:  MOVWF  75
983
00AC:  CALL   05F
984
00AD:  RETLW  00
985
*
986
02AD:  MOVLW  3D
987
02AE:  MOVWF  6B
988
02AF:  MOVLW  4C
989
02B0:  MOVWF  75
990
02B1:  CALL   05F
991
02B2:  MOVLW  3A
992
02B3:  MOVWF  75
993
02B4:  CALL   05F
994
02B5:  MOVLW  20
995
02B6:  MOVWF  75
996
02B7:  CALL   05F
997
02B8:  MOVF   70,W
998
02B9:  MOVWF  73
999
02BA:  MOVLW  18
1000
02BB:  MOVWF  74
1001
02BC:  CALL   07C
1002
02BD:  MOVLW  05
1003
02BE:  MOVWF  72
1004
02BF:  MOVF   72,W
1005
02C0:  CALL   004
1006
02C1:  INCF   72,F
1007
02C2:  MOVWF  75
1008
02C3:  CALL   05F
1009
02C4:  MOVLW  0A
1010
02C5:  SUBWF  72,W
1011
02C6:  BTFSS  03.2
1012
02C7:  GOTO   2BF
1013
02C8:  MOVF   71,W
1014
02C9:  MOVWF  73
1015
02CA:  MOVLW  18
1016
02CB:  MOVWF  74
1017
02CC:  CALL   07C
1018
....................       SendPacket(&AXstring[0]);  
1019
02CD:  MOVLW  3D
1020
02CE:  MOVWF  72
1021
....................       delay_ms(1000);  
1022
*
1023
0311:  MOVLW  04
1024
0312:  MOVWF  72
1025
0313:  MOVLW  FA
1026
0314:  MOVWF  73
1027
0315:  CALL   04A
1028
0316:  DECFSZ 72,F
1029
0317:  GOTO   313
1030
....................    };  
1031
0318:  GOTO   275
1032
0319:  BCF    0A.3
1033
031A:  GOTO   45E (RETURN)
1034
.................... }  
1035
....................   
1036
.................... void cikcak()  
1037
.................... {  
1038
.................... int n;  
1039
.................... 	switch(movement)												// podivej se na jednu stranu  
1040
*
1041
0364:  MOVLW  01
1042
0365:  SUBWF  67,W
1043
0366:  ADDLW  FD
1044
0367:  BTFSC  03.0
1045
0368:  GOTO   3A4
1046
0369:  ADDLW  03
1047
036A:  GOTO   410
1048
.................... 	{  
1049
.................... 	case L:  
1050
.................... 				FL;BR;  
1051
036B:  BSF    03.5
1052
036C:  BCF    06.7
1053
036D:  BCF    03.5
1054
036E:  BCF    06.7
1055
036F:  BSF    03.5
1056
0370:  BCF    06.6
1057
0371:  BCF    03.5
1058
0372:  BSF    06.6
1059
0373:  BSF    03.5
1060
0374:  BCF    06.4
1061
0375:  BCF    03.5
1062
0376:  BCF    06.4
1063
0377:  BSF    03.5
1064
0378:  BCF    06.5
1065
0379:  BCF    03.5
1066
037A:  BSF    06.5
1067
.................... 				movement=R;  
1068
037B:  MOVLW  01
1069
037C:  MOVWF  67
1070
.................... 			break;  
1071
037D:  GOTO   3A4
1072
.................... 	case R:  
1073
.................... 				FR;BL;  
1074
037E:  BSF    03.5
1075
037F:  BCF    06.5
1076
0380:  BCF    03.5
1077
0381:  BCF    06.5
1078
0382:  BSF    03.5
1079
0383:  BCF    06.4
1080
0384:  BCF    03.5
1081
0385:  BSF    06.4
1082
0386:  BSF    03.5
1083
0387:  BCF    06.6
1084
0388:  BCF    03.5
1085
0389:  BCF    06.6
1086
038A:  BSF    03.5
1087
038B:  BCF    06.7
1088
038C:  BCF    03.5
1089
038D:  BSF    06.7
1090
.................... 				movement=L;  
1091
038E:  MOVLW  02
1092
038F:  MOVWF  67
1093
.................... 			break;  
1094
0390:  GOTO   3A4
1095
.................... 	case S:  
1096
.................... 				FR;BL;  
1097
0391:  BSF    03.5
1098
0392:  BCF    06.5
1099
0393:  BCF    03.5
1100
0394:  BCF    06.5
1101
0395:  BSF    03.5
1102
0396:  BCF    06.4
1103
0397:  BCF    03.5
1104
0398:  BSF    06.4
1105
0399:  BSF    03.5
1106
039A:  BCF    06.6
1107
039B:  BCF    03.5
1108
039C:  BCF    06.6
1109
039D:  BSF    03.5
1110
039E:  BCF    06.7
1111
039F:  BCF    03.5
1112
03A0:  BSF    06.7
1113
.................... 				movement=L;  
1114
03A1:  MOVLW  02
1115
03A2:  MOVWF  67
1116
.................... 			break;  
1117
03A3:  GOTO   3A4
1118
.................... 	}  
1119
*
1120
0410:  BCF    0A.0
1121
0411:  BCF    0A.1
1122
0412:  BSF    0A.2
1123
0413:  ADDWF  02,F
1124
0414:  GOTO   37E
1125
0415:  GOTO   36B
1126
0416:  GOTO   391
1127
.................... 	set_adc_channel(LSENSOR);  
1128
*
1129
03A4:  MOVLW  00
1130
03A5:  MOVWF  21
1131
03A6:  MOVF   1F,W
1132
03A7:  ANDLW  C7
1133
03A8:  IORWF  21,W
1134
03A9:  MOVWF  1F
1135
.................... 	Delay_us(10);  
1136
03AA:  MOVLW  03
1137
03AB:  MOVWF  20
1138
03AC:  DECFSZ 20,F
1139
03AD:  GOTO   3AC
1140
.................... 	while (tresholdL < read_adc())						// je tam cara?? 
1141
03AE:  BSF    1F.2
1142
03AF:  BTFSC  1F.2
1143
03B0:  GOTO   3AF
1144
03B1:  MOVF   1E,W
1145
03B2:  SUBWF  65,W
1146
03B3:  BTFSC  03.0
1147
03B4:  GOTO   3FC
1148
.................... 	{  
1149
.................... 		if (n==50)												// asi bude na druhe strane  
1150
03B5:  MOVF   6E,W
1151
03B6:  SUBLW  32
1152
03B7:  BTFSS  03.2
1153
03B8:  GOTO   3F7
1154
.................... 		{  
1155
.................... 			STOPR;STOPL;  
1156
03B9:  BSF    03.5
1157
03BA:  BCF    06.4
1158
03BB:  BCF    03.5
1159
03BC:  BCF    06.4
1160
03BD:  BSF    03.5
1161
03BE:  BCF    06.5
1162
03BF:  BCF    03.5
1163
03C0:  BCF    06.5
1164
03C1:  BSF    03.5
1165
03C2:  BCF    06.6
1166
03C3:  BCF    03.5
1167
03C4:  BCF    06.6
1168
03C5:  BSF    03.5
1169
03C6:  BCF    06.7
1170
03C7:  BCF    03.5
1171
03C8:  BCF    06.7
1172
.................... 			n=0;  
1173
03C9:  CLRF   6E
1174
.................... 			switch(movement)  
1175
03CA:  MOVLW  01
1176
03CB:  SUBWF  67,W
1177
03CC:  ADDLW  FE
1178
03CD:  BTFSC  03.0
1179
03CE:  GOTO   3F7
1180
03CF:  ADDLW  02
1181
03D0:  GOTO   417
1182
.................... 			{  
1183
.................... 			case L:  
1184
.................... 						FL;BR;  
1185
03D1:  BSF    03.5
1186
03D2:  BCF    06.7
1187
03D3:  BCF    03.5
1188
03D4:  BCF    06.7
1189
03D5:  BSF    03.5
1190
03D6:  BCF    06.6
1191
03D7:  BCF    03.5
1192
03D8:  BSF    06.6
1193
03D9:  BSF    03.5
1194
03DA:  BCF    06.4
1195
03DB:  BCF    03.5
1196
03DC:  BCF    06.4
1197
03DD:  BSF    03.5
1198
03DE:  BCF    06.5
1199
03DF:  BCF    03.5
1200
03E0:  BSF    06.5
1201
.................... 						movement=R;  
1202
03E1:  MOVLW  01
1203
03E2:  MOVWF  67
1204
.................... 					break;  
1205
03E3:  GOTO   3F7
1206
.................... 			case R:  
1207
.................... 						FR;BL;  
1208
03E4:  BSF    03.5
1209
03E5:  BCF    06.5
1210
03E6:  BCF    03.5
1211
03E7:  BCF    06.5
1212
03E8:  BSF    03.5
1213
03E9:  BCF    06.4
1214
03EA:  BCF    03.5
1215
03EB:  BSF    06.4
1216
03EC:  BSF    03.5
1217
03ED:  BCF    06.6
1218
03EE:  BCF    03.5
1219
03EF:  BCF    06.6
1220
03F0:  BSF    03.5
1221
03F1:  BCF    06.7
1222
03F2:  BCF    03.5
1223
03F3:  BSF    06.7
1224
.................... 						movement=L;  
1225
03F4:  MOVLW  02
1226
03F5:  MOVWF  67
1227
.................... 					break;  
1228
03F6:  GOTO   3F7
1229
.................... 			}  
1230
*
1231
0417:  BCF    0A.0
1232
0418:  BCF    0A.1
1233
0419:  BSF    0A.2
1234
041A:  ADDWF  02,F
1235
041B:  GOTO   3E4
1236
041C:  GOTO   3D1
1237
.................... 		}  
1238
.................... 		Delay_ms(5);  
1239
*
1240
03F7:  MOVLW  05
1241
03F8:  MOVWF  73
1242
03F9:  CALL   04A
1243
.................... 		n++;  
1244
03FA:  INCF   6E,F
1245
.................... 	}  
1246
03FB:  GOTO   3AE
1247
.................... 	STOPL;STOPR;												// nasli jsme caru  
1248
03FC:  BSF    03.5
1249
03FD:  BCF    06.6
1250
03FE:  BCF    03.5
1251
03FF:  BCF    06.6
1252
0400:  BSF    03.5
1253
0401:  BCF    06.7
1254
0402:  BCF    03.5
1255
0403:  BCF    06.7
1256
0404:  BSF    03.5
1257
0405:  BCF    06.4
1258
0406:  BCF    03.5
1259
0407:  BCF    06.4
1260
0408:  BSF    03.5
1261
0409:  BCF    06.5
1262
040A:  BCF    03.5
1263
040B:  BCF    06.5
1264
.................... 	line=S;  
1265
040C:  MOVLW  03
1266
040D:  MOVWF  68
1267
040E:  BCF    0A.3
1268
040F:  GOTO   610 (RETURN)
1269
.................... }  
1270
.................... void objizdka()  
1271
.................... {  
1272
.................... 	BL;BR;Delay_ms(300);  
1273
*
1274
031B:  BSF    03.5
1275
031C:  BCF    06.6
1276
031D:  BCF    03.5
1277
031E:  BCF    06.6
1278
031F:  BSF    03.5
1279
0320:  BCF    06.7
1280
0321:  BCF    03.5
1281
0322:  BSF    06.7
1282
0323:  BSF    03.5
1283
0324:  BCF    06.4
1284
0325:  BCF    03.5
1285
0326:  BCF    06.4
1286
0327:  BSF    03.5
1287
0328:  BCF    06.5
1288
0329:  BCF    03.5
1289
032A:  BSF    06.5
1290
032B:  MOVLW  02
1291
032C:  MOVWF  6E
1292
032D:  MOVLW  96
1293
032E:  MOVWF  73
1294
032F:  CALL   04A
1295
0330:  DECFSZ 6E,F
1296
0331:  GOTO   32D
1297
.................... 	STOPR;STOPL;  
1298
0332:  BSF    03.5
1299
0333:  BCF    06.4
1300
0334:  BCF    03.5
1301
0335:  BCF    06.4
1302
0336:  BSF    03.5
1303
0337:  BCF    06.5
1304
0338:  BCF    03.5
1305
0339:  BCF    06.5
1306
033A:  BSF    03.5
1307
033B:  BCF    06.6
1308
033C:  BCF    03.5
1309
033D:  BCF    06.6
1310
033E:  BSF    03.5
1311
033F:  BCF    06.7
1312
0340:  BCF    03.5
1313
0341:  BCF    06.7
1314
.................... 	beep(1000,1000);  
1315
0342:  MOVLW  03
1316
0343:  MOVWF  73
1317
0344:  MOVLW  E8
1318
0345:  MOVWF  72
1319
0346:  MOVLW  03
1320
0347:  MOVWF  75
1321
0348:  MOVLW  E8
1322
0349:  MOVWF  74
1323
034A:  CALL   024
1324
.................... 	Delay_ms(500);  
1325
034B:  MOVLW  02
1326
034C:  MOVWF  6E
1327
034D:  MOVLW  FA
1328
034E:  MOVWF  73
1329
034F:  CALL   04A
1330
0350:  DECFSZ 6E,F
1331
0351:  GOTO   34D
1332
.................... 	beep(1000,1000);  
1333
0352:  MOVLW  03
1334
0353:  MOVWF  73
1335
0354:  MOVLW  E8
1336
0355:  MOVWF  72
1337
0356:  MOVLW  03
1338
0357:  MOVWF  75
1339
0358:  MOVLW  E8
1340
0359:  MOVWF  74
1341
035A:  CALL   024
1342
.................... 	Delay_ms(1000);  
1343
035B:  MOVLW  04
1344
035C:  MOVWF  6E
1345
035D:  MOVLW  FA
1346
035E:  MOVWF  73
1347
035F:  CALL   04A
1348
0360:  DECFSZ 6E,F
1349
0361:  GOTO   35D
1350
0362:  BCF    0A.3
1351
0363:  GOTO   48A (RETURN)
1352
....................   
1353
.................... }  
1354
.................... void kalibrace()  
1355
.................... {  
1356
.................... unsigned int16 i;  
1357
.................... int min;  
1358
.................... int max;  
1359
.................... int current;  
1360
.................... int treshold;  
1361
....................   
1362
.................... 	FL; BR; Delay_ms(130);  
1363
.................... chyba1:  
1364
.................... 	FR; BL;													//kalibrace leveho cidla  
1365
....................    set_adc_channel(LSENSOR);  
1366
.................... 	Delay_us(20);  
1367
.................... 	min=max=read_adc();  
1368
.................... 	for (i=1;i<=500;i++)  
1369
.................... 	{  
1370
.................... 		current=read_adc();  
1371
.................... 		if (max < current) max=current;  
1372
.................... 		if (min > current) min=current;  
1373
.................... 		Delay_us(500);  
1374
.................... 	}  
1375
.................... 	FL; BR;  
1376
.................... 	for (i=1;i<=500;i++)  
1377
.................... 	{  
1378
.................... 		current=read_adc();  
1379
.................... 		if (max < current) max=current;  
1380
.................... 		if (min > current) min=current;  
1381
.................... 		Delay_us(500);  
1382
.................... 	}  
1383
.................... 	STOPL; STOPR; Delay_ms(200);  
1384
.................... 	if((max-min)<50) {Beep(1000,300); GOTO chyba1;}  
1385
.................... 	treshold=(max-min)>>1;  
1386
.................... 	tresholdL=treshold+min;  
1387
....................   
1388
.................... chyba2:  
1389
.................... 	FR; BL;  
1390
....................    set_adc_channel(RSENSOR);  
1391
.................... 	Delay_us(20);  
1392
.................... 	min=max=read_adc();									//naplneni min a max nejakou rozumnou hodnotou  
1393
.................... 	for (i=1;i<=500 ;i++)  
1394
.................... 	{  
1395
.................... 		current=read_adc();  
1396
.................... 		if (max < current) max=current;				//zmereni minima a maxima  
1397
.................... 		if (min > current) min=current;  
1398
.................... 		Delay_us(500);  
1399
.................... 	}  
1400
.................... 	FL; BR;  
1401
.................... 	for (i=1;i<=500 ;i++)  
1402
.................... 	{  
1403
.................... 		current=read_adc();  
1404
.................... 		if (max < current) max=current;				//zmereni minima a maxima  
1405
.................... 		if (min > current) min=current;  
1406
.................... 		Delay_us(500);  
1407
.................... 	}  
1408
.................... 	STOPL; STOPR; Delay_ms(200);  
1409
.................... 	if((max-min)<50) {Beep(1000,300); GOTO chyba2;}  
1410
.................... 	treshold=(max-min)>>1;  
1411
.................... 	tresholdR=treshold+min;  
1412
....................   
1413
.................... 	FR; BL;  
1414
.................... 	movement=L;  
1415
.................... 	set_adc_channel(LSENSOR);  
1416
.................... 	Delay_us(20);  
1417
.................... 	while (tresholdL < read_adc()) Delay_us(100);  
1418
.................... 	FL; BR; Delay_ms(50);  
1419
.................... 	STOPL; STOPR; Delay_ms(500);  
1420
.................... 	Beep(780,200);  
1421
.................... }  
1422
....................   
1423
.................... void main()  
1424
.................... {  
1425
.................... unsigned int16 rovne;												// pocita delku rovne cary  
1426
*
1427
041D:  CLRF   04
1428
041E:  MOVLW  1F
1429
041F:  ANDWF  03,F
1430
0420:  MOVLW  07
1431
0421:  BSF    03.5
1432
0422:  MOVWF  1F
1433
0423:  MOVLW  82
1434
0424:  BCF    03.5
1435
0425:  MOVWF  25
1436
0426:  MOVLW  98
1437
0427:  MOVWF  26
1438
0428:  MOVWF  27
1439
0429:  MOVLW  40
1440
042A:  MOVWF  28
1441
042B:  MOVWF  29
1442
042C:  MOVWF  2A
1443
042D:  MOVLW  60
1444
042E:  MOVWF  2B
1445
042F:  MOVLW  86
1446
0430:  MOVWF  2C
1447
0431:  MOVLW  B4
1448
0432:  MOVWF  2D
1449
0433:  MOVLW  60
1450
0434:  MOVWF  2E
1451
0435:  MOVLW  A4
1452
0436:  MOVWF  2F
1453
0437:  MOVWF  30
1454
0438:  MOVWF  31
1455
0439:  MOVLW  61
1456
043A:  MOVWF  32
1457
043B:  MOVLW  03
1458
043C:  MOVWF  33
1459
043D:  MOVLW  F0
1460
043E:  MOVWF  34
1461
043F:  MOVLW  FF
1462
0440:  MOVWF  3C
1463
0441:  CLRF   6B
1464
....................   
1465
....................    STOPL; STOPR;  
1466
0442:  BSF    03.5
1467
0443:  BCF    06.6
1468
0444:  BCF    03.5
1469
0445:  BCF    06.6
1470
0446:  BSF    03.5
1471
0447:  BCF    06.7
1472
0448:  BCF    03.5
1473
0449:  BCF    06.7
1474
044A:  BSF    03.5
1475
044B:  BCF    06.4
1476
044C:  BCF    03.5
1477
044D:  BCF    06.4
1478
044E:  BSF    03.5
1479
044F:  BCF    06.5
1480
0450:  BCF    03.5
1481
0451:  BCF    06.5
1482
....................   
1483
....................    setup_adc_ports(RA0_RA1_RA3_ANALOG);  
1484
0452:  MOVLW  04
1485
0453:  BSF    03.5
1486
0454:  MOVWF  1F
1487
....................    setup_adc(ADC_CLOCK_DIV_2);  
1488
0455:  BCF    03.5
1489
0456:  MOVF   1F,W
1490
0457:  ANDLW  38
1491
0458:  IORLW  01
1492
0459:  MOVWF  1F
1493
....................   
1494
....................    port_b_pullups(false);  
1495
045A:  BSF    03.5
1496
045B:  BSF    01.7
1497
....................   
1498
.................... 	diagnostika();  
1499
045C:  BCF    03.5
1500
045D:  GOTO   14A
1501
....................   
1502
....................    Beep(1000,200);     //double beep  
1503
045E:  MOVLW  03
1504
045F:  MOVWF  73
1505
0460:  MOVLW  E8
1506
0461:  MOVWF  72
1507
0462:  CLRF   75
1508
0463:  MOVLW  C8
1509
0464:  MOVWF  74
1510
0465:  CALL   024
1511
....................    Delay_ms(50);  
1512
0466:  MOVLW  32
1513
0467:  MOVWF  73
1514
0468:  CALL   04A
1515
....................    Beep(1000,200);  
1516
0469:  MOVLW  03
1517
046A:  MOVWF  73
1518
046B:  MOVLW  E8
1519
046C:  MOVWF  72
1520
046D:  CLRF   75
1521
046E:  MOVLW  C8
1522
046F:  MOVWF  74
1523
0470:  CALL   024
1524
....................    Delay_ms(1000); // 1s  
1525
0471:  MOVLW  04
1526
0472:  MOVWF  6E
1527
0473:  MOVLW  FA
1528
0474:  MOVWF  73
1529
0475:  CALL   04A
1530
0476:  DECFSZ 6E,F
1531
0477:  GOTO   473
1532
....................   
1533
.................... //	kalibrace();  
1534
.................... 	tresholdl=tresholdr=80;  
1535
0478:  MOVLW  50
1536
0479:  MOVWF  66
1537
047A:  MOVWF  65
1538
.................... //	FL; FR;  
1539
....................    movement=S;  
1540
047B:  MOVLW  03
1541
047C:  MOVWF  67
1542
....................    line=S;  
1543
047D:  MOVWF  68
1544
....................    dira=0;  
1545
047E:  CLRF   6A
1546
047F:  CLRF   69
1547
.................... 	rovne=0;  
1548
0480:  CLRF   6D
1549
0481:  CLRF   6C
1550
....................   
1551
....................    while(true)  
1552
....................    {  
1553
.................... 		if(!input(BUMPER)) objizdka();  
1554
0482:  BSF    3C.4
1555
0483:  MOVF   3C,W
1556
0484:  BSF    03.5
1557
0485:  MOVWF  07
1558
0486:  BCF    03.5
1559
0487:  BTFSC  07.4
1560
0488:  GOTO   48A
1561
0489:  GOTO   31B
1562
.................... 		line=0;  
1563
048A:  CLRF   68
1564
....................       set_adc_channel(RSENSOR);								// podivej se jestli neni cara pod pravym cidlem  
1565
048B:  MOVLW  08
1566
048C:  MOVWF  21
1567
048D:  MOVF   1F,W
1568
048E:  ANDLW  C7
1569
048F:  IORWF  21,W
1570
0490:  MOVWF  1F
1571
....................       Delay_us(10);  
1572
0491:  MOVLW  03
1573
0492:  MOVWF  20
1574
0493:  DECFSZ 20,F
1575
0494:  GOTO   493
1576
....................       if(tresholdR > read_adc())  
1577
0495:  BSF    1F.2
1578
0496:  BTFSC  1F.2
1579
0497:  GOTO   496
1580
0498:  MOVF   1E,W
1581
0499:  SUBWF  66,W
1582
049A:  BTFSC  03.2
1583
049B:  GOTO   4A2
1584
049C:  BTFSS  03.0
1585
049D:  GOTO   4A2
1586
.................... 		{  
1587
.................... 			dira=0;  
1588
049E:  CLRF   6A
1589
049F:  CLRF   69
1590
.................... 			line=R;  
1591
04A0:  MOVLW  01
1592
04A1:  MOVWF  68
1593
.................... 		}  
1594
....................       set_adc_channel(LSENSOR);								// kdyz cara nebyla pod pravym cidlem, mozna bude pod levym  
1595
04A2:  MOVLW  00
1596
04A3:  MOVWF  21
1597
04A4:  MOVF   1F,W
1598
04A5:  ANDLW  C7
1599
04A6:  IORWF  21,W
1600
04A7:  MOVWF  1F
1601
....................       Delay_us(10);  
1602
04A8:  MOVLW  03
1603
04A9:  MOVWF  20
1604
04AA:  DECFSZ 20,F
1605
04AB:  GOTO   4AA
1606
....................       if(tresholdL > read_adc())  
1607
04AC:  BSF    1F.2
1608
04AD:  BTFSC  1F.2
1609
04AE:  GOTO   4AD
1610
04AF:  MOVF   1E,W
1611
04B0:  SUBWF  65,W
1612
04B1:  BTFSC  03.2
1613
04B2:  GOTO   4B8
1614
04B3:  BTFSS  03.0
1615
04B4:  GOTO   4B8
1616
.................... 		{  
1617
.................... 			dira=0;  
1618
04B5:  CLRF   6A
1619
04B6:  CLRF   69
1620
.................... 			line=line | L;  
1621
04B7:  BSF    68.1
1622
.................... 		}  
1623
....................   
1624
.................... 		switch(line)  
1625
04B8:  MOVF   68,W
1626
04B9:  MOVWF  20
1627
04BA:  MOVLW  03
1628
04BB:  SUBWF  20,W
1629
04BC:  BTFSC  03.2
1630
04BD:  GOTO   4C7
1631
04BE:  MOVLW  02
1632
04BF:  SUBWF  20,W
1633
04C0:  BTFSC  03.2
1634
04C1:  GOTO   4DA
1635
04C2:  MOVLW  01
1636
04C3:  SUBWF  20,W
1637
04C4:  BTFSC  03.2
1638
04C5:  GOTO   4ED
1639
04C6:  GOTO   500
1640
.................... 		{  
1641
.................... 		case S:  
1642
.................... 			FR;FL;  
1643
04C7:  BSF    03.5
1644
04C8:  BCF    06.5
1645
04C9:  BCF    03.5
1646
04CA:  BCF    06.5
1647
04CB:  BSF    03.5
1648
04CC:  BCF    06.4
1649
04CD:  BCF    03.5
1650
04CE:  BSF    06.4
1651
04CF:  BSF    03.5
1652
04D0:  BCF    06.7
1653
04D1:  BCF    03.5
1654
04D2:  BCF    06.7
1655
04D3:  BSF    03.5
1656
04D4:  BCF    06.6
1657
04D5:  BCF    03.5
1658
04D6:  BSF    06.6
1659
.................... 			movement=S;  
1660
04D7:  MOVLW  03
1661
04D8:  MOVWF  67
1662
.................... 			continue;  
1663
04D9:  GOTO   482
1664
.................... 		case L:  
1665
.................... 			STOPL;  
1666
04DA:  BSF    03.5
1667
04DB:  BCF    06.6
1668
04DC:  BCF    03.5
1669
04DD:  BCF    06.6
1670
04DE:  BSF    03.5
1671
04DF:  BCF    06.7
1672
04E0:  BCF    03.5
1673
04E1:  BCF    06.7
1674
.................... 			FR;movement=L;  
1675
04E2:  BSF    03.5
1676
04E3:  BCF    06.5
1677
04E4:  BCF    03.5
1678
04E5:  BCF    06.5
1679
04E6:  BSF    03.5
1680
04E7:  BCF    06.4
1681
04E8:  BCF    03.5
1682
04E9:  BSF    06.4
1683
04EA:  MOVLW  02
1684
04EB:  MOVWF  67
1685
.................... 			continue;  
1686
04EC:  GOTO   482
1687
.................... 		case R:  
1688
.................... 			STOPR;  
1689
04ED:  BSF    03.5
1690
04EE:  BCF    06.4
1691
04EF:  BCF    03.5
1692
04F0:  BCF    06.4
1693
04F1:  BSF    03.5
1694
04F2:  BCF    06.5
1695
04F3:  BCF    03.5
1696
04F4:  BCF    06.5
1697
.................... 			FL;movement=R;  
1698
04F5:  BSF    03.5
1699
04F6:  BCF    06.7
1700
04F7:  BCF    03.5
1701
04F8:  BCF    06.7
1702
04F9:  BSF    03.5
1703
04FA:  BCF    06.6
1704
04FB:  BCF    03.5
1705
04FC:  BSF    06.6
1706
04FD:  MOVLW  01
1707
04FE:  MOVWF  67
1708
.................... 			continue;  
1709
04FF:  GOTO   482
1710
.................... 		default:  
1711
.................... 		}  
1712
....................   
1713
.................... 		if (dira==ODEZVA)									// kdyz uz chvili jedeme po bile plose  
1714
0500:  DECFSZ 69,W
1715
0501:  GOTO   54A
1716
0502:  MOVF   6A,F
1717
0503:  BTFSS  03.2
1718
0504:  GOTO   54A
1719
.................... 		{  
1720
.................... 			//BR;BL;Delay_us(rovne >>= 5);  
1721
.................... 			rovne=0;											//kdyz sme museli zatocit, uz neni rovna cara  
1722
0505:  CLRF   6D
1723
0506:  CLRF   6C
1724
....................   
1725
.................... 			switch (line)									// musime zatocit  
1726
0507:  MOVLW  01
1727
0508:  SUBWF  68,W
1728
0509:  ADDLW  FE
1729
050A:  BTFSC  03.0
1730
050B:  GOTO   54A
1731
050C:  ADDLW  02
1732
050D:  GOTO   617
1733
.................... 			{  
1734
.................... 		  	case L:  
1735
....................         				BL;Delay_ms(BRZDENI);STOPL;  
1736
050E:  BSF    03.5
1737
050F:  BCF    06.6
1738
0510:  BCF    03.5
1739
0511:  BCF    06.6
1740
0512:  BSF    03.5
1741
0513:  BCF    06.7
1742
0514:  BCF    03.5
1743
0515:  BSF    06.7
1744
0516:  MOVLW  64
1745
0517:  MOVWF  73
1746
0518:  CALL   04A
1747
0519:  BSF    03.5
1748
051A:  BCF    06.6
1749
051B:  BCF    03.5
1750
051C:  BCF    06.6
1751
051D:  BSF    03.5
1752
051E:  BCF    06.7
1753
051F:  BCF    03.5
1754
0520:  BCF    06.7
1755
.................... 						FR;  
1756
0521:  BSF    03.5
1757
0522:  BCF    06.5
1758
0523:  BCF    03.5
1759
0524:  BCF    06.5
1760
0525:  BSF    03.5
1761
0526:  BCF    06.4
1762
0527:  BCF    03.5
1763
0528:  BSF    06.4
1764
.................... 						movement=L;  
1765
0529:  MOVLW  02
1766
052A:  MOVWF  67
1767
.................... 					break;  
1768
052B:  GOTO   54A
1769
....................         	case R:  
1770
....................         				BR;Delay_ms(BRZDENI);STOPR;  
1771
052C:  BSF    03.5
1772
052D:  BCF    06.4
1773
052E:  BCF    03.5
1774
052F:  BCF    06.4
1775
0530:  BSF    03.5
1776
0531:  BCF    06.5
1777
0532:  BCF    03.5
1778
0533:  BSF    06.5
1779
0534:  MOVLW  64
1780
0535:  MOVWF  73
1781
0536:  CALL   04A
1782
0537:  BSF    03.5
1783
0538:  BCF    06.4
1784
0539:  BCF    03.5
1785
053A:  BCF    06.4
1786
053B:  BSF    03.5
1787
053C:  BCF    06.5
1788
053D:  BCF    03.5
1789
053E:  BCF    06.5
1790
.................... 						FL;  
1791
053F:  BSF    03.5
1792
0540:  BCF    06.7
1793
0541:  BCF    03.5
1794
0542:  BCF    06.7
1795
0543:  BSF    03.5
1796
0544:  BCF    06.6
1797
0545:  BCF    03.5
1798
0546:  BSF    06.6
1799
.................... 						movement=R;  
1800
0547:  MOVLW  01
1801
0548:  MOVWF  67
1802
.................... 					break;  
1803
0549:  GOTO   54A
1804
.................... 			}  
1805
*
1806
0617:  BCF    0A.0
1807
0618:  BSF    0A.1
1808
0619:  BSF    0A.2
1809
061A:  ADDWF  02,F
1810
061B:  GOTO   52C
1811
061C:  GOTO   50E
1812
.................... 		}  
1813
.................... 		if (dira==MEZERA)											// kdyz zkoncila cara  
1814
*
1815
054A:  MOVF   69,W
1816
054B:  SUBLW  18
1817
054C:  BTFSS  03.2
1818
054D:  GOTO   612
1819
054E:  MOVF   6A,W
1820
054F:  SUBLW  15
1821
0550:  BTFSS  03.2
1822
0551:  GOTO   612
1823
.................... 		{  
1824
.................... 			beep(800,500);  
1825
0552:  MOVLW  03
1826
0553:  MOVWF  73
1827
0554:  MOVLW  20
1828
0555:  MOVWF  72
1829
0556:  MOVLW  01
1830
0557:  MOVWF  75
1831
0558:  MOVLW  F4
1832
0559:  MOVWF  74
1833
055A:  CALL   024
1834
.................... 			Delay_ms(50);  
1835
055B:  MOVLW  32
1836
055C:  MOVWF  73
1837
055D:  CALL   04A
1838
.................... 			beep(800,500);  
1839
055E:  MOVLW  03
1840
055F:  MOVWF  73
1841
0560:  MOVLW  20
1842
0561:  MOVWF  72
1843
0562:  MOVLW  01
1844
0563:  MOVWF  75
1845
0564:  MOVLW  F4
1846
0565:  MOVWF  74
1847
0566:  CALL   024
1848
.................... 			switch (movement)										//vrat se zpet na caru  
1849
0567:  MOVLW  01
1850
0568:  SUBWF  67,W
1851
0569:  ADDLW  FD
1852
056A:  BTFSC  03.0
1853
056B:  GOTO   5E6
1854
056C:  ADDLW  03
1855
056D:  GOTO   61D
1856
.................... 			{  
1857
.................... 		  	case L:  
1858
.................... 						STOPL;STOPR;  
1859
056E:  BSF    03.5
1860
056F:  BCF    06.6
1861
0570:  BCF    03.5
1862
0571:  BCF    06.6
1863
0572:  BSF    03.5
1864
0573:  BCF    06.7
1865
0574:  BCF    03.5
1866
0575:  BCF    06.7
1867
0576:  BSF    03.5
1868
0577:  BCF    06.4
1869
0578:  BCF    03.5
1870
0579:  BCF    06.4
1871
057A:  BSF    03.5
1872
057B:  BCF    06.5
1873
057C:  BCF    03.5
1874
057D:  BCF    06.5
1875
....................         				BR;Delay_ms(COUVANI);STOPR;  
1876
057E:  BSF    03.5
1877
057F:  BCF    06.4
1878
0580:  BCF    03.5
1879
0581:  BCF    06.4
1880
0582:  BSF    03.5
1881
0583:  BCF    06.5
1882
0584:  BCF    03.5
1883
0585:  BSF    06.5
1884
0586:  MOVLW  08
1885
0587:  MOVWF  6E
1886
0588:  MOVLW  C8
1887
0589:  MOVWF  73
1888
058A:  CALL   04A
1889
058B:  DECFSZ 6E,F
1890
058C:  GOTO   588
1891
058D:  BSF    03.5
1892
058E:  BCF    06.4
1893
058F:  BCF    03.5
1894
0590:  BCF    06.4
1895
0591:  BSF    03.5
1896
0592:  BCF    06.5
1897
0593:  BCF    03.5
1898
0594:  BCF    06.5
1899
.................... 					break;  
1900
0595:  GOTO   5E6
1901
....................         	case R:  
1902
.................... 						STOPL;STOPR;  
1903
0596:  BSF    03.5
1904
0597:  BCF    06.6
1905
0598:  BCF    03.5
1906
0599:  BCF    06.6
1907
059A:  BSF    03.5
1908
059B:  BCF    06.7
1909
059C:  BCF    03.5
1910
059D:  BCF    06.7
1911
059E:  BSF    03.5
1912
059F:  BCF    06.4
1913
05A0:  BCF    03.5
1914
05A1:  BCF    06.4
1915
05A2:  BSF    03.5
1916
05A3:  BCF    06.5
1917
05A4:  BCF    03.5
1918
05A5:  BCF    06.5
1919
....................         				BL;Delay_ms(COUVANI);STOPL;  
1920
05A6:  BSF    03.5
1921
05A7:  BCF    06.6
1922
05A8:  BCF    03.5
1923
05A9:  BCF    06.6
1924
05AA:  BSF    03.5
1925
05AB:  BCF    06.7
1926
05AC:  BCF    03.5
1927
05AD:  BSF    06.7
1928
05AE:  MOVLW  08
1929
05AF:  MOVWF  6E
1930
05B0:  MOVLW  C8
1931
05B1:  MOVWF  73
1932
05B2:  CALL   04A
1933
05B3:  DECFSZ 6E,F
1934
05B4:  GOTO   5B0
1935
05B5:  BSF    03.5
1936
05B6:  BCF    06.6
1937
05B7:  BCF    03.5
1938
05B8:  BCF    06.6
1939
05B9:  BSF    03.5
1940
05BA:  BCF    06.7
1941
05BB:  BCF    03.5
1942
05BC:  BCF    06.7
1943
.................... 					break;  
1944
05BD:  GOTO   5E6
1945
.................... 			case S:  
1946
.................... 						BL; BR; Delay_ms(COUVANI);  
1947
05BE:  BSF    03.5
1948
05BF:  BCF    06.6
1949
05C0:  BCF    03.5
1950
05C1:  BCF    06.6
1951
05C2:  BSF    03.5
1952
05C3:  BCF    06.7
1953
05C4:  BCF    03.5
1954
05C5:  BSF    06.7
1955
05C6:  BSF    03.5
1956
05C7:  BCF    06.4
1957
05C8:  BCF    03.5
1958
05C9:  BCF    06.4
1959
05CA:  BSF    03.5
1960
05CB:  BCF    06.5
1961
05CC:  BCF    03.5
1962
05CD:  BSF    06.5
1963
05CE:  MOVLW  08
1964
05CF:  MOVWF  6E
1965
05D0:  MOVLW  C8
1966
05D1:  MOVWF  73
1967
05D2:  CALL   04A
1968
05D3:  DECFSZ 6E,F
1969
05D4:  GOTO   5D0
1970
.................... 						STOPL; STOPR;  
1971
05D5:  BSF    03.5
1972
05D6:  BCF    06.6
1973
05D7:  BCF    03.5
1974
05D8:  BCF    06.6
1975
05D9:  BSF    03.5
1976
05DA:  BCF    06.7
1977
05DB:  BCF    03.5
1978
05DC:  BCF    06.7
1979
05DD:  BSF    03.5
1980
05DE:  BCF    06.4
1981
05DF:  BCF    03.5
1982
05E0:  BCF    06.4
1983
05E1:  BSF    03.5
1984
05E2:  BCF    06.5
1985
05E3:  BCF    03.5
1986
05E4:  BCF    06.5
1987
.................... 					break;  
1988
05E5:  GOTO   5E6
1989
.................... 			}  
1990
*
1991
061D:  BCF    0A.0
1992
061E:  BSF    0A.1
1993
061F:  BSF    0A.2
1994
0620:  ADDWF  02,F
1995
0621:  GOTO   596
1996
0622:  GOTO   56E
1997
0623:  GOTO   5BE
1998
....................   
1999
.................... 			FR;FL; Delay_ms(PRES_DIRU);						// popojedem dopredu mozna tam bude cara  
2000
*
2001
05E6:  BSF    03.5
2002
05E7:  BCF    06.5
2003
05E8:  BCF    03.5
2004
05E9:  BCF    06.5
2005
05EA:  BSF    03.5
2006
05EB:  BCF    06.4
2007
05EC:  BCF    03.5
2008
05ED:  BSF    06.4
2009
05EE:  BSF    03.5
2010
05EF:  BCF    06.7
2011
05F0:  BCF    03.5
2012
05F1:  BCF    06.7
2013
05F2:  BSF    03.5
2014
05F3:  BCF    06.6
2015
05F4:  BCF    03.5
2016
05F5:  BSF    06.6
2017
05F6:  MOVLW  02
2018
05F7:  MOVWF  6E
2019
05F8:  MOVLW  C8
2020
05F9:  MOVWF  73
2021
05FA:  CALL   04A
2022
05FB:  DECFSZ 6E,F
2023
05FC:  GOTO   5F8
2024
.................... 			STOPL; STOPR; movement=S;  
2025
05FD:  BSF    03.5
2026
05FE:  BCF    06.6
2027
05FF:  BCF    03.5
2028
0600:  BCF    06.6
2029
0601:  BSF    03.5
2030
0602:  BCF    06.7
2031
0603:  BCF    03.5
2032
0604:  BCF    06.7
2033
0605:  BSF    03.5
2034
0606:  BCF    06.4
2035
0607:  BCF    03.5
2036
0608:  BCF    06.4
2037
0609:  BSF    03.5
2038
060A:  BCF    06.5
2039
060B:  BCF    03.5
2040
060C:  BCF    06.5
2041
060D:  MOVLW  03
2042
060E:  MOVWF  67
2043
.................... 			cikcak();												// najdi caru  
2044
060F:  GOTO   364
2045
.................... 			dira=0;  
2046
0610:  CLRF   6A
2047
0611:  CLRF   69
2048
.................... 		}  
2049
.................... 		dira++;  
2050
0612:  INCF   69,F
2051
0613:  BTFSC  03.2
2052
0614:  INCF   6A,F
2053
....................    } // while(true)  
2054
0615:  GOTO   482
2055
.................... }  
2056
....................  
2057
0616:  SLEEP