1 /////////////////////////////////////////////////////////////////////////
2 // $Id: data_xfer8.cc,v 1.26 2007/01/12 22:47:20 sshwarts Exp $
3 /////////////////////////////////////////////////////////////////////////
5 // Copyright (C) 2001 MandrakeSoft S.A.
9 // 75002 Paris - France
10 // http://www.linux-mandrake.com/
11 // http://www.mandrakesoft.com/
13 // This library is free software; you can redistribute it and/or
14 // modify it under the terms of the GNU Lesser General Public
15 // License as published by the Free Software Foundation; either
16 // version 2 of the License, or (at your option) any later version.
18 // This library is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 // Lesser General Public License for more details.
23 // You should have received a copy of the GNU Lesser General Public
24 // License along with this library; if not, write to the Free Software
25 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #define NEED_CPU_REG_SHORTCUTS 1
31 #define LOG_THIS BX_CPU_THIS_PTR
34 void BX_CPU_C::MOV_RLIb(bxInstruction_c
*i
)
36 BX_READ_8BIT_REGx(i
->opcodeReg(),i
->extend8bitL()) = i
->Ib();
39 void BX_CPU_C::MOV_RHIb(bxInstruction_c
*i
)
41 BX_CPU_THIS_PTR gen_reg
[i
->b1() & 0x03].word
.byte
.rh
= i
->Ib();
44 void BX_CPU_C::MOV_EEbGb(bxInstruction_c
*i
)
46 write_virtual_byte(i
->seg(), RMAddr(i
), &BX_READ_8BIT_REGx(i
->nnn(),i
->extend8bitL()));
49 void BX_CPU_C::MOV_EGbGb(bxInstruction_c
*i
)
51 Bit8u op2
= BX_READ_8BIT_REGx(i
->nnn(),i
->extend8bitL());
52 BX_WRITE_8BIT_REGx(i
->rm(), i
->extend8bitL(), op2
);
55 void BX_CPU_C::MOV_GbEEb(bxInstruction_c
*i
)
57 read_virtual_byte(i
->seg(), RMAddr(i
), &BX_READ_8BIT_REGx(i
->nnn(),i
->extend8bitL()));
60 void BX_CPU_C::MOV_GbEGb(bxInstruction_c
*i
)
62 Bit8u op2
= BX_READ_8BIT_REGx(i
->rm(),i
->extend8bitL());
63 BX_WRITE_8BIT_REGx(i
->nnn(), i
->extend8bitL(), op2
);
66 void BX_CPU_C::MOV_ALOd(bxInstruction_c
*i
)
68 read_virtual_byte(i
->seg(), i
->Id(), &AL
);
71 void BX_CPU_C::MOV_OdAL(bxInstruction_c
*i
)
73 write_virtual_byte(i
->seg(), i
->Id(), &AL
);
76 void BX_CPU_C::MOV_EbIb(bxInstruction_c
*i
)
81 BX_WRITE_8BIT_REGx(i
->rm(), i
->extend8bitL(), op2
);
84 write_virtual_byte(i
->seg(), RMAddr(i
), &op2
);
88 void BX_CPU_C::XLAT(bxInstruction_c
*i
)
105 read_virtual_byte(i
->seg(), offset
, &AL
);
108 void BX_CPU_C::XCHG_EbGb(bxInstruction_c
*i
)
112 op2
= BX_READ_8BIT_REGx(i
->nnn(), i
->extend8bitL());
114 /* op1 is a register or memory reference */
116 op1
= BX_READ_8BIT_REGx(i
->rm(), i
->extend8bitL());
117 BX_WRITE_8BIT_REGx(i
->rm(), i
->extend8bitL(), op2
);
120 /* pointer, segment address pair */
121 read_RMW_virtual_byte(i
->seg(), RMAddr(i
), &op1
);
122 write_RMW_virtual_byte(op2
);
125 BX_WRITE_8BIT_REGx(i
->nnn(), i
->extend8bitL(), op1
);