POC_INCFSZ,
POC_INCFSZW,
POC_INFSNZ,
+ POC_INFSNZW,
POC_IORWF,
POC_IORFW,
POC_IORLW,
POC_SUBFWB_D1,
POC_SWAPF,
POC_SWAPFW,
-// POC_TRIS , // To be removed
- POC_TBLRD, // patch 15
- POC_TBLRD_POSTINC, //
- POC_TBLRD_POSTDEC, //
- POC_TBLRD_PREINC, //
- POC_TBLWT, //
- POC_TBLWT_POSTINC, //
- POC_TBLWT_POSTDEC, //
- POC_TBLWT_PREINC, // patch 15
+ POC_TBLRD,
+ POC_TBLRD_POSTINC,
+ POC_TBLRD_POSTDEC,
+ POC_TBLRD_PREINC,
+ POC_TBLWT,
+ POC_TBLWT_POSTINC,
+ POC_TBLWT_POSTDEC,
+ POC_TBLWT_PREINC,
POC_TSTFSZ,
POC_XORLW,
POC_XORWF,
- POC_XORFW
+ POC_XORFW,
+
+ POC_BANKSEL
} PIC_OPCODE;
* in the pCode peep hole optimizer */
PC_CSOURCE, /* C-Source Line */
PC_ASMDIR, /* Assembler directive */
- PC_BAD /* Mark the pCode object as being bad */
+ PC_BAD, /* Mark the pCode object as being bad */
+ PC_INFO /* pCode informatio node, used primarily in optimizing */
} PC_TYPE;
+
+/***********************************************************************
+ * INFO_TYPE - information node types
+ ***********************************************************************/
+
+typedef enum
+{
+ INF_OPTIMIZATION, /* structure contains optimization information */
+} INFO_TYPE;
+
+
+
+/***********************************************************************
+ * OPT_TYPE - optimization node types
+ ***********************************************************************/
+
+typedef enum
+{
+ OPT_BEGIN, /* mark beginning of optimization block */
+ OPT_END, /* mark ending of optimization block */
+} OPT_TYPE;
+
+
+
/************************************************/
/*************** Structures ********************/
/************************************************/
} pCodeOpWild;
+typedef struct pCodeOpOpt
+{
+ pCodeOp pcop;
+
+ OPT_TYPE type; /* optimization node type */
+
+ char *key; /* key by which a block is identified */
+} pCodeOpOpt;
+
+
+
/*************************************************
pCode
int absblock; /* hack to emulate a block pCodes in absolute position
but not inside a function */
+ int stackusage; /* stack positions used in function */
+
} pCodeFunction;
} pCodeWild;
+
+/*************************************************
+ pInfo
+
+ Here are stored generic informaton
+*************************************************/
+typedef struct pInfo
+{
+ pCode pc;
+
+ INFO_TYPE type; /* info node type */
+
+ pCodeOp *oper1; /* info node arguments */
+} pInfo;
+
+
/*************************************************
pBlock
#define PCOR(x) ((pCodeOpReg *)(x))
#define PCOR2(x) ((pCodeOpReg2 *)(x))
#define PCORB(x) ((pCodeOpRegBit *)(x))
+#define PCOO(x) ((pCodeOpOpt *)(x))
#define PCOW(x) ((pCodeOpWild *)(x))
#define PCOW2(x) (PCOW(PCOW(x)->pcop2))
#define PBR(x) ((pBranch *)(x))
void pCodePeepInit(void);
void pic16_pBlockConvert2ISR(pBlock *pb);
void pic16_pBlockConvert2Absolute(pBlock *pb);
-void pic16_emitDB(pBlock *pb, char c); // Add DB directives to a pBlock
-void pic16_flushDB(pBlock *pb); // Add pending DB data to a pBlock
+void pic16_initDB(void);
+void pic16_emitDB(char 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
pCode *pic16_newpCodeAsmDir(char *asdir, char *argfmt, ...);
pCodeOp *pic16_newpCodeOpImmd(char *name, int offset, int index, int code_space);
pCodeOp *pic16_newpCodeOpLit(int lit);
pCodeOp *pic16_newpCodeOpLit2(int lit, pCodeOp *arg2);
-pCodeOp *pic16_newpCodeOpBit(char *name, int bit,int inBitSpace);
+pCodeOp *pic16_newpCodeOpBit(char *name, int bit,int inBitSpace, PIC_OPTYPE subt);
pCodeOp *pic16_newpCodeOpRegFromStr(char *name);
pCodeOp *pic16_newpCodeOp(char *name, PIC_OPTYPE p);
pCodeOp *pic16_pCodeOpCopy(pCodeOp *pcop);
extern pCodeOpReg pic16_pc_prodl;
extern pCodeOpReg pic16_pc_prodh;
+extern pCodeOpReg pic16_pc_eecon1;
+extern pCodeOpReg pic16_pc_eecon2;
+extern pCodeOpReg pic16_pc_eedata;
+extern pCodeOpReg pic16_pc_eeadr;
+
extern pCodeOpReg pic16_pc_kzero;
extern pCodeOpReg pic16_pc_wsave; /* wsave and ssave are used to save W and the Status */
extern pCodeOpReg pic16_pc_ssave; /* registers during an interrupt */
+extern pCodeOpReg pic16_pc_gpsimio;
+extern pCodeOpReg pic16_pc_gpsimio2;
#endif // __PCODE_H__