From: sdattalo Date: Fri, 5 Jul 2002 06:36:30 +0000 (+0000) Subject: Applied patch from Kevin L. Pauba that added the #pragma memory declaration feature... X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=3933e81dce0294a133bee29f0d1d329dbd1365e1;p=fw%2Fsdcc Applied patch from Kevin L. Pauba that added the #pragma memory declaration feature. Updated all of the PIC regression tests to use the new #pragma declarations. git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2030 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/pic/device.c b/src/pic/device.c index eb9051d6..3872735f 100644 --- a/src/pic/device.c +++ b/src/pic/device.c @@ -34,151 +34,43 @@ #define STRCASECMP strcasecmp #endif -/* 16F627 */ -memRange p16f627_mem[] = { - {0x20, 0x6f, 0x00, 0}, - {0xa0, 0xef, 0x00, 1}, - {0x120, 0x14f, 0x00, 2}, - {0x70, 0x7f, 0x180, 0}, - {-1, -1, -1, -1} /* end indicator */ -}; -memRange p16f627_sfr[] = { - {0x00, 0x00, 0x180, 0}, - {0x01, 0x01, 0x100, 0}, - {0x02, 0x04, 0x180, 0}, - {0x05, 0x05, 0x000, 0}, - {0x06, 0x06, 0x100, 0}, - {0x81, 0x81, 0x100, 1}, - {0x85, 0x85, 0x000, 1}, - {0x86, 0x86, 0x100, 1}, - {0x0a, 0x0b, 0x180, 0}, - {0x0c, 0x0c, 0x000, 0}, - {0x0e, 0x12, 0x000, 0}, - {0x15, 0x1a, 0x000, 0}, - {0x1f, 0x1f, 0x000, 0}, - {0x8e, 0x8e, 0x000, 1}, - {0x92, 0x92, 0x000, 1}, - {0x98, 0x9d, 0x000, 1}, - {0x9f, 0x9f, 0x000, 1}, - - {-1, -1, -1, -1} /* end indicator */ -}; - -/* 16F84 */ -memRange p16f84_mem[] = { - {0x0c, 0x4f, 0x80, 0}, - {-1, -1, -1, -1} /* end indicator */ -}; -memRange p16f84_sfr[] = { - {0x01, 0x01, 0x00, 0}, - {0x02, 0x04, 0x80, 0}, - {0x05, 0x06, 0x00, 0}, - {0x81, 0x81, 0x00, 1}, - {0x85, 0x86, 0x00, 1}, - {0x08, 0x09, 0x00, 0}, - {0x88, 0x89, 0x00, 1}, - {0x0a, 0x0b, 0x80, 0}, - {-1, -1, -1, -1} /* end indicator */ -}; - -/* 16F877 */ -memRange p16f877_mem[] = { - {0x20, 0x6f, 0x00, 0}, - {0xa0, 0xef, 0x00, 1}, - {0x110, 0x16f, 0x00, 2}, - {0x190, 0x1ef, 0x00, 3}, - {0x70, 0x7f, 0x180, 0}, - {-1, -1, -1, -1} /* end indicator */ -}; -memRange p16f877_sfr[] = { - {0x00, 0x00, 0x180, 0}, - {0x01, 0x01, 0x100, 0}, - {0x02, 0x04, 0x180, 0}, - {0x05, 0x05, 0x000, 0}, - {0x85, 0x85, 0x000, 1}, - {0x81, 0x81, 0x100, 1}, - {0x06, 0x06, 0x100, 0}, - {0x86, 0x86, 0x100, 1}, - {0x07, 0x09, 0x000, 0}, - {0x87, 0x89, 0x000, 1}, - {0x0a, 0x0b, 0x180, 0}, - {0x0c, 0x1f, 0x000, 0}, - {0x8c, 0x8e, 0x000, 1}, - {0x91, 0x94, 0x000, 1}, - {0x98, 0x99, 0x000, 1}, - {0x9e, 0x9f, 0x000, 1}, - {0x10c, 0x10f, 0x000, 2}, - {0x18c, 0x18f, 0x000, 3}, - - {-1, -1, -1, -1} /* end indicator */ -}; - -/* 16F873 */ -memRange p16f873_mem[] = { - {0x20, 0x7f, 0x100, 0}, - {0xa0, 0xff, 0x100, 1}, - {-1, -1, -1, -1} /* end indicator */ -}; -memRange p16f873_sfr[] = { - {0x00, 0x00, 0x180, 0}, - {0x01, 0x01, 0x100, 0}, - {0x02, 0x04, 0x180, 0}, - {0x05, 0x05, 0x000, 0}, - {0x85, 0x85, 0x000, 1}, - {0x81, 0x81, 0x100, 1}, - {0x06, 0x06, 0x100, 0}, - {0x86, 0x86, 0x100, 1}, - {0x07, 0x09, 0x000, 0}, - {0x87, 0x89, 0x000, 1}, - {0x0a, 0x0b, 0x180, 0}, - {0x0c, 0x1f, 0x000, 0}, - {0x8c, 0x8e, 0x000, 1}, - {0x91, 0x94, 0x000, 1}, - {0x98, 0x99, 0x000, 1}, - {0x9e, 0x9f, 0x000, 1}, - {0x10c, 0x10f, 0x000, 2}, - {0x18c, 0x18f, 0x000, 3}, - - {-1, -1, -1, -1} /* end indicator */ -}; - static PIC_device Pics[] = { { {"p16f627", "16f627", "pic16f627", "f627"}, /* processor name */ - p16f627_mem, /* ram mem map */ - p16f627_sfr, /* sfr mem map */ + (memRange *)NULL, + (memRange *)NULL, 0, /* max ram address (calculated) */ 0x80, /* Bank Mask */ }, { {"p16f628", "16f628", "pic16f628", "f628"}, - p16f627_mem, - p16f627_sfr, + (memRange *)NULL, + (memRange *)NULL, 0, 0x80, }, { {"p16f84", "16f84", "pic16f84", "f84"}, - p16f84_mem, - p16f84_sfr, + (memRange *)NULL, + (memRange *)NULL, 0, 0x80, }, { {"p16f873", "16f873", "pic16f873", "f873"}, - p16f873_mem, - p16f873_sfr, + (memRange *)NULL, + (memRange *)NULL, 0, 0x180, }, { {"p16f877", "16f877", "pic16f877", "f877"}, - p16f877_mem, - p16f877_sfr, + (memRange *)NULL, + (memRange *)NULL, 0, 0x180, }, @@ -198,50 +90,61 @@ AssignedMemory *finalMapping=NULL; static unsigned int config_word = DEFAULT_CONFIG_WORD; -/*-----------------------------------------------------------------* - * - * void addMem(memRange *ranges,int type) - * - * - *-----------------------------------------------------------------*/ - -static void addMem(memRange *ranges,int type) +void addMemRange(memRange *r, int type) { - memRange *r = ranges; int i; + int alias = r->alias; - do { - - int alias = r->alias; - - do { + if (pic->maxRAMaddress < 0) { + fprintf(stderr, "missing \"#pragma maxram\" setting\n"); + return; + } - for(i=r->start_address; i<= r->end_address; i++) { - if(i <= pic->maxRAMaddress) { - finalMapping[i | alias].isValid = 1; - finalMapping[i | alias].alias = r->alias; - finalMapping[i | alias].bank = r->bank; - if(type) { - /* hack for now */ - finalMapping[i | alias].isSFR = 1; - } else - finalMapping[i | alias].isSFR = 0; + do { + for (i=r->start_address; i<= r->end_address; i++) { + if (i <= pic->maxRAMaddress) { + finalMapping[i | alias].isValid = 1; + finalMapping[i | alias].alias = r->alias; + finalMapping[i | alias].bank = r->bank; + if(type) { + /* hack for now */ + finalMapping[i | alias].isSFR = 1; + } else { + finalMapping[i | alias].isSFR = 0; } } + } - /* Decrement alias */ - if(alias) - alias -= ((alias & (alias - 1)) ^ alias); - else - alias--; - - } while(alias >= 0); + /* Decrement alias */ + if (alias) { + alias -= ((alias & (alias - 1)) ^ alias); + } else { + alias--; + } + + } while (alias >= 0); +} + +void setMaxRAM(int size) +{ + int i; + pic->maxRAMaddress = size; - r++; + if (pic->maxRAMaddress < 0) { + fprintf(stderr, "invalid \"#pragma maxram 0x%x\" setting\n", + pic->maxRAMaddress); + return; + } - } while (r->start_address >= 0); + finalMapping = Safe_calloc(1+pic->maxRAMaddress, + sizeof(AssignedMemory)); + /* Now initialize the finalMapping array */ + for(i=0; i<=pic->maxRAMaddress; i++) { + finalMapping[i].reg = NULL; + finalMapping[i].isValid = 0; + } } /*-----------------------------------------------------------------* @@ -274,45 +177,6 @@ int REGallBanks(regs *reg) /*-----------------------------------------------------------------* *-----------------------------------------------------------------*/ -static void addMaps(PIC_device *pPic) -{ - int i; - memRange *r; - - if(!pPic) - return; - - - /* First, find the maximum address */ - - r = pPic->ram; - pPic->maxRAMaddress = 0; - - do { - - if((r->end_address | r->alias) > pPic->maxRAMaddress) - pPic->maxRAMaddress = r->end_address | r->alias; - - r++; - - } while (r->start_address >= 0); - - - - finalMapping = Safe_calloc(1+pPic->maxRAMaddress, sizeof(AssignedMemory)); - - /* Now initialize the finalMapping array */ - - for(i=0; i<=pPic->maxRAMaddress; i++) { - finalMapping[i].reg = NULL; - finalMapping[i].isValid = 0; - } - - addMem(pPic->ram,0); /* add general purpose regs to the map */ - addMem(pPic->sfr,1); /* Add SFR's to the memmap */ - -} - /* * dump_map -- debug stuff */ @@ -344,6 +208,11 @@ void dump_cblock(FILE *of) //dump_map(); /* display the register map */ + if (pic->maxRAMaddress < 0) { + fprintf(stderr, "missing \"#pragma maxram\" setting\n"); + return; + } + do { if(finalMapping[addr].reg && !finalMapping[addr].reg->isEmitted) { @@ -497,10 +366,7 @@ void init_pic(char *pic_type) exit(1); } - - addMaps(pic); - - + pic->maxRAMaddress = -1; } /*-----------------------------------------------------------------* @@ -529,6 +395,11 @@ int validAddress(int address, int reg_size) { int i; + if (pic->maxRAMaddress < 0) { + fprintf(stderr, "missing \"#pragma maxram\" setting\n"); + return 0; + } + if(address > pic->maxRAMaddress) return 0; @@ -552,6 +423,11 @@ void mapRegister(regs *reg) return; } + if (pic->maxRAMaddress < 0) { + fprintf(stderr, "missing \"#pragma maxram\" setting\n"); + return; + } + for(i=0; isize; i++) { alias = finalMapping[reg->address].alias; diff --git a/src/pic/device.h b/src/pic/device.h index 3c5c9e29..591181a8 100644 --- a/src/pic/device.h +++ b/src/pic/device.h @@ -96,5 +96,7 @@ void assignConfigWordValue(int address, int value); int getConfigWord(int address); int isREGinBank(regs *reg, int bank); int REGallBanks(regs *reg); +void addMemRange(memRange *r, int type); +void setMaxRAM(int size); #endif /* __DEVICE_H__ */ diff --git a/src/pic/main.c b/src/pic/main.c index df4d2759..ea9dbad9 100644 --- a/src/pic/main.c +++ b/src/pic/main.c @@ -8,6 +8,7 @@ #include "main.h" #include "ralloc.h" #include "device.h" +#include "SDCCutil.h" //#include "gen.h" @@ -75,6 +76,70 @@ _pic14_regparm (sym_link * l) return 1; } +static int +_process_pragma(const char *sz) +{ + static const char *WHITE = " \t"; + char *ptr = strtok((char *)sz, WHITE); + + if (startsWith (ptr, "memmap")) + { + char *start; + char *end; + char *type; + char *alias; + + start = strtok((char *)NULL, WHITE); + end = strtok((char *)NULL, WHITE); + type = strtok((char *)NULL, WHITE); + alias = strtok((char *)NULL, WHITE); + + if (start != (char *)NULL + && end != (char *)NULL + && type != (char *)NULL) { + value *startVal = constVal(start); + value *endVal = constVal(end); + value *aliasVal; + memRange r; + + if (alias == (char *)NULL) { + aliasVal = constVal(0); + } else { + aliasVal = constVal(alias); + } + + r.start_address = (int)floatFromVal(startVal); + r.end_address = (int)floatFromVal(endVal); + r.alias = (int)floatFromVal(aliasVal); + r.bank = (r.start_address >> 7) & 3; + + if (strcmp(type, "RAM") == 0) { + addMemRange(&r, 0); + } else if (strcmp(type, "SFR") == 0) { + addMemRange(&r, 1); + } else { + return 1; + } + } + + return 0; + } else if (startsWith (ptr, "maxram")) { + char *maxRAM = strtok((char *)NULL, WHITE); + + if (maxRAM != (char *)NULL) { + int maxRAMaddress; + value *maxRAMVal; + + maxRAMVal = constVal(maxRAM); + maxRAMaddress = (int)floatFromVal(maxRAMVal); + setMaxRAM(maxRAMaddress); + } + + return 0; + } + return 1; +} + static bool _pic14_parseOptions (int *pargc, char **argv, int *i) { @@ -354,7 +419,7 @@ PORT pic_port = NULL, // _pic14_genXINIT _pic14_reset_regparm, _pic14_regparm, - NULL, + _process_pragma, /* process a pragma */ NULL, _hasNativeMulFor, FALSE, diff --git a/src/regression/add.c b/src/regression/add.c index 5998655b..6d8aafa1 100644 --- a/src/regression/add.c +++ b/src/regression/add.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" //#include "p16c84.h" // Addition tests diff --git a/src/regression/add2.c b/src/regression/add2.c index 56808385..bb60d0a0 100644 --- a/src/regression/add2.c +++ b/src/regression/add2.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // Addition tests - mostly int's diff --git a/src/regression/add3.c b/src/regression/add3.c index e218dc15..f0b0033b 100644 --- a/src/regression/add3.c +++ b/src/regression/add3.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // Addition tests - mostly int's diff --git a/src/regression/add4.c b/src/regression/add4.c index ceb5160e..d6721893 100644 --- a/src/regression/add4.c +++ b/src/regression/add4.c @@ -1,3 +1,6 @@ +#define __16F873 +#include "p16f873.h" + unsigned char success = 0; unsigned char failures = 0; unsigned char dummy = 0; diff --git a/src/regression/and1.c b/src/regression/and1.c index 3353ceda..b2bc764c 100644 --- a/src/regression/and1.c +++ b/src/regression/and1.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" unsigned char success=0; unsigned char failures=0; diff --git a/src/regression/arrays.c b/src/regression/arrays.c index 803e38b4..72dc7e4f 100644 --- a/src/regression/arrays.c +++ b/src/regression/arrays.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" //#include "p16c84.h" unsigned char success = 0; diff --git a/src/regression/b.c b/src/regression/b.c index 27cc34cb..37df0f8c 100644 --- a/src/regression/b.c +++ b/src/regression/b.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" unsigned char failures = 0; unsigned char dummy = 0; diff --git a/src/regression/bank1.c b/src/regression/bank1.c index 778c1e7f..5498e2c0 100644 --- a/src/regression/bank1.c +++ b/src/regression/bank1.c @@ -1,3 +1,6 @@ +#define __16F873 +#include "p16f873.h" + unsigned char success=0; unsigned char failures=0; unsigned char dummy=0; diff --git a/src/regression/bool1.c b/src/regression/bool1.c index dc0a7f3c..b5ac521f 100644 --- a/src/regression/bool1.c +++ b/src/regression/bool1.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" //#include "p16c84.h" unsigned char success=0; diff --git a/src/regression/call1.c b/src/regression/call1.c index 91b26ebb..4c6bfc37 100644 --- a/src/regression/call1.c +++ b/src/regression/call1.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" //#include "p16c84.h" unsigned char success = 0; diff --git a/src/regression/compare.c b/src/regression/compare.c index 924fe0a5..820e0b12 100644 --- a/src/regression/compare.c +++ b/src/regression/compare.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" /* PIC PORT Test code diff --git a/src/regression/compare10.c b/src/regression/compare10.c index 6582aad6..57541abc 100644 --- a/src/regression/compare10.c +++ b/src/regression/compare10.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // Signed comparisons of the form: (variable>=LIT) // // This regression test exercises all of the boundary diff --git a/src/regression/compare2.c b/src/regression/compare2.c index f58c4fbe..9655808f 100644 --- a/src/regression/compare2.c +++ b/src/regression/compare2.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" //#include "p16c84.h" unsigned char success = 0; diff --git a/src/regression/compare3.c b/src/regression/compare3.c index 6ff0cd5d..4574a76d 100644 --- a/src/regression/compare3.c +++ b/src/regression/compare3.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // // compare3.c // regression testing program for comparing literals to variables diff --git a/src/regression/compare4.c b/src/regression/compare4.c index b04fde33..37852941 100644 --- a/src/regression/compare4.c +++ b/src/regression/compare4.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // // compare4.c // regression testing program for comparing signed chars and ints diff --git a/src/regression/compare5.c b/src/regression/compare5.c index 368d8fde..eae8196f 100644 --- a/src/regression/compare5.c +++ b/src/regression/compare5.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // // compare5.c // regression testing program for comparing longs diff --git a/src/regression/compare6.c b/src/regression/compare6.c index 437f82c1..c66e9976 100644 --- a/src/regression/compare6.c +++ b/src/regression/compare6.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // Compound comparisons unsigned char success = 0; diff --git a/src/regression/compare7.c b/src/regression/compare7.c index 30fa333d..d0f254ee 100644 --- a/src/regression/compare7.c +++ b/src/regression/compare7.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // Signed comparisons of the form: (variableLIT) // // This regression test exercises all of the boundary diff --git a/src/regression/compare9.c b/src/regression/compare9.c index 6f79bc16..d5e7517c 100644 --- a/src/regression/compare9.c +++ b/src/regression/compare9.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // Signed comparisons of the form: (variable<=LIT) // // This regression test exercises all of the boundary diff --git a/src/regression/configword.c b/src/regression/configword.c index e28c417a..9710851e 100644 --- a/src/regression/configword.c +++ b/src/regression/configword.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" /* configword.c - illustrates how the configuration word can * be assigned */ diff --git a/src/regression/for.c b/src/regression/for.c index a6245070..1f6cbbb7 100644 --- a/src/regression/for.c +++ b/src/regression/for.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" //#include "p16c84.h" unsigned char success=0; diff --git a/src/regression/inline.c b/src/regression/inline.c index 893441e3..643e7341 100644 --- a/src/regression/inline.c +++ b/src/regression/inline.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" unsigned char success=0; unsigned char failures=0; unsigned char dummy=0; diff --git a/src/regression/mult1.c b/src/regression/mult1.c index 6bf36e46..514e2647 100644 --- a/src/regression/mult1.c +++ b/src/regression/mult1.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" unsigned char success=0; unsigned char failures=0; unsigned char dummy=0; diff --git a/src/regression/or1.c b/src/regression/or1.c index b17834e6..fd451f96 100644 --- a/src/regression/or1.c +++ b/src/regression/or1.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" unsigned char success=0; unsigned char failures=0; diff --git a/src/regression/pointer1.c b/src/regression/pointer1.c index 6b738ee0..67faf00b 100644 --- a/src/regression/pointer1.c +++ b/src/regression/pointer1.c @@ -1,4 +1,6 @@ -//#include "p16c84.h" +#define __16F873 +#include "p16f873.h" + // Pointer tests unsigned char success = 0; diff --git a/src/regression/rotate1.c b/src/regression/rotate1.c index 2402a500..08cf97e1 100644 --- a/src/regression/rotate1.c +++ b/src/regression/rotate1.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // Shift bytes left and right by a constant. unsigned char success=0; diff --git a/src/regression/rotate2.c b/src/regression/rotate2.c index 7891534a..8c6d65d6 100644 --- a/src/regression/rotate2.c +++ b/src/regression/rotate2.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // Shift bytes left and right by a variable. unsigned char success=0; diff --git a/src/regression/rotate3.c b/src/regression/rotate3.c index ee594481..f5408987 100644 --- a/src/regression/rotate3.c +++ b/src/regression/rotate3.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // Shift ints left and right unsigned char success=0; diff --git a/src/regression/rotate4.c b/src/regression/rotate4.c index 358dfe97..bf9c4a45 100644 --- a/src/regression/rotate4.c +++ b/src/regression/rotate4.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // rotate bytes left and right by a constant. unsigned char success=0; diff --git a/src/regression/rotate5.c b/src/regression/rotate5.c index 815f13f2..6836822f 100644 --- a/src/regression/rotate5.c +++ b/src/regression/rotate5.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // Shift bytes left and right by a constant. unsigned char success=0; diff --git a/src/regression/rotate6.c b/src/regression/rotate6.c index f0bebddf..b07072be 100644 --- a/src/regression/rotate6.c +++ b/src/regression/rotate6.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // Shift bytes left and right by a variable. unsigned char success=0; diff --git a/src/regression/rotate7.c b/src/regression/rotate7.c index c5a3dc21..1435355d 100644 --- a/src/regression/rotate7.c +++ b/src/regression/rotate7.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" // Shift ints left and right unsigned char success=0; diff --git a/src/regression/string1.c b/src/regression/string1.c index f240f2aa..e582fc5b 100644 --- a/src/regression/string1.c +++ b/src/regression/string1.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" unsigned char success=0; unsigned char failures=0; unsigned char dummy=0; diff --git a/src/regression/struct1.c b/src/regression/struct1.c index 32baf808..edbe6716 100644 --- a/src/regression/struct1.c +++ b/src/regression/struct1.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" //#include "p16c84.h" // Addition tests diff --git a/src/regression/sub.c b/src/regression/sub.c index 9ee213ab..e7f62bd8 100644 --- a/src/regression/sub.c +++ b/src/regression/sub.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" //#include "p16c84.h" // Addition tests diff --git a/src/regression/sub2.c b/src/regression/sub2.c index b4c7891f..070924fd 100644 --- a/src/regression/sub2.c +++ b/src/regression/sub2.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" //#include "p16c84.h" // Addition tests diff --git a/src/regression/switch1.c b/src/regression/switch1.c index 0d966dfa..179f9fa2 100644 --- a/src/regression/switch1.c +++ b/src/regression/switch1.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" unsigned char success=0; unsigned char failures=0; unsigned char dummy=0; diff --git a/src/regression/while.c b/src/regression/while.c index 86df05a1..c004194d 100644 --- a/src/regression/while.c +++ b/src/regression/while.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" //#include "p16c84.h" unsigned char success = 0; diff --git a/src/regression/xor.c b/src/regression/xor.c index 5e77a2a3..ce7637bb 100644 --- a/src/regression/xor.c +++ b/src/regression/xor.c @@ -1,3 +1,5 @@ +#define __16F873 +#include "p16f873.h" unsigned char success=0; unsigned char failures=0; unsigned char dummy=0;