2 * Simulator of microcontrollers (bit.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
38 *____________________________________________________________________________
43 t_uc51::inst_orl_c_bit(uchar code)
50 mem= bit2mem(bitaddr= fetch(), &a, &m);
51 SFR_SET_C(SFR_GET_C ||
60 *____________________________________________________________________________
65 t_uc51::inst_anl_c_bit(uchar code)
71 mem= bit2mem(fetch(), &a, &m);
72 SFR_SET_C(SFR_GET_C &&
81 *____________________________________________________________________________
86 t_uc51::inst_mov_bit_c(uchar code)
92 mem= bit2mem(fetch(), &a, &m);
93 d= mem->read(a, HW_PORT);
104 * 0xa2 2 12 MOV C,bit
105 *____________________________________________________________________________
110 t_uc51::inst_mov_c_bit(uchar code)
116 mem= bit2mem(fetch(), &a, &m);
117 SFR_SET_C(mem->read(a) & m);
123 * 0xb0 2 24 ANL C,/bit
124 *____________________________________________________________________________
129 t_uc51::inst_anl_c_Sbit(uchar code)
135 mem= bit2mem(fetch(), &a, &m);
136 SFR_SET_C(SFR_GET_C &&
137 !(mem->read(a) & m));
145 *____________________________________________________________________________
150 t_uc51::inst_cpl_bit(uchar code)
156 mem= bit2mem(fetch(), &a, &m);
157 d= mem->read(a, HW_PORT);
165 *____________________________________________________________________________
170 t_uc51::inst_cpl_c(uchar code)
172 psw->write(psw->read() ^ bmCY);
179 *____________________________________________________________________________
184 t_uc51::inst_clr_bit(uchar code)
190 mem= bit2mem(fetch(), &a, &m);
191 t_mem d= mem->read(a, HW_PORT);
199 *____________________________________________________________________________
204 t_uc51::inst_clr_c(uchar code)
206 psw->write(psw->read() & ~bmCY);
213 *____________________________________________________________________________
218 t_uc51::inst_setb_bit(uchar code)
224 mem= bit2mem(fetch(), &a, &m);
225 d= mem->read(a, HW_PORT);
233 *____________________________________________________________________________
238 t_uc51::inst_setb_c(uchar code)
240 psw->write(psw->read() | bmCY);
245 /* End of s51.src/bit.cc */