2 * Simulator of microcontrollers (inst.cc)
4 * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
6 * Written by Karl Bongers karl@turbobit.com
8 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
12 /* This file is part of microcontroller simulator: ucsim.
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.
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.
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
38 cl_xa::get_reg(int word_flag, unsigned int index)
40 if (index < 3) { /* banked */
42 return get_word_direct(0x400+index);
44 return mem_direct[0x400+index];
45 } else { /* non-banked */
47 return get_word_direct(0x400+index);
49 return mem_direct[0x400+index];
54 cl_xa::inst_NOP(uint code)
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)
65 cl_xa::inst_ADD(uint code)
67 int operands = code >> 16; // kludgy, param info
73 #include "inst_gen.cc"
79 cl_xa::inst_ADDC(uint code)
81 int operands = code >> 16; // kludgy, param info
87 #include "inst_gen.cc"
93 cl_xa::inst_SUB(uint code)
99 cl_xa::inst_SUBB(uint code)
105 cl_xa::inst_CMP(uint code)
110 cl_xa::inst_AND(uint code)
115 cl_xa::inst_OR(uint code)
120 cl_xa::inst_XOR(uint code)
125 cl_xa::inst_ADDS(uint code)
130 cl_xa::inst_NEG(uint code)
135 cl_xa::inst_SEXT(uint code)
140 cl_xa::inst_MUL(uint code)
145 cl_xa::inst_DIV(uint code)
150 cl_xa::inst_DA(uint code)
155 cl_xa::inst_ASL(uint code)
160 cl_xa::inst_ASR(uint code)
165 cl_xa::inst_LEA(uint code)
170 cl_xa::inst_CPL(uint code)
175 cl_xa::inst_LSR(uint code)
180 cl_xa::inst_NORM(uint code)
185 cl_xa::inst_RL(uint code)
190 cl_xa::inst_RLC(uint code)
195 cl_xa::inst_RR(uint code)
200 cl_xa::inst_RRC(uint code)
205 cl_xa::inst_MOVS(uint code)
210 cl_xa::inst_MOVC(uint code)
215 cl_xa::inst_MOVX(uint code)
220 cl_xa::inst_PUSH(uint code)
225 cl_xa::inst_POP(uint code)
230 cl_xa::inst_XCH(uint code)
235 cl_xa::inst_SETB(uint code)
240 cl_xa::inst_CLR(uint code)
245 cl_xa::inst_MOV(uint code)
250 cl_xa::inst_ANL(uint code)
255 cl_xa::inst_ORL(uint code)
260 cl_xa::inst_BR(uint code)
265 cl_xa::inst_JMP(uint code)
270 cl_xa::inst_CALL(uint code)
275 cl_xa::inst_RET(uint code)
280 cl_xa::inst_Bcc(uint code)
285 cl_xa::inst_JB(uint code)
290 cl_xa::inst_JNB(uint code)
295 cl_xa::inst_CJNE(uint code)
300 cl_xa::inst_DJNZ(uint code)
305 cl_xa::inst_JZ(uint code)
310 cl_xa::inst_JNZ(uint code)
315 cl_xa::inst_BKPT(uint code)
320 cl_xa::inst_TRAP(uint code)
325 cl_xa::inst_RESET(uint code)
331 /* End of xa.src/inst.cc */