diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2019-10-18 00:31:54 +0200 |
| commit | 268a53de823a6750d6256ee1fb1e7707b4b45740 (patch) | |
| tree | 42c1799a9a82b2f7d9790ee9fe181d72a7274751 /src/pic16/genutils.h | |
| download | sdcc-gas-268a53de823a6750d6256ee1fb1e7707b4b45740.tar.gz | |
sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
Diffstat (limited to 'src/pic16/genutils.h')
| -rw-r--r-- | src/pic16/genutils.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/pic16/genutils.h b/src/pic16/genutils.h new file mode 100644 index 0000000..d8d1966 --- /dev/null +++ b/src/pic16/genutils.h @@ -0,0 +1,75 @@ + +/* +** $Id: genutils.h 4051 2006-03-06 08:27:52Z vrokas $ +*/ + +#ifndef __GENUTILS_H__ +#define __GENUTILS_H__ + + +#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 commented out from + * gen.c + */ + +#define GEN_Not +void pic16_genNot(iCode *ic); + +#define GEN_Cpl +void pic16_genCpl(iCode *ic); + + +/* + * global function definitions + */ +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__ */ |
