about summary refs log tree commit diff stats
path: root/subx/010core.cc
diff options
context:
space:
mode:
Diffstat (limited to 'subx/010core.cc')
-rw-r--r--subx/010core.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/subx/010core.cc b/subx/010core.cc
index a23418db..050ac932 100644
--- a/subx/010core.cc
+++ b/subx/010core.cc
@@ -224,6 +224,20 @@ int32_t imm32() {
   return result;
 }
 
+string rname(uint8_t r) {
+  switch (r) {
+  case 0: return "EAX";
+  case 1: return "ECX";
+  case 2: return "EDX";
+  case 3: return "EBX";
+  case 4: return "ESP";
+  case 5: return "EBP";
+  case 6: return "ESI";
+  case 7: return "EDI";
+  default: raise << "invalid register " << r << '\n' << end();  return "";
+  }
+}
+
 :(before "End Includes")
 #include <iomanip>
 #define HEXBYTE  std::hex << std::setw(2) << std::setfill('0')