Blah. Pre 2.92.
[fw/sdcc] / src / z80 / 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
6    This program is free software; you can redistribute it and/or modify it
7    under the terms of the GNU General Public License as published by the
8    Free Software Foundation; either version 2, or (at your option) any
9    later version.
10    
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15    
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19    
20    In other words, you are welcome to use, share and improve this program.
21    You are forbidden to forbid anyone else to use, share and improve
22    what you give them.   Help stamp out software-hoarding!  
23 -------------------------------------------------------------------------*/
24
25 #ifndef SDCCGEN51_H
26 #define SDCCGEN51_H
27
28 typedef enum {
29     AOP_INVALID,
30     /* Is a literal */
31     AOP_LIT = 1,
32     /* Is in a register */
33     AOP_REG, 
34     /* Is in direct space */
35     AOP_DIR, 
36     /* Is on the stack */
37     AOP_STK ,
38     /* Is an immediate value */
39     AOP_IMMD, 
40     /* Is a string (?) */
41     AOP_STR,
42     /* Is in the carry register */
43     AOP_CRY, 
44     /* Is pointed to by IY */
45     AOP_IY,
46     /* Is pointed to by HL */
47     AOP_HL,
48     /* Is in A */
49     AOP_ACC 
50 } AOP_TYPE;
51
52 /* type asmop : a homogenised type for 
53    all the different spaces an operand can be
54    in */
55 typedef struct asmop {
56     AOP_TYPE type;
57     short coff ;  /* current offset */
58     short size ;  /* total size */
59     unsigned code :1 ;         /* is in Code space */
60     unsigned paged:1 ;         /* in paged memory  */
61     unsigned freed:1 ;         /* already freed    */
62     union {
63         value *aop_lit ;       /* if literal */
64         regs  *aop_reg[4];     /* array of registers */
65         char  *aop_dir ;       /* if direct  */
66         char  *aop_immd;       /* if immediate others are implied */    
67         int    aop_stk ;       /* stack offset when AOP_STK */
68         char  *aop_str[4];     /* just a string array containing the location */
69     } aopu;
70 } asmop;
71
72 void genZ80Code (iCode *);
73
74
75 #endif