summaryrefslogtreecommitdiffhomepage
path: root/intel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'intel.cpp')
-rw-r--r--intel.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/intel.cpp b/intel.cpp
index 471dcbf..1de2275 100644
--- a/intel.cpp
+++ b/intel.cpp
@@ -372,6 +372,16 @@ protected:
std::vector<uint8_t> machine_code;
};
+class Op_Label: public OpSimple
+{
+public:
+ Op_Label(const std::string& name) : OpSimple({}), m_name(name) {}
+ std::string name(){return m_name;}
+
+private:
+ std::string m_name;
+};
+
class Op_nop: public OpSimple
{
public:
@@ -379,7 +389,24 @@ public:
};
-bool registered { registerOp("nop", [](AsmArgs& args) -> std::shared_ptr<Op>{ return std::make_shared<Op_nop>(); }) };
+template<typename T>
+std::string mangleNameOne(const std::string& s)
+{
+ return s + "_" + typeid(T).name();
+}
+
+template<typename T, typename... Targs>
+std::string mangleName(const std::string& s)
+{
+ if constexpr (sizeof...(Targs) == 0)
+ return mangleNameOne<T>(s);
+ else
+ return mangleName<Targs...>(s + "_" + typeid(T).name());
+}
+
+bool registered { registerOp("nop", [](AsmArgs& args) -> std::shared_ptr<Op>{
+ return std::make_shared<Op_nop>();
+ }) };
class Assembler {