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 t_uc51::inst_inc_a(uchar code)
44 sfr->set(event_at.ws= ACC, sfr->get(ACC)+1);
51 *____________________________________________________________________________
56 t_uc51::inst_inc_addr(uchar code)
60 addr= get_direct(fetch(), &event_at.wi, &event_at.ws);
68 * 0x06-0x07 1 12 INC @Ri
69 *____________________________________________________________________________
74 t_uc51::inst_inc_$ri(uchar code)
79 addr= get_indirect(event_at.wi= *(get_reg(code & 0x01)), &res);
87 * 0x08-0x0f 1 12 INC Rn
88 *____________________________________________________________________________
93 t_uc51::inst_inc_rn(uchar code)
95 (*(get_reg(code & 0x07, &event_at.wi)))++;
102 *____________________________________________________________________________
107 t_uc51::inst_dec_a(uchar code)
109 sfr->set(event_at.ws= ACC, sfr->get(ACC)-1);
116 *____________________________________________________________________________
121 t_uc51::inst_dec_addr(uchar code)
125 addr= get_direct(fetch(), &event_at.wi, &event_at.ws);
133 * 0x16-0x17 1 12 DEC @Ri
134 *____________________________________________________________________________
139 t_uc51::inst_dec_$ri(uchar code)
144 addr= get_indirect(event_at.wi= *(get_reg(code & 0x01)), &res);
152 * 0x18-0x1f 1 12 DEC Rn
153 *____________________________________________________________________________
158 t_uc51::inst_dec_rn(uchar code)
160 (*(get_reg(code & 0x07, &event_at.wi)))--;
167 *____________________________________________________________________________
172 t_uc51::inst_inc_dptr(uchar code)
176 dptr= sfr->get(DPH)*256 + sfr->get(DPL) + 1;
177 sfr->set(event_at.ws= DPH, (dptr >> 8) & 0xff);
178 sfr->set(DPL, dptr & 0xff);
184 /* End of s51.src/inc.cc */