Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
2.9 KiB

  1. /*++
  2. Copyright (c) 1993 Digital Equipment Corporation
  3. Copyright (c) 1993-2001 Microsoft Corporation
  4. Module Name:
  5. alpha_optable.h
  6. Abstract:
  7. Definitions for -
  8. Table of operations, their names and charactersitics
  9. Used by ntsd, windbg and acc's dissassembler
  10. Author:
  11. Miche Baker-Harvey (mbh) 10-Jan-1993
  12. Revision History:
  13. --*/
  14. #ifndef _ALPHA_OPTABLE_
  15. #define _ALPHA_OPTABLE_
  16. //
  17. // Each entry in the opTable is either for a
  18. // + function - one option on a particular opcode
  19. // + terminal opcode - an opcode without a function field
  20. // the above two can both appear directly in disassembly
  21. //
  22. // + non terminal opcode - an opcode with a function field:
  23. // these entries do not represent values which can be
  24. // executed directly: they require a function entry.
  25. //
  26. // + invalid opcode - this is an opcode reserved to digital
  27. //
  28. typedef enum ENTRY_TYPE {
  29. INVALID_ETYPE,
  30. NON_TERMINAL_ETYPE,
  31. TERMINAL_ETYPE,
  32. FUNCTION_ETYPE,
  33. NOT_AN_ETYPE
  34. } ENTRY_TYPE;
  35. #define NO_FUNC (ULONG)-1
  36. typedef ULONG (* PFOPPARSE)(PSTR, PSTR *, struct _OPTBLENTRY *, PULONG64);
  37. typedef struct _OPTBLENTRY {
  38. union {
  39. struct {
  40. PCHAR _pszName; // Name of the instruction
  41. PFOPPARSE _parsFunc; // Function to parse operands
  42. } s0; // functions and terminal opcodes
  43. struct {
  44. struct _OPTBLENTRY * _funcTable; // Describes funcs for opcode
  45. ULONG _funcTableSize; // Number of possible funcs
  46. } s1; // non-terminal opcodes
  47. } u;
  48. //
  49. // These fields describe the instruction
  50. //
  51. ULONG opCode; // Top 6 bits of a 32-bit alpha instr
  52. ULONG funcCode; // Function; meaning is opcode dependent
  53. ULONG iType; // type of the instr: branch, fp, mem...
  54. // values are ALPHA_* in alphaops.h
  55. ENTRY_TYPE eType; // type of this entry in the opTable
  56. } OPTBLENTRY, * POPTBLENTRY;
  57. //
  58. // MBH - hack workaround:
  59. // I tried to do this with nameless functions and structures;
  60. // it works just fine on ALPHA, but dies on 386, so use this
  61. // ugly hack instead.
  62. // The name "pszAlphaName" is used instead of the more obvious
  63. // "pszName" because other structures contain pszName.
  64. //
  65. #define pszAlphaName u.s0._pszName
  66. #define parsFunc u.s0._parsFunc
  67. #define funcTable u.s1._funcTable
  68. #define funcTableSize u.s1._funcTableSize
  69. POPTBLENTRY findNonTerminalEntry(ULONG);
  70. POPTBLENTRY findStringEntry(PSTR Str);
  71. POPTBLENTRY findOpCodeEntry(ULONG);
  72. char * findFuncName(POPTBLENTRY, ULONG);
  73. char * findFlagName(ULONG, ULONG);
  74. HRESULT opTableInit(void);
  75. //
  76. // This structure is used for the floating point flag names.
  77. //
  78. #define FPFLAGS_NOT_AN_ENTRY 0xffffffff
  79. typedef struct _FPFLAGS {
  80. ULONG flags; // the flags on the opcode
  81. PCHAR flagname; // the string mnemonic for the flags
  82. } FPFLAGS, * PFPFLAGS;
  83. #endif // _ALPHA_OPTABLE_