Author: aandrejevic Date: Sat Aug 31 21:23:31 2013 New Revision: 59932
URL: http://svn.reactos.org/svn/reactos?rev=59932&view=rev Log: [SOFT386] Implement the short unconditional jump instruction (JMP imm8).
Modified: branches/ntvdm/lib/soft386/opcodes.c branches/ntvdm/lib/soft386/opcodes.h
Modified: branches/ntvdm/lib/soft386/opcodes.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/opcodes.c?rev=... ============================================================================== --- branches/ntvdm/lib/soft386/opcodes.c [iso-8859-1] (original) +++ branches/ntvdm/lib/soft386/opcodes.c [iso-8859-1] Sat Aug 31 21:23:31 2013 @@ -259,7 +259,7 @@ 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 @@
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; +}
Modified: branches/ntvdm/lib/soft386/opcodes.h URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/opcodes.h?rev=... ============================================================================== --- branches/ntvdm/lib/soft386/opcodes.h [iso-8859-1] (original) +++ branches/ntvdm/lib/soft386/opcodes.h [iso-8859-1] Sat Aug 31 21:23:31 2013 @@ -183,4 +183,12 @@ UCHAR Opcode );
+BOOLEAN +FASTCALL +Soft386OpcodeShortJump +( + PSOFT386_STATE State, + UCHAR Opcode +); + #endif // _OPCODES_H_