disassem.h 1.2 KB

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