2 * Simulator of microcontrollers (inc.cc)
4 * Copyright (C) 1999,99 Drotos Daniel, Talker Bt.
6 * To contact author send email to drdani@mazsola.iit.uni-miskolc.hu
10 /* This file is part of microcontroller simulator: ucsim.
12 UCSIM is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 UCSIM is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 GNU General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with UCSIM; see the file COPYING. If not, write to the Free
24 Software Foundation, 59 Temple Place - Suite 330, Boston, MA
37 *____________________________________________________________________________
42 cl_51core::inst_inc_a(uchar code)
51 *____________________________________________________________________________
56 cl_51core::inst_inc_addr(uchar code)
58 class cl_memory_cell *cell= get_direct(fetch());
60 t_mem d= cell->read(HW_PORT);
67 * 0x06-0x07 1 12 INC @Ri
68 *____________________________________________________________________________
73 cl_51core::inst_inc_Sri(uchar code)
75 class cl_memory_cell *cell;
77 cell= iram->get_cell(get_reg(code & 0x01)->read());
84 * 0x08-0x0f 1 12 INC Rn
85 *____________________________________________________________________________
90 cl_51core::inst_inc_rn(uchar code)
92 class cl_memory_cell *reg= get_reg(code & 0x07);
101 *____________________________________________________________________________
106 cl_51core::inst_dec_a(uchar code)
116 *____________________________________________________________________________
121 cl_51core::inst_dec_addr(uchar code)
123 class cl_memory_cell *cell;
125 cell= get_direct(fetch());
126 t_mem d= cell->read(HW_PORT);
133 * 0x16-0x17 1 12 DEC @Ri
134 *____________________________________________________________________________
139 cl_51core::inst_dec_Sri(uchar code)
141 class cl_memory_cell *cell;
143 cell= iram->get_cell(get_reg(code & 0x01)->read());
150 * 0x18-0x1f 1 12 DEC Rn
151 *____________________________________________________________________________
156 cl_51core::inst_dec_rn(uchar code)
158 class cl_memory_cell *reg= get_reg(code & 0x07);
167 *____________________________________________________________________________
172 cl_51core::inst_inc_dptr(uchar code)
176 dptr= sfr->read(DPH)*256 + sfr->read(DPL) + 1;
177 sfr->write(DPH, (dptr >> 8) & 0xff);
178 sfr->write(DPL, dptr & 0xff);
184 /* End of s51.src/inc.cc */