Enums.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #pragma once
  2. /* Machine registers */
  3. enum eReg
  4. {
  5. rAX = 1, /* These are numbered relative to real 8086 */
  6. rCX = 2,
  7. rDX = 3,
  8. rBX = 4,
  9. rSP = 5,
  10. rBP = 6,
  11. rSI = 7,
  12. rDI = 8,
  13. rES = 9,
  14. rCS = 10,
  15. rSS = 11,
  16. rDS = 12,
  17. rAL = 13,
  18. rCL = 14,
  19. rDL = 15,
  20. rBL = 16,
  21. rAH = 17,
  22. rCH = 18,
  23. rDH = 19,
  24. rBH = 20,
  25. rTMP= 21, /* temp register for DIV/IDIV/MOD */
  26. INDEXBASE = 22 /* Indexed modes go from INDEXBASE to INDEXBASE+7 */
  27. };
  28. /* Register types */
  29. enum regType
  30. {
  31. BYTE_REG,
  32. WORD_REG
  33. };
  34. enum condId
  35. {
  36. GLOB_VAR, /* global variable */
  37. REGISTER, /* register */
  38. LOCAL_VAR, /* negative disp */
  39. PARAM, /* positive disp */
  40. GLOB_VAR_IDX, /* indexed global variable *//*** should merge w/glob-var*/
  41. CONSTANT, /* constant */
  42. STRING, /* string */
  43. LONG_VAR, /* long variable */
  44. FUNCTION, /* function */
  45. OTHER /* other **** tmp solution */
  46. };
  47. enum condOp
  48. {
  49. /* For conditional expressions */
  50. LESS_EQUAL = 0, /* <= */
  51. LESS, /* < */
  52. EQUAL, /* == */
  53. NOT_EQUAL, /* != */
  54. GREATER, /* > */
  55. GREATER_EQUAL, /* >= */
  56. /* For general expressions */
  57. AND, /* & */
  58. OR, /* | */
  59. XOR, /* ^ */
  60. NOT, /* ~ */ /* 1's complement */
  61. ADD, /* + */
  62. SUB, /* - */
  63. MUL, /* * */
  64. DIV, /* / */
  65. SHR, /* >> */
  66. SHL, /* << */
  67. MOD, /* % */
  68. DBL_AND, /* && */
  69. DBL_OR, /* || */
  70. DUMMY /* */
  71. };
  72. /* LOW_LEVEL operand location: source or destination */
  73. enum opLoc
  74. {
  75. SRC, /* Source operand */
  76. DST, /* Destination operand */
  77. LHS_OP /* Left-hand side operand (for HIGH_LEVEL) */
  78. };
  79. /* Conditional Expression enumeration nodes and operators */
  80. enum condNodeType
  81. {
  82. UNKNOWN_OP=0,
  83. BOOLEAN_OP, /* condOps */
  84. NEGATION, /* not (2's complement) */
  85. ADDRESSOF, /* addressOf (&) */
  86. DEREFERENCE, /* contents of (*) */
  87. IDENTIFIER, /* {register | local | param | constant | global} */
  88. /* The following are only available to C programs */
  89. POST_INC, /* ++ (post increment) */
  90. POST_DEC, /* -- (post decrement) */
  91. PRE_INC, /* ++ (pre increment) */
  92. PRE_DEC /* -- (pre decrement) */
  93. } ;
  94. /* Enumeration to determine whether pIcode points to the high or low part
  95. * of a long number */
  96. enum hlFirst
  97. {
  98. HIGH_FIRST, /* High value is first */
  99. LOW_FIRST /* Low value is first */
  100. };
  101. /* HIGH_LEVEL icodes opcodes */
  102. enum hlIcode
  103. {
  104. HLI_ASSIGN, /* := */
  105. HLI_CALL, /* Call procedure */
  106. HLI_JCOND, /* Conditional jump */
  107. HLI_RET, /* Return from procedure */
  108. /* pseudo high-level icodes */
  109. HLI_POP, /* Pop expression */
  110. HLI_PUSH /* Push expression */
  111. } ;
  112. /* Type definitions used in the decompiled program */
  113. enum hlType
  114. {
  115. TYPE_UNKNOWN = 0, /* unknown so far */
  116. TYPE_BYTE_SIGN, /* signed byte (8 bits) */
  117. TYPE_BYTE_UNSIGN, /* unsigned byte */
  118. TYPE_WORD_SIGN, /* signed word (16 bits) */
  119. TYPE_WORD_UNSIGN, /* unsigned word (16 bits) */
  120. TYPE_LONG_SIGN, /* signed long (32 bits) */
  121. TYPE_LONG_UNSIGN, /* unsigned long (32 bits) */
  122. TYPE_RECORD, /* record structure */
  123. TYPE_PTR, /* pointer (32 bit ptr) */
  124. TYPE_STR, /* string */
  125. TYPE_CONST, /* constant (any type) */
  126. TYPE_FLOAT, /* floating point */
  127. TYPE_DOUBLE /* double precision float */
  128. };
  129. /* Operand is defined, used or both flag */
  130. enum operDu
  131. {
  132. eDEF=0x10, /* Operand is defined */
  133. eUSE=0x100, /* Operand is used */
  134. USE_DEF, /* Operand is used and defined */
  135. NONE /* No operation is required on this operand */
  136. };