mirror of https://github.com/PCSX2/pcsx2.git
eh looks like rama had more recent versions of these files too. so i'm reverting them. hopefully i didn't miss anymore files :(
git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@8 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
parent
dabe75ff69
commit
e848a8a485
|
@ -72,16 +72,16 @@ void WriteRmOffset(x86IntRegType to, int offset)
|
|||
if( (to&7) == ESP ) {
|
||||
if( offset == 0 ) {
|
||||
ModRM( 0, 0, 4 );
|
||||
ModRM( 0, ESP, 4 );
|
||||
SibSB( 0, ESP, 4 );
|
||||
}
|
||||
else if( offset < 128 && offset >= -128 ) {
|
||||
ModRM( 1, 0, 4 );
|
||||
ModRM( 0, ESP, 4 );
|
||||
SibSB( 0, ESP, 4 );
|
||||
write8(offset);
|
||||
}
|
||||
else {
|
||||
ModRM( 2, 0, 4 );
|
||||
ModRM( 0, ESP, 4 );
|
||||
SibSB( 0, ESP, 4 );
|
||||
write32(offset);
|
||||
}
|
||||
}
|
||||
|
@ -1117,6 +1117,14 @@ void ADD64RtoR( x86IntRegType to, x86IntRegType from )
|
|||
void ADD32ItoR( x86IntRegType to, u32 from )
|
||||
{
|
||||
RexB(0, to);
|
||||
if(from < 0x80)
|
||||
{
|
||||
write8( 0x83 );
|
||||
ModRM( 3, 0, to );
|
||||
write8( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( to == EAX) {
|
||||
write8( 0x05 );
|
||||
}
|
||||
|
@ -1126,24 +1134,40 @@ void ADD32ItoR( x86IntRegType to, u32 from )
|
|||
}
|
||||
write32( from );
|
||||
}
|
||||
}
|
||||
|
||||
/* add imm32 to m32 */
|
||||
void ADD32ItoM( uptr to, u32 from )
|
||||
{
|
||||
if(from < 0x80)
|
||||
{
|
||||
write8( 0x83 );
|
||||
ModRM( 0, 0, DISP32 );
|
||||
write32( MEMADDR(to, 8) );
|
||||
write8( from );
|
||||
} else {
|
||||
write8( 0x81 );
|
||||
ModRM( 0, 0, DISP32 );
|
||||
write32( MEMADDR(to, 8) );
|
||||
write32( from );
|
||||
}
|
||||
}
|
||||
|
||||
// add imm32 to [r32+off]
|
||||
void ADD32ItoRmOffset( x86IntRegType to, u32 from, int offset)
|
||||
{
|
||||
RexB(0,to);
|
||||
if(from < 0x80)
|
||||
{
|
||||
write8( 0x83 );
|
||||
WriteRmOffset(to,offset);
|
||||
write8(from);
|
||||
} else {
|
||||
write8( 0x81 );
|
||||
WriteRmOffset(to,offset);
|
||||
write32(from);
|
||||
}
|
||||
}
|
||||
|
||||
/* add r32 to r32 */
|
||||
void ADD32RtoR( x86IntRegType to, x86IntRegType from )
|
||||
|
@ -1183,29 +1207,47 @@ void ADD16RtoR( x86IntRegType to , x86IntRegType from )
|
|||
/* add imm16 to r16 */
|
||||
void ADD16ItoR( x86IntRegType to, u16 from )
|
||||
{
|
||||
write8( 0x66 );
|
||||
RexB(0,to);
|
||||
|
||||
write8( 0x66 );
|
||||
if ( to == EAX)
|
||||
{
|
||||
write8( 0x05 );
|
||||
write16( from );
|
||||
}
|
||||
else if(from < 0x80)
|
||||
{
|
||||
write8( 0x83 );
|
||||
ModRM( 3, 0, to );
|
||||
write8( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
write8( 0x81 );
|
||||
ModRM( 3, 0, to );
|
||||
}
|
||||
write16( from );
|
||||
}
|
||||
}
|
||||
|
||||
/* add imm16 to m16 */
|
||||
void ADD16ItoM( uptr to, u16 from )
|
||||
{
|
||||
write8( 0x66 );
|
||||
if(from < 0x80)
|
||||
{
|
||||
write8( 0x83 );
|
||||
ModRM( 0, 0, DISP32 );
|
||||
write32( MEMADDR(to, 6) );
|
||||
write8( from );
|
||||
}
|
||||
else
|
||||
{
|
||||
write8( 0x81 );
|
||||
ModRM( 0, 0, DISP32 );
|
||||
write32( MEMADDR(to, 6) );
|
||||
write16( from );
|
||||
}
|
||||
}
|
||||
|
||||
/* add r16 to m16 */
|
||||
void ADD16RtoM(uptr to, x86IntRegType from )
|
||||
|
@ -2286,6 +2328,12 @@ void AND64I32toM( uptr to, u32 from )
|
|||
void AND32ItoR( x86IntRegType to, u32 from )
|
||||
{
|
||||
RexB(0,to);
|
||||
if(from < 0x80)
|
||||
{
|
||||
AND32I8toR(to, (u8)from);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( to == EAX ) {
|
||||
write8( 0x25 );
|
||||
} else {
|
||||
|
@ -2294,6 +2342,7 @@ void AND32ItoR( x86IntRegType to, u32 from )
|
|||
}
|
||||
write32( from );
|
||||
}
|
||||
}
|
||||
|
||||
/* and sign ext imm8 to r32 */
|
||||
void AND32I8toR( x86IntRegType to, u8 from )
|
||||
|
@ -2306,12 +2355,19 @@ void AND32I8toR( x86IntRegType to, u8 from )
|
|||
|
||||
/* and imm32 to m32 */
|
||||
void AND32ItoM( uptr to, u32 from )
|
||||
{
|
||||
if(from < 0x80)
|
||||
{
|
||||
AND32I8toM(to, (u8)from);
|
||||
}
|
||||
else
|
||||
{
|
||||
write8( 0x81 );
|
||||
ModRM( 0, 0x4, DISP32 );
|
||||
write32( MEMADDR(to, 8) );
|
||||
write32( from );
|
||||
}
|
||||
}
|
||||
|
||||
/* and sign ext imm8 to m32 */
|
||||
void AND32I8toM( uptr to, u8 from )
|
||||
|
@ -2360,25 +2416,39 @@ void AND16RtoR( x86IntRegType to, x86IntRegType from )
|
|||
/* and imm16 to r16 */
|
||||
void AND16ItoR( x86IntRegType to, u16 from )
|
||||
{
|
||||
write8(0x66);
|
||||
RexB(0,to);
|
||||
|
||||
write8(0x66);
|
||||
if ( to == EAX ) {
|
||||
write8( 0x25 );
|
||||
write16( from );
|
||||
} else if ( from < 0x80 ) {
|
||||
write8( 0x83 );
|
||||
ModRM( 3, 0x4, to );
|
||||
write8( from );
|
||||
} else {
|
||||
write8( 0x81 );
|
||||
ModRM( 3, 0x4, to );
|
||||
}
|
||||
write16( from );
|
||||
}
|
||||
}
|
||||
|
||||
/* and imm16 to m16 */
|
||||
void AND16ItoM( uptr to, u16 from )
|
||||
{
|
||||
write16( 0x8166 );
|
||||
write8(0x66);
|
||||
if ( from < 0x80 ) {
|
||||
write8( 0x83 );
|
||||
ModRM( 0, 0x4, DISP32 );
|
||||
write32( MEMADDR(to, 6) );
|
||||
write8( from );
|
||||
} else {
|
||||
write8( 0x81 );
|
||||
ModRM( 0, 0x4, DISP32 );
|
||||
write32( MEMADDR(to, 6) );
|
||||
write16( from );
|
||||
}
|
||||
}
|
||||
|
||||
/* and r16 to m16 */
|
||||
void AND16RtoM( uptr to, x86IntRegType from )
|
||||
|
|
Loading…
Reference in New Issue