* src/avr/gen.c (aopop),
[fw/sdcc] / src / pic16 / pcode.h
index c14840e14447100471042887fa97b4d8a989387b..cf3d19113f359f1e9848a413fe2b8186abb5ccd3 100644 (file)
@@ -86,6 +86,23 @@ struct regs;
 #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
  ***********************************************************************/
@@ -282,6 +299,8 @@ typedef enum
   POC_XORFW,
 
   POC_BANKSEL
+
+  /* pseudo-instructions */
 } PIC_OPCODE;
 
 
@@ -411,6 +430,7 @@ 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
@@ -1008,7 +1028,7 @@ void pCodePeepInit(void);
 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
 
@@ -1017,8 +1037,10 @@ pCode *pic16_newpCodeAsmDir(char *asdir, char *argfmt, ...);
 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);