[FAST486]
authorAleksandar Andrejevic <aandrejevic@reactos.org>
Thu, 27 Feb 2014 03:54:43 +0000 (03:54 +0000)
committerAleksandar Andrejevic <aandrejevic@reactos.org>
Thu, 27 Feb 2014 03:54:43 +0000 (03:54 +0000)
All of the FPU opcodes fetch another byte which is the function number.
This is done by the CPU and it occurs even if there is no FPU attached.

svn path=/branches/ntvdm/; revision=62344

lib/fast486/fpu.c

index a73e079..a4a3511 100644 (file)
 
 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD8)
 {
+    UCHAR Function;
+
     FPU_CHECK();
 
+    /* Fetch the function number */
+    if (!Fast486FetchByte(State, &Function))
+    {
+        /* Exception occurred */
+        return FALSE;
+    }
+
 #ifndef FAST486_NO_FPU
     // TODO: NOT IMPLEMENTED
     UNIMPLEMENTED;
@@ -50,8 +59,17 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD8)
 
 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD9)
 {
+    UCHAR Function;
+
     FPU_CHECK();
 
+    /* Fetch the function number */
+    if (!Fast486FetchByte(State, &Function))
+    {
+        /* Exception occurred */
+        return FALSE;
+    }
+
 #ifndef FAST486_NO_FPU
     // TODO: NOT IMPLEMENTED
     UNIMPLEMENTED;
@@ -65,8 +83,17 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD9)
 
 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDA)
 {
+    UCHAR Function;
+
     FPU_CHECK();
 
+    /* Fetch the function number */
+    if (!Fast486FetchByte(State, &Function))
+    {
+        /* Exception occurred */
+        return FALSE;
+    }
+
 #ifndef FAST486_NO_FPU
     // TODO: NOT IMPLEMENTED
     UNIMPLEMENTED;
@@ -80,8 +107,17 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDA)
 
 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDB)
 {
+    UCHAR Function;
+
     FPU_CHECK();
 
+    /* Fetch the function number */
+    if (!Fast486FetchByte(State, &Function))
+    {
+        /* Exception occurred */
+        return FALSE;
+    }
+
 #ifndef FAST486_NO_FPU
     // TODO: NOT IMPLEMENTED
     UNIMPLEMENTED;
@@ -95,8 +131,17 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDB)
 
 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDC)
 {
+    UCHAR Function;
+
     FPU_CHECK();
 
+    /* Fetch the function number */
+    if (!Fast486FetchByte(State, &Function))
+    {
+        /* Exception occurred */
+        return FALSE;
+    }
+
 #ifndef FAST486_NO_FPU
     // TODO: NOT IMPLEMENTED
     UNIMPLEMENTED;
@@ -110,8 +155,17 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDC)
 
 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDD)
 {
+    UCHAR Function;
+
     FPU_CHECK();
 
+    /* Fetch the function number */
+    if (!Fast486FetchByte(State, &Function))
+    {
+        /* Exception occurred */
+        return FALSE;
+    }
+
 #ifndef FAST486_NO_FPU
     // TODO: NOT IMPLEMENTED
     UNIMPLEMENTED;
@@ -125,8 +179,17 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDD)
 
 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDE)
 {
+    UCHAR Function;
+
     FPU_CHECK();
 
+    /* Fetch the function number */
+    if (!Fast486FetchByte(State, &Function))
+    {
+        /* Exception occurred */
+        return FALSE;
+    }
+
 #ifndef FAST486_NO_FPU
     // TODO: NOT IMPLEMENTED
     UNIMPLEMENTED;
@@ -140,8 +203,17 @@ FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDE)
 
 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDF)
 {
+    UCHAR Function;
+
     FPU_CHECK();
 
+    /* Fetch the function number */
+    if (!Fast486FetchByte(State, &Function))
+    {
+        /* Exception occurred */
+        return FALSE;
+    }
+
 #ifndef FAST486_NO_FPU
     // TODO: NOT IMPLEMENTED
     UNIMPLEMENTED;