Author: aandrejevic
Date: Fri Nov 15 20:49:48 2013
New Revision: 61000

URL: http://svn.reactos.org/svn/reactos?rev=61000&view=rev
Log:
[FAST486]
- When accessing memory using ESP, make the SS segment default.
- The INT instructions always pushes 16-bit values in real mode, regardless
  of the operand/address size attributes.


Modified:
    branches/ntvdm/lib/fast486/common.c
    branches/ntvdm/lib/fast486/common.inl

Modified: branches/ntvdm/lib/fast486/common.c
URL: 
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/common.c?rev=61000&r1=60999&r2=61000&view=diff
==============================================================================
--- branches/ntvdm/lib/fast486/common.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/fast486/common.c [iso-8859-1] Fri Nov 15 20:49:48 2013
@@ -240,6 +240,14 @@
             if (!Fast486StackPush(State, OldEsp)) return FALSE;
         }
     }
+    else
+    {
+        if (State->SegmentRegs[FAST486_REG_CS].Size)
+        {
+            /* Set OPSIZE, because INT always pushes 16-bit values in real 
mode */
+            State->PrefixFlags |= FAST486_PREFIX_OPSIZE;
+        }
+    }
 
     /* Push EFLAGS */
     if (!Fast486StackPush(State, State->Flags.Long)) return FALSE;

Modified: branches/ntvdm/lib/fast486/common.inl
URL: 
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/common.inl?rev=61000&r1=60999&r2=61000&view=diff
==============================================================================
--- branches/ntvdm/lib/fast486/common.inl       [iso-8859-1] (original)
+++ branches/ntvdm/lib/fast486/common.inl       [iso-8859-1] Fri Nov 15 
20:49:48 2013
@@ -730,6 +730,17 @@
                 }
             }
 
+            if ((SibByte & 0x07) == FAST486_REG_ESP)
+            {
+                /* Check if there is no segment override */
+                if (!(State->PrefixFlags & FAST486_PREFIX_SEG))
+                {
+                    /* Add a SS: prefix */
+                    State->PrefixFlags |= FAST486_PREFIX_SEG;
+                    State->SegmentOverride = FAST486_REG_SS;
+                }
+            }
+
             /* Calculate the address */
             ModRegRm->MemoryAddress = Base + Index * Scale;
         }


Reply via email to