CCS PCM C Compiler, Version 3.058, 13126

               Filename: pic_test.LST

               ROM used: 969 (12%)
                         Largest free fragment is 2048
               RAM used: 36 (21%) at main() level
                         77 (44%) worst case
               Stack:    5 worst case (4 in main + 1 for interrupts)

*
0000:  MOVLW  00
0001:  MOVWF  0A
0002:  GOTO   370
0003:  NOP
0004:  MOVWF  7F
0005:  SWAPF  03,W
0006:  BCF    03.5
0007:  BCF    03.6
0008:  MOVWF  21
0009:  MOVF   0A,W
000A:  MOVWF  20
000B:  CLRF   0A
000C:  MOVF   04,W
000D:  MOVWF  22
000E:  MOVF   77,W
000F:  MOVWF  23
0010:  MOVF   78,W
0011:  MOVWF  24
0012:  MOVF   79,W
0013:  MOVWF  25
0014:  MOVF   7A,W
0015:  MOVWF  26
0016:  MOVF   7B,W
0017:  MOVWF  27
0018:  BCF    03.7
0019:  BCF    03.5
001A:  BTFSS  0B.5
001B:  GOTO   01E
001C:  BTFSC  0B.2
001D:  GOTO   031
001E:  MOVF   22,W
001F:  MOVWF  04
0020:  MOVF   23,W
0021:  MOVWF  77
0022:  MOVF   24,W
0023:  MOVWF  78
0024:  MOVF   25,W
0025:  MOVWF  79
0026:  MOVF   26,W
0027:  MOVWF  7A
0028:  MOVF   27,W
0029:  MOVWF  7B
002A:  MOVF   20,W
002B:  MOVWF  0A
002C:  SWAPF  21,W
002D:  MOVWF  03
002E:  SWAPF  7F,F
002F:  SWAPF  7F,W
0030:  RETFIE
0031:  BCF    0A.3
0032:  BCF    0A.4
0033:  GOTO   0DB
....................  /****************************************************************************/ 
.................... /* Copyright 2005 MBARI.                                                    */ 
.................... /* Monterey Bay Aquarium Research Institute Proprietary Information.        */ 
.................... /* All rights reserved.                                                     */ 
.................... /****************************************************************************/ 
.................... #include <16f876.h> 
....................  //////// Standard Header file for the PIC16F876 device //////////////// 
.................... #device PIC16F876 
.................... #list 
.................... 
.................... #include <stdlib.h> 
....................  ////        (C) Copyright 1996,1997 Custom Computer Services            //// 
.................... //// This source code may only be used by licensed users of the CCS C   //// 
.................... //// compiler.  This source code may only be distributed to other       //// 
.................... //// licensed users of the CCS C compiler.  No other use, reproduction  //// 
.................... //// or distribution is permitted without written permission.           //// 
.................... //// Derivative programs created using this software in object code     //// 
.................... //// form are not restricted in any way.                                //// 
.................... //////////////////////////////////////////////////////////////////////////// 
....................  
.................... #ifndef _stdlib_ 
....................  
.................... #define _stdlib_ true 
....................  
.................... float atof(char * s) { 
....................  float pow10; 
....................         float result; 
....................  int sign, point; 
....................  char c; 
....................         int ptr; 
....................  
....................         ptr=0; 
....................     sign = 0; 
....................  point = 0; 
....................  pow10 = 1.0; 
....................     result = 0.0; 
....................  
....................  do 
....................           c=s[ptr++]; 
....................         while ((c<'0'||c>'9') && c!='+' && c!='-' && c!='.'); 
....................  
....................  while((c>='0' && c<='9') || c=='+' || c=='-' || c=='.') { 
....................            if(c == '-') { 
....................               sign = 1; 
....................               c = s[ptr++]; 
....................            } 
....................  
....................            while((c >= '0' && c <= '9') && point == 0) { 
....................               result = 10*result + c - '0'; 
....................               c = s[ptr++]; 
....................            } 
....................  
....................            if (c == '.') { 
....................               point = 1; 
....................               c = s[ptr++]; 
....................            } 
....................  
....................     while((c >= '0' && c <= '9') && point == 1) { 
....................         pow10 = pow10*10; 
....................                result += (c - '0')/pow10; 
....................                c = s[ptr++]; 
....................            } 
....................         } 
....................  
....................  if (sign == 1) 
....................       result = -1*result; 
....................  
....................  return(result); 
.................... } 
....................  
.................... #define labs abs 
.................... #define fabs abs 
....................  
.................... /************************************************************/ 
....................  
.................... signed int atoi(char *s) 
.................... { 
....................    signed int result; 
....................    int sign, base, index; 
....................    char c; 
....................  
....................    index = 0; 
....................    sign = 0; 
....................    base = 10; 
....................    result = 0; 
....................  
....................    // Omit all preceeding alpha characters 
....................    do 
....................       c = s[index++]; 
....................    while ((c < '0' || c > '9') && c != '+' && c != '-'); 
....................  
....................    // increase index if either positive or negative sign is detected 
....................    if (c == '-') 
....................    { 
....................       sign = 1;         // Set the sign to negative 
....................       c = s[index++]; 
....................    } 
....................    else if (c == '+') 
....................    { 
....................       c = s[index++]; 
....................    } 
....................  
....................    if (c >= '0' && c <= '9') 
....................    { 
....................  
....................       // Check for hexa number 
....................       if (c == '0' && (s[index] == 'x' || s[index] == 'X')) 
....................       { 
....................          base = 16; 
....................          index++; 
....................          c = s[index++]; 
....................       } 
....................  
....................       // The number is a decimal number 
....................       if (base == 10) 
....................       { 
....................          while (c >= '0' && c <= '9') 
....................          { 
....................             result = 10*result + (c - '0'); 
....................             c = s[index++]; 
....................          } 
....................       } 
....................       else if (base == 16)    // The number is a hexa number 
....................       { 
....................          while (c = TOUPPER(c), (c >= '0' && c <= '9') || (c >= 'A' && c<='F')) 
....................          { 
....................             if (c >= '0' && c <= '9') 
....................                result = (result << 4) + (c - '0'); 
....................             else 
....................                result = (result << 4) + (c - 'A' + 10); 
....................  
....................             c = s[index++]; 
....................          } 
....................       } 
....................    } 
....................  
....................    if (sign == 1 && base == 10) 
....................        result = -result; 
....................  
....................    return(result); 
.................... } 
....................  
....................  
....................  
.................... signed long atol(char *s) 
.................... { 
....................    signed long result; 
....................    int sign, base, index; 
....................    char c; 
....................  
....................    index = 0; 
....................    sign = 0; 
....................    base = 10; 
....................    result = 0; 
....................  
....................    do 
....................       c = s[index++]; 
....................    while ((c < '0' || c>'9') && c != '+' && c != '-'); 
....................  
....................    // increase index if either positive or negative sign is detected 
....................    if (c == '-') 
....................    { 
....................       sign = 1;         // Set the sign to negative 
....................       c = s[index++]; 
....................    } 
....................    else if (c == '+') 
....................    { 
....................       c = s[index++]; 
....................    } 
....................  
....................    if (c >= '0' && c <= '9') 
....................    { 
....................       if (c == '0' && (s[index] == 'x' || s[index] == 'X')) 
....................       { 
....................          base = 16; 
....................          index++; 
....................          c = s[index++]; 
....................       } 
....................  
....................       // The number is a decimal number 
....................       if (base == 10) 
....................       { 
....................          while (c >= '0' && c <= '9') 
....................          { 
....................             result = 10*result + (c - '0'); 
....................             c = s[index++]; 
....................          } 
....................       } 
....................       else if (base == 16)    // The number is a hexa number 
....................       { 
....................          while (c = TOUPPER(c), (c >= '0' && c <= '9') || (c >= 'A' && c <='F')) 
....................          { 
....................             if (c >= '0' && c <= '9') 
....................                result = (result << 4) + (c - '0'); 
....................             else 
....................                result = (result << 4) + (c - 'A' + 10); 
....................  
....................             c = s[index++]; 
....................          } 
....................       } 
....................    } 
....................  
....................    if (base == 10 && sign == 1) 
....................       result = -result; 
....................  
....................    return(result); 
.................... } 
....................  
.................... signed int32 mult_with10(int32 num) 
.................... { 
....................    return ( (num << 1) + (num << 3) ); 
.................... } 
....................  
.................... signed int32 atoi32(char *s) 
.................... { 
....................    signed int32 result; 
....................    int sign, base, index; 
....................    char c; 
....................  
....................    index = 0; 
....................    sign = 0; 
....................    base = 10; 
....................    result = 0; 
....................  
....................    do 
....................       c = s[index++]; 
....................    while ((c < '0' || c>'9') && c != '+' && c != '-'); 
....................  
....................    // increase index if either positive or negative sign is detected 
....................    if (c == '-') 
....................    { 
....................       sign = 1;         // Set the sign to negative 
....................       c = s[index++]; 
....................    } 
....................    else if (c == '+') 
....................    { 
....................       c = s[index++]; 
....................    } 
....................  
....................    if (c >= '0' && c <= '9') 
....................    { 
....................       if (c == '0' && (s[index] == 'x' || s[index] == 'X')) 
....................       { 
....................          base = 16; 
....................          index++; 
....................          c = s[index++]; 
....................       } 
....................  
....................       // The number is a decimal number 
....................       if (base == 10) 
....................       { 
....................          while (c >= '0' && c <= '9') { 
....................             result = (result << 1) + (result << 3);  // result *= 10; 
....................             result += (c - '0'); 
....................             c = s[index++]; 
....................          } 
....................       } 
....................       else if (base == 16)    // The number is a hexa number 
....................       { 
....................          while (c = TOUPPER(c), (c >= '0' && c <= '9') || (c >= 'A' && c <='F')) 
....................          { 
....................             if (c >= '0' && c <= '9') 
....................                result = (result << 4) + (c - '0'); 
....................             else 
....................                result = (result << 4) + (c - 'A' + 10); 
....................  
....................             c = s[index++]; 
....................          } 
....................       } 
....................    } 
....................  
....................    if (base == 10 && sign == 1) 
....................       result = -result; 
....................  
....................    return(result); 
.................... } 
....................  
....................  
.................... #endif 
.................... 
.................... #include <string.h> 
....................  //////////////////////////////////////////////////////////////////////////// 
.................... ////        (C) Copyright 1996,1997 Custom Computer Services            //// 
.................... //// This source code may only be used by licensed users of the CCS C   //// 
.................... //// compiler.  This source code may only be distributed to other       //// 
.................... //// licensed users of the CCS C compiler.  No other use, reproduction  //// 
.................... //// or distribution is permitted without written permission.           //// 
.................... //// Derivative programs created using this software in object code     //// 
.................... //// form are not restricted in any way.                                //// 
.................... //////////////////////////////////////////////////////////////////////////// 
....................  
.................... #include <ctype.h> 
....................  ////        (C) Copyright 1996,1997 Custom Computer Services            //// 
.................... //// This source code may only be used by licensed users of the CCS C   //// 
.................... //// compiler.  This source code may only be distributed to other       //// 
.................... //// licensed users of the CCS C compiler.  No other use, reproduction  //// 
.................... //// or distribution is permitted without written permission.           //// 
.................... //// Derivative programs created using this software in object code     //// 
.................... //// form are not restricted in any way.                                //// 
.................... //////////////////////////////////////////////////////////////////////////// 
....................  
.................... #ifndef islower 
....................  
.................... #define islower(x)  isamoung(x,"abcdefghijklmnopqrstuvwxyz") 
.................... #define isupper(x)  isamoung(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZ") 
.................... #define isalnum(x)  isamoung(x,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") 
.................... #define isalpha(x)  isamoung(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") 
.................... #define isdigit(x)  isamoung(x,"0123456789") 
.................... #define isspace(x)  (x==' ') 
.................... #define isxdigit(x) isamoung(x,"0123456789ABCDEFabcdef") 
.................... #define iscntrl(x)  (x<' ') 
.................... #define isprint(x)  (x>=' ') 
.................... #define isgraph(x)  (x>' ') 
.................... #define ispunct(x)  ((x>' ')&&!isalnum(x)) 
....................  
.................... #endif 
....................  
.................... #list 
.................... 
....................  
.................... /* standard template: char *strcat(char *s1, const char *s2) */ 
....................  
.................... char strcat(char *s1, char *s2) 
.................... { 
....................    char *s; 
....................  
....................    for (s = s1; *s != '\0'; s++); 
....................    while ((*s = *s2) != '\0') 
....................    { 
....................        s++; 
....................        s2++; 
....................    } 
....................    return(s1); 
.................... } 
....................  
.................... /***********************************************************/ 
....................  
.................... /* standard template: char *strchr(const char *s, int c). 
....................    Finds first occurrence of c in s1 */ 
....................  
.................... char strchr(char *s, int c) 
.................... { 
....................    for (; *s != c; s++) 
....................       if (*s == '\0') 
....................          return(0); 
....................    return(s); 
.................... } 
....................  
.................... /* standard template: char *strrchr(const char *s, int c). 
....................    Finds last occurrence of c in s1 */ 
....................  
.................... char strrchr(char *s, int c) 
.................... { 
....................    char *p; 
....................  
....................    for (p = 0; ; s++) 
....................    { 
....................       if (*s == c) 
....................          p = s; 
....................       if (*s == '\0') 
....................          return(p); 
....................    } 
.................... } 
....................  
.................... /*****************************************************************/ 
....................  
.................... /* standard template: int strcmp(const char *s1, const char *s2). 
....................    Compares s1 & s2; returns -1 if s1<s2, 0 if s1=s2, 1 if s1>s2 */ 
....................  
.................... signed int strcmp(char *s1, char *s2) 
.................... { 
....................    for (; *s1 == *s2; s1++, s2++) 
....................       if (*s1 == '\0') 
....................          return(0); 
....................    return((*s1 < *s2) ? -1: 1); 
.................... } 
....................  
.................... /* standard template: 
....................    int strncmp(const char *s1, const char *s2, size_t n). 
....................    Compares max of n characters (not following 0) from s1 to s2; 
....................    returns same as strcmp */ 
....................  
.................... signed int strncmp(char *s1, char *s2, int n) 
.................... { 
....................    for (; n > 0; s1++, s2++, n--) 
....................       if (*s1 != *s2) 
....................          return((*s1 <*s2) ? -1: 1); 
....................       else if (*s1 == '\0') 
....................          return(0); 
....................    return(0); 
.................... } 
....................  
.................... /* standard template: size_t stricmp(const char *s1, const char *s2). 
....................    Compares s1 to s2 ignoring case (upper vs. lower) */ 
....................  
.................... signed int stricmp(char *s1, char *s2) 
.................... { 
....................  for(; *s1==*s2||(isalpha(*s1)&&isalpha(*s2)&&(*s1==*s2+32||*s2==*s1+32)); 
*
0192:  MOVF   5F,W
0193:  MOVWF  04
0194:  MOVF   00,W
0195:  MOVWF  61
0196:  MOVF   60,W
0197:  MOVWF  04
0198:  MOVF   00,W
0199:  SUBWF  61,W
019A:  BTFSC  03.2
019B:  GOTO   1DA
019C:  MOVF   5F,W
019D:  MOVWF  04
019E:  MOVF   00,W
019F:  MOVWF  62
01A0:  MOVF   62,W
01A1:  SUBLW  40
01A2:  BTFSC  03.0
01A3:  GOTO   1A8
01A4:  MOVF   62,W
01A5:  SUBLW  5A
01A6:  BTFSC  03.0
01A7:  GOTO   1B0
01A8:  MOVF   62,W
01A9:  SUBLW  60
01AA:  BTFSC  03.0
01AB:  GOTO   1E6
01AC:  MOVF   62,W
01AD:  SUBLW  7A
01AE:  BTFSS  03.0
01AF:  GOTO   1E6
01B0:  MOVF   60,W
01B1:  MOVWF  04
01B2:  MOVF   00,W
01B3:  MOVWF  63
01B4:  MOVF   63,W
01B5:  SUBLW  40
01B6:  BTFSC  03.0
01B7:  GOTO   1BC
01B8:  MOVF   63,W
01B9:  SUBLW  5A
01BA:  BTFSC  03.0
01BB:  GOTO   1C4
01BC:  MOVF   63,W
01BD:  SUBLW  60
01BE:  BTFSC  03.0
01BF:  GOTO   1E6
01C0:  MOVF   63,W
01C1:  SUBLW  7A
01C2:  BTFSS  03.0
01C3:  GOTO   1E6
01C4:  MOVF   5F,W
01C5:  MOVWF  04
01C6:  MOVF   00,W
01C7:  MOVWF  64
01C8:  MOVF   60,W
01C9:  MOVWF  04
01CA:  MOVLW  20
01CB:  ADDWF  00,W
01CC:  SUBWF  64,W
01CD:  BTFSC  03.2
01CE:  GOTO   1DA
01CF:  MOVF   60,W
01D0:  MOVWF  04
01D1:  MOVF   00,W
01D2:  MOVWF  66
01D3:  MOVF   5F,W
01D4:  MOVWF  04
01D5:  MOVLW  20
01D6:  ADDWF  00,W
01D7:  SUBWF  66,W
01D8:  BTFSS  03.2
01D9:  GOTO   1E6
....................     s1++, s2++) 
....................     if (*s1 == '\0') 
01DA:  MOVF   5F,W
01DB:  MOVWF  04
01DC:  MOVF   00,F
01DD:  BTFSS  03.2
01DE:  GOTO   1E2
....................        return(0); 
01DF:  MOVLW  00
01E0:  MOVWF  78
01E1:  GOTO   1F4
01E2:  MOVF   5F,W
01E3:  INCF   5F,F
01E4:  INCF   60,F
01E5:  GOTO   192
....................  return((*s1 < *s2) ? -1: 1); 
01E6:  MOVF   5F,W
01E7:  MOVWF  04
01E8:  MOVF   00,W
01E9:  MOVWF  61
01EA:  MOVF   60,W
01EB:  MOVWF  04
01EC:  MOVF   00,W
01ED:  SUBWF  61,W
01EE:  BTFSC  03.0
01EF:  GOTO   1F2
01F0:  MOVLW  FF
01F1:  GOTO   1F3
01F2:  MOVLW  01
01F3:  MOVWF  78
01F4:  RETLW  00
.................... } 
....................  
.................... /***************************************************************/ 
....................  
.................... /* compiler ignored the name 'strcpy()'; perhaps, it's reserved? 
....................    Standard template: char *strcpy(char *s1, const char *s2) */ 
....................  
.................... char strcopy(char *s1, char *s2) 
.................... { 
....................   char *s; 
....................  
....................   for (s = s1; *s2 != 0; s++, s2++) 
.................... 	  *s = *s2; 
....................   return(s1); 
.................... } 
....................  
.................... /* standard template: 
....................    char *strncpy(char *s1, const char *s2, size_t n). 
....................    Copies max of n characters (not following ending '\0') 
....................    from s2 in s1; if s2 has less than n characters, appends 0 */ 
....................  
.................... char strncpy(char *s1, char *s2, int n) 
.................... { 
....................   char *s; 
....................  
....................   for (s = s1; n > 0 && *s2 != '\0'; n--) 
....................      *s++ = *s2++; 
....................   for (; n > 0; n--) 
....................      *s++ = '\0'; 
....................  
....................   return(s1); 
.................... } 
....................  
.................... /***************************************************************/ 
....................  
.................... /* standard template: 
....................    size_t strcspn(const char *s1, const char *s2). 
....................    Computes length of max initial segment of s1 that 
....................    consists entirely of characters NOT from s2*/ 
....................  
.................... int strcspn(char *s1, char *s2) 
.................... { 
....................    char *sc1, *sc2; 
....................  
....................    for (sc1 = s1; *sc1 != 0; sc1++) 
....................       for (sc2 = s2; *sc2 != 0; sc2++) 
....................          if (*sc1 == *sc2) 
....................             return(sc1 - s1); 
....................    return(sc1 - s1); 
.................... } 
....................  
.................... /* computes length of max initial segment of s1 consisting 
....................    entirely of characters from s2 */ 
....................  
.................... int strspn(char *s1, char *s2) 
.................... { 
....................    char *sc1, *sc2; 
....................  
....................    for (sc1 = s1; *sc1 != 0; sc1++) 
*
0275:  MOVF   63,W
0276:  MOVWF  65
0277:  MOVF   65,W
0278:  MOVWF  04
0279:  MOVF   00,F
027A:  BTFSC  03.2
027B:  GOTO   296
....................       for (sc2 = s2; ; sc2++) 
027C:  MOVF   64,W
027D:  MOVWF  66
.................... 	 if (*sc2 == '\0') 
027E:  MOVF   66,W
027F:  MOVWF  04
0280:  MOVF   00,F
0281:  BTFSS  03.2
0282:  GOTO   288
.................... 	    return(sc1 - s1); 
0283:  MOVF   63,W
0284:  SUBWF  65,W
0285:  MOVWF  78
0286:  GOTO   299
....................          else if (*sc1 == *sc2) 
0287:  GOTO   292
0288:  MOVF   65,W
0289:  MOVWF  04
028A:  MOVF   00,W
028B:  MOVWF  67
028C:  MOVF   66,W
028D:  MOVWF  04
028E:  MOVF   00,W
028F:  SUBWF  67,W
0290:  BTFSC  03.2
....................             break; 
0291:  GOTO   294
0292:  INCF   66,F
0293:  GOTO   27E
0294:  INCF   65,F
0295:  GOTO   277
....................    return(sc1 - s1); 
0296:  MOVF   63,W
0297:  SUBWF  65,W
0298:  MOVWF  78
.................... } 
....................  
.................... /***************************************************************/ 
....................  
.................... /* standard template: size_t strlen(const char *s). 
....................    Computes length of s1 (preceding terminating 0) */ 
....................  
.................... int strlen(char *s) 
.................... { 
....................    char *sc; 
....................  
....................    for (sc = s; *sc != 0; sc++); 
....................    return(sc - s); 
.................... } 
....................  
.................... /***************************************************************/ 
....................  
.................... /* standard template: char *strlwr(char *s). 
....................    Replaces uppercase letters by lowercase; 
....................    returns pointer to new string s */ 
....................  
.................... char strlwr(char *s) 
.................... { 
....................    char *p; 
....................  
....................    for (p = s; *p != '\0'; p++) 
....................       if (*p >= 'A' && *p <='Z') 
....................          *p += 'a' - 'A'; 
....................    return(s); 
.................... } 
....................  
.................... /****************************************************************/ 
....................  
.................... /* standard template: 
....................    char *strpbrk(const char *s1, const char *s2). 
....................    Locates first occurence of any character from s2 in s1; 
....................    returns s1 if s2 is empty string */ 
....................  
.................... char strpbrk(char *s1, char *s2) 
.................... { 
....................    char *sc1, *sc2; 
....................  
....................    for (sc1 = s1; *sc1 != 0; sc1++) 
*
02AB:  MOVF   63,W
02AC:  MOVWF  65
02AD:  MOVF   65,W
02AE:  MOVWF  04
02AF:  MOVF   00,F
02B0:  BTFSC  03.2
02B1:  GOTO   2CA
....................       for (sc2 = s2; *sc2 != 0; sc2++) 
02B2:  MOVF   64,W
02B3:  MOVWF  66
02B4:  MOVF   66,W
02B5:  MOVWF  04
02B6:  MOVF   00,F
02B7:  BTFSC  03.2
02B8:  GOTO   2C8
....................          if (*sc1 == *sc2) 
02B9:  MOVF   65,W
02BA:  MOVWF  04
02BB:  MOVF   00,W
02BC:  MOVWF  67
02BD:  MOVF   66,W
02BE:  MOVWF  04
02BF:  MOVF   00,W
02C0:  SUBWF  67,W
02C1:  BTFSS  03.2
02C2:  GOTO   2C6
....................             return(sc1); 
02C3:  MOVF   65,W
02C4:  MOVWF  78
02C5:  GOTO   2CC
02C6:  INCF   66,F
02C7:  GOTO   2B4
02C8:  INCF   65,F
02C9:  GOTO   2AD
....................    return(0); 
02CA:  MOVLW  00
02CB:  MOVWF  78
.................... } 
....................  
.................... /****************************************************************/ 
....................  
.................... /* standard template: 
....................    char *strstr(const char *s1, const char *s2); 
....................    Locates first occurence of character sequence s2 in s1; 
....................    returns 0 if s2 is empty string */ 
....................  
.................... char strstr(char *s1, char *s2) 
.................... { 
....................    char *sc1, *sc2; 
....................  
....................    if (*s2 == 0) 
....................          return(s1); 
....................    for (; s1 = strchr(s1, *s2); s1++) 
....................    { 
....................       for (sc1 = s1, sc2 = s2; ; sc1++, sc2++) 
....................          if (*sc2 == 0) 
.................... 	    return(s1); 
....................          else if (*sc1 != *sc2) 
....................             break; 
....................    } 
....................    return(0); 
.................... } 
....................  
.................... /************************************************************/ 
....................  
.................... /* standard template: char *strtok(char *s1, const char *s2). 
....................  
....................    Finds next token in s1 delimited by a character from separator 
....................    string s2 (which can be different from call to call).  First call 
....................    starts at beginning of s1 searching for first character NOT 
....................    contained in s2; returns 0 if none is found. 
....................    If one is found, it is the start of first token (return value). 
....................    Function then searches from there for a character contained in s2. 
....................    If none is found, current token extends to end of s1, and subsequent 
....................    searches for a token will return 0.  If one is found, it is 
....................    overwritten by '\0', which terminates current token.  Function saves 
....................    pointer to following character from which next search will start. 
....................    Each subsequent call, with 0 as first argument, starts searching 
....................    from saved pointer */ 
....................  
.................... char strtok(char *s1, char *s2) 
.................... { 
....................    char *beg, *end; 
....................    static char *save; 
....................  
....................    beg = (s1)? s1: save; 
*
026B:  MOVF   5F,F
026C:  BTFSC  03.2
026D:  GOTO   270
026E:  MOVF   5F,W
026F:  GOTO   271
0270:  MOVF   28,W
0271:  MOVWF  61
....................    beg += strspn(beg, s2); 
0272:  MOVWF  63
0273:  MOVF   60,W
0274:  MOVWF  64
*
0299:  MOVF   78,W
029A:  ADDWF  61,F
....................    if (*beg == '\0') 
029B:  MOVF   61,W
029C:  MOVWF  04
029D:  MOVF   00,F
029E:  BTFSS  03.2
029F:  GOTO   2A7
....................    { 
....................       *save = ' '; 
02A0:  MOVF   28,W
02A1:  MOVWF  04
02A2:  MOVLW  20
02A3:  MOVWF  00
....................       return(0); 
02A4:  MOVLW  00
02A5:  MOVWF  78
02A6:  GOTO   2DA
....................    } 
....................    end = strpbrk(beg, s2); 
02A7:  MOVF   61,W
02A8:  MOVWF  63
02A9:  MOVF   60,W
02AA:  MOVWF  64
*
02CC:  MOVF   78,W
02CD:  MOVWF  62
....................    if (*end != '\0') 
02CE:  MOVWF  04
02CF:  MOVF   00,F
02D0:  BTFSC  03.2
02D1:  GOTO   2D6
....................    { 
....................       *end = '\0'; 
02D2:  MOVF   62,W
02D3:  MOVWF  04
02D4:  CLRF   00
....................       end++; 
02D5:  INCF   62,F
....................    } 
....................    save = end; 
02D6:  MOVF   62,W
02D7:  MOVWF  28
....................    return(beg); 
02D8:  MOVF   61,W
02D9:  MOVWF  78
.................... } 
....................  
.................... 
.................... #include "pic_test.h" 
....................  /****************************************************************************/ 
.................... /* Copyright 2004 MBARI.                                                    */ 
.................... /* Monterey Bay Aquarium Research Institute Proprietary Information.        */ 
.................... /* All rights reserved.                                                     */ 
.................... /****************************************************************************/ 
.................... #ifndef PH_PROBE_H 
.................... #define PH_PROBE_H 
....................  
.................... #define VS_VERSION  "0.1" 
.................... #define DEBUG 0 
....................  
....................  
.................... /* 
....................     The ticks per second is based on an 8-bit counter over flowing that 
....................     is driven by a 4 Mhz ocsillator prescaled by 4 and postscaled by 64. 
....................  
....................     TICKS_PER_SEC = (OSC_CLK) / (PRESCALE) / (POSTSCALE) / (8_BIT_OVERFLOW) 
....................                   = 4000000   /     4      /      64     /      256 
....................                   = 61.0351 
.................... */ 
.................... #define TICKS_PER_SEC   61 
....................  
....................  
....................  
.................... #define HI  1 
.................... #define LO  0 
....................  
.................... #define ON  1 
.................... #define OFF 0 
....................  
.................... #define NULL 0 
....................  
.................... #endif 
.................... 
.................... #include "errors.h" 
....................  /****************************************************************************/ 
.................... /* Copyright 2004 MBARI.                                                    */ 
.................... /* Monterey Bay Aquarium Research Institute Proprietary Information.        */ 
.................... /* All rights reserved.                                                     */ 
.................... /****************************************************************************/ 
.................... #ifndef ERRORS_H 
.................... #define ERRORS_H 
....................  
.................... /* error codes */ 
.................... #define ERR_SUCCESS         0 
.................... #define NO_COMMAND_MATCH    1 
....................  
.................... #define ERR_BAD_PARAM       20 
....................  
.................... #endif 
.................... 
....................  
.................... #if DEBUG 
.................... #device ICD=TRUE 
.................... #fuses XT,NOWDT,NOPROTECT,PUT,NOBROWNOUT,NOLVP 
.................... #else 
.................... #fuses XT,NOWDT,NOPROTECT,PUT,NOLVP 
.................... #endif 
....................  
.................... #use delay(clock=4000000) 
*
00E2:  MOVLW  3F
00E3:  MOVWF  04
00E4:  MOVF   00,W
00E5:  BTFSC  03.2
00E6:  GOTO   0F6
00E7:  MOVLW  01
00E8:  MOVWF  78
00E9:  CLRF   77
00EA:  DECFSZ 77,F
00EB:  GOTO   0EA
00EC:  DECFSZ 78,F
00ED:  GOTO   0E9
00EE:  MOVLW  4A
00EF:  MOVWF  77
00F0:  DECFSZ 77,F
00F1:  GOTO   0F0
00F2:  NOP
00F3:  NOP
00F4:  DECFSZ 00,F
00F5:  GOTO   0E7
00F6:  RETLW  00
.................... #use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS) 
00F7:  BTFSS  0C.5
00F8:  GOTO   0F7
00F9:  MOVF   18,W
00FA:  MOVWF  29
00FB:  MOVF   1A,W
00FC:  MOVWF  78
00FD:  BTFSS  29.1
00FE:  GOTO   101
00FF:  BCF    18.4
0100:  BSF    18.4
0101:  NOP
0102:  BCF    0A.3
0103:  BCF    0A.4
0104:  GOTO   20C (RETURN)
....................  
.................... #include "cmd_io.c" 
....................  /****************************************************************************/ 
.................... /* Copyright 2004 MBARI.                                                    */ 
.................... /* Monterey Bay Aquarium Research Institute Proprietary Information.        */ 
.................... /* All rights reserved.                                                     */ 
.................... /****************************************************************************/ 
....................  
.................... #define MAX_CHARS   15 
.................... #define putEcho()   if ( echoMode ) putc('\n') 
.................... #define setEcho(X)  echoMode = (X) 
....................  
.................... int echoMode = false; 
....................  
.................... int getCommand(char* cmd) 
.................... { 
....................     static int char_count = 0; 
....................     static char line[MAX_CHARS] = ""; 
....................     char terminator = '\r'; 
....................     int got_line; 
....................     int c; 
*
0206:  MOVLW  0D
0207:  MOVWF  60
....................     int i; 
....................  
....................     got_line = FALSE; 
0208:  CLRF   61
....................  
....................     if (  kbhit() ) 
0209:  BTFSS  0C.5
020A:  GOTO   25C
....................     { 
....................         c = getc(); 
020B:  GOTO   0F7
020C:  MOVF   78,W
020D:  MOVWF  62
....................  
....................         if ( echoMode ) 
020E:  MOVF   2A,F
020F:  BTFSC  03.2
0210:  GOTO   222
....................         { 
....................             if (c == '\r') 
0211:  MOVF   62,W
0212:  SUBLW  0D
0213:  BTFSS  03.2
0214:  GOTO   21E
....................             { 
....................                 putc('\r'); 
0215:  MOVLW  0D
0216:  BTFSS  0C.4
0217:  GOTO   216
0218:  MOVWF  19
....................                 putc('\n'); 
0219:  MOVLW  0A
021A:  BTFSS  0C.4
021B:  GOTO   21A
021C:  MOVWF  19
....................             } 
....................             else 
021D:  GOTO   222
....................             { 
....................                 putc(c); 
021E:  MOVF   62,W
021F:  BTFSS  0C.4
0220:  GOTO   21F
0221:  MOVWF  19
....................             } 
....................         } 
....................  
....................         if ( c != terminator ) 
0222:  MOVF   60,W
0223:  SUBWF  62,W
0224:  BTFSC  03.2
0225:  GOTO   23C
....................         { 
....................             if ( (c != 8) && (char_count < MAX_CHARS) ) 
0226:  MOVF   62,W
0227:  SUBLW  08
0228:  BTFSC  03.2
0229:  GOTO   235
022A:  MOVF   2B,W
022B:  SUBLW  0E
022C:  BTFSS  03.0
022D:  GOTO   235
....................                 line[char_count++] = c; 
022E:  MOVF   2B,W
022F:  INCF   2B,F
0230:  ADDLW  2C
0231:  MOVWF  04
0232:  MOVF   62,W
0233:  MOVWF  00
....................             else if ( char_count > 0 ) 
0234:  GOTO   238
0235:  MOVF   2B,F
0236:  BTFSS  03.2
....................                 --char_count; 
0237:  DECF   2B,F
....................  
....................             cmd[0] = '\0'; 
0238:  MOVF   5F,W
0239:  MOVWF  04
023A:  CLRF   00
....................         }  
....................         else 
023B:  GOTO   25C
....................         { 
....................             got_line = TRUE; 
023C:  MOVLW  01
023D:  MOVWF  61
....................              
....................             if ( char_count < MAX_CHARS ) 
023E:  MOVF   2B,W
023F:  SUBLW  0E
0240:  BTFSS  03.0
0241:  GOTO   247
....................                 line[char_count] = '\0'; 
0242:  MOVLW  2C
0243:  ADDWF  2B,W
0244:  MOVWF  04
0245:  CLRF   00
....................             else 
0246:  GOTO   248
....................                 line[MAX_CHARS - 1] = '\0'; 
0247:  CLRF   3A
....................  
....................             for (i = 0; i <= char_count; i++) 
0248:  CLRF   63
0249:  MOVF   63,W
024A:  SUBWF  2B,W
024B:  BTFSS  03.0
024C:  GOTO   25B
....................                 cmd[i] = line[i]; 
024D:  MOVF   5F,W
024E:  ADDWF  63,W
024F:  MOVWF  64
0250:  MOVLW  2C
0251:  ADDWF  63,W
0252:  MOVWF  04
0253:  MOVF   00,W
0254:  MOVWF  65
0255:  MOVF   64,W
0256:  MOVWF  04
0257:  MOVF   65,W
0258:  MOVWF  00
0259:  INCF   63,F
025A:  GOTO   249
....................             char_count = 0; 
025B:  CLRF   2B
....................         } 
....................     } 
....................  
....................     return got_line; 
025C:  MOVF   61,W
025D:  MOVWF  78
.................... } 
....................  
.................... void putErr(int err_code) 
.................... { 
....................     if ( err_code ) 
*
0162:  MOVF   60,F
0163:  BTFSC  03.2
0164:  GOTO   17F
....................     { 
....................         printf("ERR %03d\r", err_code); 
*
0034:  BCF    0A.0
0035:  BCF    0A.1
0036:  BCF    0A.2
0037:  ADDWF  02,F
0038:  RETLW  45
0039:  RETLW  52
003A:  RETLW  52
003B:  RETLW  20
003C:  RETLW  25
003D:  RETLW  30
003E:  RETLW  33
003F:  RETLW  64
0040:  RETLW  0D
0041:  RETLW  00
*
011A:  MOVLW  20
011B:  MOVWF  78
011C:  MOVF   62,W
011D:  MOVWF  77
011E:  BTFSS  77.7
011F:  GOTO   126
0120:  COMF   77,F
0121:  INCF   77,F
0122:  MOVF   77,W
0123:  MOVWF  62
0124:  MOVLW  2D
0125:  MOVWF  78
0126:  MOVF   78,W
0127:  BTFSS  0C.4
0128:  GOTO   127
0129:  MOVWF  19
012A:  BTFSC  63.0
012B:  GOTO   145
012C:  BTFSC  63.1
012D:  GOTO   159
012E:  MOVF   62,W
012F:  MOVWF  64
0130:  MOVLW  64
0131:  MOVWF  65
0132:  CALL   105
0133:  MOVF   77,W
0134:  MOVWF  62
0135:  MOVF   78,W
0136:  MOVLW  30
0137:  BTFSS  03.2
0138:  GOTO   13E
0139:  BTFSC  63.2
013A:  GOTO   145
013B:  BTFSC  63.3
013C:  MOVLW  20
013D:  GOTO   140
013E:  BCF    63.2
013F:  BCF    63.3
0140:  ADDWF  78,F
0141:  MOVF   78,W
0142:  BTFSS  0C.4
0143:  GOTO   142
0144:  MOVWF  19
0145:  MOVF   62,W
0146:  MOVWF  64
0147:  MOVLW  0A
0148:  MOVWF  65
0149:  CALL   105
014A:  MOVF   77,W
014B:  MOVWF  62
014C:  MOVF   78,W
014D:  MOVLW  30
014E:  BTFSS  03.2
014F:  GOTO   154
0150:  BTFSC  63.2
0151:  GOTO   159
0152:  BTFSC  63.3
0153:  MOVLW  20
0154:  ADDWF  78,F
0155:  MOVF   78,W
0156:  BTFSS  0C.4
0157:  GOTO   156
0158:  MOVWF  19
0159:  MOVLW  30
015A:  ADDWF  62,F
015B:  MOVF   62,W
015C:  BTFSS  0C.4
015D:  GOTO   15C
015E:  MOVWF  19
015F:  BCF    0A.3
0160:  BCF    0A.4
0161:  GOTO   174 (RETURN)
*
0165:  CLRF   61
0166:  MOVF   61,W
0167:  CALL   034
0168:  INCF   61,F
0169:  BTFSS  0C.4
016A:  GOTO   169
016B:  MOVWF  19
016C:  MOVLW  04
016D:  SUBWF  61,W
016E:  BTFSS  03.2
016F:  GOTO   166
0170:  MOVF   60,W
0171:  MOVWF  62
0172:  CLRF   63
0173:  GOTO   11A
0174:  MOVLW  0D
0175:  BTFSS  0C.4
0176:  GOTO   175
0177:  MOVWF  19
....................         putEcho(); 
0178:  MOVF   2A,F
0179:  BTFSC  03.2
017A:  GOTO   17F
017B:  MOVLW  0A
017C:  BTFSS  0C.4
017D:  GOTO   17C
017E:  MOVWF  19
....................     } 
....................  
....................     printf("RDY\r"); 
*
0042:  BCF    0A.0
0043:  BCF    0A.1
0044:  BCF    0A.2
0045:  ADDWF  02,F
0046:  RETLW  52
0047:  RETLW  44
0048:  RETLW  59
0049:  RETLW  0D
004A:  RETLW  00
*
017F:  CLRF   61
0180:  MOVF   61,W
0181:  CALL   042
0182:  INCF   61,F
0183:  BTFSS  0C.4
0184:  GOTO   183
0185:  MOVWF  19
0186:  MOVLW  04
0187:  SUBWF  61,W
0188:  BTFSS  03.2
0189:  GOTO   180
....................     putEcho(); 
018A:  MOVF   2A,F
018B:  BTFSC  03.2
018C:  GOTO   191
018D:  MOVLW  0A
018E:  BTFSS  0C.4
018F:  GOTO   18E
0190:  MOVWF  19
....................  
....................     return; 
0191:  RETLW  00
.................... } 
....................  
.................... 
....................  
.................... long clockTicks = 0; 
....................  
.................... #INT_RTCC 
.................... rtccCounter() 
.................... { 
....................     clockTicks++; 
*
00DB:  INCF   3B,F
00DC:  BTFSC  03.2
00DD:  INCF   3C,F
00DE:  BCF    0B.2
00DF:  BCF    0A.3
00E0:  BCF    0A.4
00E1:  GOTO   01E
.................... } 
....................  
.................... int showHelp() 
.................... { 
....................     printf("V - show version\r\n"); 
*
004B:  BCF    0A.0
004C:  BCF    0A.1
004D:  BCF    0A.2
004E:  ADDWF  02,F
004F:  RETLW  56
0050:  RETLW  20
0051:  RETLW  2D
0052:  RETLW  20
0053:  RETLW  73
0054:  RETLW  68
0055:  RETLW  6F
0056:  RETLW  77
0057:  RETLW  20
0058:  RETLW  76
0059:  RETLW  65
005A:  RETLW  72
005B:  RETLW  73
005C:  RETLW  69
005D:  RETLW  6F
005E:  RETLW  6E
005F:  RETLW  0D
0060:  RETLW  0A
0061:  RETLW  00
*
02F3:  CLRF   5F
02F4:  MOVF   5F,W
02F5:  CALL   04B
02F6:  INCF   5F,F
02F7:  BTFSS  0C.4
02F8:  GOTO   2F7
02F9:  MOVWF  19
02FA:  MOVLW  12
02FB:  SUBWF  5F,W
02FC:  BTFSS  03.2
02FD:  GOTO   2F4
....................     printf("? - show this menu\r\n"); 
*
0062:  BCF    0A.0
0063:  BCF    0A.1
0064:  BCF    0A.2
0065:  ADDWF  02,F
0066:  RETLW  3F
0067:  RETLW  20
0068:  RETLW  2D
0069:  RETLW  20
006A:  RETLW  73
006B:  RETLW  68
006C:  RETLW  6F
006D:  RETLW  77
006E:  RETLW  20
006F:  RETLW  74
0070:  RETLW  68
0071:  RETLW  69
0072:  RETLW  73
0073:  RETLW  20
0074:  RETLW  6D
0075:  RETLW  65
0076:  RETLW  6E
0077:  RETLW  75
0078:  RETLW  0D
0079:  RETLW  0A
007A:  RETLW  00
*
02FE:  CLRF   5F
02FF:  MOVF   5F,W
0300:  CALL   062
0301:  INCF   5F,F
0302:  BTFSS  0C.4
0303:  GOTO   302
0304:  MOVWF  19
0305:  MOVLW  14
0306:  SUBWF  5F,W
0307:  BTFSS  03.2
0308:  GOTO   2FF
....................      
....................     return ERR_SUCCESS; 
0309:  MOVLW  00
030A:  MOVWF  78
.................... } 
....................  
.................... int showVersion() 
.................... { 
....................     printf("Alana's Magic PIC Board, rev %s\r\n", VS_VERSION); 
*
007B:  BCF    0A.0
007C:  BCF    0A.1
007D:  BCF    0A.2
007E:  ADDWF  02,F
007F:  RETLW  41
0080:  RETLW  6C
0081:  RETLW  61
0082:  RETLW  6E
0083:  RETLW  61
0084:  RETLW  27
0085:  RETLW  73
0086:  RETLW  20
0087:  RETLW  4D
0088:  RETLW  61
0089:  RETLW  67
008A:  RETLW  69
008B:  RETLW  63
008C:  RETLW  20
008D:  RETLW  50
008E:  RETLW  49
008F:  RETLW  43
0090:  RETLW  20
0091:  RETLW  42
0092:  RETLW  6F
0093:  RETLW  61
0094:  RETLW  72
0095:  RETLW  64
0096:  RETLW  2C
0097:  RETLW  20
0098:  RETLW  72
0099:  RETLW  65
009A:  RETLW  76
009B:  RETLW  20
009C:  RETLW  25
009D:  RETLW  73
009E:  RETLW  0D
009F:  RETLW  0A
00A0:  RETLW  00
00A1:  BCF    0A.0
00A2:  BCF    0A.1
00A3:  BCF    0A.2
00A4:  ADDWF  02,F
00A5:  RETLW  30
00A6:  RETLW  2E
00A7:  RETLW  31
00A8:  RETLW  00
*
0327:  CLRF   5F
0328:  MOVF   5F,W
0329:  CALL   07B
032A:  INCF   5F,F
032B:  BTFSS  0C.4
032C:  GOTO   32B
032D:  MOVWF  19
032E:  MOVLW  1D
032F:  SUBWF  5F,W
0330:  BTFSS  03.2
0331:  GOTO   328
0332:  CLRF   60
0333:  MOVF   60,W
0334:  CALL   0A1
0335:  IORLW  00
0336:  BTFSC  03.2
0337:  GOTO   33D
0338:  INCF   60,F
0339:  BTFSS  0C.4
033A:  GOTO   339
033B:  MOVWF  19
033C:  GOTO   333
033D:  MOVLW  0D
033E:  BTFSS  0C.4
033F:  GOTO   33E
0340:  MOVWF  19
0341:  MOVLW  0A
0342:  BTFSS  0C.4
0343:  GOTO   342
0344:  MOVWF  19
....................     printf("built on %s\r\n", __DATE__); 
*
00A9:  BCF    0A.0
00AA:  BCF    0A.1
00AB:  BCF    0A.2
00AC:  ADDWF  02,F
00AD:  RETLW  62
00AE:  RETLW  75
00AF:  RETLW  69
00B0:  RETLW  6C
00B1:  RETLW  74
00B2:  RETLW  20
00B3:  RETLW  6F
00B4:  RETLW  6E
00B5:  RETLW  20
00B6:  RETLW  25
00B7:  RETLW  73
00B8:  RETLW  0D
00B9:  RETLW  0A
00BA:  RETLW  00
00BB:  BCF    0A.0
00BC:  BCF    0A.1
00BD:  BCF    0A.2
00BE:  ADDWF  02,F
00BF:  RETLW  30
00C0:  RETLW  34
00C1:  RETLW  2D
00C2:  RETLW  4A
00C3:  RETLW  61
00C4:  RETLW  6E
00C5:  RETLW  2D
00C6:  RETLW  30
00C7:  RETLW  36
00C8:  RETLW  00
*
0345:  CLRF   5F
0346:  MOVF   5F,W
0347:  CALL   0A9
0348:  INCF   5F,F
0349:  BTFSS  0C.4
034A:  GOTO   349
034B:  MOVWF  19
034C:  MOVLW  09
034D:  SUBWF  5F,W
034E:  BTFSS  03.2
034F:  GOTO   346
0350:  CLRF   60
0351:  MOVF   60,W
0352:  CALL   0BB
0353:  IORLW  00
0354:  BTFSC  03.2
0355:  GOTO   35B
0356:  INCF   60,F
0357:  BTFSS  0C.4
0358:  GOTO   357
0359:  MOVWF  19
035A:  GOTO   351
035B:  MOVLW  0D
035C:  BTFSS  0C.4
035D:  GOTO   35C
035E:  MOVWF  19
035F:  MOVLW  0A
0360:  BTFSS  0C.4
0361:  GOTO   360
0362:  MOVWF  19
....................      
....................     return ERR_SUCCESS; 
0363:  MOVLW  00
0364:  MOVWF  78
.................... } 
....................  
.................... void processCmds() 
.................... { 
....................     char *token; 
....................     char usr_cmd[MAX_CHARS]; 
....................     char cmd_str[MAX_CHARS]; 
....................     char delim[2]; 
....................  
....................     strcpy(delim, " "); 
*
00C9:  BCF    0A.0
00CA:  BCF    0A.1
00CB:  BCF    0A.2
00CC:  ADDWF  02,F
00CD:  RETLW  20
00CE:  RETLW  00
*
01F5:  CLRF   60
01F6:  CLRF   5F
01F7:  MOVLW  5D
01F8:  MOVWF  04
01F9:  MOVF   5F,W
01FA:  ADDWF  04,F
01FB:  MOVF   60,W
01FC:  CALL   0C9
01FD:  MOVWF  00
01FE:  IORLW  00
01FF:  BTFSC  03.2
0200:  GOTO   204
0201:  INCF   60,F
0202:  INCF   5F,F
0203:  GOTO   1F7
....................  
....................     if ( !getCommand(usr_cmd) ) 
0204:  MOVLW  3F
0205:  MOVWF  5F
*
025E:  MOVF   78,F
025F:  BTFSC  03.2
....................         return; 
0260:  GOTO   36D
....................  
....................     if ( usr_cmd[0] == '\0' ) 
0261:  MOVF   3F,F
0262:  BTFSS  03.2
0263:  GOTO   267
....................     { 
....................         putErr(ERR_SUCCESS); 
0264:  CLRF   60
0265:  CALL   162
....................         return; 
0266:  GOTO   36D
....................     } 
....................  
....................     /* grab first token */ 
....................     token = strtok(usr_cmd, delim); 
0267:  MOVLW  3F
0268:  MOVWF  5F
0269:  MOVLW  5D
026A:  MOVWF  60
*
02DA:  MOVF   78,W
02DB:  MOVWF  3E
....................  
....................     /********************************** ? ***********************************/ 
....................     strcpy(cmd_str, "?"); 
*
00CF:  BCF    0A.0
00D0:  BCF    0A.1
00D1:  BCF    0A.2
00D2:  ADDWF  02,F
00D3:  RETLW  3F
00D4:  RETLW  00
*
02DC:  CLRF   60
02DD:  CLRF   5F
02DE:  MOVLW  4E
02DF:  MOVWF  04
02E0:  MOVF   5F,W
02E1:  ADDWF  04,F
02E2:  MOVF   60,W
02E3:  CALL   0CF
02E4:  MOVWF  00
02E5:  IORLW  00
02E6:  BTFSC  03.2
02E7:  GOTO   2EB
02E8:  INCF   60,F
02E9:  INCF   5F,F
02EA:  GOTO   2DE
....................  
....................     if ( stricmp(token, cmd_str) == 0 ) 
02EB:  MOVF   3E,W
02EC:  MOVWF  5F
02ED:  MOVLW  4E
02EE:  MOVWF  60
02EF:  CALL   192
02F0:  MOVF   78,F
02F1:  BTFSS  03.2
02F2:  GOTO   310
....................     { 
....................         putErr(showHelp()); 
*
030B:  MOVF   78,W
030C:  MOVWF  5F
030D:  MOVWF  60
030E:  CALL   162
....................         return; 
030F:  GOTO   36D
....................     } 
....................  
....................     /********************************** V ***********************************/ 
....................     strcpy(cmd_str, "V"); 
*
00D5:  BCF    0A.0
00D6:  BCF    0A.1
00D7:  BCF    0A.2
00D8:  ADDWF  02,F
00D9:  RETLW  56
00DA:  RETLW  00
*
0310:  CLRF   60
0311:  CLRF   5F
0312:  MOVLW  4E
0313:  MOVWF  04
0314:  MOVF   5F,W
0315:  ADDWF  04,F
0316:  MOVF   60,W
0317:  CALL   0D5
0318:  MOVWF  00
0319:  IORLW  00
031A:  BTFSC  03.2
031B:  GOTO   31F
031C:  INCF   60,F
031D:  INCF   5F,F
031E:  GOTO   312
....................  
....................     if ( stricmp(token, cmd_str) == 0 ) 
031F:  MOVF   3E,W
0320:  MOVWF  5F
0321:  MOVLW  4E
0322:  MOVWF  60
0323:  CALL   192
0324:  MOVF   78,F
0325:  BTFSS  03.2
0326:  GOTO   36A
....................     { 
....................         putErr(showVersion()); 
*
0365:  MOVF   78,W
0366:  MOVWF  5F
0367:  MOVWF  60
0368:  CALL   162
....................  
....................         return;   
0369:  GOTO   36D
....................     } 
....................      
....................     /************************************************************************/ 
....................     /***                        start debug commands                      ***/ 
....................     /************************************************************************/ 
....................      
....................     /************************************************************************/ 
....................     /***                         end debug commands                       ***/ 
....................     /************************************************************************/ 
....................  
....................     /****************************** END CMDS ********************************/ 
....................  
....................     putErr(NO_COMMAND_MATCH); 
036A:  MOVLW  01
036B:  MOVWF  60
036C:  CALL   162
....................     return; 
036D:  BCF    0A.3
036E:  BCF    0A.4
036F:  GOTO   3C7 (RETURN)
.................... } 
....................  
.................... main() 
.................... { 
0370:  CLRF   04
0371:  MOVLW  1F
0372:  ANDWF  03,F
0373:  MOVLW  9F
0374:  MOVWF  04
0375:  MOVLW  07
0376:  MOVWF  00
0377:  CLRF   28
0378:  CLRF   29
0379:  MOVLW  19
037A:  BSF    03.5
037B:  MOVWF  19
037C:  MOVLW  26
037D:  MOVWF  18
037E:  MOVLW  90
037F:  BCF    03.5
0380:  MOVWF  18
0381:  CLRF   2A
0382:  CLRF   2B
0383:  CLRF   2C
0384:  CLRF   2D
0385:  CLRF   2E
0386:  CLRF   2F
0387:  CLRF   30
0388:  CLRF   31
0389:  CLRF   32
038A:  CLRF   33
038B:  CLRF   34
038C:  CLRF   35
038D:  CLRF   36
038E:  CLRF   37
038F:  CLRF   38
0390:  CLRF   39
0391:  CLRF   3A
0392:  CLRF   3B
0393:  CLRF   3C
0394:  MOVLW  FF
0395:  MOVWF  3D
....................     /* set up the system clock */ 
....................     setup_counters(RTCC_INTERNAL, RTCC_DIV_64); 
0396:  MOVLW  05
0397:  MOVWF  77
0398:  BTFSS  77.3
0399:  GOTO   3A2
039A:  MOVLW  07
039B:  CLRF   01
039C:  MOVLW  81
039D:  MOVWF  04
039E:  MOVF   00,W
039F:  ANDLW  C0
03A0:  IORLW  0F
03A1:  MOVWF  00
03A2:  CLRWDT
03A3:  MOVLW  81
03A4:  MOVWF  04
03A5:  MOVF   00,W
03A6:  ANDLW  C0
03A7:  IORWF  77,W
03A8:  MOVWF  00
....................      
....................     /* enable appropriate interrupts */ 
....................     enable_interrupts(INT_RTCC); 
03A9:  BSF    0B.5
....................     enable_interrupts(GLOBAL); 
03AA:  MOVLW  C0
03AB:  IORWF  0B,F
....................  
....................     /* main loop */ 
....................     for(;;) 
....................     { 
....................         output_bit(PIN_C3, LO); 
03AC:  BCF    07.3
03AD:  BCF    3D.3
03AE:  MOVF   3D,W
03AF:  BSF    03.5
03B0:  MOVWF  07
....................         delay_ms(2000); 
03B1:  MOVLW  08
03B2:  BCF    03.5
03B3:  MOVWF  3E
03B4:  MOVLW  FA
03B5:  MOVWF  3F
03B6:  CALL   0E2
03B7:  DECFSZ 3E,F
03B8:  GOTO   3B4
....................         output_bit(PIN_C3, HI); 
03B9:  BSF    07.3
03BA:  BCF    3D.3
03BB:  MOVF   3D,W
03BC:  BSF    03.5
03BD:  MOVWF  07
....................         delay_ms(2000); 
03BE:  MOVLW  08
03BF:  BCF    03.5
03C0:  MOVWF  3E
03C1:  MOVLW  FA
03C2:  MOVWF  3F
03C3:  CALL   0E2
03C4:  DECFSZ 3E,F
03C5:  GOTO   3C1
....................         processCmds(); 
03C6:  GOTO   1F5
....................     } 
03C7:  GOTO   3AC
.................... } 
.................... 
03C8:  SLEEP
