Subversion Repositories svnkaklik

Rev

Go to most recent revision | Blame | Last modification | View Log | Download

CCS PCM C Compiler, Version 3.245, 27853               25-IV-06 20:23

               Filename: D:\KAKLIK\programy\PIC_C\roboti\3Orbis\main.lst

               ROM used: 1149 words (28%)
                         Largest free fragment is 2048
               RAM used: 32 (18%) at main() level
                         35 (20%) worst case
               Stack:    5 worst case (3 in main + 2 for interrupts)

*
0000:  MOVLW  00
0001:  MOVWF  0A
0002:  GOTO   261
0003:  NOP
0004:  MOVWF  7F
0005:  SWAPF  03,W
0006:  CLRF   03
0007:  MOVWF  21
0008:  MOVF   7F,W
0009:  MOVWF  20
000A:  MOVF   0A,W
000B:  MOVWF  28
000C:  CLRF   0A
000D:  SWAPF  20,F
000E:  MOVF   04,W
000F:  MOVWF  22
0010:  MOVF   77,W
0011:  MOVWF  23
0012:  MOVF   78,W
0013:  MOVWF  24
0014:  MOVF   79,W
0015:  MOVWF  25
0016:  MOVF   7A,W
0017:  MOVWF  26
0018:  MOVF   7B,W
0019:  MOVWF  27
001A:  BCF    03.7
001B:  BCF    03.5
001C:  MOVLW  8C
001D:  MOVWF  04
001E:  BTFSS  00.1
001F:  GOTO   022
0020:  BTFSC  0C.1
0021:  GOTO   035
0022:  MOVF   22,W
0023:  MOVWF  04
0024:  MOVF   23,W
0025:  MOVWF  77
0026:  MOVF   24,W
0027:  MOVWF  78
0028:  MOVF   25,W
0029:  MOVWF  79
002A:  MOVF   26,W
002B:  MOVWF  7A
002C:  MOVF   27,W
002D:  MOVWF  7B
002E:  MOVF   28,W
002F:  MOVWF  0A
0030:  SWAPF  21,W
0031:  MOVWF  03
0032:  SWAPF  7F,F
0033:  SWAPF  7F,W
0034:  RETFIE
0035:  BCF    0A.3
0036:  GOTO   047
.................... #include ".\main.h" 
.................... #include <16F88.h> 
.................... //////// Standard Header file for the PIC16F88 device //////////////// 
.................... #device PIC16F88 
.................... #list 
....................  
.................... #device adc=8 
....................  
.................... #FUSES NOWDT                       //No Watch Dog Timer 
.................... #FUSES INTRC_IO 
.................... #FUSES NOPUT                       //No Power Up Timer 
.................... #FUSES MCLR                        //Master Clear pin enabled 
.................... #FUSES NOBROWNOUT             //Reset when brownout detected 
.................... #FUSES NOLVP                  //Low Voltage Programming on B3(PIC16) or B5(PIC18) 
.................... #FUSES NOCPD                       //No EE protection 
.................... #FUSES NOWRT                       //Program memory not write protected 
.................... #FUSES NODEBUG                     //No Debug mode for ICD 
.................... #FUSES NOPROTECT                   //Code not protected from reading 
.................... #FUSES NOFCMEN                //Fail-safe clock monitor enabled 
.................... #FUSES NOIESO                      //Internal External Switch Over mode enabled 
....................  
.................... #use delay(clock=8000000,RESTART_WDT) 
0037:  MOVLW  08
0038:  SUBWF  3D,F
0039:  BTFSS  03.0
003A:  GOTO   046
003B:  MOVLW  3D
003C:  MOVWF  04
003D:  BCF    03.0
003E:  RRF    00,F
003F:  MOVF   00,W
0040:  BTFSC  03.2
0041:  GOTO   046
0042:  GOTO   044
0043:  CLRWDT
0044:  DECFSZ 00,F
0045:  GOTO   043
0046:  RETLW  00
*
0065:  MOVLW  3A
0066:  MOVWF  04
0067:  MOVF   00,W
0068:  BTFSC  03.2
0069:  GOTO   07C
006A:  MOVLW  02
006B:  MOVWF  78
006C:  MOVLW  BF
006D:  MOVWF  77
006E:  CLRWDT
006F:  DECFSZ 77,F
0070:  GOTO   06E
0071:  DECFSZ 78,F
0072:  GOTO   06C
0073:  MOVLW  96
0074:  MOVWF  77
0075:  DECFSZ 77,F
0076:  GOTO   075
0077:  NOP
0078:  NOP
0079:  CLRWDT
007A:  DECFSZ 00,F
007B:  GOTO   06A
007C:  RETLW  00
....................  
....................  
....................  
.................... #define  KOLMO1      225         // predni kolecko sroubem dopredu 
.................... #define  KOLMO2      30          // predni kolecko je hlavou sroubu dozadu 
.................... #define  STRED       128         // sredni poloha zataceciho kolecka 
.................... #define  BEAR1       10//10          // 3 stupne zataceni 
.................... #define  BEAR2       25//25 
.................... #define  BEAR3       45//45 
.................... #define  R           100         // Rozumna rychlost 
.................... #define  R17         200         // X nasobek rozumne rychlosti 
.................... //#define  L1            1     // cara vlevo 
.................... #define  L2            2     // cara vlevo 
.................... #define  L3            3     // cara vlevo 
.................... #define  S             0     // cara mezi sensory 
.................... //#define  R1           -1     // cara vpravo 
.................... #define  R2           -2     // cara vpravo 
.................... #define  R3           -3     // cara vpravo 
....................  
.................... // servo 
.................... #define  SERVO PIN_B5 
....................  
.................... // kroutitka 
.................... #define  CERVENA  4  // AN4 
.................... //#define  CERNA    5  // AN5 
.................... //#define  ZELENA   6  // AN6 
.................... #define  MODRA    2  // AN2 
....................  
.................... // IR 
.................... #define IRTX      PIN_B2 
.................... #define  CIHLA    PIN_A3 
....................  
.................... //motory 
.................... #define  FR         output_low(PIN_A7); output_high(PIN_A6)  // Vpred 
.................... #define  FL         output_low(PIN_A1); output_high(PIN_A0) 
.................... #define  BR         output_low(PIN_A6); output_high(PIN_A7)  // Vzad 
.................... #define  BL         output_low(PIN_A0); output_high(PIN_A1) 
.................... #define  STOPR      output_low(PIN_A6);output_low(PIN_A7) 
.................... #define  STOPL      output_low(PIN_A0);output_low(PIN_A1) 
....................  
.................... //HID 
.................... #define  LED1     PIN_B1      //oranzova 
.................... #define  LED2     PIN_B2      //zluta 
....................  
.................... #define  STROBE   PIN_B0 
.................... //#define  SW1      PIN_A2      // Motory On/off 
....................  
.................... unsigned int8 sensors;        // pomocna promenna pro cteni cidel na caru 
.................... signed int8 line = S;         // na ktere strane byla detekovana cara 
*
026E:  BCF    03.5
026F:  CLRF   2B
.................... //unsigned int8 dira;         // pocita dobu po kterou je ztracena cara 
.................... unsigned int8 uhel;           // urcuje aktualni uhel zataceni 
.................... unsigned int8 speed;          // maximalni povolena rychlost 
.................... unsigned int8 turn;           // rychlost toceni 
.................... unsigned int8 rovinka;        // pocitadlo na zjisteni rovinky 
....................  
.................... signed int16  Lmotor;         // promene, ktere urcuji velikost vykonu na levem 
.................... signed int16  Rmotor;         // a pravem motoru 
....................  
.................... // makro pro PWM pro motory 
.................... #define GO(motor, direction, power) if(get_timer0()<=power) \ 
.................... {direction##motor;} else {stop##motor;} 
.................... //////////////////////////////////////////////////////////////////////////////// 
.................... #int_TIMER2 
.................... TIMER2_isr()      // ovladani serva 
.................... { 
....................    unsigned int8 n; 
....................  
....................    output_high(SERVO); 
*
0047:  BSF    03.5
0048:  BCF    06.5
0049:  BCF    03.5
004A:  BSF    06.5
....................    delay_us(1000); 
004B:  CLRWDT
004C:  MOVLW  09
004D:  MOVWF  3C
004E:  MOVLW  6D
004F:  MOVWF  3D
0050:  CALL   037
0051:  DECFSZ 3C,F
0052:  GOTO   04E
....................    for(n=uhel; n>0; n--) Delay_us(2); 
0053:  MOVF   2C,W
0054:  MOVWF  3B
0055:  MOVF   3B,F
0056:  BTFSC  03.2
0057:  GOTO   05E
0058:  CLRWDT
0059:  NOP
005A:  NOP
005B:  NOP
005C:  DECF   3B,F
005D:  GOTO   055
....................    output_low(SERVO); 
005E:  BSF    03.5
005F:  BCF    06.5
0060:  BCF    03.5
0061:  BCF    06.5
.................... } 
....................  
.................... //////////////////////////////////////////////////////////////////////////////// 
0062:  BCF    0C.1
0063:  BCF    0A.3
0064:  GOTO   022
.................... short int IRcheck()                 // potvrdi detekci cihly 
.................... { 
....................    output_high(IRTX);               // vypne vysilac IR 
....................    delay_ms(100); 
....................  
....................    output_low(STROBE); 
....................    sensors = spi_read(0);         // cteni senzoru 
....................    sensors=~sensors; 
....................    output_high(STROBE); 
....................  
....................    if(true==bit_test(sensors,7))    // otestuje, jestli je stale detekovan IR signal 
....................    { 
....................       output_low(IRTX);             // zapne vysilac IR 
....................       delay_ms(100); 
....................  
....................       output_low(STROBE); 
....................       sensors = spi_read(0);         // cteni senzoru 
....................       sensors=~sensors; 
....................       output_high(STROBE); 
....................  
....................       if(false==bit_test(sensors,7))      // otestuje, jestli je detekovana cihla 
....................       { 
....................          output_high(IRTX);            // vypne vysilac IR 
....................          delay_ms(100); 
....................  
....................          output_low(STROBE); 
....................          sensors = spi_read(0);         // cteni senzoru 
....................          sensors=~sensors; 
....................          output_high(STROBE); 
....................  
....................          output_low(IRTX);             // zapne vysilac IR 
....................          if(bit_test(sensors,7)) return 1; // vrat 1, kdyz je stale cihla 
....................       } 
....................    }; 
....................    output_low(IRTX);             // zapne vysilac IR 
....................    return 0; // vrat 0, kdyz je detekovano ruseni 
.................... } 
.................... //////////////////////////////////////////////////////////////////////////////// 
.................... #include ".\objizdka_centrovani.c" 
.................... #define  DOLEVA   0 
.................... #define  DOPRAVA  1 
....................  
.................... void cikcak() 
.................... { 
.................... unsigned int8 i; 
....................  
....................    uhel=KOLMO1; 
*
007D:  MOVLW  E1
007E:  MOVWF  2C
....................    Delay_ms(100); 
007F:  MOVLW  64
0080:  MOVWF  3A
0081:  CALL   065
....................    if (line==L2) line=L3; 
0082:  MOVF   2B,W
0083:  SUBLW  02
0084:  BTFSS  03.2
0085:  GOTO   088
0086:  MOVLW  03
0087:  MOVWF  2B
....................    if (line==S) line=L3; 
0088:  MOVF   2B,F
0089:  BTFSS  03.2
008A:  GOTO   08D
008B:  MOVLW  03
008C:  MOVWF  2B
....................    if (line==R2) line=R3; 
008D:  MOVF   2B,W
008E:  SUBLW  FE
008F:  BTFSS  03.2
0090:  GOTO   093
0091:  MOVLW  FD
0092:  MOVWF  2B
....................  
....................    Delay_ms(3); 
0093:  MOVLW  03
0094:  MOVWF  3A
0095:  CALL   065
....................  
....................    output_low(STROBE);              // vypni zobrazovani na posuvnem registru    
0096:  BSF    03.5
0097:  BCF    06.0
0098:  BCF    03.5
0099:  BCF    06.0
....................    sensors = spi_read(0);           // cteni senzoru 
009A:  MOVF   13,W
009B:  CLRF   13
009C:  BSF    03.5
009D:  BTFSC  14.0
009E:  GOTO   0A1
009F:  BCF    03.5
00A0:  GOTO   09C
00A1:  BCF    03.5
00A2:  MOVF   13,W
00A3:  MOVWF  2A
....................    sensors=~sensors; 
00A4:  COMF   2A,F
....................    output_high(STROBE);             // vypni zobrazovani na posuvnem registru 
00A5:  BSF    03.5
00A6:  BCF    06.0
00A7:  BCF    03.5
00A8:  BSF    06.0
....................  
....................    while(!bit_test(sensors,3)) 
....................    { 
00A9:  BTFSC  2A.3
00AA:  GOTO   171
....................       while(true) 
....................       { 
....................          Delay_ms(3); 
00AB:  MOVLW  03
00AC:  MOVWF  3A
00AD:  CALL   065
....................        
....................          if (line==L3) 
00AE:  MOVF   2B,W
00AF:  SUBLW  03
00B0:  BTFSS  03.2
00B1:  GOTO   0DC
....................          { 
....................             GO(L,B,160);GO(R,F,160); 
00B2:  MOVF   01,W
00B3:  SUBLW  A0
00B4:  BTFSS  03.0
00B5:  GOTO   0BF
00B6:  BSF    03.5
00B7:  BCF    05.0
00B8:  BCF    03.5
00B9:  BCF    05.0
00BA:  BSF    03.5
00BB:  BCF    05.1
00BC:  BCF    03.5
00BD:  BSF    05.1
00BE:  GOTO   0C7
00BF:  BSF    03.5
00C0:  BCF    05.0
00C1:  BCF    03.5
00C2:  BCF    05.0
00C3:  BSF    03.5
00C4:  BCF    05.1
00C5:  BCF    03.5
00C6:  BCF    05.1
00C7:  MOVF   01,W
00C8:  SUBLW  A0
00C9:  BTFSS  03.0
00CA:  GOTO   0D4
00CB:  BSF    03.5
00CC:  BCF    05.7
00CD:  BCF    03.5
00CE:  BCF    05.7
00CF:  BSF    03.5
00D0:  BCF    05.6
00D1:  BCF    03.5
00D2:  BSF    05.6
00D3:  GOTO   0DC
00D4:  BSF    03.5
00D5:  BCF    05.6
00D6:  BCF    03.5
00D7:  BCF    05.6
00D8:  BSF    03.5
00D9:  BCF    05.7
00DA:  BCF    03.5
00DB:  BCF    05.7
....................          }; 
....................          if (line==R3) 
00DC:  MOVF   2B,W
00DD:  SUBLW  FD
00DE:  BTFSS  03.2
00DF:  GOTO   10A
....................          { 
....................             GO(R,B,160);GO(L,F,160);    
00E0:  MOVF   01,W
00E1:  SUBLW  A0
00E2:  BTFSS  03.0
00E3:  GOTO   0ED
00E4:  BSF    03.5
00E5:  BCF    05.6
00E6:  BCF    03.5
00E7:  BCF    05.6
00E8:  BSF    03.5
00E9:  BCF    05.7
00EA:  BCF    03.5
00EB:  BSF    05.7
00EC:  GOTO   0F5
00ED:  BSF    03.5
00EE:  BCF    05.6
00EF:  BCF    03.5
00F0:  BCF    05.6
00F1:  BSF    03.5
00F2:  BCF    05.7
00F3:  BCF    03.5
00F4:  BCF    05.7
00F5:  MOVF   01,W
00F6:  SUBLW  A0
00F7:  BTFSS  03.0
00F8:  GOTO   102
00F9:  BSF    03.5
00FA:  BCF    05.1
00FB:  BCF    03.5
00FC:  BCF    05.1
00FD:  BSF    03.5
00FE:  BCF    05.0
00FF:  BCF    03.5
0100:  BSF    05.0
0101:  GOTO   10A
0102:  BSF    03.5
0103:  BCF    05.0
0104:  BCF    03.5
0105:  BCF    05.0
0106:  BSF    03.5
0107:  BCF    05.1
0108:  BCF    03.5
0109:  BCF    05.1
....................          }; 
....................          if (line==S) {STOPL;STOPR; i++;} 
010A:  MOVF   2B,F
010B:  BTFSS  03.2
010C:  GOTO   11F
010D:  BSF    03.5
010E:  BCF    05.0
010F:  BCF    03.5
0110:  BCF    05.0
0111:  BSF    03.5
0112:  BCF    05.1
0113:  BCF    03.5
0114:  BCF    05.1
0115:  BSF    03.5
0116:  BCF    05.6
0117:  BCF    03.5
0118:  BCF    05.6
0119:  BSF    03.5
011A:  BCF    05.7
011B:  BCF    03.5
011C:  BCF    05.7
011D:  INCF   39,F
....................          else i=0; 
011E:  GOTO   120
011F:  CLRF   39
....................           
....................          if (i>=100) break; 
0120:  MOVF   39,W
0121:  SUBLW  63
0122:  BTFSS  03.0
0123:  GOTO   15A
....................           
....................          output_low(STROBE);              // vypni zobrazovani na posuvnem registru    
0124:  BSF    03.5
0125:  BCF    06.0
0126:  BCF    03.5
0127:  BCF    06.0
....................          sensors = spi_read(0);         // cteni senzoru 
0128:  MOVF   13,W
0129:  CLRF   13
012A:  BSF    03.5
012B:  BTFSC  14.0
012C:  GOTO   12F
012D:  BCF    03.5
012E:  GOTO   12A
012F:  BCF    03.5
0130:  MOVF   13,W
0131:  MOVWF  2A
....................          sensors=~sensors; 
0132:  COMF   2A,F
....................          output_high(STROBE);              // vypni zobrazovani na posuvnem registru 
0133:  BSF    03.5
0134:  BCF    06.0
0135:  BCF    03.5
0136:  BSF    06.0
....................           
....................          if(bit_test(sensors,3)) //...|...// 
0137:  BTFSS  2A.3
0138:  GOTO   13B
....................          { 
....................             line=S; 
0139:  CLRF   2B
....................             continue; 
013A:  GOTO   0AB
....................          } 
....................     
....................          if(bit_test(sensors,0)) //|......//     // z duvodu zkraceni doby reakce se cidla nevyhodnocuji poporade ale od krajnich k prostrednimu 
013B:  BTFSS  2A.0
013C:  GOTO   140
....................          { 
....................             line=L3; 
013D:  MOVLW  03
013E:  MOVWF  2B
....................             continue; 
013F:  GOTO   0AB
....................          } 
....................     
....................          if(bit_test(sensors,6)) //......|// 
0140:  BTFSS  2A.6
0141:  GOTO   145
....................          { 
....................             line=R3; 
0142:  MOVLW  FD
0143:  MOVWF  2B
....................             continue; 
0144:  GOTO   0AB
....................          } 
....................     
....................          if(bit_test(sensors,1)) //.|.....// 
0145:  BTFSS  2A.1
0146:  GOTO   14A
....................          { 
....................             line=L3; 
0147:  MOVLW  03
0148:  MOVWF  2B
....................             continue; 
0149:  GOTO   0AB
....................          } 
....................     
....................          if(bit_test(sensors,5)) //.....|.// 
014A:  BTFSS  2A.5
014B:  GOTO   14F
....................          { 
....................             line=R3; 
014C:  MOVLW  FD
014D:  MOVWF  2B
....................             continue; 
014E:  GOTO   0AB
....................          } 
....................     
....................          if (bit_test(sensors,2)) //..|....// 
014F:  BTFSS  2A.2
0150:  GOTO   154
....................          { 
....................             line=L3; 
0151:  MOVLW  03
0152:  MOVWF  2B
....................             continue; 
0153:  GOTO   0AB
....................          } 
....................     
....................          if (bit_test(sensors,4)) //....|..// 
0154:  BTFSS  2A.4
0155:  GOTO   159
....................          { 
....................             line=R3; 
0156:  MOVLW  FD
0157:  MOVWF  2B
....................             continue; 
0158:  GOTO   0AB
....................          } 
....................       } 
0159:  GOTO   0AB
....................       delay_ms(100); 
015A:  MOVLW  64
015B:  MOVWF  3A
015C:  CALL   065
....................  
....................       output_low(STROBE);              // vypni zobrazovani na posuvnem registru    
015D:  BSF    03.5
015E:  BCF    06.0
015F:  BCF    03.5
0160:  BCF    06.0
....................       sensors = spi_read(0);         // cteni senzoru 
0161:  MOVF   13,W
0162:  CLRF   13
0163:  BSF    03.5
0164:  BTFSC  14.0
0165:  GOTO   168
0166:  BCF    03.5
0167:  GOTO   163
0168:  BCF    03.5
0169:  MOVF   13,W
016A:  MOVWF  2A
....................       sensors=~sensors; 
016B:  COMF   2A,F
....................       output_high(STROBE);              // vypni zobrazovani na posuvnem registru 
016C:  BSF    03.5
016D:  BCF    06.0
016E:  BCF    03.5
016F:  BSF    06.0
....................    }    
0170:  GOTO   0A9
.................... } 
0171:  RETLW  00
....................  
.................... /* 
.................... void cikcak() 
.................... { 
.................... short int movement; 
.................... unsigned int8 n,i=0; 
....................  
....................    if(uhel>=STRED) 
....................    { 
....................       uhel=KOLMO1; 
....................       Delay_ms(100); 
....................    } 
....................  
....................    if(uhel<=STRED) 
....................    { 
....................       uhel=KOLMO2; 
....................       Delay_ms(100); 
....................    } 
....................  
....................  
....................    sensors = spi_read(0);         // cteni senzoru 
....................    sensors=~sensors; 
....................    Delay_ms(5); 
....................     
.................... if ((sensors & 0b11100000)!=0) movement=DOPRAVA; 
....................  
....................    while(i<=100) 
....................    { 
....................       while(!bit_test(sensors,3)) 
....................       { 
....................          if(DOPRAVA == movement) 
....................          { 
....................             FR;BL; 
....................             movement=DOLEVA; 
....................             n=0; 
.................... //if ((sensors & 0b11100000)!=0) line=L1; 
.................... //if ((sensors & 0b00001110)!=0) line=R1; 
.................... //if ((sensors & 0b00010000)!=0) line=S; 
....................  
....................             for(n=0; n<=100; n++) 
....................             { 
....................                sensors = spi_read(0);         // cteni senzoru 
....................                sensors=~sensors; 
....................                Delay_ms(5);                     // cekani na SLAVE nez pripravi data od cidel 
....................                if(bit_test(sensors,3)) break; 
....................                else i=0; 
....................             } 
....................             STOPL;STOPR; 
....................          } 
....................  
....................          if(DOLEVA == movement) 
....................          { 
....................             FL;BR; 
....................             movement=DOPRAVA; 
....................             n=0; 
....................  
....................             for(n=0; n<=100; n++) 
....................             { 
....................                sensors = spi_read(0); 
....................                sensors =~ sensors; 
....................                Delay_ms(5); 
....................                if(bit_test(sensors,3)) break; 
....................                else i=0; 
....................             } 
....................             STOPL;STOPR; 
....................          } 
....................          sensors = spi_read(0);         // cteni senzoru 
....................          sensors=~sensors; 
....................          Delay_ms(5); 
....................       } 
....................       i++; 
....................    } 
.................... } 
.................... */ 
.................... //////////////////////////////////////////////////////////////////////////////// 
.................... void objizdka() 
.................... { 
....................    BL;FR; 
0172:  BSF    03.5
0173:  BCF    05.0
0174:  BCF    03.5
0175:  BCF    05.0
0176:  BSF    03.5
0177:  BCF    05.1
0178:  BCF    03.5
0179:  BSF    05.1
017A:  BSF    03.5
017B:  BCF    05.7
017C:  BCF    03.5
017D:  BCF    05.7
017E:  BSF    03.5
017F:  BCF    05.6
0180:  BCF    03.5
0181:  BSF    05.6
....................    Delay_ms(300); 
0182:  MOVLW  02
0183:  MOVWF  39
0184:  MOVLW  96
0185:  MOVWF  3A
0186:  CALL   065
0187:  DECFSZ 39,F
0188:  GOTO   184
....................    FL;BR; 
0189:  BSF    03.5
018A:  BCF    05.1
018B:  BCF    03.5
018C:  BCF    05.1
018D:  BSF    03.5
018E:  BCF    05.0
018F:  BCF    03.5
0190:  BSF    05.0
0191:  BSF    03.5
0192:  BCF    05.6
0193:  BCF    03.5
0194:  BCF    05.6
0195:  BSF    03.5
0196:  BCF    05.7
0197:  BCF    03.5
0198:  BSF    05.7
....................    Delay_ms(100); 
0199:  MOVLW  64
019A:  MOVWF  3A
019B:  CALL   065
....................    STOPL;STOPR; 
019C:  BSF    03.5
019D:  BCF    05.0
019E:  BCF    03.5
019F:  BCF    05.0
01A0:  BSF    03.5
01A1:  BCF    05.1
01A2:  BCF    03.5
01A3:  BCF    05.1
01A4:  BSF    03.5
01A5:  BCF    05.6
01A6:  BCF    03.5
01A7:  BCF    05.6
01A8:  BSF    03.5
01A9:  BCF    05.7
01AA:  BCF    03.5
01AB:  BCF    05.7
....................     
....................    uhel=STRED; 
01AC:  MOVLW  80
01AD:  MOVWF  2C
....................    FL;FR; 
01AE:  BSF    03.5
01AF:  BCF    05.1
01B0:  BCF    03.5
01B1:  BCF    05.1
01B2:  BSF    03.5
01B3:  BCF    05.0
01B4:  BCF    03.5
01B5:  BSF    05.0
01B6:  BSF    03.5
01B7:  BCF    05.7
01B8:  BCF    03.5
01B9:  BCF    05.7
01BA:  BSF    03.5
01BB:  BCF    05.6
01BC:  BCF    03.5
01BD:  BSF    05.6
....................    Delay_ms(500);       // rovne 
01BE:  MOVLW  02
01BF:  MOVWF  39
01C0:  MOVLW  FA
01C1:  MOVWF  3A
01C2:  CALL   065
01C3:  DECFSZ 39,F
01C4:  GOTO   1C0
....................  
....................    uhel=STRED+55; 
01C5:  MOVLW  B7
01C6:  MOVWF  2C
....................    STOPR;FL; 
01C7:  BSF    03.5
01C8:  BCF    05.6
01C9:  BCF    03.5
01CA:  BCF    05.6
01CB:  BSF    03.5
01CC:  BCF    05.7
01CD:  BCF    03.5
01CE:  BCF    05.7
01CF:  BSF    03.5
01D0:  BCF    05.1
01D1:  BCF    03.5
01D2:  BCF    05.1
01D3:  BSF    03.5
01D4:  BCF    05.0
01D5:  BCF    03.5
01D6:  BSF    05.0
....................    Delay_ms(190);       // doprava 
01D7:  MOVLW  BE
01D8:  MOVWF  3A
01D9:  CALL   065
....................  
....................    uhel=STRED; 
01DA:  MOVLW  80
01DB:  MOVWF  2C
....................    FR;FL; 
01DC:  BSF    03.5
01DD:  BCF    05.7
01DE:  BCF    03.5
01DF:  BCF    05.7
01E0:  BSF    03.5
01E1:  BCF    05.6
01E2:  BCF    03.5
01E3:  BSF    05.6
01E4:  BSF    03.5
01E5:  BCF    05.1
01E6:  BCF    03.5
01E7:  BCF    05.1
01E8:  BSF    03.5
01E9:  BCF    05.0
01EA:  BCF    03.5
01EB:  BSF    05.0
....................    Delay_ms(500);       // rovne 
01EC:  MOVLW  02
01ED:  MOVWF  39
01EE:  MOVLW  FA
01EF:  MOVWF  3A
01F0:  CALL   065
01F1:  DECFSZ 39,F
01F2:  GOTO   1EE
....................  
....................    uhel=STRED+55; 
01F3:  MOVLW  B7
01F4:  MOVWF  2C
....................    FL;STOPR; 
01F5:  BSF    03.5
01F6:  BCF    05.1
01F7:  BCF    03.5
01F8:  BCF    05.1
01F9:  BSF    03.5
01FA:  BCF    05.0
01FB:  BCF    03.5
01FC:  BSF    05.0
01FD:  BSF    03.5
01FE:  BCF    05.6
01FF:  BCF    03.5
0200:  BCF    05.6
0201:  BSF    03.5
0202:  BCF    05.7
0203:  BCF    03.5
0204:  BCF    05.7
....................    Delay_ms(200);       // doprava 
0205:  MOVLW  C8
0206:  MOVWF  3A
0207:  CALL   065
....................  
....................    uhel=STRED; 
0208:  MOVLW  80
0209:  MOVWF  2C
....................    FR;FL; 
020A:  BSF    03.5
020B:  BCF    05.7
020C:  BCF    03.5
020D:  BCF    05.7
020E:  BSF    03.5
020F:  BCF    05.6
0210:  BCF    03.5
0211:  BSF    05.6
0212:  BSF    03.5
0213:  BCF    05.1
0214:  BCF    03.5
0215:  BCF    05.1
0216:  BSF    03.5
0217:  BCF    05.0
0218:  BCF    03.5
0219:  BSF    05.0
....................    Delay_ms(150);       // rovne 
021A:  MOVLW  96
021B:  MOVWF  3A
021C:  CALL   065
....................  
....................    While((sensors & 0b11111110)!=0) //dokud neni cara 
....................    { 
021D:  MOVF   2A,W
021E:  ANDLW  FE
021F:  BTFSC  03.2
0220:  GOTO   230
....................        sensors = spi_read(0);         // cteni senzoru 
0221:  MOVF   13,W
0222:  CLRF   13
0223:  BSF    03.5
0224:  BTFSC  14.0
0225:  GOTO   228
0226:  BCF    03.5
0227:  GOTO   223
0228:  BCF    03.5
0229:  MOVF   13,W
022A:  MOVWF  2A
....................        sensors=~sensors; 
022B:  COMF   2A,F
....................        Delay_ms(4);              // cekani na SLAVE nez pripravi data od cidel 
022C:  MOVLW  04
022D:  MOVWF  3A
022E:  CALL   065
....................    } 
022F:  GOTO   21D
....................    BL;BR; 
0230:  BSF    03.5
0231:  BCF    05.0
0232:  BCF    03.5
0233:  BCF    05.0
0234:  BSF    03.5
0235:  BCF    05.1
0236:  BCF    03.5
0237:  BSF    05.1
0238:  BSF    03.5
0239:  BCF    05.6
023A:  BCF    03.5
023B:  BCF    05.6
023C:  BSF    03.5
023D:  BCF    05.7
023E:  BCF    03.5
023F:  BSF    05.7
....................    Delay_ms(400); 
0240:  MOVLW  02
0241:  MOVWF  39
0242:  MOVLW  C8
0243:  MOVWF  3A
0244:  CALL   065
0245:  DECFSZ 39,F
0246:  GOTO   242
....................     
....................    uhel=STRED-55; 
0247:  MOVLW  49
0248:  MOVWF  2C
....................    FR;STOPL;         // doleva 
0249:  BSF    03.5
024A:  BCF    05.7
024B:  BCF    03.5
024C:  BCF    05.7
024D:  BSF    03.5
024E:  BCF    05.6
024F:  BCF    03.5
0250:  BSF    05.6
0251:  BSF    03.5
0252:  BCF    05.0
0253:  BCF    03.5
0254:  BCF    05.0
0255:  BSF    03.5
0256:  BCF    05.1
0257:  BCF    03.5
0258:  BCF    05.1
....................    delay_ms(250); 
0259:  MOVLW  FA
025A:  MOVWF  3A
025B:  CALL   065
....................     
....................    line=L3; 
025C:  MOVLW  03
025D:  MOVWF  2B
....................    cikcak(); 
025E:  CALL   07D
.................... } 
025F:  BCF    0A.3
0260:  GOTO   3D2 (RETURN)
....................   
....................  
.................... //////////////////////////////////////////////////////////////////////////////// 
.................... void main() 
.................... { 
0261:  CLRF   04
0262:  MOVLW  1F
0263:  ANDWF  03,F
0264:  MOVLW  70
0265:  BSF    03.5
0266:  MOVWF  0F
0267:  BCF    1F.4
0268:  BCF    1F.5
0269:  MOVF   1B,W
026A:  ANDLW  80
026B:  MOVWF  1B
026C:  MOVLW  07
026D:  MOVWF  1C
....................  
....................    unsigned int8 n; 
....................    unsigned int8 i,j; 
....................    unsigned int8 last_sensors; 
....................    unsigned int8 RozumnaRychlost; 
....................  
....................    setup_adc_ports(sAN5|sAN2|sAN4|sAN6|VSS_VDD); // AD pro kroutitka 
*
0270:  BSF    03.5
0271:  BCF    1F.4
0272:  BCF    1F.5
0273:  MOVF   1B,W
0274:  ANDLW  80
0275:  IORLW  74
0276:  MOVWF  1B
....................    setup_adc(ADC_CLOCK_INTERNAL); 
0277:  BCF    1F.6
0278:  BCF    03.5
0279:  BSF    1F.6
027A:  BSF    1F.7
027B:  BSF    03.5
027C:  BCF    1F.7
027D:  BCF    03.5
027E:  BSF    1F.0
....................    setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_XMIT_L_TO_H|SPI_CLK_DIV_16); 
027F:  BCF    14.5
0280:  BSF    03.5
0281:  BCF    06.2
0282:  BSF    06.1
0283:  BCF    06.4
0284:  MOVLW  31
0285:  BCF    03.5
0286:  MOVWF  14
0287:  MOVLW  00
0288:  BSF    03.5
0289:  MOVWF  14
....................    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); 
028A:  MOVF   01,W
028B:  ANDLW  C7
028C:  IORLW  08
028D:  MOVWF  01
....................    setup_timer_1(T1_DISABLED|T1_DIV_BY_8); 
028E:  MOVLW  30
028F:  BCF    03.5
0290:  MOVWF  10
....................    setup_timer_2(T2_DIV_BY_16,140,16); 
0291:  MOVLW  78
0292:  MOVWF  78
0293:  IORLW  06
0294:  MOVWF  12
0295:  MOVLW  8C
0296:  BSF    03.5
0297:  MOVWF  12
....................    setup_oscillator(OSC_8MHZ|OSC_INTRC); 
0298:  MOVLW  72
0299:  MOVWF  0F
....................  
....................    STOPR; STOPL;  // zastav motory 
029A:  BCF    05.6
029B:  BCF    03.5
029C:  BCF    05.6
029D:  BSF    03.5
029E:  BCF    05.7
029F:  BCF    03.5
02A0:  BCF    05.7
02A1:  BSF    03.5
02A2:  BCF    05.0
02A3:  BCF    03.5
02A4:  BCF    05.0
02A5:  BSF    03.5
02A6:  BCF    05.1
02A7:  BCF    03.5
02A8:  BCF    05.1
....................    Lmotor=0;Rmotor=0; 
02A9:  CLRF   31
02AA:  CLRF   30
02AB:  CLRF   33
02AC:  CLRF   32
....................  
....................    uhel = STRED;    // nastav zadni kolecko na stred 
02AD:  MOVLW  80
02AE:  MOVWF  2C
....................    rovinka = 0; 
02AF:  CLRF   2F
....................  
....................    enable_interrupts(INT_TIMER2); 
02B0:  BSF    03.5
02B1:  BSF    0C.1
....................    enable_interrupts(GLOBAL); 
02B2:  MOVLW  C0
02B3:  BCF    03.5
02B4:  IORWF  0B,F
....................  
....................    output_low(IRTX); // zapni IR vysilac 
02B5:  BSF    03.5
02B6:  BCF    06.2
02B7:  BCF    03.5
02B8:  BCF    06.2
....................  
....................    delay_ms(2000); // musime pockat na diagnostiku slave CPU 
02B9:  MOVLW  08
02BA:  MOVWF  39
02BB:  MOVLW  FA
02BC:  MOVWF  3A
02BD:  CALL   065
02BE:  DECFSZ 39,F
02BF:  GOTO   2BB
....................  
....................    //nastaveni rychlosti 
....................    set_adc_channel(CERVENA); 
02C0:  MOVLW  20
02C1:  MOVWF  78
02C2:  MOVF   1F,W
02C3:  ANDLW  C7
02C4:  IORWF  78,W
02C5:  MOVWF  1F
....................  
....................    Delay_ms(1); 
02C6:  MOVLW  01
02C7:  MOVWF  3A
02C8:  CALL   065
....................    speed=R+(read_adc()>>2); // rychlost rovne +63; kroutitko dava 0-63 
02C9:  BSF    1F.2
02CA:  BTFSC  1F.2
02CB:  GOTO   2CA
02CC:  MOVF   1E,W
02CD:  MOVWF  77
02CE:  RRF    77,F
02CF:  RRF    77,F
02D0:  MOVLW  3F
02D1:  ANDWF  77,F
02D2:  MOVF   77,W
02D3:  ADDLW  64
02D4:  MOVWF  2D
....................    set_adc_channel(MODRA); 
02D5:  MOVLW  10
02D6:  MOVWF  78
02D7:  MOVF   1F,W
02D8:  ANDLW  C7
02D9:  IORWF  78,W
02DA:  MOVWF  1F
....................    Delay_ms(1); 
02DB:  MOVLW  01
02DC:  MOVWF  3A
02DD:  CALL   065
....................    turn=speed-32+(read_adc()>>2);  // rychlost toceni +-32; kroutitko dava 0-63 
02DE:  MOVLW  20
02DF:  SUBWF  2D,W
02E0:  MOVWF  39
02E1:  BSF    1F.2
02E2:  BTFSC  1F.2
02E3:  GOTO   2E2
02E4:  MOVF   1E,W
02E5:  MOVWF  77
02E6:  RRF    77,F
02E7:  RRF    77,F
02E8:  MOVLW  3F
02E9:  ANDWF  77,F
02EA:  MOVF   77,W
02EB:  ADDWF  39,W
02EC:  MOVWF  2E
....................  
....................    RozumnaRychlost=speed; 
02ED:  MOVF   2D,W
02EE:  MOVWF  38
....................     
....................    while(true) 
....................    { 
....................  
....................       GO(L,F,Lmotor);GO(R,F,Rmotor);   // zapni motory PWM podle promenych Lmotor a Rmotor 
02EF:  MOVF   01,W
02F0:  BTFSS  00.7
02F1:  GOTO   2F5
02F2:  BTFSS  31.7
02F3:  GOTO   2FD
02F4:  GOTO   2F7
02F5:  BTFSC  31.7
02F6:  GOTO   306
02F7:  MOVF   31,F
02F8:  BTFSS  03.2
02F9:  GOTO   2FD
02FA:  SUBWF  30,W
02FB:  BTFSS  03.0
02FC:  GOTO   306
02FD:  BSF    03.5
02FE:  BCF    05.1
02FF:  BCF    03.5
0300:  BCF    05.1
0301:  BSF    03.5
0302:  BCF    05.0
0303:  BCF    03.5
0304:  BSF    05.0
0305:  GOTO   30E
0306:  BSF    03.5
0307:  BCF    05.0
0308:  BCF    03.5
0309:  BCF    05.0
030A:  BSF    03.5
030B:  BCF    05.1
030C:  BCF    03.5
030D:  BCF    05.1
030E:  MOVF   01,W
030F:  BTFSS  00.7
0310:  GOTO   314
0311:  BTFSS  33.7
0312:  GOTO   31C
0313:  GOTO   316
0314:  BTFSC  33.7
0315:  GOTO   325
0316:  MOVF   33,F
0317:  BTFSS  03.2
0318:  GOTO   31C
0319:  SUBWF  32,W
031A:  BTFSS  03.0
031B:  GOTO   325
031C:  BSF    03.5
031D:  BCF    05.7
031E:  BCF    03.5
031F:  BCF    05.7
0320:  BSF    03.5
0321:  BCF    05.6
0322:  BCF    03.5
0323:  BSF    05.6
0324:  GOTO   32D
0325:  BSF    03.5
0326:  BCF    05.6
0327:  BCF    03.5
0328:  BCF    05.6
0329:  BSF    03.5
032A:  BCF    05.7
032B:  BCF    03.5
032C:  BCF    05.7
....................  
....................       delay_us(2000);                  // cekani na SLAVE, nez pripravi data od cidel 
032D:  CLRWDT
032E:  MOVLW  01
032F:  MOVWF  3A
0330:  CALL   065
0331:  MOVLW  09
0332:  MOVWF  39
0333:  CLRF   29
0334:  BTFSC  0B.7
0335:  BSF    29.7
0336:  BCF    0B.7
0337:  MOVLW  6D
0338:  MOVWF  3D
0339:  CALL   037
033A:  BTFSC  29.7
033B:  BSF    0B.7
033C:  DECFSZ 39,F
033D:  GOTO   333
....................  
....................       last_sensors=sensors; 
033E:  MOVF   2A,W
033F:  MOVWF  37
....................  
....................       output_low(STROBE);              // vypni zobrazovani na posuvnem registru 
0340:  BSF    03.5
0341:  BCF    06.0
0342:  BCF    03.5
0343:  BCF    06.0
....................       sensors = spi_read(0);           // cteni senzoru 
0344:  MOVF   13,W
0345:  CLRF   13
0346:  BSF    03.5
0347:  BTFSC  14.0
0348:  GOTO   34B
0349:  BCF    03.5
034A:  GOTO   346
034B:  BCF    03.5
034C:  MOVF   13,W
034D:  MOVWF  2A
....................       sensors=~sensors;                // neguj prijata data 
034E:  COMF   2A,F
....................       output_high(STROBE);       // zobraz data na posuvnem registru 
034F:  BSF    03.5
0350:  BCF    06.0
0351:  BCF    03.5
0352:  BSF    06.0
....................  
....................       i=0;                       // havarijni kod 
0353:  CLRF   35
....................       for (n=0; n<=6; n++) 
0354:  CLRF   34
0355:  MOVF   34,W
0356:  SUBLW  06
0357:  BTFSS  03.0
0358:  GOTO   367
....................       { 
....................          if(bit_test(sensors,n)) i++; 
0359:  MOVF   2A,W
035A:  MOVWF  77
035B:  MOVF   34,W
035C:  MOVWF  78
035D:  BTFSC  03.2
035E:  GOTO   363
035F:  BCF    03.0
0360:  RRF    77,F
0361:  DECFSZ 78,F
0362:  GOTO   35F
0363:  BTFSC  77.0
0364:  INCF   35,F
....................       } 
0365:  INCF   34,F
0366:  GOTO   355
....................       if (i>3) // zastavi, kdyz je cerno pod vice nez tremi cidly 
0367:  MOVF   35,W
0368:  SUBLW  03
0369:  BTFSC  03.0
036A:  GOTO   393
....................       { 
....................          BL; BR; 
036B:  BSF    03.5
036C:  BCF    05.0
036D:  BCF    03.5
036E:  BCF    05.0
036F:  BSF    03.5
0370:  BCF    05.1
0371:  BCF    03.5
0372:  BSF    05.1
0373:  BSF    03.5
0374:  BCF    05.6
0375:  BCF    03.5
0376:  BCF    05.6
0377:  BSF    03.5
0378:  BCF    05.7
0379:  BCF    03.5
037A:  BSF    05.7
....................          delay_ms(300); 
037B:  MOVLW  02
037C:  MOVWF  39
037D:  MOVLW  96
037E:  MOVWF  3A
037F:  CALL   065
0380:  DECFSZ 39,F
0381:  GOTO   37D
....................          STOPR; STOPL; 
0382:  BSF    03.5
0383:  BCF    05.6
0384:  BCF    03.5
0385:  BCF    05.6
0386:  BSF    03.5
0387:  BCF    05.7
0388:  BCF    03.5
0389:  BCF    05.7
038A:  BSF    03.5
038B:  BCF    05.0
038C:  BCF    03.5
038D:  BCF    05.0
038E:  BSF    03.5
038F:  BCF    05.1
0390:  BCF    03.5
0391:  BCF    05.1
....................          While(true); 
0392:  GOTO   392
....................       }; 
....................  
....................       if (!input(CIHLA))      // dalkova detekce cihly 
0393:  BSF    03.5
0394:  BSF    05.3
0395:  BCF    03.5
0396:  BTFSC  05.3
0397:  GOTO   39B
....................       { 
....................          speed=100; 
0398:  MOVLW  64
0399:  MOVWF  2D
....................       } 
....................       else 
039A:  GOTO   39D
....................       { 
....................          speed=RozumnaRychlost; 
039B:  MOVF   38,W
039C:  MOVWF  2D
....................       } 
....................        
....................       if (bit_test(sensors,7))    // detekce cihly 
039D:  BTFSS  2A.7
039E:  GOTO   3D2
....................       { 
....................          BR;BL; 
039F:  BSF    03.5
03A0:  BCF    05.6
03A1:  BCF    03.5
03A2:  BCF    05.6
03A3:  BSF    03.5
03A4:  BCF    05.7
03A5:  BCF    03.5
03A6:  BSF    05.7
03A7:  BSF    03.5
03A8:  BCF    05.0
03A9:  BCF    03.5
03AA:  BCF    05.0
03AB:  BSF    03.5
03AC:  BCF    05.1
03AD:  BCF    03.5
03AE:  BSF    05.1
....................          Delay_ms(400); 
03AF:  MOVLW  02
03B0:  MOVWF  39
03B1:  MOVLW  C8
03B2:  MOVWF  3A
03B3:  CALL   065
03B4:  DECFSZ 39,F
03B5:  GOTO   3B1
....................          STOPR;STOPL; 
03B6:  BSF    03.5
03B7:  BCF    05.6
03B8:  BCF    03.5
03B9:  BCF    05.6
03BA:  BSF    03.5
03BB:  BCF    05.7
03BC:  BCF    03.5
03BD:  BCF    05.7
03BE:  BSF    03.5
03BF:  BCF    05.0
03C0:  BCF    03.5
03C1:  BCF    05.0
03C2:  BSF    03.5
03C3:  BCF    05.1
03C4:  BCF    03.5
03C5:  BCF    05.1
....................          Delay_ms(100); 
03C6:  MOVLW  64
03C7:  MOVWF  3A
03C8:  CALL   065
....................          cikcak(); 
03C9:  CALL   07D
....................          delay_ms(500); 
03CA:  MOVLW  02
03CB:  MOVWF  39
03CC:  MOVLW  FA
03CD:  MOVWF  3A
03CE:  CALL   065
03CF:  DECFSZ 39,F
03D0:  GOTO   3CC
....................          objizdka();       // objede cihlu 
03D1:  GOTO   172
....................       } 
....................  
....................  
....................       if(bit_test(sensors,3)) //...|...// 
03D2:  BTFSS  2A.3
03D3:  GOTO   3E6
....................       { 
....................          uhel=STRED; 
03D4:  MOVLW  80
03D5:  MOVWF  2C
....................          Lmotor=speed; 
03D6:  CLRF   7A
03D7:  MOVF   2D,W
03D8:  MOVWF  30
03D9:  MOVF   7A,W
03DA:  MOVWF  31
....................          Rmotor=speed; 
03DB:  CLRF   7A
03DC:  MOVF   2D,W
03DD:  MOVWF  32
03DE:  MOVF   7A,W
03DF:  MOVWF  33
....................          line=S; 
03E0:  CLRF   2B
....................          if (rovinka < 255) rovinka++; 
03E1:  INCFSZ 2F,W
03E2:  GOTO   3E4
03E3:  GOTO   3E5
03E4:  INCF   2F,F
.................... //         if (speed > R) speed--; 
....................          continue; 
03E5:  GOTO   2EF
....................       } 
....................  
....................       if(bit_test(sensors,0)) //|......//     // z duvodu zkraceni doby reakce se cidla nevyhodnocuji poporade ale od krajnich k prostrednimu 
03E6:  BTFSS  2A.0
03E7:  GOTO   3F4
....................       { 
....................          uhel=STRED - BEAR3; 
03E8:  MOVLW  53
03E9:  MOVWF  2C
....................          Lmotor=0; 
03EA:  CLRF   31
03EB:  CLRF   30
....................          Rmotor=turn; 
03EC:  CLRF   7A
03ED:  MOVF   2E,W
03EE:  MOVWF  32
03EF:  MOVF   7A,W
03F0:  MOVWF  33
....................          line=L3; 
03F1:  MOVLW  03
03F2:  MOVWF  2B
.................... //         if (speed > R) speed--; 
....................          continue; 
03F3:  GOTO   2EF
....................       } 
....................  
....................       if(bit_test(sensors,6)) //......|// 
03F4:  BTFSS  2A.6
03F5:  GOTO   402
....................       { 
....................          uhel=STRED + BEAR3; 
03F6:  MOVLW  AD
03F7:  MOVWF  2C
....................          Rmotor=0; 
03F8:  CLRF   33
03F9:  CLRF   32
....................          Lmotor=turn; 
03FA:  CLRF   7A
03FB:  MOVF   2E,W
03FC:  MOVWF  30
03FD:  MOVF   7A,W
03FE:  MOVWF  31
....................          line=R3; 
03FF:  MOVLW  FD
0400:  MOVWF  2B
.................... //         if (speed > R) speed--; 
....................          continue; 
0401:  GOTO   2EF
....................       } 
....................  
....................       if(bit_test(sensors,1)) //.|.....// 
0402:  BTFSS  2A.1
0403:  GOTO   414
....................       { 
....................          uhel=STRED - BEAR2; 
0404:  MOVLW  67
0405:  MOVWF  2C
....................          Lmotor=speed-50; 
0406:  MOVLW  32
0407:  SUBWF  2D,W
0408:  CLRF   7A
0409:  MOVWF  30
040A:  MOVF   7A,W
040B:  MOVWF  31
....................          Rmotor=speed; 
040C:  CLRF   7A
040D:  MOVF   2D,W
040E:  MOVWF  32
040F:  MOVF   7A,W
0410:  MOVWF  33
....................          line=L2; 
0411:  MOVLW  02
0412:  MOVWF  2B
.................... //         if (speed > R) speed--; 
....................          continue; 
0413:  GOTO   2EF
....................       } 
....................  
....................       if(bit_test(sensors,5)) //.....|.// 
0414:  BTFSS  2A.5
0415:  GOTO   426
....................       { 
....................          uhel=STRED + BEAR2; 
0416:  MOVLW  99
0417:  MOVWF  2C
....................          Rmotor=speed-50; 
0418:  MOVLW  32
0419:  SUBWF  2D,W
041A:  CLRF   7A
041B:  MOVWF  32
041C:  MOVF   7A,W
041D:  MOVWF  33
....................          Lmotor=speed; 
041E:  CLRF   7A
041F:  MOVF   2D,W
0420:  MOVWF  30
0421:  MOVF   7A,W
0422:  MOVWF  31
....................          line=R2; 
0423:  MOVLW  FE
0424:  MOVWF  2B
.................... //         if (speed > R) speed--; 
....................          continue; 
0425:  GOTO   2EF
....................       } 
....................  
....................       if (bit_test(sensors,2)) //..|....// 
0426:  BTFSS  2A.2
0427:  GOTO   43B
....................       { 
....................          uhel=STRED - BEAR1; 
0428:  MOVLW  76
0429:  MOVWF  2C
....................          Lmotor=speed; 
042A:  CLRF   7A
042B:  MOVF   2D,W
042C:  MOVWF  30
042D:  MOVF   7A,W
042E:  MOVWF  31
....................          Rmotor=speed; 
042F:  CLRF   7A
0430:  MOVF   2D,W
0431:  MOVWF  32
0432:  MOVF   7A,W
0433:  MOVWF  33
....................          line=L2; 
0434:  MOVLW  02
0435:  MOVWF  2B
....................          if (rovinka<255) rovinka++; 
0436:  INCFSZ 2F,W
0437:  GOTO   439
0438:  GOTO   43A
0439:  INCF   2F,F
.................... //         if (speed > R) speed--; 
....................          continue; 
043A:  GOTO   2EF
....................       } 
....................  
....................       if (bit_test(sensors,4)) //....|..// 
043B:  BTFSS  2A.4
043C:  GOTO   450
....................       { 
....................          uhel=STRED + BEAR1; 
043D:  MOVLW  8A
043E:  MOVWF  2C
....................          Rmotor=speed; 
043F:  CLRF   7A
0440:  MOVF   2D,W
0441:  MOVWF  32
0442:  MOVF   7A,W
0443:  MOVWF  33
....................          Lmotor=speed; 
0444:  CLRF   7A
0445:  MOVF   2D,W
0446:  MOVWF  30
0447:  MOVF   7A,W
0448:  MOVWF  31
....................          line=L2; 
0449:  MOVLW  02
044A:  MOVWF  2B
....................          if (rovinka<255) rovinka++; 
044B:  INCFSZ 2F,W
044C:  GOTO   44E
044D:  GOTO   44F
044E:  INCF   2F,F
.................... //         if (speed > R) speed--; 
....................          continue; 
044F:  GOTO   2EF
....................       } 
....................  
....................  
....................       if ((L3==line) || (R3==line)) // Brzdeni pri vyjeti z trate 
0450:  MOVF   2B,W
0451:  SUBLW  03
0452:  BTFSC  03.2
0453:  GOTO   458
0454:  MOVF   2B,W
0455:  SUBLW  FD
0456:  BTFSS  03.2
0457:  GOTO   47B
....................       { 
....................          if (rovinka>50) 
0458:  MOVF   2F,W
0459:  SUBLW  32
045A:  BTFSC  03.0
045B:  GOTO   47A
....................          { 
....................             BL; BR; 
045C:  BSF    03.5
045D:  BCF    05.0
045E:  BCF    03.5
045F:  BCF    05.0
0460:  BSF    03.5
0461:  BCF    05.1
0462:  BCF    03.5
0463:  BSF    05.1
0464:  BSF    03.5
0465:  BCF    05.6
0466:  BCF    03.5
0467:  BCF    05.6
0468:  BSF    03.5
0469:  BCF    05.7
046A:  BCF    03.5
046B:  BSF    05.7
....................             Delay_ms(100); 
046C:  MOVLW  64
046D:  MOVWF  3A
046E:  CALL   065
....................             if (rovinka > 250 || speed > 170) delay_ms(50); 
046F:  MOVF   2F,W
0470:  SUBLW  FA
0471:  BTFSS  03.0
0472:  GOTO   477
0473:  MOVF   2D,W
0474:  SUBLW  AA
0475:  BTFSC  03.0
0476:  GOTO   47A
0477:  MOVLW  32
0478:  MOVWF  3A
0479:  CALL   065
....................          }; 
....................          rovinka=0; 
047A:  CLRF   2F
.................... //         speed=R17; 
....................       }; 
....................    } 
047B:  GOTO   2EF
.................... } 
047C:  SLEEP

Configuration Fuses:
   Word  1: 3F38   NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC_IO
   Word  2: 3FFC   NOFCMEN NOIESO