diff -r 16817406af29 src/arch/x86/isa/decoder/x87.isa
--- a/src/arch/x86/isa/decoder/x87.isa	Tue Nov 10 11:29:30 2009 -0500
+++ b/src/arch/x86/isa/decoder/x87.isa	Tue Nov 10 14:56:59 2009 -0500
@@ -265,7 +265,7 @@
             }
             0x7: decode MODRM_MOD {
                 0x3: Inst::UD2();
-                default: fnstsw();
+                default: Inst::FNSTSW(Mw);
             }
         }
         //0x6: esc6();
@@ -326,7 +326,7 @@
             }
             0x4: decode MODRM_MOD {
                 0x3: decode MODRM_RM {
-                    0x0: fnstsw();
+                    0x0: Inst::FNSTSW(rAw);
                     default: Inst::UD2();
                 }
                 default: fbld();
diff -r 16817406af29 src/arch/x86/isa/insts/x87/control/save_x87_status_word.py
--- a/src/arch/x86/isa/insts/x87/control/save_x87_status_word.py	Tue Nov 10 11:29:30 2009 -0500
+++ b/src/arch/x86/isa/insts/x87/control/save_x87_status_word.py	Tue Nov 10 14:56:59 2009 -0500
@@ -54,6 +54,44 @@
 # Authors: Gabe Black
 
 microcode = '''
-# FSTSW
-# FNSTSW
+
+# FSTSW (pseudo-op, FWAIT followed by FNSTSW)
+
+# x87 status word is 16-bits
+#   15 = busy
+#   14,10,9,8 = condition codes set by results of various instructions
+#   13,12,11  = top of stack pointer
+#   7 = exception flag
+#   6 = stack fault
+#   5 = precision
+#   4 = underflow
+#   3 = overflow
+#   2 = divide by zero
+#   1 = denormalized
+#   0 = invalid
+
+def macroop FNSTSW_R {
+    rdval t1, "InstRegIndex(MISCREG_X87_STATUS)"
+    rdval t2, "InstRegIndex(MISCREG_X87_TOP)"
+    slli t2, t2, 11
+    or t1,t1,t2
+    mov rax, rax, t1, dataSize=2
+};
+
+def macroop FNSTSW_M {
+    rdval t1, "InstRegIndex(MISCREG_X87_STATUS)"
+    rdval t2, "InstRegIndex(MISCREG_X87_TOP)"
+    slli t2, t2, 11
+    or t1,t1,t2
+    st t1, seg, sib, disp, dataSize=2
+};
+
+def macroop FNSTSW_P {
+    rdip t7
+    rdval t1, "InstRegIndex(MISCREG_X87_STATUS)"
+    rdval t2, "InstRegIndex(MISCREG_X87_TOP)"
+    slli t2, t2, 11
+    or t1,t1,t2
+    st t1, seg, riprel, disp, dataSize=2
+};
 '''
diff -r 16817406af29 src/arch/x86/isa/operands.isa
--- a/src/arch/x86/isa/operands.isa	Tue Nov 10 11:29:30 2009 -0500
+++ b/src/arch/x86/isa/operands.isa	Tue Nov 10 14:56:59 2009 -0500
@@ -150,5 +150,6 @@
         # instructions don't map their indexes with an old value.
         'nccFlagBits':   controlReg('MISCREG_RFLAGS', 61),
         'TOP':           controlReg('MISCREG_X87_TOP', 62, ctype='ub'),
+	'FPSTATUS':      controlReg('MISCREG_X87_STATUS', 63, ctype='uw'),
         # The segment base as used by memory instructions.
         'SegBase':       controlReg('MISCREG_SEG_EFF_BASE(segment)', 70),
diff -r 16817406af29 src/arch/x86/miscregs.hh
--- a/src/arch/x86/miscregs.hh	Tue Nov 10 11:29:30 2009 -0500
+++ b/src/arch/x86/miscregs.hh	Tue Nov 10 14:56:59 2009 -0500
@@ -373,6 +373,7 @@
         // Floating point control registers
         MISCREG_X87_TOP =
             MISCREG_SEG_ATTR_BASE + NUM_SEGMENTREGS,
+	MISCREG_X87_STATUS,
 
         MISCREG_MXCSR,
         MISCREG_FCW,
