[SOFT386]

Implement the short unconditional jump instruction (JMP imm8).


svn path=/branches/ntvdm/; revision=59932
This commit is contained in:
Aleksandar Andrejevic 2013-08-31 21:23:31 +00:00
parent c6c282fd70
commit 50e90be14b
2 changed files with 31 additions and 1 deletions

View file

@ -259,7 +259,7 @@ Soft386OpcodeHandlers[SOFT386_NUM_OPCODE_HANDLERS] =
NULL, // TODO: OPCODE 0xE8 NOT SUPPORTED NULL, // TODO: OPCODE 0xE8 NOT SUPPORTED
NULL, // TODO: OPCODE 0xE9 NOT SUPPORTED NULL, // TODO: OPCODE 0xE9 NOT SUPPORTED
NULL, // TODO: OPCODE 0xEA NOT SUPPORTED NULL, // TODO: OPCODE 0xEA NOT SUPPORTED
NULL, // TODO: OPCODE 0xEB NOT SUPPORTED Soft386OpcodeShortJump,
Soft386OpcodeInByte, Soft386OpcodeInByte,
Soft386OpcodeIn, Soft386OpcodeIn,
Soft386OpcodeOutByte, Soft386OpcodeOutByte,
@ -1146,3 +1146,25 @@ Soft386OpcodeOut(PSOFT386_STATE State, UCHAR Opcode)
return TRUE; return TRUE;
} }
BOOLEAN
FASTCALL
Soft386OpcodeShortJump(PSOFT386_STATE State, UCHAR Opcode)
{
CHAR Offset = 0;
/* Make sure this is the right instruction */
ASSERT(Opcode == 0xEB);
/* Fetch the offset */
if (!Soft386FetchByte(State, (PUCHAR)&Offset))
{
/* An exception occurred */
return FALSE;
}
/* Move the instruction pointer */
State->InstPtr.Long += Offset;
return TRUE;
}

View file

@ -183,4 +183,12 @@ Soft386OpcodeOut
UCHAR Opcode UCHAR Opcode
); );
BOOLEAN
FASTCALL
Soft386OpcodeShortJump
(
PSOFT386_STATE State,
UCHAR Opcode
);
#endif // _OPCODES_H_ #endif // _OPCODES_H_