annotate mc.h @ 309:a86612cf1a19

struct partial initialization (local struct copy)
author kono
date Thu, 10 Jun 2004 19:09:36 +0900
parents e1d17d6adfcc
children a93e619cf772
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
1 /* Micro-C header file */
d35df41eac69 Initial revision
kono
parents:
diff changeset
2
d35df41eac69 Initial revision
kono
parents:
diff changeset
3 #define DEBUG error(-1)
d35df41eac69 Initial revision
kono
parents:
diff changeset
4
d35df41eac69 Initial revision
kono
parents:
diff changeset
5 /*#include "CCLIB.TXT" */
19
b62230ea38f6 ifdef debug
kono
parents: 18
diff changeset
6 #ifdef __micro_c__
b62230ea38f6 ifdef debug
kono
parents: 18
diff changeset
7 #include "stdio.h"
b62230ea38f6 ifdef debug
kono
parents: 18
diff changeset
8 #else
b62230ea38f6 ifdef debug
kono
parents: 18
diff changeset
9 #include <stdio.h>
195
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
10 #include <stdlib.h>
19
b62230ea38f6 ifdef debug
kono
parents: 18
diff changeset
11 #endif
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
12
195
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
13 #define FLOAT_CODE 1
237
1933266f1efa long long ia32 (imcomplete)
kono
parents: 235
diff changeset
14 #define LONGLONG_CODE 1
292
6d4231b6f9fe switch statement prepare
kono
parents: 278
diff changeset
15 #define CASE_CODE 1
195
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
16
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
17 /* reserved word start */
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
18
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
19 #define INT (-1)
162
0c604d2ff585 *** empty log message ***
kono
parents: 150
diff changeset
20 #define UNSIGNED (-2)
0c604d2ff585 *** empty log message ***
kono
parents: 150
diff changeset
21 #define CHAR (-3)
0c604d2ff585 *** empty log message ***
kono
parents: 150
diff changeset
22 #define UCHAR (-4)
0c604d2ff585 *** empty log message ***
kono
parents: 150
diff changeset
23 #define POINTER (-5)
0c604d2ff585 *** empty log message ***
kono
parents: 150
diff changeset
24 #define ARRAY (-6)
0c604d2ff585 *** empty log message ***
kono
parents: 150
diff changeset
25 #define STRUCT (-7)
0c604d2ff585 *** empty log message ***
kono
parents: 150
diff changeset
26 #define UNION (-8)
0c604d2ff585 *** empty log message ***
kono
parents: 150
diff changeset
27 #define FUNCTION (-9)
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
28
d35df41eac69 Initial revision
kono
parents:
diff changeset
29 #define STATIC (-10)
d35df41eac69 Initial revision
kono
parents:
diff changeset
30 #define GOTO (-11)
d35df41eac69 Initial revision
kono
parents:
diff changeset
31 #define RETURN (-12)
d35df41eac69 Initial revision
kono
parents:
diff changeset
32 #define BREAK (-13)
d35df41eac69 Initial revision
kono
parents:
diff changeset
33 #define CONTINUE (-14)
d35df41eac69 Initial revision
kono
parents:
diff changeset
34 #define IF (-15)
d35df41eac69 Initial revision
kono
parents:
diff changeset
35 #define ELSE (-16)
d35df41eac69 Initial revision
kono
parents:
diff changeset
36 #define FOR (-17)
d35df41eac69 Initial revision
kono
parents:
diff changeset
37 #define DO (-18)
d35df41eac69 Initial revision
kono
parents:
diff changeset
38 #define WHILE (-19)
d35df41eac69 Initial revision
kono
parents:
diff changeset
39 #define SWITCH (-20)
d35df41eac69 Initial revision
kono
parents:
diff changeset
40 #define CASE (-21)
d35df41eac69 Initial revision
kono
parents:
diff changeset
41 #define DEFAULT (-22)
d35df41eac69 Initial revision
kono
parents:
diff changeset
42 #define RESERVE (-23)
d35df41eac69 Initial revision
kono
parents:
diff changeset
43 #define TAG (-24)
d35df41eac69 Initial revision
kono
parents:
diff changeset
44 #define FIELD (-25)
d35df41eac69 Initial revision
kono
parents:
diff changeset
45 #define IDENT (-26)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
46 #define MACRO (-27)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
47 #define BLABEL (-28)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
48 #define FLABEL (-29)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
49 #define TYPEDEF (-30)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
50 #define SIZEOF (-31)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
51 #define TYPE (-32)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
52 #define LONG (-33)
178
0f395aa93438 gcc include file
kono
parents: 177
diff changeset
53 #define SHORT (-34)
0f395aa93438 gcc include file
kono
parents: 177
diff changeset
54 #define USHORT (-35)
0f395aa93438 gcc include file
kono
parents: 177
diff changeset
55 #define EXTRN (-36)
0f395aa93438 gcc include file
kono
parents: 177
diff changeset
56 #define EXTRN1 (-37)
0f395aa93438 gcc include file
kono
parents: 177
diff changeset
57 #define VOID (-38)
0f395aa93438 gcc include file
kono
parents: 177
diff changeset
58 #define INLINE (-39)
0f395aa93438 gcc include file
kono
parents: 177
diff changeset
59 #define REGISTER (-40)
0f395aa93438 gcc include file
kono
parents: 177
diff changeset
60 #define FREGISTER (-41)
0f395aa93438 gcc include file
kono
parents: 177
diff changeset
61 #define DREGISTER (-42)
195
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
62 #define LREGISTER (-43)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
63 #define CODE (-44)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
64 #define ENVIRONMENT (-45)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
65 #define DEFINED (-46)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
66 #define ENUM (-47)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
67 #define KONST (-48)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
68 #define FMACRO (-49)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
69 #define LMACRO (-50)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
70 #define SIGNED (-51)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
71 #define DOTS (-52)
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
72
195
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
73 #define FLOAT (-53)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
74 #define DOUBLE (-54)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
75 #define LONGLONG (-55)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
76 #define ULONGLONG (-56)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
77 #define VOLATILE (-57)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
78
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
79 /* reserved word end */
78
8418d4b7caa7 *** empty log message ***
kono
parents: 77
diff changeset
80
103
f849af4b5ea9 *** empty log message ***
kono
parents: 101
diff changeset
81 #define EMPTY (-99)
f849af4b5ea9 *** empty log message ***
kono
parents: 101
diff changeset
82
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
83 /* mode start */
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
84 #define TOP 0
d35df41eac69 Initial revision
kono
parents:
diff changeset
85 #define GDECL 1
d35df41eac69 Initial revision
kono
parents:
diff changeset
86 #define GSDECL 2
d35df41eac69 Initial revision
kono
parents:
diff changeset
87 #define GUDECL 3
d35df41eac69 Initial revision
kono
parents:
diff changeset
88 #define ADECL 4
d35df41eac69 Initial revision
kono
parents:
diff changeset
89 #define LDECL 5
d35df41eac69 Initial revision
kono
parents:
diff changeset
90 #define LSDECL 6
d35df41eac69 Initial revision
kono
parents:
diff changeset
91 #define LUDECL 7
d35df41eac69 Initial revision
kono
parents:
diff changeset
92 #define STADECL 8
d35df41eac69 Initial revision
kono
parents:
diff changeset
93 #define STAT 9
d35df41eac69 Initial revision
kono
parents:
diff changeset
94 #define GTDECL 10
d35df41eac69 Initial revision
kono
parents:
diff changeset
95 #define LTDECL 11
18
df7fa8cee67b pass -Wall
kono
parents: 3
diff changeset
96 #define IFDEF 12
29
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
97 #define MDECL 13
176
kono
parents: 174
diff changeset
98 #define GEDECL 14
kono
parents: 174
diff changeset
99 #define LEDECL 15
308
e1d17d6adfcc struct field init (first try, no compile error)
kono
parents: 304
diff changeset
100 #define SFDINIT 16
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
101 /* mode end */
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
102
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
103 #define US 1
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
104 #define AS 10000
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
105 #define SOP 200
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
106 #define COP 400
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
107 #define DOP 600
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
108 #define FOP 800
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
109 #define LOP 1000
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
110
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
111 /* tree node tags start */
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
112
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
113 #define LIST_ARGS(i) (i==FUNCTION||i==CODE)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
114
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
115 /* nullary argments */
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
116
d35df41eac69 Initial revision
kono
parents:
diff changeset
117 #define GVAR 1
d35df41eac69 Initial revision
kono
parents:
diff changeset
118 #define RGVAR 2
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
119 #define URGVAR 3
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
120 #define LVAR 4
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
121 #define RLVAR 5
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
122 #define URLVAR 6
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
123 #define CRGVAR (COP+RGVAR)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
124 #define CURGVAR (COP+URGVAR)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
125 #define CRLVAR (COP+RLVAR)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
126 #define CURLVAR (COP+URLVAR)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
127 #define FRGVAR (FOP+RGVAR)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
128 #define FRLVAR (FOP+RLVAR)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
129 #define DRGVAR (DOP+RGVAR)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
130 #define DRLVAR (DOP+RLVAR)
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
131 #define SRGVAR (SOP+RGVAR)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
132 #define SURGVAR (SOP+URGVAR)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
133 #define SRLVAR (SOP+RLVAR)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
134 #define SURLVAR (SOP+URLVAR)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
135 #define LRGVAR (LOP+RGVAR)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
136 #define LURGVAR (LOP+URGVAR)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
137 #define LRLVAR (LOP+RLVAR)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
138 #define LURLVAR (LOP+URLVAR)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
139
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
140 #define CONST 7
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
141 #define DCONST (DOP+CONST)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
142 #define FCONST (FOP+CONST)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
143 #define LCONST (LOP+CONST)
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
144 #define STRING 8
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
145 #define FNAME 9
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
146
219
6190d24e178c long long code generation level 4
kono
parents: 216
diff changeset
147 #define NULLARY_ARGS(i) (i==REGISTER||i==DREGISTER||i==FREGISTER||i==LREGISTER||(GVAR<=(i%SOP)&&(i%SOP)<=FNAME))
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
148
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
149 /* unary argments */
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
150
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
151 #define ADDRESS 10
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
152 #define MINUS 11
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
153 #define LNOT 12
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
154 #define BNOT 13
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
155 #define INC 14
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
156 #define POSTINC 15
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
157 #define UPOSTINC 16
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
158 #define PREINC 17
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
159 #define UPREINC 18
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
160 #define POSTDEC 19
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
161 #define UPOSTDEC 20
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
162 #define PREDEC 21
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
163 #define UPREDEC 22
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
164 #define DEC 23
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
165 #define CPOSTINC (COP+POSTINC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
166 #define CUPOSTINC (COP+UPOSTINC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
167 #define CPREINC (COP+PREINC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
168 #define CUPREINC (COP+UPREINC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
169 #define CPOSTDEC (COP+POSTDEC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
170 #define CUPOSTDEC (COP+UPOSTDEC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
171 #define CPREDEC (COP+CPREDEC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
172 #define CUPREDEC (COP+UPREDEC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
173 #define SPOSTINC (SOP+POSTINC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
174 #define SUPOSTINC (SOP+UPOSTINC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
175 #define SPREINC (SOP+PREINC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
176 #define SUPREINC (SOP+UPREINC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
177 #define SPOSTDEC (SOP+POSTDEC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
178 #define SUPOSTDEC (SOP+UPOSTDEC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
179 #define SPREDEC (SOP+PREDEC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
180 #define SUPREDEC (SOP+UPREDEC)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
181 #define FPOSTINC (FOP+POSTINC)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
182 #define FPREINC (FOP+PREINC)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
183 #define DPOSTINC (DOP+POSTINC)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
184 #define DPREINC (DOP+PREINC)
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
185 #define LPOSTINC (LOP+POSTINC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
186 #define LPREINC (LOP+PREINC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
187 #define LUPOSTINC (LOP+UPOSTINC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
188 #define LUPREINC (LOP+UPREINC)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
189 #define INDIRECT 24
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
190 #define RINDIRECT 25
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
191 #define URINDIRECT 26
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
192 #define CRINDIRECT (COP+RINDIRECT)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
193 #define CURINDIRECT (COP+URINDIRECT)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
194 #define SRINDIRECT (SOP+RINDIRECT)
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
195 #define SURINDIRECT (SOP+URINDIRECT)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
196 #define FRINDIRECT (FOP+RINDIRECT)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
197 #define DRINDIRECT (DOP+RINDIRECT)
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
198 #define LRINDIRECT (LOP+RINDIRECT)
207
8a3516f6eb66 *** empty log message ***
kono
parents: 206
diff changeset
199 #define LURINDIRECT (LOP+URINDIRECT)
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
200 #define RSTRUCT 27
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
201 #define CONV 28
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
202
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
203 #define UNARY_ARGS(i) (ADDRESS<=(i%SOP)&&(i%SOP)<=CONV)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
204
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
205 /* binary argments */
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
206
196
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
207 #define MUL 29
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
208 #define UMUL 30
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
209 #define DIV 31
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
210 #define UDIV 32
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
211 #define MOD 33
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
212 #define UMOD 34
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
213 #define ADD 35
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
214 #define SUB 36
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
215 #define CMP 37
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
216 #define RSHIFT 38
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
217 #define URSHIFT 39
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
218 #define LSHIFT 40
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
219 #define ULSHIFT 41
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
220 #define GT 42
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
221 #define UGT 43
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
222 #define GE 44
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
223 #define UGE 45
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
224 #define LT 46
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
225 #define ULT 47
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
226 #define LE 48
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
227 #define ULE 49
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
228 #define EQ 50
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
229 #define NEQ 51
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
230 #define BAND 52
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
231 #define EOR 53
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
232 #define BOR 54
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
233 #define LAND 55
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
234 #define LOR 56
5f70abd9453d *** empty log message ***
kono
parents: 195
diff changeset
235 #define ASS 57
246
0dcc0ec81ed2 MIPS on going (90%)
kono
parents: 237
diff changeset
236 #define UCMP 58
278
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
237 #define UCMPGE 59
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
238 #define CMPGE 60
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
239 #define CMPEQ 61
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
240 #define CMPNEQ 62
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
241 #define ASSOP 63
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
242 #define COMMA 64
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
243
278
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
244 #define CASS 65
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
245 #define CASSOP 66
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
246 #define CUASSOP 67
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
247
165
kono
parents: 164
diff changeset
248 #define SASS (SOP+CASS)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
249 #define SASSOP (SOP+CASSOP)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
250 #define SUASSOP (SOP+CUASSOP)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
251
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
252 #define DASS (DOP+ASS)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
253 #define DCMPGE (DOP+CMPGE)
248
b4a57dd14801 no compile error (mips)
kono
parents: 246
diff changeset
254 #define DCMPEQ (DOP+CMPEQ)
250
7637295c4fb8 *** empty log message ***
kono
parents: 248
diff changeset
255 #define DCMPNEQ (DOP+CMPNEQ)
89
917947ffeb7c power pc version
kono
parents: 85
diff changeset
256 #define DASSOP (DOP+ASSOP)
917947ffeb7c power pc version
kono
parents: 85
diff changeset
257 #define DCMP (DOP+CMP)
917947ffeb7c power pc version
kono
parents: 85
diff changeset
258 #define DMINUS (DOP+MINUS)
82
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
259 #define DMUL (DOP+MUL)
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
260 #define DDIV (DOP+DIV)
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
261 #define DADD (DOP+ADD)
25654dc29ecc First Floating Point coding done.
kono
parents: 81
diff changeset
262 #define DSUB (DOP+SUB)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
263
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
264 #define FASS (FOP+ASS)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
265 #define FCMPGE (FOP+CMPGE)
248
b4a57dd14801 no compile error (mips)
kono
parents: 246
diff changeset
266 #define FCMPEQ (FOP+CMPEQ)
250
7637295c4fb8 *** empty log message ***
kono
parents: 248
diff changeset
267 #define FCMPNEQ (FOP+CMPNEQ)
133
7d436c08e949 separate float / double flow
kono
parents: 119
diff changeset
268 #define FASSOP (FOP+ASSOP)
7d436c08e949 separate float / double flow
kono
parents: 119
diff changeset
269 #define FCMP (FOP+CMP)
7d436c08e949 separate float / double flow
kono
parents: 119
diff changeset
270 #define FMINUS (FOP+MINUS)
7d436c08e949 separate float / double flow
kono
parents: 119
diff changeset
271 #define FMUL (FOP+MUL)
7d436c08e949 separate float / double flow
kono
parents: 119
diff changeset
272 #define FDIV (FOP+DIV)
7d436c08e949 separate float / double flow
kono
parents: 119
diff changeset
273 #define FADD (FOP+ADD)
7d436c08e949 separate float / double flow
kono
parents: 119
diff changeset
274 #define FSUB (FOP+SUB)
78
8418d4b7caa7 *** empty log message ***
kono
parents: 77
diff changeset
275
165
kono
parents: 164
diff changeset
276 #define LASS (LOP+CASS)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
277 #define LCMPGE (LOP+CMPGE)
250
7637295c4fb8 *** empty log message ***
kono
parents: 248
diff changeset
278 #define LCMPEQ (LOP+CMPEQ)
7637295c4fb8 *** empty log message ***
kono
parents: 248
diff changeset
279 #define LCMPNEQ (LOP+CMPNEQ)
195
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
280 #define LASSOP (LOP+CASSOP)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
281 #define LUASSOP (LOP+CUASSOP)
195
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
282 #define LCMP (LOP+CMP)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
283 #define LMINUS (LOP+MINUS)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
284 #define LMUL (LOP+MUL)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
285 #define LDIV (LOP+DIV)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
286 #define LUMUL (LOP+UMUL)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
287 #define LUDIV (LOP+UDIV)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
288 #define LADD (LOP+ADD)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
289 #define LSUB (LOP+SUB)
81
f94ca1168520 float first try...
kono
parents: 78
diff changeset
290
195
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
291
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
292 #define LMOD (LOP+MOD)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
293 #define LUMOD (LOP+UMOD)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
294 #define LLSHIFT (LOP+LSHIFT)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
295 #define LULSHIFT (LOP+ULSHIFT)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
296 #define LRSHIFT (LOP+RSHIFT)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
297 #define LURSHIFT (LOP+URSHIFT)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
298 #define LBAND (LOP+BAND)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
299 #define LEOR (LOP+EOR)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
300 #define LBOR (LOP+BOR)
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
301
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
302
278
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
303 #define STASS 68
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
304
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
305 #define BINARY_ARGS(i) (MUL<=(i%SOP)&&(i%SOP)<=STASS)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
306
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
307 /* tarnary argments */
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
308
278
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
309 #define COND 69
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
310 #define SCOND (SOP+COND)
133
7d436c08e949 separate float / double flow
kono
parents: 119
diff changeset
311 #define DCOND (DOP+COND)
7d436c08e949 separate float / double flow
kono
parents: 119
diff changeset
312 #define FCOND (FOP+COND)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
313 #define LCOND (LOP+COND)
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
314
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
315 #define TARNARY_ARGS(i) (COND==(i%SOP))
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
316
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
317 /* not appeared as tags */
81
f94ca1168520 float first try...
kono
parents: 78
diff changeset
318
278
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
319 #define I2I 70
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
320 #define I2U 71
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
321 #define I2D 72
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
322 #define I2F 73
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
323 #define I2LL 74
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
324 #define I2ULL 75
194
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
325
278
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
326 #define U2I 76
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
327 #define U2U 77
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
328 #define U2D 78
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
329 #define U2F 79
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
330 #define U2LL 80
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
331 #define U2ULL 81
194
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
332
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
333 #define D2I (DOP+I2I)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
334 #define D2U (DOP+I2U)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
335 #define D2D (DOP+I2D)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
336 #define D2F (DOP+I2F)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
337 #define D2LL (DOP+I2LL)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
338 #define D2ULL (DOP+I2ULL)
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
339
194
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
340 #define F2I (FOP+I2I)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
341 #define F2U (FOP+I2U)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
342 #define F2D (FOP+I2D)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
343 #define F2F (FOP+I2F)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
344 #define F2LL (FOP+I2LL)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
345 #define F2ULL (FOP+I2ULL)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
346
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
347 #define LL2I (LOP+I2I)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
348 #define LL2U (LOP+I2U)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
349 #define LL2D (LOP+I2D)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
350 #define LL2F (LOP+I2F)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
351 #define LL2LL (LOP+I2LL)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
352 #define LL2ULL (LOP+I2ULL)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
353
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
354 #define ULL2I (LOP+U2I)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
355 #define ULL2U (LOP+U2U)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
356 #define ULL2D (LOP+U2D)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
357 #define ULL2F (LOP+U2F)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
358 #define ULL2LL (LOP+U2LL)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
359 #define ULL2ULL (LOP+U2ULL)
114e9d64b5cc *** empty log message ***
kono
parents: 188
diff changeset
360
278
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
361 #define LPAR 82
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
362 #define RPAR 83
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
363 #define LBRA 84
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
364 #define RBRA 85
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
365 #define LC 86
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
366 #define RC 87
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
367 #define COLON 88
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
368 #define SM 89
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
369 #define PERIOD 90
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
370 #define ARROW 91
5b50813d0c45 MIPS 90% test passed. Self compile core dumped.
kono
parents: 254
diff changeset
371 #define CNAME 92
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
372
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
373 /* tree node tags end */
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
374
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
375 /* error number start */
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
376
d35df41eac69 Initial revision
kono
parents:
diff changeset
377 #define FILERR 1
d35df41eac69 Initial revision
kono
parents:
diff changeset
378 #define DCERR 2
304
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
379 #define RDERR 3
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
380 #define STERR 4
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
381 #define EXERR 5
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
382 #define CNERR 6
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
383 #define CHERR 7
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
384 #define GSERR 8
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
385 #define LSERR 9
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
386 #define STRERR 10
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
387 #define LNERR 11
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
388 #define EOFERR 12
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
389 #define MCERR 13
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
390 #define INCERR 14
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
391 #define HPERR 15
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
392 #define TYERR 16
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
393 #define LVERR 17
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
394 #define UDERR 18
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
395 #define OPTION 19
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
396 #define REG_ERR 20
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
397 #define CODE_ERR 21
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
398 #define MSERR 22
164
1c2a9232ea93 mc.h generation
kono
parents: 162
diff changeset
399 /* error number end */
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
400
d35df41eac69 Initial revision
kono
parents:
diff changeset
401 #define GSYMS 9000
d35df41eac69 Initial revision
kono
parents:
diff changeset
402 #define LSYMS 500
32
b35787d8a442 macro initialization
kono
parents: 30
diff changeset
403 #define MSYMS 3000
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
404
183
1d80ad165831 recursive macros
kono
parents: 182
diff changeset
405 #define HEAPSIZE 30000
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
406 /* #define CHEAPSIZE 3000 */
183
1d80ad165831 recursive macros
kono
parents: 182
diff changeset
407 #define CHEAPSIZE 356000
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
408 #define LBUFSIZE 4096
34
0756caa79167 macro function recursive and copy method
kono
parents: 33
diff changeset
409 #define MACROSIZE 16000
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
410
25
b7a94557bf92 *** empty log message ***
kono
parents: 20
diff changeset
411 #define FILES 10
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
412 #define OUTPUT_FILE_NAME "mcout.s"
d35df41eac69 Initial revision
kono
parents:
diff changeset
413
29
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
414 EXTERN int sym,ch,type,mode,stmode,gfree,lfree,mflag,lineno,glineno;
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
415 EXTERN int labelno,gpc,disp,reg_var,debug;
d35df41eac69 Initial revision
kono
parents:
diff changeset
416 EXTERN int symval,args,init_vars,heap[HEAPSIZE];
292
6d4231b6f9fe switch statement prepare
kono
parents: 278
diff changeset
417 EXTERN int blabel,clabel,dlabel,cslist,cslabel,ilabel,control;
6d4231b6f9fe switch statement prepare
kono
parents: 278
diff changeset
418 EXTERN int ac,ac2,lsrc,chk,asmf;
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
419 EXTERN int MAX_REGISTER_VAR;
d35df41eac69 Initial revision
kono
parents:
diff changeset
420
d35df41eac69 Initial revision
kono
parents:
diff changeset
421 EXTERN unsigned hash;
d35df41eac69 Initial revision
kono
parents:
diff changeset
422
34
0756caa79167 macro function recursive and copy method
kono
parents: 33
diff changeset
423 EXTERN int chsave;
115
ebac635814dc fix nested macro function
kono
parents: 110
diff changeset
424 EXTERN int chptrsave;
29
160e20394f80 macro function (imcomplete)
kono
parents: 28
diff changeset
425 EXTERN char linebuf[LBUFSIZE],namebuf[LBUFSIZE],*chptr;
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
426 EXTERN char *name,*cheapp,**av,/*obuf[320],*/*sptr,escape(void);
254
5aaca4f9d96b *** empty log message ***
kono
parents: 250
diff changeset
427 EXTERN int arg_offset,stat_no,disp_offset,csvalue1;
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
428 EXTERN int code_arg_offset;
d35df41eac69 Initial revision
kono
parents:
diff changeset
429 EXTERN int retlabel,retpending,retcont;
77
2b8ba655e572 fix arg type
kono
parents: 72
diff changeset
430 EXTERN int arglist;
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
431
304
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
432 extern char *init_src;
9df8aa0497ea fix line continuation and #macro in string.
kono
parents: 293
diff changeset
433
254
5aaca4f9d96b *** empty log message ***
kono
parents: 250
diff changeset
434 extern int size_of_int;
5aaca4f9d96b *** empty log message ***
kono
parents: 250
diff changeset
435 extern int size_of_short;
5aaca4f9d96b *** empty log message ***
kono
parents: 250
diff changeset
436 extern int size_of_float;
5aaca4f9d96b *** empty log message ***
kono
parents: 250
diff changeset
437 extern int size_of_double;
5aaca4f9d96b *** empty log message ***
kono
parents: 250
diff changeset
438 extern int size_of_longlong;
5aaca4f9d96b *** empty log message ***
kono
parents: 250
diff changeset
439 extern int endian;
5aaca4f9d96b *** empty log message ***
kono
parents: 250
diff changeset
440
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
441 EXTERN FILE *obuf;
d35df41eac69 Initial revision
kono
parents:
diff changeset
442
168
b1297c82e926 cpostinc removal
kono
parents: 166
diff changeset
443 #if 1
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
444 typedef struct nametable {
d35df41eac69 Initial revision
kono
parents:
diff changeset
445 char *nm;
d35df41eac69 Initial revision
kono
parents:
diff changeset
446 int sc,ty,dsp; } NMTBL;
110
fb502a0071f8 first binary run
kono
parents: 108
diff changeset
447 #else
fb502a0071f8 first binary run
kono
parents: 108
diff changeset
448 typedef struct nametable {
fb502a0071f8 first binary run
kono
parents: 108
diff changeset
449 char *nm;
fb502a0071f8 first binary run
kono
parents: 108
diff changeset
450 int sc; int ty; int dsp; } NMTBL;
fb502a0071f8 first binary run
kono
parents: 108
diff changeset
451 #endif
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
452
30
20ed2786a276 still macro
kono
parents: 29
diff changeset
453 EXTERN NMTBL mtable[MSYMS];
28
c6994794f084 functional macro (imcomplete)
kono
parents: 25
diff changeset
454 EXTERN NMTBL ntable[GSYMS+LSYMS];
c6994794f084 functional macro (imcomplete)
kono
parents: 25
diff changeset
455 EXTERN NMTBL *nptr,*gnptr;
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
456 EXTERN NMTBL *fnptr;
105
7e3d59e56a53 save register ( incomplete )
kono
parents: 104
diff changeset
457 EXTERN NMTBL null_nptr;
72
3b5d293cea36 type def etc
kono
parents: 70
diff changeset
458 EXTERN int typedefed,gtypedefed;
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
459
173
3b33c7daae95 *** empty log message ***
kono
parents: 168
diff changeset
460 EXTERN struct {int fd,ln;char *name0;int inc;FILE *fcb;} *filep,filestack[FILES];
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
461 EXTERN char cheap[CHEAPSIZE];
34
0756caa79167 macro function recursive and copy method
kono
parents: 33
diff changeset
462 EXTERN char *macropp,macro_buf[MACROSIZE];
0
d35df41eac69 Initial revision
kono
parents:
diff changeset
463
173
3b33c7daae95 *** empty log message ***
kono
parents: 168
diff changeset
464 extern void macro_define(char *n);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
465 extern void error(int n);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
466 extern int size(int t);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
467 extern int scalar(int t);
195
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
468 #if FLOAT_CODE
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
469 EXTERN double dsymval;
81
f94ca1168520 float first try...
kono
parents: 78
diff changeset
470 extern int dlist2(int e1, double e2);
195
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
471 #endif
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
472 #if LONGLONG_CODE
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
473 EXTERN long long lsymval;
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
474 extern int llist2(int e1, long long e2);
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
475 #endif
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
476 extern int list2(int e1, int e2);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
477 extern int list3(int e1, int e2, int e3);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
478 extern int list4(int e1, int e2, int e3,int e4);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
479 extern int reverse0(int t1);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
480 extern int assign_data(int e, int t, NMTBL *n,int offset);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
481 extern int assign_expr0(int e1,int e2,int t,int type) ;
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
482 extern int assign_expr(int e1,int e2,int t,int type) ;
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
483 extern int append4(int p,int a1,int a2,int a3);
309
a86612cf1a19 struct partial initialization (local struct copy)
kono
parents: 308
diff changeset
484 extern int insert_ascend(int p,int e,int eq());
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
485
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
486
33
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
487 #define car(e) (heap[(int)(e)])
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
488
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
489 #define cadr(e) (heap[((int)(e))+1])
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
490
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
491 #define caddr(e) (heap[((int)(e))+2])
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
492
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
493 #define cadddr(e) (heap[((int)(e))+3])
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
494
195
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
495 #if FLOAT_CODE
81
f94ca1168520 float first try...
kono
parents: 78
diff changeset
496 #define dcadr(e) (*(double*)&heap[((int)(e))+1])
f94ca1168520 float first try...
kono
parents: 78
diff changeset
497 #define dcaddr(e) (*(double*)&heap[((int)(e))+2])
195
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
498 #endif
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
499
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
500 #if LONGLONG_CODE
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
501 #define lcadr(e) (*(long long*)&heap[((int)(e))+1])
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
502 #define lcaddr(e) (*(long long*)&heap[((int)(e))+2])
c193120ee2a6 *** empty log message ***
kono
parents: 194
diff changeset
503 #endif
81
f94ca1168520 float first try...
kono
parents: 78
diff changeset
504
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
505 #include "conv/conv.h"
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
506 /*
59
eeca07d1b1c2 *** empty log message ***
kono
parents: 42
diff changeset
507 #include "conv/c2cbc.h"
eeca07d1b1c2 *** empty log message ***
kono
parents: 42
diff changeset
508 #include "conv/cbc2c.h"
66
0b068058dd67 *** empty log message ***
kono
parents: 65
diff changeset
509 */
59
eeca07d1b1c2 *** empty log message ***
kono
parents: 42
diff changeset
510
62
129f4802b027 separation done
kono
parents: 61
diff changeset
511 extern Converter *conv;
59
eeca07d1b1c2 *** empty log message ***
kono
parents: 42
diff changeset
512
119
b815fcd57b9d input var ( incomplete )
kono
parents: 117
diff changeset
513 EXTERN void extern_define(char *s,int dsp,int type,int use);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
514 EXTERN void error(int n);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
515 EXTERN int append4(int p,int a1,int a2,int a3);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
516 EXTERN int assign_expr(int e1,int e2,int t,int type);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
517 EXTERN int assign_expr0(int e1,int e2,int t,int type);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
518 EXTERN int backdef(void);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
519 EXTERN int fwdlabel(void);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
520 EXTERN int glist2(int e1,int e2);
95
185d2cc6a3a9 *** empty log message ***
kono
parents: 94
diff changeset
521 EXTERN int glist3(int e1,int e2,int e3);
117
2d5a203cc3a6 lvar reuse
kono
parents: 115
diff changeset
522 EXTERN void free_glist2(int e1);
2d5a203cc3a6 lvar reuse
kono
parents: 115
diff changeset
523 EXTERN void free_glist3(int e1);
2d5a203cc3a6 lvar reuse
kono
parents: 115
diff changeset
524 EXTERN int integral(int t);
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
525 EXTERN int integral(int t);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
526 EXTERN int list2(int e1, int e2);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
527 EXTERN int list3(int e1, int e2, int e3);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
528 EXTERN int list4(int e1, int e2, int e3, int e4);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
529 EXTERN int reverse0(int t1);
188
4303255fc3cf minor fix
kono
parents: 183
diff changeset
530 /*
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
531 EXTERN int rplacad(int e, int n);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
532 EXTERN int rplacadd(int e, int n);
188
4303255fc3cf minor fix
kono
parents: 183
diff changeset
533 */
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
534 EXTERN int rvalue_t(int e,int type);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
535 EXTERN int scalar(int t);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
536 EXTERN void bexpr(int e1, char cond, int l1);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
537 EXTERN void def_label(int cslabel, int dlabel);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
538 EXTERN void display_ntable(NMTBL *n, char *s);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
539 EXTERN void exit(int l);
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
540 EXTERN void fwddef(int l);
94
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
541 EXTERN int new_lvar(int size);
1ad7045741a7 float dbinop fix
kono
parents: 91
diff changeset
542
117
2d5a203cc3a6 lvar reuse
kono
parents: 115
diff changeset
543 EXTERN void free_lvar(int lvar);
2d5a203cc3a6 lvar reuse
kono
parents: 115
diff changeset
544 EXTERN void init_free_lvar_list();
61
8ffb8ca3fe34 separation of architecture dependent part.
kono
parents: 59
diff changeset
545
33
8500dbb69dd9 bad macro processing. give up this method.
kono
parents: 32
diff changeset
546 /* end */