machine_x86.h 972 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include <string>
  3. /* Machine registers */
  4. enum eReg
  5. {
  6. rUNDEF = 0,
  7. rAX = 1, /* These are numbered relative to real 8086 */
  8. rCX = 2,
  9. rDX = 3,
  10. rBX = 4,
  11. rSP = 5,
  12. rBP = 6,
  13. rSI = 7,
  14. rDI = 8,
  15. rES = 9,
  16. rCS = 10,
  17. rSS = 11,
  18. rDS = 12,
  19. rAL = 13,
  20. rCL = 14,
  21. rDL = 15,
  22. rBL = 16,
  23. rAH = 17,
  24. rCH = 18,
  25. rDH = 19,
  26. rBH = 20,
  27. rTMP= 21, /* temp register for DIV/IDIV/MOD */
  28. /* Indexed modes go from INDEXBASE to INDEXBASE+7 */
  29. INDEX_BX_SI = 22, // "bx+si"
  30. INDEX_BX_DI, // "bx+di"
  31. INDEX_BP_SI, // "bp+si"
  32. INDEX_BP_DI, // "bp+di"
  33. INDEX_SI, // "si"
  34. INDEX_DI, // "di"
  35. INDEX_BP, // "bp"
  36. INDEX_BX, // "bx"
  37. LAST_REG
  38. };
  39. class Machine_X86
  40. {
  41. public:
  42. Machine_X86();
  43. static const std::string &regName(eReg r);
  44. };