Author: aandrejevic
Date: Sun Sep 29 15:52:20 2013
New Revision: 60451
URL:
http://svn.reactos.org/svn/reactos?rev=60451&view=rev
Log:
[SOFT386]
Implement opcode group 0x8F.
Modified:
branches/ntvdm/lib/soft386/opgroups.c
Modified: branches/ntvdm/lib/soft386/opgroups.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/soft386/opgroups.c?re…
==============================================================================
--- branches/ntvdm/lib/soft386/opgroups.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/soft386/opgroups.c [iso-8859-1] Sun Sep 29 15:52:20 2013
@@ -175,8 +175,58 @@
SOFT386_OPCODE_HANDLER(Soft386OpcodeGroup8F)
{
- UNIMPLEMENTED;
- return FALSE; // TODO: NOT IMPLEMENTED
+ ULONG Value;
+ SOFT386_MOD_REG_RM ModRegRm;
+ BOOLEAN OperandSize, AddressSize;
+
+ OperandSize = AddressSize = State->SegmentRegs[SOFT386_REG_CS].Size;
+
+ if (State->PrefixFlags & SOFT386_PREFIX_OPSIZE)
+ {
+ /* The OPSIZE prefix toggles the size */
+ OperandSize = !OperandSize;
+ }
+
+ if (State->PrefixFlags & SOFT386_PREFIX_ADSIZE)
+ {
+ /* The ADSIZE prefix toggles the size */
+ AddressSize = !AddressSize;
+ }
+
+ if (!Soft386ParseModRegRm(State, AddressSize, &ModRegRm))
+ {
+ /* Exception occurred */
+ return FALSE;
+ }
+
+ if (ModRegRm.Register != 0)
+ {
+ /* Invalid */
+ Soft386Exception(State, SOFT386_EXCEPTION_UD);
+ return FALSE;
+ }
+
+ /* Pop a value from the stack */
+ if (!Soft386StackPop(State, &Value))
+ {
+ /* Exception occurred */
+ return FALSE;
+ }
+
+ if (OperandSize)
+ {
+ return Soft386WriteModrmDwordOperands(State,
+ &ModRegRm,
+ FALSE,
+ Value);
+ }
+ else
+ {
+ return Soft386WriteModrmWordOperands(State,
+ &ModRegRm,
+ FALSE,
+ LOWORD(Value));
+ }
}
SOFT386_OPCODE_HANDLER(Soft386OpcodeGroupC0)