OpenCores
URL https://opencores.org/ocsvn/ao486/ao486/trunk

Subversion Repositories ao486

[/] [ao486/] [trunk/] [bochs486/] [cpu/] [logical8.cc] - Blame information for rev 7

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 alfik
/////////////////////////////////////////////////////////////////////////
2
// $Id: logical8.cc 11313 2012-08-05 13:52:40Z sshwarts $
3
/////////////////////////////////////////////////////////////////////////
4
//
5
//  Copyright (C) 2001-2012  The Bochs Project
6
//
7
//  This library is free software; you can redistribute it and/or
8
//  modify it under the terms of the GNU Lesser General Public
9
//  License as published by the Free Software Foundation; either
10
//  version 2 of the License, or (at your option) any later version.
11
//
12
//  This library is distributed in the hope that it will be useful,
13
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
//  Lesser General Public License for more details.
16
//
17
//  You should have received a copy of the GNU Lesser General Public
18
//  License along with this library; if not, write to the Free Software
19
//  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA B 02110-1301 USA
20
/////////////////////////////////////////////////////////////////////////
21
 
22
#define NEED_CPU_REG_SHORTCUTS 1
23
#include "bochs.h"
24
#include "cpu.h"
25
#define LOG_THIS BX_CPU_THIS_PTR
26
 
27
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::XOR_EbGbM(bxInstruction_c *i)
28
{
29
  Bit8u op1, op2;
30
 
31
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
32
 
33
  op1 = read_RMW_virtual_byte(i->seg(), eaddr);
34
  op2 = BX_READ_8BIT_REGx(i->src(), i->extend8bitL());
35
  op1 ^= op2;
36
  write_RMW_virtual_byte(op1);
37
 
38
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
39
 
40
  BX_NEXT_INSTR(i);
41
}
42
 
43
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::XOR_GbEbR(bxInstruction_c *i)
44
{
45
  Bit8u op1, op2;
46
 
47
  op1 = BX_READ_8BIT_REGx(i->dst(), i->extend8bitL());
48
  op2 = BX_READ_8BIT_REGx(i->src(), i->extend8bitL());
49
  op1 ^= op2;
50
  BX_WRITE_8BIT_REGx(i->dst(), i->extend8bitL(), op1);
51
 
52
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
53
 
54
  BX_NEXT_INSTR(i);
55
}
56
 
57
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::XOR_GbEbM(bxInstruction_c *i)
58
{
59
  Bit8u op1, op2;
60
 
61
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
62
 
63
  op1 = BX_READ_8BIT_REGx(i->dst(), i->extend8bitL());
64
  op2 = read_virtual_byte(i->seg(), eaddr);
65
  op1 ^= op2;
66
  BX_WRITE_8BIT_REGx(i->dst(), i->extend8bitL(), op1);
67
 
68
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
69
 
70
  BX_NEXT_INSTR(i);
71
}
72
 
73
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::XOR_EbIbM(bxInstruction_c *i)
74
{
75
  Bit8u op1, op2 = i->Ib();
76
 
77
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
78
 
79
  op1 = read_RMW_virtual_byte(i->seg(), eaddr);
80
  op1 ^= op2;
81
  write_RMW_virtual_byte(op1);
82
 
83
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
84
 
85
  BX_NEXT_INSTR(i);
86
}
87
 
88
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::XOR_EbIbR(bxInstruction_c *i)
89
{
90
  Bit8u op1, op2 = i->Ib();
91
 
92
  op1 = BX_READ_8BIT_REGx(i->dst(), i->extend8bitL());
93
  op1 ^= op2;
94
  BX_WRITE_8BIT_REGx(i->dst(), i->extend8bitL(), op1);
95
 
96
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
97
 
98
  BX_NEXT_INSTR(i);
99
}
100
 
101
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::OR_EbIbM(bxInstruction_c *i)
102
{
103
  Bit8u op1, op2 = i->Ib();
104
 
105
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
106
 
107
  op1 = read_RMW_virtual_byte(i->seg(), eaddr);
108
  op1 |= op2;
109
  write_RMW_virtual_byte(op1);
110
 
111
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
112
 
113
  BX_NEXT_INSTR(i);
114
}
115
 
116
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::OR_EbIbR(bxInstruction_c *i)
117
{
118
  Bit8u op1, op2 = i->Ib();
119
 
120
  op1 = BX_READ_8BIT_REGx(i->dst(), i->extend8bitL());
121
  op1 |= op2;
122
  BX_WRITE_8BIT_REGx(i->dst(), i->extend8bitL(), op1);
123
 
124
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
125
 
126
  BX_NEXT_INSTR(i);
127
}
128
 
129
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::NOT_EbM(bxInstruction_c *i)
130
{
131
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
132
 
133
  Bit8u op1_8 = read_RMW_virtual_byte(i->seg(), eaddr);
134
  op1_8 = ~op1_8;
135
  write_RMW_virtual_byte(op1_8);
136
 
137
  BX_NEXT_INSTR(i);
138
}
139
 
140
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::NOT_EbR(bxInstruction_c *i)
141
{
142
  Bit8u op1_8 = BX_READ_8BIT_REGx(i->dst(), i->extend8bitL());
143
  op1_8 = ~op1_8;
144
  BX_WRITE_8BIT_REGx(i->dst(), i->extend8bitL(), op1_8);
145
 
146
  BX_NEXT_INSTR(i);
147
}
148
 
149
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::OR_EbGbM(bxInstruction_c *i)
150
{
151
  Bit8u op1, op2;
152
 
153
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
154
 
155
  op1 = read_RMW_virtual_byte(i->seg(), eaddr);
156
  op2 = BX_READ_8BIT_REGx(i->src(), i->extend8bitL());
157
  op1 |= op2;
158
  write_RMW_virtual_byte(op1);
159
 
160
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
161
 
162
  BX_NEXT_INSTR(i);
163
}
164
 
165
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::OR_GbEbR(bxInstruction_c *i)
166
{
167
  Bit8u op1, op2;
168
 
169
  op1 = BX_READ_8BIT_REGx(i->dst(), i->extend8bitL());
170
  op2 = BX_READ_8BIT_REGx(i->src(), i->extend8bitL());
171
  op1 |= op2;
172
  BX_WRITE_8BIT_REGx(i->dst(), i->extend8bitL(), op1);
173
 
174
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
175
 
176
  BX_NEXT_INSTR(i);
177
}
178
 
179
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::OR_GbEbM(bxInstruction_c *i)
180
{
181
  Bit8u op1, op2;
182
 
183
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
184
 
185
  op1 = BX_READ_8BIT_REGx(i->dst(), i->extend8bitL());
186
  op2 = read_virtual_byte(i->seg(), eaddr);
187
  op1 |= op2;
188
  BX_WRITE_8BIT_REGx(i->dst(), i->extend8bitL(), op1);
189
 
190
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
191
 
192
  BX_NEXT_INSTR(i);
193
}
194
 
195
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::AND_EbGbM(bxInstruction_c *i)
196
{
197
  Bit8u op1, op2;
198
 
199
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
200
 
201
  op1 = read_RMW_virtual_byte(i->seg(), eaddr);
202
  op2 = BX_READ_8BIT_REGx(i->src(), i->extend8bitL());
203
  op1 &= op2;
204
  write_RMW_virtual_byte(op1);
205
 
206
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
207
 
208
  BX_NEXT_INSTR(i);
209
}
210
 
211
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::AND_GbEbR(bxInstruction_c *i)
212
{
213
  Bit8u op1, op2;
214
 
215
  op1 = BX_READ_8BIT_REGx(i->dst(), i->extend8bitL());
216
  op2 = BX_READ_8BIT_REGx(i->src(), i->extend8bitL());
217
  op1 &= op2;
218
  BX_WRITE_8BIT_REGx(i->dst(), i->extend8bitL(), op1);
219
 
220
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
221
 
222
  BX_NEXT_INSTR(i);
223
}
224
 
225
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::AND_GbEbM(bxInstruction_c *i)
226
{
227
  Bit8u op1, op2;
228
 
229
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
230
 
231
  op1 = BX_READ_8BIT_REGx(i->dst(), i->extend8bitL());
232
  op2 = read_virtual_byte(i->seg(), eaddr);
233
  op1 &= op2;
234
  BX_WRITE_8BIT_REGx(i->dst(), i->extend8bitL(), op1);
235
 
236
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
237
 
238
  BX_NEXT_INSTR(i);
239
}
240
 
241
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::AND_EbIbM(bxInstruction_c *i)
242
{
243
  Bit8u op1, op2 = i->Ib();
244
 
245
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
246
 
247
  op1 = read_RMW_virtual_byte(i->seg(), eaddr);
248
  op1 &= op2;
249
  write_RMW_virtual_byte(op1);
250
 
251
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
252
 
253
  BX_NEXT_INSTR(i);
254
}
255
 
256
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::AND_EbIbR(bxInstruction_c *i)
257
{
258
  Bit8u op1, op2 = i->Ib();
259
 
260
  op1 = BX_READ_8BIT_REGx(i->dst(), i->extend8bitL());
261
  op1 &= op2;
262
  BX_WRITE_8BIT_REGx(i->dst(), i->extend8bitL(), op1);
263
 
264
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
265
 
266
  BX_NEXT_INSTR(i);
267
}
268
 
269
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::TEST_EbGbR(bxInstruction_c *i)
270
{
271
  Bit8u op1, op2;
272
 
273
  op1 = BX_READ_8BIT_REGx(i->dst(), i->extend8bitL());
274
  op2 = BX_READ_8BIT_REGx(i->src(), i->extend8bitL());
275
  op1 &= op2;
276
 
277
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
278
 
279
  BX_NEXT_INSTR(i);
280
}
281
 
282
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::TEST_EbGbM(bxInstruction_c *i)
283
{
284
  Bit8u op1, op2;
285
 
286
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
287
 
288
  op1 = read_virtual_byte(i->seg(), eaddr);
289
  op2 = BX_READ_8BIT_REGx(i->src(), i->extend8bitL());
290
  op1 &= op2;
291
 
292
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
293
 
294
  BX_NEXT_INSTR(i);
295
}
296
 
297
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::TEST_EbIbR(bxInstruction_c *i)
298
{
299
  Bit8u op1 = BX_READ_8BIT_REGx(i->dst(), i->extend8bitL());
300
  op1 &= i->Ib();
301
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
302
 
303
  BX_NEXT_INSTR(i);
304
}
305
 
306
BX_INSF_TYPE BX_CPP_AttrRegparmN(1) BX_CPU_C::TEST_EbIbM(bxInstruction_c *i)
307
{
308
  bx_address eaddr = BX_CPU_CALL_METHODR(i->ResolveModrm, (i));
309
 
310
  Bit8u op1 = read_virtual_byte(i->seg(), eaddr);
311
  op1 &= i->Ib();
312
  SET_FLAGS_OSZAPC_LOGIC_8(op1);
313
 
314
  BX_NEXT_INSTR(i);
315
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.