disassem.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. ***************************************************************************
  3. dcc project disassembler header
  4. (C) Mike van Emmerik
  5. ***************************************************************************
  6. */
  7. #pragma once
  8. #include <fstream>
  9. #include <vector>
  10. #include "bundle.h"
  11. struct LLInst;
  12. struct Disassembler
  13. {
  14. protected:
  15. int pass;
  16. int g_lab;
  17. //bundle &cCode;
  18. std::ofstream m_fp;
  19. std::vector<std::string> m_decls;
  20. std::vector<std::string> m_code;
  21. public:
  22. Disassembler(int _p) : pass(_p)
  23. {
  24. g_lab=0;
  25. }
  26. public:
  27. void disassem(Function *ppProc);
  28. void disassem(Function *ppProc, int i);
  29. void dis1Line(LLInst &inst, int loc_ip, int pass);
  30. };
  31. /* Definitions for extended keys (first key is zero) */
  32. #define EXT 0x100 /* "Extended" flag */
  33. #ifdef __UNIX__
  34. #define KEY_DOWN EXT+'B'
  35. #define KEY_LEFT EXT+'D'
  36. #define KEY_UP EXT+'A'
  37. #define KEY_RIGHT EXT+'C'
  38. #define KEY_NPAGE EXT+'J' /* Enter correct value! */
  39. #define KEY_PPAGE EXT+'K' /* Another guess! */
  40. #endif
  41. /* "Attributes" */
  42. #define A_NORMAL 'N' /* For Dos/Unix */
  43. #define A_REVERSE 'I'
  44. #define A_BOLD 'B'
  45. #define LINES 24
  46. #define COLS 80