Cleaned up ds390 leftovers in the mcs51 port.
[fw/sdcc] / src / pic / gen.h
1 /*-------------------------------------------------------------------------
2   SDCCgen51.h - header file for code generation for 8051
3
4              Written By -  Sandeep Dutta . sandeep.dutta@usa.net (1998)
5              PIC port   - T. Scott Dattalo scott@dattalo.com (2000)
6
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
10    later version.
11    
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.
16    
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.
20    
21    In other words, you are welcome to use, share and improve this program.
22    You are forbidden to forbid anyone else to use, share and improve
23    what you give them.   Help stamp out software-hoarding!  
24 -------------------------------------------------------------------------*/
25
26 #ifndef SDCCGENPIC14_H
27 #define SDCCGENPIC14_H
28
29 enum
30   {
31     AOP_LIT = 1,
32     AOP_REG, AOP_DIR,
33     AOP_DPTR, AOP_DPTR2, AOP_R0, AOP_R1,
34     AOP_STK, AOP_IMMD, AOP_STR,
35     AOP_CRY, AOP_ACC
36   };
37
38 /* type asmop : a homogenised type for 
39    all the different spaces an operand can be
40    in */
41 typedef struct asmop
42   {
43
44     short type;                 /* can have values
45                                    AOP_LIT    -  operand is a literal value
46                                    AOP_REG    -  is in registers
47                                    AOP_DIR    -  direct just a name
48                                    AOP_DPTR   -  dptr contains address of operand
49                                    AOP_DPTR2  -  dptr2 contains address of operand (DS80C390 only).
50                                    AOP_R0/R1  -  r0/r1 contains address of operand               
51                                    AOP_STK    -  should be pushed on stack this
52                                    can happen only for the result
53                                    AOP_IMMD   -  immediate value for eg. remateriazable 
54                                    AOP_CRY    -  carry contains the value of this
55                                    AOP_STR    -  array of strings
56                                    AOP_ACC    -  result is in the acc:b pair
57                                  */
58     short coff;                 /* current offset */
59     short size;                 /* total size */
60     unsigned code:1;            /* is in Code space */
61     unsigned paged:1;           /* in paged memory  */
62     unsigned freed:1;           /* already freed    */
63     union
64       {
65         value *aop_lit;         /* if literal */
66         regs *aop_reg[4];       /* array of registers */
67         char *aop_dir;          /* if direct  */
68         regs *aop_ptr;          /* either -> to r0 or r1 */
69         char *aop_immd;         /* if immediate others are implied */
70         int aop_stk;            /* stack offset when AOP_STK */
71         char *aop_str[4];       /* just a string array containing the location */
72       }
73     aopu;
74   }
75 asmop;
76
77 void genpic14Code (iCode *);
78
79 //extern char *fReturnpic14[];
80 //extern char *fReturn390[];
81 extern unsigned fReturnSizePic;
82 //extern char **fReturn;
83
84 #endif