x64Analyzer.h 773 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2008 Dolphin Emulator Project
  2. // Licensed under GPLv2+
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "Common/CommonTypes.h"
  6. struct InstructionInfo
  7. {
  8. int operandSize; //8, 16, 32, 64
  9. int instructionSize;
  10. int regOperandReg;
  11. int otherReg;
  12. int scaledReg;
  13. bool zeroExtend;
  14. bool signExtend;
  15. bool hasImmediate;
  16. bool isMemoryWrite;
  17. bool byteSwap;
  18. u64 immediate;
  19. s32 displacement;
  20. bool operator==(const InstructionInfo &other) const;
  21. };
  22. struct ModRM
  23. {
  24. int mod, reg, rm;
  25. ModRM(u8 modRM, u8 rex)
  26. {
  27. mod = modRM >> 6;
  28. reg = ((modRM >> 3) & 7) | ((rex & 4) ? 8 : 0);
  29. rm = modRM & 7;
  30. }
  31. };
  32. enum AccessType
  33. {
  34. OP_ACCESS_READ = 0,
  35. OP_ACCESS_WRITE = 1
  36. };
  37. bool DisassembleMov(const unsigned char *codePtr, InstructionInfo *info);