Started PIC port (based on mcs51 port)
[fw/sdcc] / src / pic / ralloc.h
1 /*-------------------------------------------------------------------------
2
3   SDCCralloc.h - header file register allocation
4
5                 Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1998)
6                 PIC port   - T. Scott Dattalo scott@dattalo.com (2000)
7
8    This program is free software; you can redistribute it and/or modify it
9    under the terms of the GNU General Public License as published by the
10    Free Software Foundation; either version 2, or (at your option) any
11    later version.
12    
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17    
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21    
22    In other words, you are welcome to use, share and improve this program.
23    You are forbidden to forbid anyone else to use, share and improve
24    what you give them.   Help stamp out software-hoarding!  
25 -------------------------------------------------------------------------*/
26 #include "SDCCicode.h"
27 #include "SDCCBBlock.h"
28 #ifndef SDCCRALLOC_H
29 #define SDCCRALLOC_H 1
30
31 enum { R2_IDX = 0, R3_IDX , R4_IDX  ,
32        R5_IDX   ,R6_IDX   , R7_IDX  ,
33        R0_IDX   ,R1_IDX   , X8_IDX  ,
34        X9_IDX   ,X10_IDX  , X11_IDX ,
35        X12_IDX  ,CND_IDX };
36
37
38 #define REG_PTR 0x01
39 #define REG_GPR 0x02
40 #define REG_CND 0x04
41 /* definition for the registers */
42 typedef struct regs
43 {
44     short type;          /* can have value 
45                             REG_GPR, REG_PTR or REG_CND */
46     short rIdx ;         /* index into register table */
47   //    short otype;        
48     char *name ;         /* name */
49     char *dname;         /* name when direct access needed */
50     char *base ;         /* base address */
51     short offset;        /* offset from the base */
52     unsigned isFree :1;  /* is currently unassigned  */    
53 } regs;
54 extern regs regspic14[];
55
56 regs  *pic14_regWithIdx (int);
57
58
59 enum PIC_register_types {
60   PIC_INDF,
61   PIC_TMR0,
62   PIC_FSR,
63   PIC_STATUS,
64   PIC_IOPORT,
65   PIC_IOTRIS,
66   PIC_GPR,         /*  A general purpose file register */
67   PIC_SFR          /*  A special function register */
68 };
69
70
71 #endif