1 /*-------------------------------------------------------------------------
2 SDCCgen51.h - header file for code generation for 8051
4 Written By - Sandeep Dutta . sandeep.dutta@usa.net (1998)
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
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.
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 -------------------------------------------------------------------------*/
29 /* Is in a register */
31 /* Is in direct space */
33 /* SFR space ($FF00 and above) */
37 /* Is an immediate value */
39 /* Is an address on the stack */
41 /* Is in the carry register */
43 /* Is pointed to by IY */
45 /* Is pointed to by HL */
47 /* Is on the extended stack (addressed via IY or HL) */
49 /* Is referenced by a pointer in a register pair. */
51 /* Read undefined, discard writes */
56 /* type asmop : a homogenised type for
57 all the different spaces an operand can be
62 short coff
; /* current offset */
63 short size
; /* total size */
64 unsigned code
:1; /* is in Code space */
65 unsigned paged
:1; /* in paged memory */
66 unsigned freed
:1; /* already freed */
67 unsigned bcInUse
:1; /* for banked I/O, which uses bc for the I/O address */
70 value
*aop_lit
; /* if literal */
71 reg_info
*aop_reg
[4]; /* array of registers */
72 char *aop_dir
; /* if direct */
73 char *aop_immd
; /* if immediate others are implied */
74 int aop_stk
; /* stack offset when AOP_STK or AOP_STL*/
75 int aop_pairId
; /* The pair ID */
78 signed char regs
[9]; // Byte of this aop that is in the register. -1 if no byte of this aop is in the reg.
79 struct valinfo valinfo
;
83 void genZ80Code (iCode
*);
84 void z80_emitDebuggerSymbol (const char *);
87 bool z80IsReturned(const char *what
);
89 // Check if what is part of the ith argument (counting from 1) to a function of type ftype.
90 // If what is 0, just check if hte ith argument is in registers.
91 bool z80IsRegArg(struct sym_link
*ftype
, int i
, const char *what
);
93 // Check if what is part of the any argument (counting from 1) to a function of type ftype.
94 bool z80IsParmInCall(sym_link
*ftype
, const char *what
);
96 extern bool z80_assignment_optimal
;
97 extern bool should_omit_frame_ptr
;