[FAST486]
[reactos.git] / reactos / lib / fast486 / opcodes.c
index a032691..a719988 100644 (file)
@@ -279,7 +279,7 @@ Fast486OpcodeHandlers[FAST486_NUM_OPCODE_HANDLERS] =
     Fast486OpcodeOutByte,               /* 0xEE */
     Fast486OpcodeOut,                   /* 0xEF */
     Fast486OpcodePrefix,                /* 0xF0 */
-    Fast486OpcodeInvalid,               /* 0xF1 */  // Invalid opcode
+    Fast486OpcodeInvalid,               /* 0xF1 */  // Invalid opcode -- ICEBP/INT01 opcode
     Fast486OpcodePrefix,                /* 0xF2 */
     Fast486OpcodePrefix,                /* 0xF3 */
     Fast486OpcodeHalt,                  /* 0xF4 */
@@ -300,7 +300,12 @@ Fast486OpcodeHandlers[FAST486_NUM_OPCODE_HANDLERS] =
 
 FAST486_OPCODE_HANDLER(Fast486OpcodeInvalid)
 {
-    /* This is not a valid opcode */
+    /*
+     * This is not a valid opcode.
+     * Well, not totally: see http://www.rcollins.org/secrets/opcodes/ICEBP.html
+     * for more details.
+     */
+    DPRINT1("FAST486 -- Calling ICEBP opcode\n");
     Fast486Exception(State, FAST486_EXCEPTION_UD);
     return FALSE;
 }
@@ -4625,14 +4630,14 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeInt)
 
     switch (Opcode)
     {
-        case 0xCC:
+        case 0xCC:  // INT 3
         {
             /* This is the INT3 instruction */
             IntNum = 3;
             break;
         }
 
-        case 0xCD:
+        case 0xCD:  // INT xx
         {
             /* Fetch the interrupt number */
             if (!Fast486FetchByte(State, &IntNum))
@@ -4644,7 +4649,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeInt)
             break;
         }
 
-        case 0xCE:
+        case 0xCE:  // INTO
         {
             /* Don't do anything if OF is cleared */
             if (!State->Flags.Of) return TRUE;
@@ -5428,6 +5433,11 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeMovOffsetEax)
 
 FAST486_OPCODE_HANDLER(Fast486OpcodeSalc)
 {
+    /*
+     * See: http://www.rcollins.org/secrets/opcodes/SALC.html
+     * for more information.
+     */
+
     /* Make sure this is the right instruction */
     ASSERT(Opcode == 0xD6);