*** empty log message ***
[fw/sdcc] / sim / ucsim / xa.src / inst.cc
1 /*
2  * Simulator of microcontrollers (inst.cc)
3  *
4  * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
5  *
6  * Written by Karl Bongers karl@turbobit.com
7  * 
8  * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
9  *
10  */
11
12 /* This file is part of microcontroller simulator: ucsim.
13
14 UCSIM is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
18
19 UCSIM is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 GNU General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with UCSIM; see the file COPYING.  If not, write to the Free
26 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
27 02111-1307, USA. */
28 /*@1@*/
29
30 #include "ddconfig.h"
31
32 // local
33 #include "glob.h"
34 #include "xacl.h"
35 #include "regsxa.h"
36
37 int
38 cl_xa::get_reg(int word_flag, unsigned int index)
39 {
40   if (index < 3) { /* banked */
41     if (word_flag)
42       return get_word_direct(0x400+index);
43     else
44       return mem_direct[0x400+index];
45   } else { /* non-banked */
46     if (word_flag)
47       return get_word_direct(0x400+index);
48     else
49       return mem_direct[0x400+index];
50   }
51 }
52
53 int
54 cl_xa::inst_NOP(uint code)
55 {
56   return(resGO);
57 }
58
59 #define RI_F0 ((code >> 4) & 0xf)
60 #define RI_70 ((code >> 4) & 0x7)
61 #define RI_0F (code & 0xf)
62 #define RI_07 (code & 0x7)
63
64 int
65 cl_xa::inst_ADD(uint code)
66 {
67   int operands = code >> 16;  // kludgy, param info
68
69 #undef FUNC1
70 #define FUNC1 add1
71 #undef FUNC2
72 #define FUNC2 add2
73 #include "inst_gen.cc"
74
75   return(resGO);
76 }
77
78 int
79 cl_xa::inst_ADDC(uint code)
80 {
81   int operands = code >> 16;  // kludgy, param info
82
83 #undef FUNC1
84 #define FUNC1 addc1
85 #undef FUNC2
86 #define FUNC2 addc2
87 #include "inst_gen.cc"
88
89   return(resGO);
90 }
91
92 int
93 cl_xa::inst_SUB(uint code)
94 {
95   return(resGO);
96 }
97
98 int
99 cl_xa::inst_SUBB(uint code)
100 {
101   return(resGO);
102 }
103
104 int
105 cl_xa::inst_CMP(uint code)
106 {
107   return(resGO);
108 }
109 int
110 cl_xa::inst_AND(uint code)
111 {
112   return(resGO);
113 }
114 int
115 cl_xa::inst_OR(uint code)
116 {
117   return(resGO);
118 }
119 int
120 cl_xa::inst_XOR(uint code)
121 {
122   return(resGO);
123 }
124 int
125 cl_xa::inst_ADDS(uint code)
126 {
127   return(resGO);
128 }
129 int
130 cl_xa::inst_NEG(uint code)
131 {
132   return(resGO);
133 }
134 int
135 cl_xa::inst_SEXT(uint code)
136 {
137   return(resGO);
138 }
139 int
140 cl_xa::inst_MUL(uint code)
141 {
142   return(resGO);
143 }
144 int
145 cl_xa::inst_DIV(uint code)
146 {
147   return(resGO);
148 }
149 int
150 cl_xa::inst_DA(uint code)
151 {
152   return(resGO);
153 }
154 int
155 cl_xa::inst_ASL(uint code)
156 {
157   return(resGO);
158 }
159 int
160 cl_xa::inst_ASR(uint code)
161 {
162   return(resGO);
163 }
164 int
165 cl_xa::inst_LEA(uint code)
166 {
167   return(resGO);
168 }
169 int
170 cl_xa::inst_CPL(uint code)
171 {
172   return(resGO);
173 }
174 int
175 cl_xa::inst_LSR(uint code)
176 {
177   return(resGO);
178 }
179 int
180 cl_xa::inst_NORM(uint code)
181 {
182   return(resGO);
183 }
184 int
185 cl_xa::inst_RL(uint code)
186 {
187   return(resGO);
188 }
189 int
190 cl_xa::inst_RLC(uint code)
191 {
192   return(resGO);
193 }
194 int
195 cl_xa::inst_RR(uint code)
196 {
197   return(resGO);
198 }
199 int
200 cl_xa::inst_RRC(uint code)
201 {
202   return(resGO);
203 }
204 int
205 cl_xa::inst_MOVS(uint code)
206 {
207   return(resGO);
208 }
209 int
210 cl_xa::inst_MOVC(uint code)
211 {
212   return(resGO);
213 }
214 int
215 cl_xa::inst_MOVX(uint code)
216 {
217   return(resGO);
218 }
219 int
220 cl_xa::inst_PUSH(uint code)
221 {
222   return(resGO);
223 }
224 int
225 cl_xa::inst_POP(uint code)
226 {
227   return(resGO);
228 }
229 int
230 cl_xa::inst_XCH(uint code)
231 {
232   return(resGO);
233 }
234 int
235 cl_xa::inst_SETB(uint code)
236 {
237   return(resGO);
238 }
239 int
240 cl_xa::inst_CLR(uint code)
241 {
242   return(resGO);
243 }
244 int
245 cl_xa::inst_MOV(uint code)
246 {
247   return(resGO);
248 }
249 int
250 cl_xa::inst_ANL(uint code)
251 {
252   return(resGO);
253 }
254 int
255 cl_xa::inst_ORL(uint code)
256 {
257   return(resGO);
258 }
259 int
260 cl_xa::inst_BR(uint code)
261 {
262   return(resGO);
263 }
264 int
265 cl_xa::inst_JMP(uint code)
266 {
267   return(resGO);
268 }
269 int
270 cl_xa::inst_CALL(uint code)
271 {
272   return(resGO);
273 }
274 int
275 cl_xa::inst_RET(uint code)
276 {
277   return(resGO);
278 }
279 int
280 cl_xa::inst_Bcc(uint code)
281 {
282   return(resGO);
283 }
284 int
285 cl_xa::inst_JB(uint code)
286 {
287   return(resGO);
288 }
289 int
290 cl_xa::inst_JNB(uint code)
291 {
292   return(resGO);
293 }
294 int
295 cl_xa::inst_CJNE(uint code)
296 {
297   return(resGO);
298 }
299 int
300 cl_xa::inst_DJNZ(uint code)
301 {
302   return(resGO);
303 }
304 int
305 cl_xa::inst_JZ(uint code)
306 {
307   return(resGO);
308 }
309 int
310 cl_xa::inst_JNZ(uint code)
311 {
312   return(resGO);
313 }
314 int
315 cl_xa::inst_BKPT(uint code)
316 {
317   return(resGO);
318 }
319 int
320 cl_xa::inst_TRAP(uint code)
321 {
322   return(resGO);
323 }
324 int
325 cl_xa::inst_RESET(uint code)
326 {
327   return(resGO);
328 }
329
330
331 /* End of xa.src/inst.cc */