1 /*-------------------------------------------------------------------------
3 pcode.h - post code generation
4 Written By - Scott Dattalo scott@dattalo.com
5 Ported to PIC16 By - Martin Dubuc m.dubuc@rogers.com
7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 2, or (at your option) any
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 -------------------------------------------------------------------------*/
29 The post code generation is an assembler optimizer. The assembly code
30 produced by all of the previous steps is fully functional. This step
31 will attempt to analyze the flow of the assembly code and agressively
32 optimize it. The peep hole optimizer attempts to do the same thing.
33 As you may recall, the peep hole optimizer replaces blocks of assembly
34 with more optimal blocks (e.g. removing redundant register loads).
35 However, the peep hole optimizer has to be somewhat conservative since
36 an assembly program has implicit state information that's unavailable
37 when only a few instructions are examined.
38 Consider this example:
44 The movf seems redundant since we know that the W register already
45 contains the same value of t1. So a peep hole optimizer is tempted to
46 remove the "movf". However, this is dangerous since the movf affects
47 the flags in the status register (specifically the Z flag) and subsequent
48 code may depend upon this. Look at these two examples:
52 movf t1,w ; Can't remove this movf
58 movf t1,w ; This movf can be removed
59 xorwf t2,w ; since xorwf will over write Z
69 /***********************************************************************
72 * The DFPRINTF macro will call fprintf if PCODE_DEBUG is defined.
73 * The macro is used like:
75 * DPRINTF(("%s #%d\n","test", 1));
77 * The double parenthesis (()) are necessary
79 ***********************************************************************/
83 #define DFPRINTF(args) (fprintf args)
85 #define DFPRINTF(args) ;
89 /***********************************************************************
90 * PIC status bits - this will move into device dependent headers
91 ***********************************************************************/
97 #define PIC_IRP_BIT 7 /* Indirect register page select */
99 /***********************************************************************
100 * PIC INTCON bits - this will move into device dependent headers
101 ***********************************************************************/
102 #define PIC_RBIF_BIT 0 /* Port B level has changed flag */
103 #define PIC_INTF_BIT 1 /* Port B bit 0 interrupt on edge flag */
104 #define PIC_T0IF_BIT 2 /* TMR0 has overflowed flag */
105 #define PIC_RBIE_BIT 3 /* Port B level has changed - Interrupt Enable */
106 #define PIC_INTE_BIT 4 /* Port B bit 0 interrupt on edge - Int Enable */
107 #define PIC_T0IE_BIT 5 /* TMR0 overflow Interrupt Enable */
108 #define PIC_PIE_BIT 6 /* Peripheral Interrupt Enable */
109 #define PIC_GIE_BIT 7 /* Global Interrupt Enable */
111 /***********************************************************************
112 * PIC bank definitions
113 ***********************************************************************/
114 #define PIC_BANK_FIRST 0
115 #define PIC_BANK_LAST 0xf
118 /***********************************************************************
120 ***********************************************************************/
126 /***********************************************************************
128 * PIC_OPTYPE - Operand types that are specific to the PIC architecture
130 * If a PIC assembly instruction has an operand then here is where we
131 * associate a type to it. For example,
135 * The movf has two operands: 'reg' and the W register. 'reg' is some
136 * arbitrary general purpose register, hence it has the type PO_GPR_REGISTER.
137 * The W register, which is the PIC's accumulator, has the type PO_W.
139 ***********************************************************************/
145 PO_NONE=0, // No operand e.g. NOP
146 PO_W, // The working register (as a destination)
147 PO_WREG, // The working register (as a file register)
148 PO_STATUS, // The 'STATUS' register
149 PO_BSR, // The 'BSR' register
150 PO_FSR0, // The "file select register" (in PIC18 family it's one
152 PO_INDF0, // The Indirect register
153 PO_INTCON, // Interrupt Control register
154 PO_GPR_REGISTER, // A general purpose register
155 PO_GPR_BIT, // A bit of a general purpose register
156 PO_GPR_TEMP, // A general purpose temporary register
157 PO_SFR_REGISTER, // A special function register (e.g. PORTA)
158 PO_PCL, // Program counter Low register
159 PO_PCLATH, // Program counter Latch high register
160 PO_PCLATU, // Program counter Latch upper register
161 PO_PRODL, // Product Register Low
162 PO_PRODH, // Product Register High
163 PO_LITERAL, // A constant
164 PO_REL_ADDR, // A relative address
165 PO_IMMEDIATE, // (8051 legacy)
166 PO_DIR, // Direct memory (8051 legacy)
167 PO_CRY, // bit memory (8051 legacy)
168 PO_BIT, // bit operand.
169 PO_STR, // (8051 legacy)
171 PO_WILD // Wild card operand in peep optimizer
175 /***********************************************************************
179 * This is not a list of the PIC's opcodes per se, but instead
180 * an enumeration of all of the different types of pic opcodes.
182 ***********************************************************************/
186 POC_WILD=-1, /* Wild card - used in the pCode peep hole optimizer
187 * to represent ANY pic opcode */
288 /***********************************************************************
289 * PC_TYPE - pCode Types
290 ***********************************************************************/
294 PC_COMMENT=0, /* pCode is a comment */
295 PC_INLINE, /* user's inline code */
296 PC_OPCODE, /* PORT dependent opcode */
297 PC_LABEL, /* assembly label */
298 PC_FLOW, /* flow analysis */
299 PC_FUNCTION, /* Function start or end */
300 PC_WILD, /* wildcard - an opcode place holder used
301 * in the pCode peep hole optimizer */
302 PC_CSOURCE, /* C-Source Line */
303 PC_ASMDIR, /* Assembler directive */
304 PC_BAD, /* Mark the pCode object as being bad */
305 PC_INFO /* pCode informatio node, used primarily in optimizing */
309 /***********************************************************************
310 * INFO_TYPE - information node types
311 ***********************************************************************/
315 INF_OPTIMIZATION, /* structure contains optimization information */
320 /***********************************************************************
321 * OPT_TYPE - optimization node types
322 ***********************************************************************/
326 OPT_BEGIN, /* mark beginning of optimization block */
327 OPT_END, /* mark ending of optimization block */
332 /************************************************/
333 /*************** Structures ********************/
334 /************************************************/
335 /* These are here as forward references - the
336 * full definition of these are below */
338 struct pCodeWildBlock;
339 struct pCodeRegLives;
341 /*************************************************
344 The first step in optimizing pCode is determining
345 the program flow. This information is stored in
346 single-linked lists in the for of 'from' and 'to'
347 objects with in a pcode. For example, most instructions
348 don't involve any branching. So their from branch
349 points to the pCode immediately preceding them and
350 their 'to' branch points to the pcode immediately
351 following them. A skip instruction is an example of
352 a pcode that has multiple (in this case two) elements
353 in the 'to' branch. A 'label' pcode is an where there
354 may be multiple 'from' branches.
355 *************************************************/
357 typedef struct pBranch
359 struct pCode *pc; // Next pCode in a branch
360 struct pBranch *next; /* If more than one branch
361 * the next one is here */
365 /*************************************************
368 pCode Operand structure.
369 For those assembly instructions that have arguments,
370 the pCode will have a pCodeOp in which the argument
371 can be stored. For example
375 'some_register' will be stored/referenced in a pCodeOp
377 *************************************************/
379 typedef struct pCodeOp
387 typedef struct pCodeOpBit
391 unsigned int inBitSpace: 1; /* True if in bit space, else
392 just a bit of a register */
395 typedef struct pCodeOpLit
401 typedef struct pCodeOpLit2
409 typedef struct pCodeOpImmd
412 int offset; /* low,high or upper byte of immediate value */
413 int index; /* add this to the immediate value */
414 unsigned _const:1; /* is in code space */
416 int rIdx; /* If this immd points to a register */
417 struct regs *r; /* then this is the reg. */
421 typedef struct pCodeOpLabel
427 typedef struct pCodeOpReg
429 pCodeOp pcop; // Can be either GPR or SFR
430 int rIdx; // Index into the register table
432 int instance; // byte # of Multi-byte registers
436 typedef struct pCodeOpReg2
438 pCodeOp pcop; // used by default to all references
441 int instance; // assume same instance for both operands
444 pCodeOp *pcop2; // second memory operand
447 typedef struct pCodeOpRegBit
449 pCodeOpReg pcor; // The Register containing this bit
450 int bit; // 0-7 bit number.
451 PIC_OPTYPE subtype; // The type of this register.
452 unsigned int inBitSpace: 1; /* True if in bit space, else
453 just a bit of a register */
457 typedef struct pCodeOpWild
461 struct pCodeWildBlock *pcwb;
463 int id; /* index into an array of char *'s that will match
464 * the wild card. The array is in *pcp. */
465 pCodeOp *subtype; /* Pointer to the Operand type into which this wild
466 * card will be expanded */
467 pCodeOp *matched; /* When a wild matches, we'll store a pointer to the
468 * opcode we matched */
470 pCodeOp *pcop2; /* second operand if exists */
475 typedef struct pCodeOpOpt
479 OPT_TYPE type; /* optimization node type */
481 char *key; /* key by which a block is identified */
486 /*************************************************
489 Here is the basic build block of a PIC instruction.
490 Each pic instruction will get allocated a pCode.
491 A linked list of pCodes makes a program.
493 **************************************************/
499 struct pCode *prev; // The pCode objects are linked together
500 struct pCode *next; // in doubly linked lists.
502 int seq; // sequence number
504 struct pBlock *pb; // The pBlock that contains this pCode.
506 /* "virtual functions"
507 * The pCode structure is like a base class
508 * in C++. The subsequent structures that "inherit"
509 * the pCode structure will initialize these function
510 * pointers to something useful */
511 // void (*analyze) (struct pCode *_this);
512 void (*destruct)(struct pCode *_this);
513 void (*print) (FILE *of,struct pCode *_this);
518 /*************************************************
520 **************************************************/
522 typedef struct pCodeComment
532 /*************************************************
534 **************************************************/
536 typedef struct pCodeCSource
548 /*************************************************
550 **************************************************/
552 /*************************************************
555 The Flow object is used as marker to separate
556 the assembly code into contiguous chunks. In other
557 words, everytime an instruction cause or potentially
558 causes a branch, a Flow object will be inserted into
559 the pCode chain to mark the beginning of the next
562 **************************************************/
564 typedef struct pCodeFlow
569 pCode *end; /* Last pCode in this flow. Note that
570 the first pCode is pc.next */
572 /* set **uses; * map the pCode instruction inCond and outCond conditions
573 * in this array of set's. The reason we allocate an
574 * array of pointers instead of declaring each type of
575 * usage is because there are port dependent usage definitions */
576 //int nuses; /* number of uses sets */
578 set *from; /* flow blocks that can send control to this flow block */
579 set *to; /* flow blocks to which this one can send control */
580 struct pCodeFlow *ancestor; /* The most immediate "single" pCodeFlow object that
581 * executes prior to this one. In many cases, this
582 * will be just the previous */
584 int inCond; /* Input conditions - stuff assumed defined at entry */
585 int outCond; /* Output conditions - stuff modified by flow block */
587 int firstBank; /* The first and last bank flags are the first and last */
588 int lastBank; /* register banks used within one flow object */
593 set *registers;/* Registers used in this flow */
597 /*************************************************
600 The Flow Link object is used to record information
601 about how consecutive excutive Flow objects are related.
602 The pCodeFlow objects demarcate the pCodeInstructions
603 into contiguous chunks. The FlowLink records conflicts
604 in the discontinuities. For example, if one Flow object
605 references a register in bank 0 and the next Flow object
606 references a register in bank 1, then there is a discontinuity
607 in the banking registers.
610 typedef struct pCodeFlowLink
612 pCodeFlow *pcflow; /* pointer to linked pCodeFlow object */
614 int bank_conflict; /* records bank conflicts */
618 /*************************************************
621 Here we describe all the facets of a PIC instruction
622 (expansion for the 18cxxx is also provided).
624 **************************************************/
626 typedef struct pCodeInstruction
631 PIC_OPCODE op; // The opcode of the instruction.
633 char const * const mnemonic; // Pointer to mnemonic string
635 pBranch *from; // pCodes that execute before this one
636 pBranch *to; // pCodes that execute after
637 pBranch *label; // pCode instructions that have labels
639 pCodeOp *pcop; /* Operand, if this instruction has one */
640 pCodeFlow *pcflow; /* flow block to which this instruction belongs */
641 pCodeCSource *cline; /* C Source from which this instruction was derived */
643 unsigned int num_ops; /* Number of operands (0,1,2 for mid range pics) */
644 unsigned int isModReg: 1; /* If destination is W or F, then 1==F */
645 unsigned int isBitInst: 1; /* e.g. BCF */
646 unsigned int isBranch: 1; /* True if this is a branching instruction */
647 unsigned int isSkip: 1; /* True if this is a skip instruction */
648 unsigned int isLit: 1; /* True if this instruction has an literal operand */
649 unsigned int isAccess: 1; /* True if this instruction has an access RAM operand */
650 unsigned int isFastCall: 1; /* True if this instruction has a fast call/return mode select operand */
651 unsigned int is2MemOp: 1; /* True is second operand is a memory operand VR - support for MOVFF */
652 unsigned int is2LitOp: 1; /* True if instruction takes 2 literal operands VR - support for LFSR */
654 PIC_OPCODE inverted_op; /* Opcode of instruction that's the opposite of this one */
655 unsigned int inCond; // Input conditions for this instruction
656 unsigned int outCond; // Output conditions for this instruction
658 #define PCI_MAGIC 0x6e12
659 unsigned int pci_magic; // sanity check for pci initialization
664 /*************************************************
666 **************************************************/
668 typedef struct pCodeAsmDir
670 pCodeInstruction pci;
677 /*************************************************
679 **************************************************/
681 typedef struct pCodeLabel
688 int force; /* label cannot be optimized out */
692 /*************************************************
694 **************************************************/
696 typedef struct pCodeFunction
702 char *fname; /* If NULL, then this is the end of
703 a function. Otherwise, it's the
704 start and the name is contained
707 pBranch *from; // pCodes that execute before this one
708 pBranch *to; // pCodes that execute after
709 pBranch *label; // pCode instructions that have labels
711 int ncalled; /* Number of times function is called */
713 int absblock; /* hack to emulate a block pCodes in absolute position
714 but not inside a function */
715 int stackusage; /* stack positions used in function */
720 /*************************************************
722 **************************************************/
724 typedef struct pCodeWild
727 pCodeInstruction pci;
729 int id; /* Index into the wild card array of a peepBlock
730 * - this wild card will get expanded into that pCode
731 * that is stored at this index */
733 /* Conditions on wild pcode instruction */
734 int mustBeBitSkipInst:1;
735 int mustNotBeBitSkipInst:1;
736 int invertBitSkipInst:1;
738 pCodeOp *operand; // Optional operand
739 pCodeOp *label; // Optional label
744 /*************************************************
747 Here are stored generic informaton
748 *************************************************/
753 INFO_TYPE type; /* info node type */
755 pCodeOp *oper1; /* info node arguments */
759 /*************************************************
762 Here are PIC program snippets. There's a strong
763 correlation between the eBBlocks and pBlocks.
764 SDCC subdivides a C program into managable chunks.
765 Each chunk becomes a eBBlock and ultimately in the
768 **************************************************/
770 typedef struct pBlock
772 memmap *cmemmap; /* The snippet is from this memmap */
773 char dbName; /* if cmemmap is NULL, then dbName will identify the block */
774 pCode *pcHead; /* A pointer to the first pCode in a link list of pCodes */
775 pCode *pcTail; /* A pointer to the last pCode in a link list of pCodes */
777 struct pBlock *next; /* The pBlocks will form a doubly linked list */
780 set *function_entries; /* dll of functions in this pblock */
786 unsigned visited:1; /* set true if traversed in call tree */
788 unsigned seq; /* sequence number of this pBlock */
792 /*************************************************
795 The collection of pBlock program snippets are
796 placed into a linked list that is implemented
797 in the pFile structure.
799 The pcode optimizer will parse the pFile.
801 **************************************************/
805 pBlock *pbHead; /* A pointer to the first pBlock */
806 pBlock *pbTail; /* A pointer to the last pBlock */
808 pBranch *functions; /* A SLL of functions in this pFile */
814 /*************************************************
817 The pCodeWildBlock object keeps track of the wild
818 variables, operands, and opcodes that exist in
820 **************************************************/
821 typedef struct pCodeWildBlock {
823 struct pCodePeep *pcp; // pointer back to ... I don't like this...
825 int nvars; // Number of wildcard registers in target.
826 char **vars; // array of pointers to them
828 int nops; // Number of wildcard operands in target.
829 pCodeOp **wildpCodeOps; // array of pointers to the pCodeOp's.
831 int nwildpCodes; // Number of wildcard pCodes in target/replace
832 pCode **wildpCodes; // array of pointers to the pCode's.
836 /*************************************************
839 The pCodePeep object mimics the peep hole optimizer
840 in the main SDCC src (e.g. SDCCpeeph.c). Essentially
841 there is a target pCode chain and a replacement
842 pCode chain. The target chain is compared to the
843 pCode that is generated by gen.c. If a match is
844 found then the pCode is replaced by the replacement
846 **************************************************/
847 typedef struct pCodePeep {
848 pCodeWildBlock target; // code we'd like to optimize
849 pCodeWildBlock replace; // and this is what we'll optimize it with.
852 //pBlock replace; // and this is what we'll optimize it with.
856 /* (Note: a wildcard register is a place holder. Any register
857 * can be replaced by the wildcard when the pcode is being
858 * compared to the target. */
860 /* Post Conditions. A post condition is a condition that
861 * must be either true or false before the peep rule is
862 * accepted. For example, a certain rule may be accepted
863 * if and only if the Z-bit is not used as an input to
864 * the subsequent instructions in a pCode chain.
866 unsigned int postFalseCond;
867 unsigned int postTrueCond;
871 /*************************************************
873 pCode peep command definitions
875 Here are some special commands that control the
876 way the peep hole optimizer behaves
878 **************************************************/
880 enum peepCommandTypes{
887 /*************************************************
888 peepCommand structure stores the peep commands.
890 **************************************************/
892 typedef struct peepCommand {
897 /*************************************************
900 **************************************************/
901 #define PCODE(x) ((pCode *)(x))
902 #define PCI(x) ((pCodeInstruction *)(x))
903 #define PCL(x) ((pCodeLabel *)(x))
904 #define PCF(x) ((pCodeFunction *)(x))
905 #define PCFL(x) ((pCodeFlow *)(x))
906 #define PCFLINK(x)((pCodeFlowLink *)(x))
907 #define PCW(x) ((pCodeWild *)(x))
908 #define PCCS(x) ((pCodeCSource *)(x))
909 #define PCAD(x) ((pCodeAsmDir *)(x))
911 #define PCOP(x) ((pCodeOp *)(x))
912 //#define PCOB(x) ((pCodeOpBit *)(x))
913 #define PCOL(x) ((pCodeOpLit *)(x))
914 #define PCOI(x) ((pCodeOpImmd *)(x))
915 #define PCOLAB(x) ((pCodeOpLabel *)(x))
916 #define PCOR(x) ((pCodeOpReg *)(x))
917 #define PCOR2(x) ((pCodeOpReg2 *)(x))
918 #define PCORB(x) ((pCodeOpRegBit *)(x))
919 #define PCOO(x) ((pCodeOpOpt *)(x))
920 #define PCOW(x) ((pCodeOpWild *)(x))
921 #define PCOW2(x) (PCOW(PCOW(x)->pcop2))
922 #define PBR(x) ((pBranch *)(x))
924 #define PCWB(x) ((pCodeWildBlock *)(x))
928 macros for checking pCode types
930 #define isPCI(x) ((PCODE(x)->type == PC_OPCODE))
931 #define isPCI_BRANCH(x) ((PCODE(x)->type == PC_OPCODE) && PCI(x)->isBranch)
932 #define isPCI_SKIP(x) ((PCODE(x)->type == PC_OPCODE) && PCI(x)->isSkip)
933 #define isPCI_LIT(x) ((PCODE(x)->type == PC_OPCODE) && PCI(x)->isLit)
934 #define isPCI_BITSKIP(x)((PCODE(x)->type == PC_OPCODE) && PCI(x)->isSkip && PCI(x)->isBitInst)
935 #define isPCFL(x) ((PCODE(x)->type == PC_FLOW))
936 #define isPCF(x) ((PCODE(x)->type == PC_FUNCTION))
937 #define isPCL(x) ((PCODE(x)->type == PC_LABEL))
938 #define isPCW(x) ((PCODE(x)->type == PC_WILD))
939 #define isPCCS(x) ((PCODE(x)->type == PC_CSOURCE))
940 #define isASMDIR(x) ((PCODE(x)->type == PC_ASMDIR))
942 #define isCALL(x) ((isPCI(x)) && (PCI(x)->op == POC_CALL))
943 #define isSTATUS_REG(r) ((r)->pc_type == PO_STATUS)
944 #define isBSR_REG(r) ((r)->pc_type == PO_BSR)
945 #define isACCESS_BANK(r) (r->accessBank)
949 #define isPCOLAB(x) ((PCOP(x)->type) == PO_LABEL)
951 /*-----------------------------------------------------------------*
953 *-----------------------------------------------------------------*/
955 pCode *pic16_newpCode (PIC_OPCODE op, pCodeOp *pcop); // Create a new pCode given an operand
956 pCode *pic16_newpCodeCharP(char *cP); // Create a new pCode given a char *
957 pCode *pic16_newpCodeInlineP(char *cP); // Create a new pCode given a char *
958 pCode *pic16_newpCodeFunction(char *g, char *f); // Create a new function
959 pCode *pic16_newpCodeLabel(char *name,int key); // Create a new label given a key
960 pCode *pic16_newpCodeLabelFORCE(char *name, int key); // Same as newpCodeLabel but label cannot be optimized out
961 pCode *pic16_newpCodeCSource(int ln, char *f, char *l); // Create a new symbol line
962 pBlock *pic16_newpCodeChain(memmap *cm,char c, pCode *pc); // Create a new pBlock
963 void pic16_printpBlock(FILE *of, pBlock *pb); // Write a pBlock to a file
964 void pic16_addpCode2pBlock(pBlock *pb, pCode *pc); // Add a pCode to a pBlock
965 void pic16_addpBlock(pBlock *pb); // Add a pBlock to a pFile
966 void pic16_copypCode(FILE *of, char dbName); // Write all pBlocks with dbName to *of
967 void pic16_movepBlock2Head(char dbName); // move pBlocks around
968 void pic16_AnalyzepCode(char dbName);
969 void pic16_AssignRegBanks(void);
970 void pic16_printCallTree(FILE *of);
971 void pCodePeepInit(void);
972 void pic16_pBlockConvert2ISR(pBlock *pb);
973 void pic16_pBlockConvert2Absolute(pBlock *pb);
974 void pic16_initDB(void);
975 void pic16_emitDB(char c, char ptype, void *p); // Add DB directives to a pBlock
976 void pic16_emitDS(char *s, char ptype, void *p);
977 void pic16_flushDB(char ptype, void *p); // Add pending DB data to a pBlock
979 pCode *pic16_newpCodeAsmDir(char *asdir, char *argfmt, ...);
981 pCodeOp *pic16_newpCodeOpLabel(char *name, int key);
982 pCodeOp *pic16_newpCodeOpImmd(char *name, int offset, int index, int code_space);
983 pCodeOp *pic16_newpCodeOpLit(int lit);
984 pCodeOp *pic16_newpCodeOpLit2(int lit, pCodeOp *arg2);
985 pCodeOp *pic16_newpCodeOpBit(char *name, int bit,int inBitSpace, PIC_OPTYPE subt);
986 pCodeOp *pic16_newpCodeOpRegFromStr(char *name);
987 pCodeOp *pic16_newpCodeOp(char *name, PIC_OPTYPE p);
988 pCodeOp *pic16_pCodeOpCopy(pCodeOp *pcop);
990 pCode * pic16_findNextInstruction(pCode *pci);
991 pCode * pic16_findNextpCode(pCode *pc, PC_TYPE pct);
992 int pic16_isPCinFlow(pCode *pc, pCode *pcflow);
993 struct regs * pic16_getRegFromInstruction(pCode *pc);
994 struct regs * pic16_getRegFromInstruction2(pCode *pc);
996 extern void pic16_pcode_test(void);
997 extern int pic16_debug_verbose;
998 extern int pic16_pcode_verbose;
1000 /*-----------------------------------------------------------------*
1002 *-----------------------------------------------------------------*/
1004 extern pCodeOpReg pic16_pc_status;
1005 extern pCodeOpReg pic16_pc_intcon;
1006 extern pCodeOpReg pic16_pc_pcl;
1007 extern pCodeOpReg pic16_pc_pclath;
1008 extern pCodeOpReg pic16_pc_pclatu; // patch 14
1009 extern pCodeOpReg pic16_pc_wreg;
1010 extern pCodeOpReg pic16_pc_tosl; // patch 14
1011 extern pCodeOpReg pic16_pc_tosh; // patch 14
1012 extern pCodeOpReg pic16_pc_tosu; // patch 14
1013 extern pCodeOpReg pic16_pc_tblptrl; // patch 15
1014 extern pCodeOpReg pic16_pc_tblptrh; //
1015 extern pCodeOpReg pic16_pc_tblptru; //
1016 extern pCodeOpReg pic16_pc_tablat; // patch 15
1017 extern pCodeOpReg pic16_pc_bsr;
1018 extern pCodeOpReg pic16_pc_fsr0;
1019 extern pCodeOpReg pic16_pc_fsr0l;
1020 extern pCodeOpReg pic16_pc_fsr0h;
1021 extern pCodeOpReg pic16_pc_fsr1l;
1022 extern pCodeOpReg pic16_pc_fsr1h;
1023 extern pCodeOpReg pic16_pc_fsr2l;
1024 extern pCodeOpReg pic16_pc_fsr2h;
1025 extern pCodeOpReg pic16_pc_indf0;
1026 extern pCodeOpReg pic16_pc_postinc0;
1027 extern pCodeOpReg pic16_pc_postdec0;
1028 extern pCodeOpReg pic16_pc_preinc0;
1029 extern pCodeOpReg pic16_pc_plusw0;
1030 extern pCodeOpReg pic16_pc_indf1;
1031 extern pCodeOpReg pic16_pc_postinc1;
1032 extern pCodeOpReg pic16_pc_postdec1;
1033 extern pCodeOpReg pic16_pc_preinc1;
1034 extern pCodeOpReg pic16_pc_plusw1;
1035 extern pCodeOpReg pic16_pc_indf2;
1036 extern pCodeOpReg pic16_pc_postinc2;
1037 extern pCodeOpReg pic16_pc_postdec2;
1038 extern pCodeOpReg pic16_pc_preinc2;
1039 extern pCodeOpReg pic16_pc_plusw2;
1040 extern pCodeOpReg pic16_pc_prodl;
1041 extern pCodeOpReg pic16_pc_prodh;
1043 extern pCodeOpReg pic16_pc_eecon1;
1044 extern pCodeOpReg pic16_pc_eecon2;
1045 extern pCodeOpReg pic16_pc_eedata;
1046 extern pCodeOpReg pic16_pc_eeadr;
1048 extern pCodeOpReg pic16_pc_kzero;
1049 extern pCodeOpReg pic16_pc_wsave; /* wsave and ssave are used to save W and the Status */
1050 extern pCodeOpReg pic16_pc_ssave; /* registers during an interrupt */
1052 extern pCodeOpReg pic16_pc_gpsimio;
1053 extern pCodeOpReg pic16_pc_gpsimio2;
1054 extern pCodeOpReg pic16_pc_gptrreg;
1056 #endif // __PCODE_H__