#endif
+#ifdef WORDS_BIGENDIAN
+ #define _ENDIAN(x) (3-x)
+#else
+ #define _ENDIAN(x) (x)
+#endif
+
+
+#define BYTE_IN_LONG(x,b) ((x>>(8*_ENDIAN(b)))&0xff)
+
+
+/***********************************************************************
+ * Extended Instruction Set/Indexed Literal Offset Mode *
+ * Set this macro to enable code generation with the extended *
+ * instruction set and the new Indexed Literal Offset Mode *
+ ***********************************************************************/
+#define XINST 1
+
/***********************************************************************
* PIC status bits - this will move into device dependent headers
***********************************************************************/
POC_XORFW,
POC_BANKSEL
+
+ /* pseudo-instructions */
} PIC_OPCODE;
PC_CSOURCE, /* C-Source Line */
PC_ASMDIR, /* Assembler directive */
PC_BAD, /* Mark the pCode object as being bad */
- PC_INFO /* pCode informatio node, used primarily in optimizing */
+ PC_INFO /* pCode information node, used primarily in optimizing */
} PC_TYPE;
just a bit of a register */
} pCodeOpBit;
#endif
+
typedef struct pCodeOpLit
{
pCodeOp pcop;
int lit;
+ pCodeOp *arg2; /* needed as pCodeOpLit and pCodeOpLit2 are not separable via their type (PO_LITERAL) */
} pCodeOpLit;
typedef struct pCodeOpLit2
contiguous chunk.
**************************************************/
+struct defmap_s; // defined in pcode.c
typedef struct pCodeFlow
{
set *registers;/* Registers used in this flow */
+ struct defmap_s *defmap; /* chronologically ordered list of definitions performed
+ in this flow (most recent at the front) */
+ struct defmap_s *in_vals; /* definitions of all symbols reaching this flow
+ * symbols with multiple different definitions are stored
+ * with an assigned value of 0. */
+ struct defmap_s *out_vals; /* definitions valid AFTER thie flow */
+
} pCodeFlow;
/*************************************************
#define isPCW(x) ((PCODE(x)->type == PC_WILD))
#define isPCCS(x) ((PCODE(x)->type == PC_CSOURCE))
#define isPCAD(x) ((PCODE(x)->type == PC_ASMDIR))
+#define isPCINFO(x) ((PCODE(x)->type == PC_INFO))
#define isCALL(x) ((isPCI(x)) && (PCI(x)->op == POC_CALL))
#define isSTATUS_REG(r) ((r)->pc_type == PO_STATUS)
void pic16_pBlockConvert2ISR(pBlock *pb);
void pic16_pBlockConvert2Absolute(pBlock *pb);
void pic16_initDB(void);
-void pic16_emitDB(char c, char ptype, void *p); // Add DB directives to a pBlock
+void pic16_emitDB(int c, char ptype, void *p); // Add DB directives to a pBlock
void pic16_emitDS(char *s, char ptype, void *p);
void pic16_flushDB(char ptype, void *p); // Add pending DB data to a pBlock
pCodeOp *pic16_newpCodeOpLabel(char *name, int key);
pCodeOp *pic16_newpCodeOpImmd(char *name, int offset, int index, int code_space);
pCodeOp *pic16_newpCodeOpLit(int lit);
+pCodeOp *pic16_newpCodeOpLit12(int lit);
pCodeOp *pic16_newpCodeOpLit2(int lit, pCodeOp *arg2);
pCodeOp *pic16_newpCodeOpBit(char *name, int bit,int inBitSpace, PIC_OPTYPE subt);
+pCodeOp *pic16_newpCodeOpBit_simple (struct asmop *op, int offs, int bit);
pCodeOp *pic16_newpCodeOpRegFromStr(char *name);
+pCodeOp *pic16_newpCodeOpReg(int rIdx);
pCodeOp *pic16_newpCodeOp(char *name, PIC_OPTYPE p);
+pCodeOp *pic16_newpCodeOpRegNotVect(bitVect *bv);
pCodeOp *pic16_pCodeOpCopy(pCodeOp *pcop);
pCode *pic16_newpCodeInfo(INFO_TYPE type, pCodeOp *pcop);
pCodeOp *pic16_newpCodeOpOpt(OPT_TYPE type, char *key);
pCodeOp *pic16_newpCodeOpLocalRegs(LR_TYPE type);
+pCodeOp *pic16_newpCodeOpReg(int rIdx);
pCode * pic16_findNextInstruction(pCode *pci);
pCode * pic16_findNextpCode(pCode *pc, PC_TYPE pct);
extern int pic16_debug_verbose;
extern int pic16_pcode_verbose;
+extern char *LR_TYPE_STR[];
+
+
#ifndef debugf
//#define debugf(frm, rest...) _debugf(__FILE__, __LINE__, frm, rest)
#define debugf(frm, rest) _debugf(__FILE__, __LINE__, frm, rest)