mirror of
https://github.com/reactos/reactos.git
synced 2025-07-04 13:41:24 +00:00
[SOFT386]
Implement the opcodes for MOV reg16/32, imm16/32 svn path=/branches/ntvdm/; revision=59949
This commit is contained in:
parent
50e90be14b
commit
179627bf40
2 changed files with 69 additions and 8 deletions
|
@ -208,14 +208,14 @@ Soft386OpcodeHandlers[SOFT386_NUM_OPCODE_HANDLERS] =
|
||||||
NULL, // TODO: OPCODE 0xB5 NOT SUPPORTED
|
NULL, // TODO: OPCODE 0xB5 NOT SUPPORTED
|
||||||
NULL, // TODO: OPCODE 0xB6 NOT SUPPORTED
|
NULL, // TODO: OPCODE 0xB6 NOT SUPPORTED
|
||||||
NULL, // TODO: OPCODE 0xB7 NOT SUPPORTED
|
NULL, // TODO: OPCODE 0xB7 NOT SUPPORTED
|
||||||
NULL, // TODO: OPCODE 0xB8 NOT SUPPORTED
|
Soft386OpcodeMovRegImm,
|
||||||
NULL, // TODO: OPCODE 0xB9 NOT SUPPORTED
|
Soft386OpcodeMovRegImm,
|
||||||
NULL, // TODO: OPCODE 0xBA NOT SUPPORTED
|
Soft386OpcodeMovRegImm,
|
||||||
NULL, // TODO: OPCODE 0xBB NOT SUPPORTED
|
Soft386OpcodeMovRegImm,
|
||||||
NULL, // TODO: OPCODE 0xBC NOT SUPPORTED
|
Soft386OpcodeMovRegImm,
|
||||||
NULL, // TODO: OPCODE 0xBD NOT SUPPORTED
|
Soft386OpcodeMovRegImm,
|
||||||
NULL, // TODO: OPCODE 0xBE NOT SUPPORTED
|
Soft386OpcodeMovRegImm,
|
||||||
NULL, // TODO: OPCODE 0xBF NOT SUPPORTED
|
Soft386OpcodeMovRegImm,
|
||||||
NULL, // TODO: OPCODE 0xC0 NOT SUPPORTED
|
NULL, // TODO: OPCODE 0xC0 NOT SUPPORTED
|
||||||
NULL, // TODO: OPCODE 0xC1 NOT SUPPORTED
|
NULL, // TODO: OPCODE 0xC1 NOT SUPPORTED
|
||||||
NULL, // TODO: OPCODE 0xC2 NOT SUPPORTED
|
NULL, // TODO: OPCODE 0xC2 NOT SUPPORTED
|
||||||
|
@ -1168,3 +1168,56 @@ Soft386OpcodeShortJump(PSOFT386_STATE State, UCHAR Opcode)
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
FASTCALL
|
||||||
|
Soft386OpcodeMovRegImm(PSOFT386_STATE State, UCHAR Opcode)
|
||||||
|
{
|
||||||
|
BOOLEAN Size = State->SegmentRegs[SOFT386_REG_CS].Size;
|
||||||
|
|
||||||
|
/* Make sure this is the right instruction */
|
||||||
|
ASSERT((Opcode & 0xF8) == 0xB8);
|
||||||
|
|
||||||
|
if (State->PrefixFlags == SOFT386_PREFIX_OPSIZE)
|
||||||
|
{
|
||||||
|
/* The OPSIZE prefix toggles the size */
|
||||||
|
Size = !Size;
|
||||||
|
}
|
||||||
|
else if (State->PrefixFlags != 0)
|
||||||
|
{
|
||||||
|
/* Invalid prefix */
|
||||||
|
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Size)
|
||||||
|
{
|
||||||
|
ULONG Value;
|
||||||
|
|
||||||
|
/* Fetch the dword */
|
||||||
|
if (!Soft386FetchDword(State, &Value))
|
||||||
|
{
|
||||||
|
/* Exception occurred */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Store the value in the register */
|
||||||
|
State->GeneralRegs[Opcode & 0x07].Long = Value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
USHORT Value;
|
||||||
|
|
||||||
|
/* Fetch the word */
|
||||||
|
if (!Soft386FetchWord(State, &Value))
|
||||||
|
{
|
||||||
|
/* Exception occurred */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Store the value in the register */
|
||||||
|
State->GeneralRegs[Opcode & 0x07].LowWord = Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
|
@ -191,4 +191,12 @@ Soft386OpcodeShortJump
|
||||||
UCHAR Opcode
|
UCHAR Opcode
|
||||||
);
|
);
|
||||||
|
|
||||||
|
BOOLEAN
|
||||||
|
FASTCALL
|
||||||
|
Soft386OpcodeMovRegImm
|
||||||
|
(
|
||||||
|
PSOFT386_STATE State,
|
||||||
|
UCHAR Opcode
|
||||||
|
);
|
||||||
|
|
||||||
#endif // _OPCODES_H_
|
#endif // _OPCODES_H_
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue