984871bb61a2045085c202453fe2e03577daac2e
[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 #define FUNC1 add1
70 #define FUNC2 add2
71 #include "inst_gen.cc"
72
73   return(resGO);
74 }
75
76 int
77 cl_xa::inst_ADDC(uint code)
78 {
79   int operands = code >> 16;  // kludgy, param info
80
81 #define FUNC1 addc1
82 #define FUNC2 addc2
83 #include "inst_gen.cc"
84
85   return(resGO);
86 }
87
88 int
89 cl_xa::inst_SUB(uint code)
90 {
91   return(resGO);
92 }
93
94 int
95 cl_xa::inst_SUBB(uint code)
96 {
97   return(resGO);
98 }
99
100 int
101 cl_xa::inst_CMP(uint code)
102 {
103   return(resGO);
104 }
105 int
106 cl_xa::inst_AND(uint code)
107 {
108   return(resGO);
109 }
110 int
111 cl_xa::inst_OR(uint code)
112 {
113   return(resGO);
114 }
115 int
116 cl_xa::inst_XOR(uint code)
117 {
118   return(resGO);
119 }
120 int
121 cl_xa::inst_ADDS(uint code)
122 {
123   return(resGO);
124 }
125 int
126 cl_xa::inst_NEG(uint code)
127 {
128   return(resGO);
129 }
130 int
131 cl_xa::inst_SEXT(uint code)
132 {
133   return(resGO);
134 }
135 int
136 cl_xa::inst_MUL(uint code)
137 {
138   return(resGO);
139 }
140 int
141 cl_xa::inst_DIV(uint code)
142 {
143   return(resGO);
144 }
145 int
146 cl_xa::inst_DA(uint code)
147 {
148   return(resGO);
149 }
150 int
151 cl_xa::inst_ASL(uint code)
152 {
153   return(resGO);
154 }
155 int
156 cl_xa::inst_ASR(uint code)
157 {
158   return(resGO);
159 }
160 int
161 cl_xa::inst_LEA(uint code)
162 {
163   return(resGO);
164 }
165 int
166 cl_xa::inst_CPL(uint code)
167 {
168   return(resGO);
169 }
170 int
171 cl_xa::inst_LSR(uint code)
172 {
173   return(resGO);
174 }
175 int
176 cl_xa::inst_NORM(uint code)
177 {
178   return(resGO);
179 }
180 int
181 cl_xa::inst_RL(uint code)
182 {
183   return(resGO);
184 }
185 int
186 cl_xa::inst_RLC(uint code)
187 {
188   return(resGO);
189 }
190 int
191 cl_xa::inst_RR(uint code)
192 {
193   return(resGO);
194 }
195 int
196 cl_xa::inst_RRC(uint code)
197 {
198   return(resGO);
199 }
200 int
201 cl_xa::inst_MOVS(uint code)
202 {
203   return(resGO);
204 }
205 int
206 cl_xa::inst_MOVC(uint code)
207 {
208   return(resGO);
209 }
210 int
211 cl_xa::inst_MOVX(uint code)
212 {
213   return(resGO);
214 }
215 int
216 cl_xa::inst_PUSH(uint code)
217 {
218   return(resGO);
219 }
220 int
221 cl_xa::inst_POP(uint code)
222 {
223   return(resGO);
224 }
225 int
226 cl_xa::inst_XCH(uint code)
227 {
228   return(resGO);
229 }
230 int
231 cl_xa::inst_SETB(uint code)
232 {
233   return(resGO);
234 }
235 int
236 cl_xa::inst_CLR(uint code)
237 {
238   return(resGO);
239 }
240 int
241 cl_xa::inst_MOV(uint code)
242 {
243   return(resGO);
244 }
245 int
246 cl_xa::inst_ANL(uint code)
247 {
248   return(resGO);
249 }
250 int
251 cl_xa::inst_ORL(uint code)
252 {
253   return(resGO);
254 }
255 int
256 cl_xa::inst_BR(uint code)
257 {
258   return(resGO);
259 }
260 int
261 cl_xa::inst_JMP(uint code)
262 {
263   return(resGO);
264 }
265 int
266 cl_xa::inst_CALL(uint code)
267 {
268   return(resGO);
269 }
270 int
271 cl_xa::inst_RET(uint code)
272 {
273   return(resGO);
274 }
275 int
276 cl_xa::inst_Bcc(uint code)
277 {
278   return(resGO);
279 }
280 int
281 cl_xa::inst_JB(uint code)
282 {
283   return(resGO);
284 }
285 int
286 cl_xa::inst_JNB(uint code)
287 {
288   return(resGO);
289 }
290 int
291 cl_xa::inst_CJNE(uint code)
292 {
293   return(resGO);
294 }
295 int
296 cl_xa::inst_DJNZ(uint code)
297 {
298   return(resGO);
299 }
300 int
301 cl_xa::inst_JZ(uint code)
302 {
303   return(resGO);
304 }
305 int
306 cl_xa::inst_JNZ(uint code)
307 {
308   return(resGO);
309 }
310 int
311 cl_xa::inst_BKPT(uint code)
312 {
313   return(resGO);
314 }
315 int
316 cl_xa::inst_TRAP(uint code)
317 {
318   return(resGO);
319 }
320 int
321 cl_xa::inst_RESET(uint code)
322 {
323   return(resGO);
324 }
325
326
327 /* End of xa.src/inst.cc */