struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / sdas / astlcs90 / t90.h
blob542c08f1ecf272c3b22e3009dac9879a8b6f32ed
1 /* t90.h */
3 /*
4 * Copyright (C) 1989-2009 Alan R. Baldwin
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
20 * Alan R. Baldwin
21 * 721 Berkeley St.
22 * Kent, Ohio 44240
26 * Extensions: P. Felber
30 * TLCS90 Port: R. Keuchel
34 * Indirect Addressing delimeters
36 #define LFIND '('
37 #define RTIND ')'
40 * Registers
42 #define B 0
43 #define C 1
44 #define D 2
45 #define E 3
46 #define H 4
47 #define L 5
48 #define A 6
50 #define I 0107
51 #define R 0117
53 #define BC 0
54 #define DE 1
55 #define HL 2
56 #define IX 4
57 #define IY 5
58 #define SP 6
60 #define AF 6
63 * Conditional definitions
67 F - always False
68 T - always True
69 Z Z = 1 Result zero
70 NZ Z = 0 Result not zero
71 C C = 1 Carry is Set
72 NC C = 0 Carry is not Set
73 PL or P S = 0 Result positive; >= 0
74 MI or M S = 1 Result negative; < 0
75 NE Z = 0 Result not zero
76 EQ Z = 1 Result zero
77 OV P/V = 1 Overflow ocurred
78 NOV P/V = 0 Overflow didn't occur
79 PE P/V = 1 Result has even Parity
80 PO P/V = 0 Result has odd Parity
81 GE (S xor P/V) = 0 Result (signed) is >= 0
82 LT (S xor P/V) = 1 Result (signed) is < 0
83 GT [Z or (S xor P/V)] = 0 Result (signed) is > 0
84 LE [Z or (S xor P/V)] = 1 Result (signed) is <= 0
85 UGE C = 0 Result (unsigned) is >= 0
86 ULT C = 1 Result (unsigned) is < 0
87 UGT (C or Z) = 0 Result (unsigned) is > 0
88 ULE (C or Z) = 1 Result (unsigned) is <= 0
91 #define CS 0x7
92 #define EQ 0x6
93 #define F 0x0
94 #define GE 0x9
95 #define GT 0xA
96 #define LE 0x2
97 #define LT 0x1
98 #define M 0x5
99 #define NC 0xF
100 #define NE 0xE
101 #define NOV 0xC
102 #define NZ 0xE
103 #define OV 0x4
104 #define P 0xD
105 #define PE 0x4
106 #define PO 0xC
107 #define T 0x8
108 #define UGE 0xF
109 #define UGT 0xB
110 #define ULE 0x3
111 #define ULT 0x7
112 #define Z 0x6
115 * Symbol types
117 #define S_IMMED 30
118 #define S_R8 31
119 #define S_R8X 32
120 #define S_R16 33
121 #define S_R16X 34
122 #define S_CND 35
123 #define S_FLAG 36
124 //#define S_R8U1 37
125 #define S_R8U2 38
128 * Indexing modes
130 #define S_INDB 40
131 #define S_IDC 41
133 #define S_INDR 50
135 #define S_IDBC 50
136 #define S_IDDE 51
137 #define S_IDHL 52
138 #define S_IDIX 54
139 #define S_IDIY 55
140 #define S_IDSP 56
142 #define S_INDM 57
145 * Instruction types
147 #define S_LD 60
148 #define S_CALL 61
149 #define S_JP 62
150 #define S_JR 63
151 #define S_RET 64
152 #define S_INC 66
153 #define S_DEC 67
154 #define S_ADD 68
155 #define S_ADC 69
156 #define S_EX 71
157 #define S_PUSH 72
158 #define S_INH1 78
159 #define S_DJNZ 80
160 #define S_SUB 81
161 #define S_SBC 82
164 * CPU Types
167 #define S_INCX 84
168 #define S_DECX 85
170 #define S_IRET 86
172 #define S_MUL 87
173 #define S_DIV 88
175 #define S_INCW 89
176 #define S_DECW 90
178 #define S_BIT 91
179 #define S_SET 92
180 #define S_RES 93
181 #define S_TSET 94
183 #define S_AND 95
184 #define S_CP 96
185 #define S_OR 97
186 #define S_XOR 98
188 // must be ordered!
189 #define S_RLC 99
190 #define S_RRC 100
191 #define S_RL 101
192 #define S_RR 102
193 #define S_SLA 103
194 #define S_SRA 104
195 #define S_SLL 105
196 #define S_SRL 106
198 #define S_LDI 107
199 #define S_LDIR 108
200 #define S_LDD 109
201 #define S_LDDR 110
202 #define S_CPI 111
203 #define S_CPIR 112
204 #define S_CPD 113
205 #define S_CPDR 114
207 #define S_LDAR 115
209 #define S_LDW 116
211 #define S_RLD 117
212 #define S_RRD 118
214 #define S_CALLR 119
216 #define S_LDA 120
218 // .t90
219 #define S_CPU 123
222 * Processor Types (S_CPU)
224 #define X_T90 0
226 struct adsym
228 char a_str[4]; /* addressing string */
229 int a_val; /* addressing mode value */
232 extern struct adsym R8[];
233 //extern struct adsym R8X[];
234 //extern struct adsym R8U1[];
235 //extern struct adsym R8U2[];
237 extern struct adsym R16[];
238 extern struct adsym R16X[];
239 extern struct adsym CND[];
241 /* machine dependent functions */
243 #ifdef OTHERSYSTEM
245 /* t90adr.c */
246 extern int addr(struct expr *esp);
247 extern int admode(struct adsym *sp);
248 extern int srch(char *str);
250 /* t90mch.c */
251 extern int genop(int pop, int op, struct expr *esp, int f);
252 extern VOID machine(struct mne *mp);
253 extern int mchpcr(struct expr *esp);
254 extern VOID minit(void);
256 #else
258 /* t90adr.c */
259 extern int addr();
260 extern int admode();
261 extern int srch();
263 /* t90mch.c */
264 extern VOID machine();
265 extern int mchpcr();
266 extern VOID minit();
268 #endif