Leaked source code of windows server 2003
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.

86 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. instr.h
  5. Abstract:
  6. This module contains structures, enums and constants used to define the
  7. Intel instruction stream.
  8. Author:
  9. Dave Hastings (daveh) creation-date 23-Jun-1995
  10. Revision History:
  11. --*/
  12. #ifndef _INSTR_H_
  13. #define _INSTR_H_
  14. // We need the definitions of Entry Points for the instruction structure
  15. #include "entrypt.h"
  16. //
  17. // This enumeration defines all of the possible operations.
  18. // N.B. It is also used to find the fragment corresponding to the
  19. // operation.
  20. //
  21. typedef enum _Operation {
  22. #define DEF_INSTR(OpName, FlagsNeeded, FlagsSet, RegsSet, Opfl, FastPlaceFn, SlowPlaceFn, FragName) OpName,
  23. #include "idata.h"
  24. OP_MAX
  25. } OPERATION, *POPERATION;
  26. typedef enum _PlaceFn {
  27. #define DEF_PLACEFN(Name) FN_ ## Name,
  28. #include "fndata.h"
  29. FN_MAX
  30. } PLACEFN;
  31. typedef struct _Operand {
  32. enum {
  33. OPND_NONE = 0,
  34. OPND_NOCODEGEN,
  35. OPND_REGREF,
  36. OPND_REGVALUE,
  37. OPND_ADDRREF,
  38. OPND_ADDRVALUE32,
  39. OPND_ADDRVALUE16,
  40. OPND_ADDRVALUE8,
  41. OPND_IMM,
  42. OPND_MOVTOREG,
  43. OPND_MOVREGTOREG,
  44. OPND_MOVTOMEM,
  45. } Type;
  46. ULONG Immed;
  47. ULONG Reg;
  48. ULONG Scale;
  49. ULONG IndexReg;
  50. ULONG Alignment;
  51. } OPERAND, *POPERAND;
  52. typedef struct _Instruction {
  53. OPERATION Operation;
  54. OPERAND Operand1;
  55. OPERAND Operand2;
  56. OPERAND Operand3;
  57. ULONG FsOverride;
  58. ULONG Size;
  59. PCHAR NativeStart;
  60. ULONG IntelAddress;
  61. DWORD RegsSet;
  62. DWORD RegsNeeded;
  63. DWORD RegsToCache;
  64. BOOL EbpAligned;
  65. PENTRYPOINT EntryPoint;
  66. } INSTRUCTION, *PINSTRUCTION;
  67. #endif