- added some jit stuff for cs:s dm

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401015
This commit is contained in:
David Anderson 2007-06-24 04:15:18 +00:00
parent 493ee21c6d
commit aa5f3c1cf2
2 changed files with 15 additions and 0 deletions

View File

@ -62,6 +62,14 @@ public:
}
outptr++;
}
inline void write_ushort(unsigned short c)
{
if (outbase)
{
*(unsigned short *)outptr = c;
}
outptr += sizeof(unsigned short);
}
inline void write_byte(jit_int8_t c)
{
if (outbase)

View File

@ -107,6 +107,7 @@
#define IA32_JCC_IMM32_1 0x0F // opcode part 1
#define IA32_JCC_IMM32_2 0x80 // encoding is +cc <imm32>
#define IA32_RET 0xC3 // no extra encoding
#define IA32_RETN 0xC2 // encoding is <imm16>
#define IA32_NEG_RM 0xF7 // encoding is /3
#define IA32_INC_REG 0x40 // encoding is +r
#define IA32_INC_RM 0xFF // encoding is /0
@ -1349,6 +1350,12 @@ inline void IA32_Return(JitWriter *jit)
jit->write_ubyte(IA32_RET);
}
inline void IA32_Return_Popstack(JitWriter *jit, unsigned short bytes)
{
jit->write_ubyte(IA32_RETN);
jit->write_ushort(bytes);
}
inline void IA32_Test_Rm_Reg(JitWriter *jit, jit_uint8_t reg1, jit_uint8_t reg2, jit_uint8_t mode)
{
jit->write_ubyte(IA32_TEST_RM_REG);