#include #include #include #define DATA_EEMEM_PROTECT_DISABLE 0x0100 #define XT_OSC 0x0001 #define DISABLE_DEBUG 0x0800 #define CP0 0x1010 #define CP1 0x2020 /* CP0,CP1 code protect off*/ /* other bits zero which means WDT disabled Low Voltage prm disabled, brownout disabled power up timer enabled */ __CONFIG((CP1 | CP0) | DATA_EEMEM_PROTECT_DISABLE | XT_OSC | DISABLE_DEBUG); char s1[] = "Upper/LOWER."; char s2[] = "mIXeD CaSe.."; /* counts characters in string */ unsigned char strcnt (ptr) char *ptr; { unsigned char i; i = 0; while (*ptr != 0) { ptr++; i++; } return(i); } main() { unsigned char i; i = strcnt(s1); while(1); /* infinite loop */ }