CCS PCM C Compiler, Version 4.106, 47914               23-4-13 11:20

               Filename: c:\users\honza\documents\pic\i2c_magnetometr\main.lst

               ROM used: 1041 words (13%)
                         Largest free fragment is 2048
               RAM used: 7 (2%) at main() level
                         22 (6%) worst case
               Stack:    3 locations

*
0000:  MOVLW  03
0001:  MOVWF  0A
0002:  GOTO   32F
0003:  NOP
.................... //Magnetometr Jan Chroust 2013 
.................... //vypise hodnoty jednotlivych os 
....................  
.................... #include "main.h" 
.................... #include <16F887.h> 
.................... //////// Standard Header file for the PIC16F887 device //////////////// 
.................... #device PIC16F887 
.................... #list 
....................  
.................... #device adc=8 
....................  
.................... #FUSES NOWDT                       //No Watch Dog Timer 
.................... #FUSES INTRC                       //Internal RC Osc 
.................... #FUSES NOPUT                       //No Power Up Timer 
.................... #FUSES MCLR                        //Master Clear pin enabled 
.................... #FUSES NOPROTECT                   //Code not protected from reading 
.................... #FUSES NOCPD                       //No EE protection 
.................... #FUSES NOBROWNOUT                  //No brownout reset 
.................... #FUSES IESO                        //Internal External Switch Over mode enabled 
.................... #FUSES FCMEN                       //Fail-safe clock monitor enabled 
.................... #FUSES NOLVP                       //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O 
.................... #FUSES NODEBUG                     //No Debug mode for ICD 
.................... #FUSES NOWRT                       //Program memory not write protected 
.................... #FUSES BORV40                      //Brownout reset at 4.0V 
....................  
.................... #use delay(clock=8000000) 
*
00EB:  MOVLW  28
00EC:  MOVWF  04
00ED:  BCF    03.7
00EE:  MOVF   00,W
00EF:  BTFSC  03.2
00F0:  GOTO   0FE
00F1:  MOVLW  02
00F2:  MOVWF  78
00F3:  CLRF   77
00F4:  DECFSZ 77,F
00F5:  GOTO   0F4
00F6:  DECFSZ 78,F
00F7:  GOTO   0F3
00F8:  MOVLW  97
00F9:  MOVWF  77
00FA:  DECFSZ 77,F
00FB:  GOTO   0FA
00FC:  DECFSZ 00,F
00FD:  GOTO   0F1
00FE:  RETURN
....................  
....................  
....................  
.................... #define EEPROM_SDA  PIN_C4 
.................... #define EEPROM_SCL  PIN_C3 
.................... #use i2c(master, sda=EEPROM_SDA, scl=EEPROM_SCL) 
*
00A1:  MOVLW  08
00A2:  MOVWF  78
00A3:  NOP
00A4:  BCF    07.3
00A5:  BCF    20.3
00A6:  MOVF   20,W
00A7:  BSF    03.5
00A8:  MOVWF  07
00A9:  NOP
00AA:  BCF    03.5
00AB:  RLF    2C,F
00AC:  BCF    07.4
00AD:  BTFSS  03.0
00AE:  GOTO   0B5
00AF:  BSF    20.4
00B0:  MOVF   20,W
00B1:  BSF    03.5
00B2:  MOVWF  07
00B3:  GOTO   0B9
00B4:  BCF    03.5
00B5:  BCF    20.4
00B6:  MOVF   20,W
00B7:  BSF    03.5
00B8:  MOVWF  07
00B9:  NOP
00BA:  BCF    03.5
00BB:  BSF    20.3
00BC:  MOVF   20,W
00BD:  BSF    03.5
00BE:  MOVWF  07
00BF:  BCF    03.5
00C0:  BTFSS  07.3
00C1:  GOTO   0C0
00C2:  DECFSZ 78,F
00C3:  GOTO   0A3
00C4:  NOP
00C5:  BCF    07.3
00C6:  BCF    20.3
00C7:  MOVF   20,W
00C8:  BSF    03.5
00C9:  MOVWF  07
00CA:  NOP
00CB:  BCF    03.5
00CC:  BSF    20.4
00CD:  MOVF   20,W
00CE:  BSF    03.5
00CF:  MOVWF  07
00D0:  NOP
00D1:  NOP
00D2:  BCF    03.5
00D3:  BSF    20.3
00D4:  MOVF   20,W
00D5:  BSF    03.5
00D6:  MOVWF  07
00D7:  BCF    03.5
00D8:  BTFSS  07.3
00D9:  GOTO   0D8
00DA:  CLRF   78
00DB:  NOP
00DC:  BTFSC  07.4
00DD:  BSF    78.0
00DE:  BCF    07.3
00DF:  BCF    20.3
00E0:  MOVF   20,W
00E1:  BSF    03.5
00E2:  MOVWF  07
00E3:  BCF    03.5
00E4:  BCF    07.4
00E5:  BCF    20.4
00E6:  MOVF   20,W
00E7:  BSF    03.5
00E8:  MOVWF  07
00E9:  BCF    03.5
00EA:  RETURN
*
0203:  MOVLW  08
0204:  MOVWF  2D
0205:  MOVF   77,W
0206:  MOVWF  2E
0207:  BSF    20.4
0208:  MOVF   20,W
0209:  BSF    03.5
020A:  MOVWF  07
020B:  NOP
020C:  BCF    03.5
020D:  BSF    20.3
020E:  MOVF   20,W
020F:  BSF    03.5
0210:  MOVWF  07
0211:  BCF    03.5
0212:  BTFSS  07.3
0213:  GOTO   212
0214:  BTFSC  07.4
0215:  BSF    03.0
0216:  BTFSS  07.4
0217:  BCF    03.0
0218:  RLF    78,F
0219:  NOP
021A:  BCF    20.3
021B:  MOVF   20,W
021C:  BSF    03.5
021D:  MOVWF  07
021E:  BCF    03.5
021F:  BCF    07.3
0220:  DECFSZ 2D,F
0221:  GOTO   207
0222:  BSF    20.4
0223:  MOVF   20,W
0224:  BSF    03.5
0225:  MOVWF  07
0226:  NOP
0227:  BCF    03.5
0228:  BCF    07.4
0229:  MOVF   2E,W
022A:  BTFSC  03.2
022B:  GOTO   231
022C:  BCF    20.4
022D:  MOVF   20,W
022E:  BSF    03.5
022F:  MOVWF  07
0230:  BCF    03.5
0231:  NOP
0232:  BSF    20.3
0233:  MOVF   20,W
0234:  BSF    03.5
0235:  MOVWF  07
0236:  BCF    03.5
0237:  BTFSS  07.3
0238:  GOTO   237
0239:  NOP
023A:  BCF    07.3
023B:  BCF    20.3
023C:  MOVF   20,W
023D:  BSF    03.5
023E:  MOVWF  07
023F:  NOP
0240:  BCF    03.5
0241:  BCF    07.4
0242:  BCF    20.4
0243:  MOVF   20,W
0244:  BSF    03.5
0245:  MOVWF  07
.................... #use rs232(baud=9600,parity=N,xmit=PIN_C7,rcv=PIN_C6,bits=8) //rcv TXD xmit RXD 
*
0037:  BCF    20.7
0038:  MOVF   20,W
0039:  BSF    03.5
003A:  MOVWF  07
003B:  BCF    03.5
003C:  BCF    07.7
003D:  MOVLW  08
003E:  MOVWF  78
003F:  GOTO   040
0040:  NOP
0041:  BSF    78.7
0042:  GOTO   051
0043:  BCF    78.7
0044:  RRF    30,F
0045:  BTFSC  03.0
0046:  BSF    07.7
0047:  BTFSS  03.0
0048:  BCF    07.7
0049:  BSF    78.6
004A:  GOTO   051
004B:  BCF    78.6
004C:  DECFSZ 78,F
004D:  GOTO   044
004E:  GOTO   04F
004F:  NOP
0050:  BSF    07.7
0051:  MOVLW  3F
0052:  MOVWF  04
0053:  DECFSZ 04,F
0054:  GOTO   053
0055:  NOP
0056:  BTFSC  78.7
0057:  GOTO   043
0058:  BTFSC  78.6
0059:  GOTO   04B
005A:  RETURN
....................  
.................... #include "HMC5883L.h" 
.................... #define MAG_ADDR_R  0x3D //addresa pro cteni 
.................... #define MAG_ADDR_W  0x3C 
....................  
....................  
.................... //Konstanty nastavujici rozsah 
.................... //pro void set_mag_roz (unsigned int8 h) 
.................... #define MAG_ROZ088  0x00 
.................... #define MAG_ROZ130  0x20 
.................... #define MAG_ROZ190  0x40 
.................... #define MAG_ROZ250  0x60 
.................... #define MAG_ROZ400  0x80 
.................... #define MAG_ROZ470  0xA0 
.................... #define MAG_ROZ560  0xC0 
.................... #define MAG_ROZ810  0xE0 
....................  
....................  
.................... #include "HMC5883L.c" 
.................... void set_mag (void) //uvodni nastaveni na kontinualni mereni, rozsah ± 8.1 Ga, frekvence mereni 15HZ 
.................... { 
....................   i2c_start();       //nastavení Configuration Register A 
*
00FF:  BSF    20.4
0100:  MOVF   20,W
0101:  BSF    03.5
0102:  MOVWF  07
0103:  NOP
0104:  BCF    03.5
0105:  BSF    20.3
0106:  MOVF   20,W
0107:  BSF    03.5
0108:  MOVWF  07
0109:  NOP
010A:  BCF    03.5
010B:  BCF    07.4
010C:  BCF    20.4
010D:  MOVF   20,W
010E:  BSF    03.5
010F:  MOVWF  07
0110:  NOP
0111:  BCF    03.5
0112:  BCF    07.3
0113:  BCF    20.3
0114:  MOVF   20,W
0115:  BSF    03.5
0116:  MOVWF  07
....................   I2C_Write(MAG_ADDR_W);      
0117:  MOVLW  3C
0118:  BCF    03.5
0119:  MOVWF  2C
011A:  CALL   0A1
....................   I2C_Write(0x00);    
011B:  CLRF   2C
011C:  CALL   0A1
....................   I2C_Write(0x70); 
011D:  MOVLW  70
011E:  MOVWF  2C
011F:  CALL   0A1
....................   i2c_stop(); 
0120:  BCF    20.4
0121:  MOVF   20,W
0122:  BSF    03.5
0123:  MOVWF  07
0124:  NOP
0125:  BCF    03.5
0126:  BSF    20.3
0127:  MOVF   20,W
0128:  BSF    03.5
0129:  MOVWF  07
012A:  BCF    03.5
012B:  BTFSS  07.3
012C:  GOTO   12B
012D:  NOP
012E:  GOTO   12F
012F:  NOP
0130:  BSF    20.4
0131:  MOVF   20,W
0132:  BSF    03.5
0133:  MOVWF  07
0134:  NOP
....................   Delay_ms(6); 
0135:  MOVLW  06
0136:  BCF    03.5
0137:  MOVWF  28
0138:  CALL   0EB
....................     
....................   i2c_start();       //nastavení Configuration Register B 
0139:  BSF    20.4
013A:  MOVF   20,W
013B:  BSF    03.5
013C:  MOVWF  07
013D:  NOP
013E:  BCF    03.5
013F:  BSF    20.3
0140:  MOVF   20,W
0141:  BSF    03.5
0142:  MOVWF  07
0143:  NOP
0144:  BCF    03.5
0145:  BCF    07.4
0146:  BCF    20.4
0147:  MOVF   20,W
0148:  BSF    03.5
0149:  MOVWF  07
014A:  NOP
014B:  BCF    03.5
014C:  BCF    07.3
014D:  BCF    20.3
014E:  MOVF   20,W
014F:  BSF    03.5
0150:  MOVWF  07
....................   I2C_Write(MAG_ADDR_W);      
0151:  MOVLW  3C
0152:  BCF    03.5
0153:  MOVWF  2C
0154:  CALL   0A1
....................   I2C_Write(0x01);    
0155:  MOVLW  01
0156:  MOVWF  2C
0157:  CALL   0A1
....................   I2C_Write(MAG_ROZ810); 
0158:  MOVLW  E0
0159:  MOVWF  2C
015A:  CALL   0A1
....................   i2c_stop(); 
015B:  BCF    20.4
015C:  MOVF   20,W
015D:  BSF    03.5
015E:  MOVWF  07
015F:  NOP
0160:  BCF    03.5
0161:  BSF    20.3
0162:  MOVF   20,W
0163:  BSF    03.5
0164:  MOVWF  07
0165:  BCF    03.5
0166:  BTFSS  07.3
0167:  GOTO   166
0168:  NOP
0169:  GOTO   16A
016A:  NOP
016B:  BSF    20.4
016C:  MOVF   20,W
016D:  BSF    03.5
016E:  MOVWF  07
016F:  NOP
....................  
....................   Delay_ms(6); 
0170:  MOVLW  06
0171:  BCF    03.5
0172:  MOVWF  28
0173:  CALL   0EB
....................  
....................   i2c_start();          //nastveni Mode Register  
0174:  BSF    20.4
0175:  MOVF   20,W
0176:  BSF    03.5
0177:  MOVWF  07
0178:  NOP
0179:  BCF    03.5
017A:  BSF    20.3
017B:  MOVF   20,W
017C:  BSF    03.5
017D:  MOVWF  07
017E:  NOP
017F:  BCF    03.5
0180:  BCF    07.4
0181:  BCF    20.4
0182:  MOVF   20,W
0183:  BSF    03.5
0184:  MOVWF  07
0185:  NOP
0186:  BCF    03.5
0187:  BCF    07.3
0188:  BCF    20.3
0189:  MOVF   20,W
018A:  BSF    03.5
018B:  MOVWF  07
....................   I2C_Write(MAG_ADDR_W);      
018C:  MOVLW  3C
018D:  BCF    03.5
018E:  MOVWF  2C
018F:  CALL   0A1
....................   I2C_Write(0x02);    
0190:  MOVLW  02
0191:  MOVWF  2C
0192:  CALL   0A1
....................   I2C_Write(0x00); 
0193:  CLRF   2C
0194:  CALL   0A1
....................   i2c_stop(); 
0195:  BCF    20.4
0196:  MOVF   20,W
0197:  BSF    03.5
0198:  MOVWF  07
0199:  NOP
019A:  BCF    03.5
019B:  BSF    20.3
019C:  MOVF   20,W
019D:  BSF    03.5
019E:  MOVWF  07
019F:  BCF    03.5
01A0:  BTFSS  07.3
01A1:  GOTO   1A0
01A2:  NOP
01A3:  GOTO   1A4
01A4:  NOP
01A5:  BSF    20.4
01A6:  MOVF   20,W
01A7:  BSF    03.5
01A8:  MOVWF  07
01A9:  NOP
....................   Delay_ms(6);   
01AA:  MOVLW  06
01AB:  BCF    03.5
01AC:  MOVWF  28
01AD:  CALL   0EB
.................... } 
01AE:  BCF    0A.3
01AF:  BCF    0A.4
01B0:  GOTO   3AA (RETURN)
....................  
.................... void set_mag_roz (unsigned int8 h) //nastavy rozsah 
.................... { 
....................  
.................... // 
....................    
....................     
....................   i2c_start();        
....................   I2C_Write(MAG_ADDR_W);      
....................   I2C_Write(0x01);    
....................   I2C_Write(h); 
....................   i2c_stop(); 
....................  
....................   Delay_ms(6); 
....................  
....................   
.................... } 
....................  
....................  
.................... byte mag_read(byte reg) //pro cteni reg 
.................... { 
....................   
....................    i2c_start(); 
01B1:  BSF    20.4
01B2:  MOVF   20,W
01B3:  BSF    03.5
01B4:  MOVWF  07
01B5:  NOP
01B6:  BCF    03.5
01B7:  BSF    20.3
01B8:  MOVF   20,W
01B9:  BSF    03.5
01BA:  MOVWF  07
01BB:  NOP
01BC:  BCF    03.5
01BD:  BCF    07.4
01BE:  BCF    20.4
01BF:  MOVF   20,W
01C0:  BSF    03.5
01C1:  MOVWF  07
01C2:  NOP
01C3:  BCF    03.5
01C4:  BCF    07.3
01C5:  BCF    20.3
01C6:  MOVF   20,W
01C7:  BSF    03.5
01C8:  MOVWF  07
....................    I2C_Write(MAG_ADDR_W); 
01C9:  MOVLW  3C
01CA:  BCF    03.5
01CB:  MOVWF  2C
01CC:  CALL   0A1
....................    I2C_write(reg); 
01CD:  MOVF   2B,W
01CE:  MOVWF  2C
01CF:  CALL   0A1
....................    i2c_stop(); 
01D0:  BCF    20.4
01D1:  MOVF   20,W
01D2:  BSF    03.5
01D3:  MOVWF  07
01D4:  NOP
01D5:  BCF    03.5
01D6:  BSF    20.3
01D7:  MOVF   20,W
01D8:  BSF    03.5
01D9:  MOVWF  07
01DA:  BCF    03.5
01DB:  BTFSS  07.3
01DC:  GOTO   1DB
01DD:  NOP
01DE:  GOTO   1DF
01DF:  NOP
01E0:  BSF    20.4
01E1:  MOVF   20,W
01E2:  BSF    03.5
01E3:  MOVWF  07
01E4:  NOP
....................    i2c_start(); 
01E5:  BCF    03.5
01E6:  BSF    20.4
01E7:  MOVF   20,W
01E8:  BSF    03.5
01E9:  MOVWF  07
01EA:  NOP
01EB:  BCF    03.5
01EC:  BSF    20.3
01ED:  MOVF   20,W
01EE:  BSF    03.5
01EF:  MOVWF  07
01F0:  NOP
01F1:  BCF    03.5
01F2:  BCF    07.4
01F3:  BCF    20.4
01F4:  MOVF   20,W
01F5:  BSF    03.5
01F6:  MOVWF  07
01F7:  NOP
01F8:  BCF    03.5
01F9:  BCF    07.3
01FA:  BCF    20.3
01FB:  MOVF   20,W
01FC:  BSF    03.5
01FD:  MOVWF  07
....................    I2C_Write(MAG_ADDR_R); 
01FE:  MOVLW  3D
01FF:  BCF    03.5
0200:  MOVWF  2C
0201:  CALL   0A1
....................    reg=i2c_read(0); 
0202:  CLRF   77
*
0246:  MOVF   78,W
0247:  BCF    03.5
0248:  MOVWF  2B
....................   return reg; 
0249:  MOVF   2B,W
024A:  MOVWF  78
.................... } 
024B:  RETURN
....................  
....................  
.................... signed int16 mag_vypocet(unsigned int8 h, unsigned int8 l) //prepocet na 16bit cislo 
.................... { 
.................... signed int16 x; 
.................... x = (((unsigned int16) h << 8) + l ); 
024C:  CLRF   30
024D:  MOVF   2B,W
024E:  MOVWF  2F
024F:  MOVWF  30
0250:  CLRF   2F
0251:  MOVF   2C,W
0252:  ADDWF  2F,W
0253:  MOVWF  78
0254:  MOVF   30,W
0255:  MOVWF  7A
0256:  BTFSC  03.0
0257:  INCF   7A,F
0258:  MOVF   78,W
0259:  MOVWF  2D
025A:  MOVF   7A,W
025B:  MOVWF  2E
.................... return x;    
025C:  MOVF   2D,W
025D:  MOVWF  78
025E:  MOVF   2E,W
025F:  MOVWF  79
.................... } 
0260:  RETURN
....................  
....................  
.................... signed int16 mag_readX(void) //nacteni osy x 
.................... { 
.................... unsigned int8 h,l; 
.................... signed int16 x; 
.................... h=mag_read(0x03); 
0261:  MOVLW  03
0262:  MOVWF  2B
0263:  CALL   1B1
0264:  MOVF   78,W
0265:  MOVWF  27
.................... l=mag_read(0x04); 
0266:  MOVLW  04
0267:  MOVWF  2B
0268:  CALL   1B1
0269:  MOVF   78,W
026A:  MOVWF  28
.................... x=mag_vypocet(h,l); 
026B:  MOVF   27,W
026C:  MOVWF  2B
026D:  MOVF   28,W
026E:  MOVWF  2C
026F:  CALL   24C
0270:  MOVF   79,W
0271:  MOVWF  2A
0272:  MOVF   78,W
0273:  MOVWF  29
.................... return x; 
0274:  MOVF   29,W
0275:  MOVWF  78
0276:  MOVF   2A,W
0277:  MOVWF  79
....................     
.................... } 
0278:  BCF    0A.3
0279:  BCF    0A.4
027A:  GOTO   3B2 (RETURN)
....................  
....................  
.................... signed int16 mag_readY(void) //nacteni osy x 
.................... { 
.................... unsigned int8 h,l; 
.................... signed int16 x; 
.................... h=mag_read(0x07); 
027B:  MOVLW  07
027C:  MOVWF  2B
027D:  CALL   1B1
027E:  MOVF   78,W
027F:  MOVWF  27
.................... l=mag_read(0x08); 
0280:  MOVLW  08
0281:  MOVWF  2B
0282:  CALL   1B1
0283:  MOVF   78,W
0284:  MOVWF  28
.................... x=mag_vypocet(h,l); 
0285:  MOVF   27,W
0286:  MOVWF  2B
0287:  MOVF   28,W
0288:  MOVWF  2C
0289:  CALL   24C
028A:  MOVF   79,W
028B:  MOVWF  2A
028C:  MOVF   78,W
028D:  MOVWF  29
.................... return x; 
028E:  MOVF   29,W
028F:  MOVWF  78
0290:  MOVF   2A,W
0291:  MOVWF  79
....................     
.................... } 
0292:  BCF    0A.3
0293:  BCF    0A.4
0294:  GOTO   3B7 (RETURN)
....................  
....................  
.................... signed int16 mag_readZ(void) //nacteni osy x 
.................... { 
.................... unsigned int8 h,l; 
.................... signed int16 x; 
.................... h=mag_read(0x05); 
0295:  MOVLW  05
0296:  MOVWF  2B
0297:  CALL   1B1
0298:  MOVF   78,W
0299:  MOVWF  27
.................... l=mag_read(0x06); 
029A:  MOVLW  06
029B:  MOVWF  2B
029C:  CALL   1B1
029D:  MOVF   78,W
029E:  MOVWF  28
.................... x=mag_vypocet(h,l); 
029F:  MOVF   27,W
02A0:  MOVWF  2B
02A1:  MOVF   28,W
02A2:  MOVWF  2C
02A3:  CALL   24C
02A4:  MOVF   79,W
02A5:  MOVWF  2A
02A6:  MOVF   78,W
02A7:  MOVWF  29
.................... return x; 
02A8:  MOVF   29,W
02A9:  MOVWF  78
02AA:  MOVF   2A,W
02AB:  MOVWF  79
....................     
.................... } 
02AC:  BCF    0A.3
02AD:  BCF    0A.4
02AE:  GOTO   3BC (RETURN)
....................  
....................  
....................  
....................  
....................  
.................... void main() 
.................... { 
*
032F:  CLRF   04
0330:  BCF    03.7
0331:  MOVLW  1F
0332:  ANDWF  03,F
0333:  MOVLW  71
0334:  BSF    03.5
0335:  MOVWF  0F
0336:  MOVF   0F,W
0337:  BCF    03.5
0338:  BCF    20.7
0339:  MOVF   20,W
033A:  BSF    03.5
033B:  MOVWF  07
033C:  BCF    03.5
033D:  BSF    07.7
033E:  BSF    03.5
033F:  BSF    03.6
0340:  MOVF   09,W
0341:  ANDLW  C0
0342:  MOVWF  09
0343:  BCF    03.6
0344:  BCF    1F.4
0345:  BCF    1F.5
0346:  MOVLW  00
0347:  BSF    03.6
0348:  MOVWF  08
0349:  BCF    03.5
034A:  CLRF   07
034B:  CLRF   08
034C:  CLRF   09
....................  
....................    setup_adc_ports(NO_ANALOGS|VSS_VDD); 
*
0350:  BSF    03.5
0351:  BSF    03.6
0352:  MOVF   09,W
0353:  ANDLW  C0
0354:  MOVWF  09
0355:  BCF    03.6
0356:  BCF    1F.4
0357:  BCF    1F.5
0358:  MOVLW  00
0359:  BSF    03.6
035A:  MOVWF  08
....................    setup_adc(ADC_CLOCK_DIV_2); 
035B:  BCF    03.5
035C:  BCF    03.6
035D:  BCF    1F.6
035E:  BCF    1F.7
035F:  BSF    03.5
0360:  BCF    1F.7
0361:  BCF    03.5
0362:  BSF    1F.0
....................    setup_spi(SPI_SS_DISABLED); 
0363:  BCF    14.5
0364:  BCF    20.5
0365:  MOVF   20,W
0366:  BSF    03.5
0367:  MOVWF  07
0368:  BCF    03.5
0369:  BSF    20.4
036A:  MOVF   20,W
036B:  BSF    03.5
036C:  MOVWF  07
036D:  BCF    03.5
036E:  BCF    20.3
036F:  MOVF   20,W
0370:  BSF    03.5
0371:  MOVWF  07
0372:  MOVLW  01
0373:  BCF    03.5
0374:  MOVWF  14
0375:  MOVLW  00
0376:  BSF    03.5
0377:  MOVWF  14
....................    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); 
0378:  MOVF   01,W
0379:  ANDLW  C7
037A:  IORLW  08
037B:  MOVWF  01
....................    setup_timer_1(T1_DISABLED); 
037C:  BCF    03.5
037D:  CLRF   10
....................    setup_timer_2(T2_DISABLED,0,1); 
037E:  MOVLW  00
037F:  MOVWF  78
0380:  MOVWF  12
0381:  MOVLW  00
0382:  BSF    03.5
0383:  MOVWF  12
....................    setup_ccp1(CCP_OFF); 
0384:  BCF    03.5
0385:  BSF    20.2
0386:  MOVF   20,W
0387:  BSF    03.5
0388:  MOVWF  07
0389:  BCF    03.5
038A:  CLRF   17
038B:  BSF    03.5
038C:  CLRF   1B
038D:  CLRF   1C
038E:  MOVLW  01
038F:  MOVWF  1D
....................    setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard 
0390:  BCF    03.5
0391:  BSF    03.6
0392:  CLRF   07
0393:  CLRF   08
0394:  CLRF   09
....................  
.................... printf("Magnetometr:  \r\n",); 
0395:  MOVLW  04
0396:  MOVWF  0D
0397:  MOVLW  00
0398:  MOVWF  0F
0399:  BCF    03.6
039A:  CALL   05B
.................... printf("(c)mlab JACHO 2013:  \r\n",); 
039B:  MOVLW  0D
039C:  BSF    03.6
039D:  MOVWF  0D
039E:  MOVLW  00
039F:  MOVWF  0F
03A0:  BCF    03.6
03A1:  CALL   05B
.................... printf("Vysledky z jednotlivych os:\r\n",); 
03A2:  MOVLW  19
03A3:  BSF    03.6
03A4:  MOVWF  0D
03A5:  MOVLW  00
03A6:  MOVWF  0F
03A7:  BCF    03.6
03A8:  CALL   05B
.................... signed int16 X,Y,Z; 
....................  
....................  set_mag (); 
03A9:  GOTO   0FF
.................... while(true) 
.................... {   
....................    printf("Vysledky z jednotlivych os:\r\n",); 
03AA:  MOVLW  28
03AB:  BSF    03.6
03AC:  MOVWF  0D
03AD:  MOVLW  00
03AE:  MOVWF  0F
03AF:  BCF    03.6
03B0:  CALL   05B
....................    X=mag_readX(); 
03B1:  GOTO   261
03B2:  MOVF   79,W
03B3:  MOVWF  22
03B4:  MOVF   78,W
03B5:  MOVWF  21
....................    Y=mag_readY(); 
03B6:  GOTO   27B
03B7:  MOVF   79,W
03B8:  MOVWF  24
03B9:  MOVF   78,W
03BA:  MOVWF  23
....................    Z=mag_readZ(); 
03BB:  GOTO   295
03BC:  MOVF   79,W
03BD:  MOVWF  26
03BE:  MOVF   78,W
03BF:  MOVWF  25
....................    printf("X: %Ld \r\n", X); 
03C0:  MOVLW  58
03C1:  MOVWF  30
03C2:  CALL   037
03C3:  MOVLW  3A
03C4:  MOVWF  30
03C5:  CALL   037
03C6:  MOVLW  20
03C7:  MOVWF  30
03C8:  CALL   037
03C9:  MOVLW  10
03CA:  MOVWF  04
03CB:  MOVF   22,W
03CC:  MOVWF  28
03CD:  MOVF   21,W
03CE:  MOVWF  27
03CF:  CALL   2AF
03D0:  MOVLW  20
03D1:  MOVWF  30
03D2:  CALL   037
03D3:  MOVLW  0D
03D4:  MOVWF  30
03D5:  CALL   037
03D6:  MOVLW  0A
03D7:  MOVWF  30
03D8:  CALL   037
....................    printf("Y %Ld \r\n", Y); 
03D9:  MOVLW  59
03DA:  MOVWF  30
03DB:  CALL   037
03DC:  MOVLW  20
03DD:  MOVWF  30
03DE:  CALL   037
03DF:  MOVLW  10
03E0:  MOVWF  04
03E1:  MOVF   24,W
03E2:  MOVWF  28
03E3:  MOVF   23,W
03E4:  MOVWF  27
03E5:  CALL   2AF
03E6:  MOVLW  20
03E7:  MOVWF  30
03E8:  CALL   037
03E9:  MOVLW  0D
03EA:  MOVWF  30
03EB:  CALL   037
03EC:  MOVLW  0A
03ED:  MOVWF  30
03EE:  CALL   037
....................    printf("Z: %Ld \r\n", Z); 
03EF:  MOVLW  5A
03F0:  MOVWF  30
03F1:  CALL   037
03F2:  MOVLW  3A
03F3:  MOVWF  30
03F4:  CALL   037
03F5:  MOVLW  20
03F6:  MOVWF  30
03F7:  CALL   037
03F8:  MOVLW  10
03F9:  MOVWF  04
03FA:  MOVF   26,W
03FB:  MOVWF  28
03FC:  MOVF   25,W
03FD:  MOVWF  27
03FE:  CALL   2AF
03FF:  MOVLW  20
0400:  MOVWF  30
0401:  CALL   037
0402:  MOVLW  0D
0403:  MOVWF  30
0404:  CALL   037
0405:  MOVLW  0A
0406:  MOVWF  30
0407:  CALL   037
....................    Delay_ms(2000);   
0408:  MOVLW  08
0409:  MOVWF  27
040A:  MOVLW  FA
040B:  MOVWF  28
040C:  CALL   0EB
040D:  DECFSZ 27,F
040E:  GOTO   40A
....................     
.................... } 
040F:  GOTO   3AA
.................... } 
0410:  SLEEP

Configuration Fuses:
   Word  1: 2CF5   INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
   Word  2: 3FFF   NOWRT BORV40