diff --git a/lib/soft386/opcodes.c b/lib/soft386/opcodes.c index 51ed74e4d4d..0aa22fd6efd 100644 --- a/lib/soft386/opcodes.c +++ b/lib/soft386/opcodes.c @@ -259,7 +259,7 @@ Soft386OpcodeHandlers[SOFT386_NUM_OPCODE_HANDLERS] = NULL, // TODO: OPCODE 0xE8 NOT SUPPORTED NULL, // TODO: OPCODE 0xE9 NOT SUPPORTED NULL, // TODO: OPCODE 0xEA NOT SUPPORTED - NULL, // TODO: OPCODE 0xEB NOT SUPPORTED + Soft386OpcodeShortJump, Soft386OpcodeInByte, Soft386OpcodeIn, Soft386OpcodeOutByte, @@ -1146,3 +1146,25 @@ Soft386OpcodeOut(PSOFT386_STATE State, UCHAR Opcode) 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; +} diff --git a/lib/soft386/opcodes.h b/lib/soft386/opcodes.h index 801c05b6d08..8a560e97bab 100644 --- a/lib/soft386/opcodes.h +++ b/lib/soft386/opcodes.h @@ -183,4 +183,12 @@ Soft386OpcodeOut UCHAR Opcode ); +BOOLEAN +FASTCALL +Soft386OpcodeShortJump +( + PSOFT386_STATE State, + UCHAR Opcode +); + #endif // _OPCODES_H_