X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fpic16%2Fgenutils.h;h=ea2ca70ae9b49a24be398bc41ef3554eda5d6279;hb=d0b75a25e014ff9924b4961e7927de9f591f5d0d;hp=f6dc45ce59dd1ac89f48b5bc21735386306c2d0e;hpb=7a742aa53d932c986e05ab285410366d414e23a4;p=fw%2Fsdcc diff --git a/src/pic16/genutils.h b/src/pic16/genutils.h index f6dc45ce..ea2ca70a 100644 --- a/src/pic16/genutils.h +++ b/src/pic16/genutils.h @@ -10,10 +10,30 @@ #include "common.h" +#if !defined(__BORLANDC__) && !defined(_MSC_VER) +#define DEBUGpc(fmt,...) DEBUGpic16_emitcode("; =:=", "%s:%s:%d: " fmt, __FILE__, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#else +#define DEBUGpc 1 ? (void)0 : printf +#endif +#define isAOP_LIT(x) (AOP_TYPE(x) == AOP_LIT) +#define isAOP_REGlike(x) (AOP_TYPE(x) == AOP_REG || AOP_TYPE(x) == AOP_DIR || AOP_TYPE(x) == AOP_PCODE || AOP_TYPE(x) == AOP_STA) + + +/* Resolved ifx structure. This structure stores information + * about an iCode ifx that makes it easier to generate code. + */ +typedef struct resolvedIfx { + symbol *lbl; /* pointer to a label */ + int condition; /* true or false ifx */ + int generated; /* set true when the code associated with the ifx + * is generated */ +} resolvedIfx; + + /* * The various GEN_xxxxx macros handle which functions * should be included in the gen.c source. We are going to use - * our own functions here so, they must be commentted out from + * our own functions here so, they must be commented out from * gen.c */ @@ -27,7 +47,29 @@ void pic16_genCpl(iCode *ic); /* * global function definitions */ -void DEBUGpic16_pic16_AopType(int line_no, operand *left, operand *right, operand *result); +void pic16_DumpValue(char *prefix, value *val); +void pic16_DumpPcodeOp(char *prefix, pCodeOp *pcop); +void pic16_DumpAop(char *prefix, asmop *aop); +void pic16_DumpSymbol(char *prefix, symbol *sym); +void pic16_DumpOp(char *prefix, operand *op); +void pic16_DumpOpX(FILE *fp, char *prefix, operand *op); + +pCodeOp *pic16_popGetWithString(char *str); +void pic16_callGenericPointerRW(int rw, int size); + + + +void gpsimio2_pcop(pCodeOp *pcop); +void gpsimio2_lit(unsigned char lit); + +void gpsimDebug_StackDump(char *fname, int line, char *info); + +int pic16_genCmp_special(operand *left, operand *right, operand *result, + iCode *ifx, resolvedIfx *rIfx, int sign); +#ifndef debugf +#define debugf(frm, rest) _debugf(__FILE__, __LINE__, frm, rest) +#endif +void _debugf(char *f, int l, char *frm, ...); #endif /* __GENUTILS_H__ */