ROSE  0.11.145.0
Unparser/M68k.h
1 #ifndef ROSE_BinaryAnalysis_Unparser_M68k_H
2 #define ROSE_BinaryAnalysis_Unparser_M68k_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 #include <Rose/BinaryAnalysis/Unparser/Base.h>
6 
7 #include <Rose/BinaryAnalysis/BasicTypes.h>
8 
9 namespace Rose {
10 namespace BinaryAnalysis {
11 namespace Unparser {
12 
13 std::string unparseM68kMnemonic(SgAsmM68kInstruction*);
14 std::string unparseM68kExpression(SgAsmExpression*, const LabelMap*, RegisterDictionaryPtr);
15 
17 struct M68kSettings: public Settings {};
18 
20 class M68k: public Base {
21  M68kSettings settings_;
22 
23 protected:
24  explicit M68k(const M68kSettings &settings)
25  : settings_(settings) {}
26 
27 public:
28  static Ptr instance(const M68kSettings &settings = M68kSettings()) {
29  return Ptr(new M68k(settings));
30  }
31 
32  Ptr copy() const override {
33  return instance(settings());
34  }
35 
36  const M68kSettings& settings() const override { return settings_; }
37  M68kSettings& settings() override { return settings_; }
38 
39 protected:
40  void emitInstruction(std::ostream&, SgAsmInstruction*, State&) const override;
41  void emitOperandBody(std::ostream&, SgAsmExpression*, State&) const override;
42 
43 private:
44  void outputExpr(std::ostream&, SgAsmExpression*, State&) const;
45 };
46 
47 } // namespace
48 } // namespace
49 } // namespace
50 
51 #endif
52 #endif
Base class for machine instructions.
Sawyer::SharedPointer< RegisterDictionary > RegisterDictionaryPtr
Reference counting pointer.
Main namespace for the ROSE library.
Settings that control unparsing.
Base class for expressions.
Settings specific to the M68k unparser.
Definition: Unparser/M68k.h:17
Unparser for Motorola M68k and related instruction sets.
Definition: Unparser/M68k.h:20