Add a function to print out segment names.
authorGabe Black <gblack@eecs.umich.edu>
Tue, 19 Jun 2007 14:14:17 +0000 (14:14 +0000)
committerGabe Black <gblack@eecs.umich.edu>
Tue, 19 Jun 2007 14:14:17 +0000 (14:14 +0000)
--HG--
extra : convert_revision : 8cbe3ca0d05165f7da5d6fa38c899ecc9e782511

src/arch/x86/isa/base.isa

index d9bd87f2d7e605c25e79e45e7c67f66301046681..eed969b47a6eda342b7f926688997064da318e7a 100644 (file)
@@ -182,6 +182,33 @@ output decoder {{
             ccprintf(os, "\t%s : %s   ", instMnemonic, mnemonic);
         }
 
+        void printSegment(std::ostream &os, int segment)
+        {
+            switch (segment)
+            {
+              case 0:
+                ccprintf(os, "ES");
+                break;
+              case 1:
+                ccprintf(os, "CS");
+                break;
+              case 2:
+                ccprintf(os, "SS");
+                break;
+              case 3:
+                ccprintf(os, "DS");
+                break;
+              case 4:
+                ccprintf(os, "FS");
+                break;
+              case 5:
+                ccprintf(os, "GS");
+                break;
+              default:
+                panic("Unrecognized segment %d\n", segment);
+            }
+        }
+
         void
         X86StaticInst::printSrcReg(std::ostream &os, int reg) const
         {