Subversion Repositories svnkaklik

Rev

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

CCS PCM C Compiler, Version 3.245, 27853               12-V-06 23:56

               Filename: D:\KAKLIK\roboti\istrobot\3Orbis\vystava\main.lst

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

*
0000:  MOVLW  00
0001:  MOVWF  0A
0002:  GOTO   07D
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          // 3 stupne zataceni 
.................... #define  BEAR2       25 
.................... #define  BEAR3       45 
.................... #define  R           100         // Rozumna rychlost 
.................... #define  R17         200         // X nasobek rozumne rychlosti 
.................... #define  PRED_CIHLOU 100         // rychlost pri dalkove detekci cihly 
.................... #define  L2            2     // cara vlevo 
.................... #define  L3            3     // cara vlevo 
.................... #define  S             0     // cara mezi sensory 
.................... #define  R2           -2     // cara vpravo 
.................... #define  R3           -3     // cara vpravo 
....................  
.................... // servo 
.................... #define  SERVO PIN_B5 
....................  
.................... // kroutitka 
.................... #define  CERVENA  4  // AN4 
.................... #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 
....................  
.................... unsigned int8 sensors;        // pomocna promenna pro cteni cidel na caru 
.................... signed int8 line = S;         // na ktere strane byla detekovana cara 
*
008A:  BCF    03.5
008B:  CLRF   2B
.................... 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
.................... void main() 
.................... { 
*
007D:  CLRF   04
007E:  MOVLW  1F
007F:  ANDWF  03,F
0080:  MOVLW  70
0081:  BSF    03.5
0082:  MOVWF  0F
0083:  BCF    1F.4
0084:  BCF    1F.5
0085:  MOVF   1B,W
0086:  ANDLW  80
0087:  MOVWF  1B
0088:  MOVLW  07
0089:  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 
*
008C:  BSF    03.5
008D:  BCF    1F.4
008E:  BCF    1F.5
008F:  MOVF   1B,W
0090:  ANDLW  80
0091:  IORLW  74
0092:  MOVWF  1B
....................    setup_adc(ADC_CLOCK_INTERNAL); 
0093:  BCF    1F.6
0094:  BCF    03.5
0095:  BSF    1F.6
0096:  BSF    1F.7
0097:  BSF    03.5
0098:  BCF    1F.7
0099:  BCF    03.5
009A:  BSF    1F.0
....................    setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_XMIT_L_TO_H|SPI_CLK_DIV_16); 
009B:  BCF    14.5
009C:  BSF    03.5
009D:  BCF    06.2
009E:  BSF    06.1
009F:  BCF    06.4
00A0:  MOVLW  31
00A1:  BCF    03.5
00A2:  MOVWF  14
00A3:  MOVLW  00
00A4:  BSF    03.5
00A5:  MOVWF  14
....................    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); 
00A6:  MOVF   01,W
00A7:  ANDLW  C7
00A8:  IORLW  08
00A9:  MOVWF  01
....................    setup_timer_1(T1_DISABLED|T1_DIV_BY_8); 
00AA:  MOVLW  30
00AB:  BCF    03.5
00AC:  MOVWF  10
....................    setup_timer_2(T2_DIV_BY_16,140,16); 
00AD:  MOVLW  78
00AE:  MOVWF  78
00AF:  IORLW  06
00B0:  MOVWF  12
00B1:  MOVLW  8C
00B2:  BSF    03.5
00B3:  MOVWF  12
....................    setup_oscillator(OSC_8MHZ|OSC_INTRC); 
00B4:  MOVLW  72
00B5:  MOVWF  0F
....................  
....................    STOPR; STOPL;  // zastav motory 
00B6:  BCF    05.6
00B7:  BCF    03.5
00B8:  BCF    05.6
00B9:  BSF    03.5
00BA:  BCF    05.7
00BB:  BCF    03.5
00BC:  BCF    05.7
00BD:  BSF    03.5
00BE:  BCF    05.0
00BF:  BCF    03.5
00C0:  BCF    05.0
00C1:  BSF    03.5
00C2:  BCF    05.1
00C3:  BCF    03.5
00C4:  BCF    05.1
....................    Lmotor=0;Rmotor=0; 
00C5:  CLRF   31
00C6:  CLRF   30
00C7:  CLRF   33
00C8:  CLRF   32
....................  
....................    uhel = STRED;    // nastav zadni kolecko na stred 
00C9:  MOVLW  80
00CA:  MOVWF  2C
....................    rovinka = 0; 
00CB:  CLRF   2F
....................  
....................    enable_interrupts(INT_TIMER2); 
00CC:  BSF    03.5
00CD:  BSF    0C.1
....................    enable_interrupts(GLOBAL); 
00CE:  MOVLW  C0
00CF:  BCF    03.5
00D0:  IORWF  0B,F
....................  
....................    output_low(IRTX); // zapni IR vysilac 
00D1:  BSF    03.5
00D2:  BCF    06.2
00D3:  BCF    03.5
00D4:  BCF    06.2
....................  
....................    delay_ms(2000); // musime pockat na diagnostiku slave CPU 
00D5:  MOVLW  08
00D6:  MOVWF  39
00D7:  MOVLW  FA
00D8:  MOVWF  3A
00D9:  CALL   065
00DA:  DECFSZ 39,F
00DB:  GOTO   0D7
....................  
....................    //nastaveni rychlosti 
....................    set_adc_channel(CERVENA); 
00DC:  MOVLW  20
00DD:  MOVWF  78
00DE:  MOVF   1F,W
00DF:  ANDLW  C7
00E0:  IORWF  78,W
00E1:  MOVWF  1F
....................  
....................    Delay_ms(1); 
00E2:  MOVLW  01
00E3:  MOVWF  3A
00E4:  CALL   065
....................    speed=R+(read_adc()>>2); // rychlost rovne +63; kroutitko dava 0-63 
00E5:  BSF    1F.2
00E6:  BTFSC  1F.2
00E7:  GOTO   0E6
00E8:  MOVF   1E,W
00E9:  MOVWF  77
00EA:  RRF    77,F
00EB:  RRF    77,F
00EC:  MOVLW  3F
00ED:  ANDWF  77,F
00EE:  MOVF   77,W
00EF:  ADDLW  64
00F0:  MOVWF  2D
....................    set_adc_channel(MODRA); 
00F1:  MOVLW  10
00F2:  MOVWF  78
00F3:  MOVF   1F,W
00F4:  ANDLW  C7
00F5:  IORWF  78,W
00F6:  MOVWF  1F
....................    Delay_ms(1); 
00F7:  MOVLW  01
00F8:  MOVWF  3A
00F9:  CALL   065
....................    turn=speed-32+(read_adc()>>2);  // rychlost toceni +-32; kroutitko dava 0-63 
00FA:  MOVLW  20
00FB:  SUBWF  2D,W
00FC:  MOVWF  39
00FD:  BSF    1F.2
00FE:  BTFSC  1F.2
00FF:  GOTO   0FE
0100:  MOVF   1E,W
0101:  MOVWF  77
0102:  RRF    77,F
0103:  RRF    77,F
0104:  MOVLW  3F
0105:  ANDWF  77,F
0106:  MOVF   77,W
0107:  ADDWF  39,W
0108:  MOVWF  2E
....................  
....................  
....................    while(true) 
....................    { 
....................  
....................       GO(L,F,Lmotor);GO(R,F,Rmotor);   // zapni motory PWM podle promenych Lmotor a Rmotor 
0109:  MOVF   01,W
010A:  BTFSS  00.7
010B:  GOTO   10F
010C:  BTFSS  31.7
010D:  GOTO   117
010E:  GOTO   111
010F:  BTFSC  31.7
0110:  GOTO   120
0111:  MOVF   31,F
0112:  BTFSS  03.2
0113:  GOTO   117
0114:  SUBWF  30,W
0115:  BTFSS  03.0
0116:  GOTO   120
0117:  BSF    03.5
0118:  BCF    05.1
0119:  BCF    03.5
011A:  BCF    05.1
011B:  BSF    03.5
011C:  BCF    05.0
011D:  BCF    03.5
011E:  BSF    05.0
011F:  GOTO   128
0120:  BSF    03.5
0121:  BCF    05.0
0122:  BCF    03.5
0123:  BCF    05.0
0124:  BSF    03.5
0125:  BCF    05.1
0126:  BCF    03.5
0127:  BCF    05.1
0128:  MOVF   01,W
0129:  BTFSS  00.7
012A:  GOTO   12E
012B:  BTFSS  33.7
012C:  GOTO   136
012D:  GOTO   130
012E:  BTFSC  33.7
012F:  GOTO   13F
0130:  MOVF   33,F
0131:  BTFSS  03.2
0132:  GOTO   136
0133:  SUBWF  32,W
0134:  BTFSS  03.0
0135:  GOTO   13F
0136:  BSF    03.5
0137:  BCF    05.7
0138:  BCF    03.5
0139:  BCF    05.7
013A:  BSF    03.5
013B:  BCF    05.6
013C:  BCF    03.5
013D:  BSF    05.6
013E:  GOTO   147
013F:  BSF    03.5
0140:  BCF    05.6
0141:  BCF    03.5
0142:  BCF    05.6
0143:  BSF    03.5
0144:  BCF    05.7
0145:  BCF    03.5
0146:  BCF    05.7
....................  
....................       delay_us(2000);                  // cekani na SLAVE, nez pripravi data od cidel 
0147:  CLRWDT
0148:  MOVLW  01
0149:  MOVWF  3A
014A:  CALL   065
014B:  MOVLW  09
014C:  MOVWF  39
014D:  CLRF   29
014E:  BTFSC  0B.7
014F:  BSF    29.7
0150:  BCF    0B.7
0151:  MOVLW  6D
0152:  MOVWF  3D
0153:  CALL   037
0154:  BTFSC  29.7
0155:  BSF    0B.7
0156:  DECFSZ 39,F
0157:  GOTO   14D
....................  
....................       last_sensors=sensors; 
0158:  MOVF   2A,W
0159:  MOVWF  37
....................  
....................       output_low(STROBE);              // vypni zobrazovani na posuvnem registru 
015A:  BSF    03.5
015B:  BCF    06.0
015C:  BCF    03.5
015D:  BCF    06.0
....................       sensors = spi_read(0);           // cteni senzoru 
015E:  MOVF   13,W
015F:  CLRF   13
0160:  BSF    03.5
0161:  BTFSC  14.0
0162:  GOTO   165
0163:  BCF    03.5
0164:  GOTO   160
0165:  BCF    03.5
0166:  MOVF   13,W
0167:  MOVWF  2A
....................       sensors=~sensors;                // neguj prijata data 
0168:  COMF   2A,F
....................       output_high(STROBE);       // zobraz data na posuvnem registru 
0169:  BSF    03.5
016A:  BCF    06.0
016B:  BCF    03.5
016C:  BSF    06.0
....................  
....................       i=0;                       // havarijni kod 
016D:  CLRF   35
....................       for (n=0; n<=6; n++) 
016E:  CLRF   34
016F:  MOVF   34,W
0170:  SUBLW  06
0171:  BTFSS  03.0
0172:  GOTO   181
....................       { 
....................          if(bit_test(sensors,n)) i++; 
0173:  MOVF   2A,W
0174:  MOVWF  77
0175:  MOVF   34,W
0176:  MOVWF  78
0177:  BTFSC  03.2
0178:  GOTO   17D
0179:  BCF    03.0
017A:  RRF    77,F
017B:  DECFSZ 78,F
017C:  GOTO   179
017D:  BTFSC  77.0
017E:  INCF   35,F
....................       } 
017F:  INCF   34,F
0180:  GOTO   16F
....................       if (i>4) // zastavi, kdyz je cerno pod vice nez tremi cidly 
0181:  MOVF   35,W
0182:  SUBLW  04
0183:  BTFSC  03.0
0184:  GOTO   1AD
....................       { 
....................          BL; BR; 
0185:  BSF    03.5
0186:  BCF    05.0
0187:  BCF    03.5
0188:  BCF    05.0
0189:  BSF    03.5
018A:  BCF    05.1
018B:  BCF    03.5
018C:  BSF    05.1
018D:  BSF    03.5
018E:  BCF    05.6
018F:  BCF    03.5
0190:  BCF    05.6
0191:  BSF    03.5
0192:  BCF    05.7
0193:  BCF    03.5
0194:  BSF    05.7
....................          delay_ms(300); 
0195:  MOVLW  02
0196:  MOVWF  39
0197:  MOVLW  96
0198:  MOVWF  3A
0199:  CALL   065
019A:  DECFSZ 39,F
019B:  GOTO   197
....................          STOPR; STOPL; 
019C:  BSF    03.5
019D:  BCF    05.6
019E:  BCF    03.5
019F:  BCF    05.6
01A0:  BSF    03.5
01A1:  BCF    05.7
01A2:  BCF    03.5
01A3:  BCF    05.7
01A4:  BSF    03.5
01A5:  BCF    05.0
01A6:  BCF    03.5
01A7:  BCF    05.0
01A8:  BSF    03.5
01A9:  BCF    05.1
01AA:  BCF    03.5
01AB:  BCF    05.1
....................          While(true); 
01AC:  GOTO   1AC
....................       }; 
....................  
....................       if (bit_test(sensors,7))    // detekce cihly 
01AD:  BTFSS  2A.7
01AE:  GOTO   1D9
....................       { 
....................          BR;BL; 
01AF:  BSF    03.5
01B0:  BCF    05.6
01B1:  BCF    03.5
01B2:  BCF    05.6
01B3:  BSF    03.5
01B4:  BCF    05.7
01B5:  BCF    03.5
01B6:  BSF    05.7
01B7:  BSF    03.5
01B8:  BCF    05.0
01B9:  BCF    03.5
01BA:  BCF    05.0
01BB:  BSF    03.5
01BC:  BCF    05.1
01BD:  BCF    03.5
01BE:  BSF    05.1
....................          Delay_ms(100); 
01BF:  MOVLW  64
01C0:  MOVWF  3A
01C1:  CALL   065
....................          STOPR;STOPL; 
01C2:  BSF    03.5
01C3:  BCF    05.6
01C4:  BCF    03.5
01C5:  BCF    05.6
01C6:  BSF    03.5
01C7:  BCF    05.7
01C8:  BCF    03.5
01C9:  BCF    05.7
01CA:  BSF    03.5
01CB:  BCF    05.0
01CC:  BCF    03.5
01CD:  BCF    05.0
01CE:  BSF    03.5
01CF:  BCF    05.1
01D0:  BCF    03.5
01D1:  BCF    05.1
....................          Delay_ms(1000); 
01D2:  MOVLW  04
01D3:  MOVWF  39
01D4:  MOVLW  FA
01D5:  MOVWF  3A
01D6:  CALL   065
01D7:  DECFSZ 39,F
01D8:  GOTO   1D4
....................       } 
....................  
....................       if(bit_test(sensors,0)) //|......//     // z duvodu zkraceni doby reakce se cidla nevyhodnocuji poporade ale od krajnich k prostrednimu 
01D9:  BTFSS  2A.0
01DA:  GOTO   1E7
....................       { 
....................          uhel=STRED - BEAR3; 
01DB:  MOVLW  53
01DC:  MOVWF  2C
....................          Lmotor=0; 
01DD:  CLRF   31
01DE:  CLRF   30
....................          Rmotor=turn; 
01DF:  CLRF   7A
01E0:  MOVF   2E,W
01E1:  MOVWF  32
01E2:  MOVF   7A,W
01E3:  MOVWF  33
....................          line=L3; 
01E4:  MOVLW  03
01E5:  MOVWF  2B
....................          continue; 
01E6:  GOTO   109
....................       } 
....................  
....................       if(bit_test(sensors,6)) //......|// 
01E7:  BTFSS  2A.6
01E8:  GOTO   1F5
....................       { 
....................          uhel=STRED + BEAR3; 
01E9:  MOVLW  AD
01EA:  MOVWF  2C
....................          Rmotor=0; 
01EB:  CLRF   33
01EC:  CLRF   32
....................          Lmotor=turn; 
01ED:  CLRF   7A
01EE:  MOVF   2E,W
01EF:  MOVWF  30
01F0:  MOVF   7A,W
01F1:  MOVWF  31
....................          line=R3; 
01F2:  MOVLW  FD
01F3:  MOVWF  2B
....................          continue; 
01F4:  GOTO   109
....................       } 
....................  
....................       if(bit_test(sensors,1)) //.|.....// 
01F5:  BTFSS  2A.1
01F6:  GOTO   207
....................       { 
....................          uhel=STRED - BEAR2; 
01F7:  MOVLW  67
01F8:  MOVWF  2C
....................          Lmotor=speed-70; 
01F9:  MOVLW  46
01FA:  SUBWF  2D,W
01FB:  CLRF   7A
01FC:  MOVWF  30
01FD:  MOVF   7A,W
01FE:  MOVWF  31
....................          Rmotor=speed; 
01FF:  CLRF   7A
0200:  MOVF   2D,W
0201:  MOVWF  32
0202:  MOVF   7A,W
0203:  MOVWF  33
....................          line=L2; 
0204:  MOVLW  02
0205:  MOVWF  2B
....................          continue; 
0206:  GOTO   109
....................       } 
....................  
....................       if(bit_test(sensors,5)) //.....|.// 
0207:  BTFSS  2A.5
0208:  GOTO   219
....................       { 
....................          uhel=STRED + BEAR2; 
0209:  MOVLW  99
020A:  MOVWF  2C
....................          Rmotor=speed-70; 
020B:  MOVLW  46
020C:  SUBWF  2D,W
020D:  CLRF   7A
020E:  MOVWF  32
020F:  MOVF   7A,W
0210:  MOVWF  33
....................          Lmotor=speed; 
0211:  CLRF   7A
0212:  MOVF   2D,W
0213:  MOVWF  30
0214:  MOVF   7A,W
0215:  MOVWF  31
....................          line=R2; 
0216:  MOVLW  FE
0217:  MOVWF  2B
....................          continue; 
0218:  GOTO   109
....................       } 
....................  
....................       if (bit_test(sensors,2)) //..|....// 
0219:  BTFSS  2A.2
021A:  GOTO   22F
....................       { 
....................          uhel=STRED - BEAR1; 
021B:  MOVLW  76
021C:  MOVWF  2C
....................          Lmotor=speed-20; 
021D:  MOVLW  14
021E:  SUBWF  2D,W
021F:  CLRF   7A
0220:  MOVWF  30
0221:  MOVF   7A,W
0222:  MOVWF  31
....................          Rmotor=speed; 
0223:  CLRF   7A
0224:  MOVF   2D,W
0225:  MOVWF  32
0226:  MOVF   7A,W
0227:  MOVWF  33
....................          line=L2; 
0228:  MOVLW  02
0229:  MOVWF  2B
....................          if (rovinka<255) rovinka++; 
022A:  INCFSZ 2F,W
022B:  GOTO   22D
022C:  GOTO   22E
022D:  INCF   2F,F
....................          continue; 
022E:  GOTO   109
....................       } 
....................  
....................       if (bit_test(sensors,4)) //....|..// 
022F:  BTFSS  2A.4
0230:  GOTO   245
....................       { 
....................          uhel=STRED + BEAR1; 
0231:  MOVLW  8A
0232:  MOVWF  2C
....................          Rmotor=speed-20; 
0233:  MOVLW  14
0234:  SUBWF  2D,W
0235:  CLRF   7A
0236:  MOVWF  32
0237:  MOVF   7A,W
0238:  MOVWF  33
....................          Lmotor=speed; 
0239:  CLRF   7A
023A:  MOVF   2D,W
023B:  MOVWF  30
023C:  MOVF   7A,W
023D:  MOVWF  31
....................          line=L2; 
023E:  MOVLW  02
023F:  MOVWF  2B
....................          if (rovinka<255) rovinka++; 
0240:  INCFSZ 2F,W
0241:  GOTO   243
0242:  GOTO   244
0243:  INCF   2F,F
....................          continue; 
0244:  GOTO   109
....................       } 
....................  
....................       if(bit_test(sensors,3)) //...|...// 
0245:  BTFSS  2A.3
0246:  GOTO   259
....................       { 
....................          uhel=STRED; 
0247:  MOVLW  80
0248:  MOVWF  2C
....................          Lmotor=speed; 
0249:  CLRF   7A
024A:  MOVF   2D,W
024B:  MOVWF  30
024C:  MOVF   7A,W
024D:  MOVWF  31
....................          Rmotor=speed; 
024E:  CLRF   7A
024F:  MOVF   2D,W
0250:  MOVWF  32
0251:  MOVF   7A,W
0252:  MOVWF  33
....................          line=S; 
0253:  CLRF   2B
....................          if (rovinka < 255) rovinka++; 
0254:  INCFSZ 2F,W
0255:  GOTO   257
0256:  GOTO   258
0257:  INCF   2F,F
....................          continue; 
0258:  GOTO   109
....................       } 
....................  
....................  
....................  
....................       if ((L3==line) || (R3==line)) // Brzdeni pri vyjeti z trate 
0259:  MOVF   2B,W
025A:  SUBLW  03
025B:  BTFSC  03.2
025C:  GOTO   261
025D:  MOVF   2B,W
025E:  SUBLW  FD
025F:  BTFSS  03.2
0260:  GOTO   284
....................       { 
....................          if (rovinka>50) 
0261:  MOVF   2F,W
0262:  SUBLW  32
0263:  BTFSC  03.0
0264:  GOTO   283
....................          { 
....................             BL; BR; 
0265:  BSF    03.5
0266:  BCF    05.0
0267:  BCF    03.5
0268:  BCF    05.0
0269:  BSF    03.5
026A:  BCF    05.1
026B:  BCF    03.5
026C:  BSF    05.1
026D:  BSF    03.5
026E:  BCF    05.6
026F:  BCF    03.5
0270:  BCF    05.6
0271:  BSF    03.5
0272:  BCF    05.7
0273:  BCF    03.5
0274:  BSF    05.7
....................             Delay_ms(70); 
0275:  MOVLW  46
0276:  MOVWF  3A
0277:  CALL   065
....................             if (rovinka > 250 || speed > 170) delay_ms(50); 
0278:  MOVF   2F,W
0279:  SUBLW  FA
027A:  BTFSS  03.0
027B:  GOTO   280
027C:  MOVF   2D,W
027D:  SUBLW  AA
027E:  BTFSC  03.0
027F:  GOTO   283
0280:  MOVLW  32
0281:  MOVWF  3A
0282:  CALL   065
....................          }; 
....................          rovinka=0; 
0283:  CLRF   2F
....................       }; 
....................    } 
0284:  GOTO   109
.................... } 
0285:  SLEEP

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