Author: aandrejevic
Date: Sat Oct 19 17:57:26 2013
New Revision: 60706
URL:
http://svn.reactos.org/svn/reactos?rev=60706&view=rev
Log:
[FAST486]
Implement SETO, SETNO, SETC, SETNC, SETZ, SETNZ, SETBE, SETNBE, SETS, SETNS, SETP
SETNP, SETL, SETNL, SETLE and SETNLE.
Modified:
branches/ntvdm/lib/fast486/extraops.c
Modified: branches/ntvdm/lib/fast486/extraops.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/extraops.c?re…
==============================================================================
--- branches/ntvdm/lib/fast486/extraops.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/fast486/extraops.c [iso-8859-1] Sat Oct 19 17:57:26 2013
@@ -418,6 +418,96 @@
return TRUE;
}
+FAST486_OPCODE_HANDLER(Fast486ExtOpcodeConditionalSet)
+{
+ BOOLEAN Value = FALSE;
+ BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
+ FAST486_MOD_REG_RM ModRegRm;
+
+ if (State->PrefixFlags & FAST486_PREFIX_ADSIZE)
+ {
+ /* The OPSIZE prefix toggles the size */
+ AddressSize = !AddressSize;
+ }
+
+ /* Get the operands */
+ if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
+ {
+ /* Exception occurred */
+ return FALSE;
+ }
+
+ /* Make sure this is the right instruction */
+ ASSERT((Opcode & 0xF0) == 0x90);
+
+ switch ((Opcode & 0x0F) >> 1)
+ {
+ /* SETO / SETNO */
+ case 0:
+ {
+ Value = State->Flags.Of;
+ break;
+ }
+
+ /* SETC / SETNC */
+ case 1:
+ {
+ Value = State->Flags.Cf;
+ break;
+ }
+
+ /* SETZ / SETNZ */
+ case 2:
+ {
+ Value = State->Flags.Zf;
+ break;
+ }
+
+ /* SETBE / SETNBE */
+ case 3:
+ {
+ Value = State->Flags.Cf || State->Flags.Zf;
+ break;
+ }
+
+ /* SETS / SETNS */
+ case 4:
+ {
+ Value = State->Flags.Sf;
+ break;
+ }
+
+ /* SETP / SETNP */
+ case 5:
+ {
+ Value = State->Flags.Pf;
+ break;
+ }
+
+ /* SETL / SETNL */
+ case 6:
+ {
+ Value = State->Flags.Sf != State->Flags.Of;
+ break;
+ }
+
+ /* SETLE / SETNLE */
+ case 7:
+ {
+ Value = (State->Flags.Sf != State->Flags.Of) || State->Flags.Zf;
+ break;
+ }
+ }
+
+ if (Opcode & 1)
+ {
+ /* Invert the result */
+ Value = !Value;
+ }
+
+ /* Write back the result */
+ return Fast486WriteModrmByteOperands(State, &ModRegRm, FALSE, Value);
+}
FAST486_OPCODE_HANDLER(Fast486OpcodeExtended)
{