diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-11-21 21:38:56 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-11-21 21:38:56 +0100 |
commit | 39bccce4fdd1d5ebe312321c963e0325e4d696c5 (patch) | |
tree | 6663c36c77a7209bb2318d1f20d2b23dcf5782e0 /asm/assembler.cpp | |
parent | 7fd9bbf4ea1ba5ea1b30e9ba3039195ab40c246a (diff) |
Bugfixing of stack (WIP)
Diffstat (limited to 'asm/assembler.cpp')
-rw-r--r-- | asm/assembler.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/asm/assembler.cpp b/asm/assembler.cpp index 4eb37f0..35e971b 100644 --- a/asm/assembler.cpp +++ b/asm/assembler.cpp @@ -10,6 +10,24 @@ Asm::Args::Immediate32::Immediate32(const Asm::Args::Immediate64& imm64) throw std::runtime_error("Immediate32: Constructed from too big Immediate64"); } +Asm::Args::Mem8Ptr64::Mem8Ptr64(const std::string& reg, int32_t offs): m_reg(reg), m_offs(offs) {} +Asm::Args::Mem8Ptr64::Mem8Ptr64(const std::string& reg, const std::string& reg2, int32_t offs): m_reg(reg), m_reg2(reg2), m_offs(offs) {} +std::string Asm::Args::Mem8Ptr64::reg() const { return "["s + m_reg + "]"s; } +std::string Asm::Args::Mem8Ptr64::reg2() const { return "["s + m_reg2 + "]"s; } +int32_t Asm::Args::Mem8Ptr64::offs() const { return m_offs; } + +Asm::Args::Mem32Ptr64::Mem32Ptr64(const std::string& reg, int32_t offs): m_reg(reg), m_offs(offs) {} +Asm::Args::Mem32Ptr64::Mem32Ptr64(const std::string& reg, const std::string& reg2, int32_t offs): m_reg(reg), m_reg2(reg2), m_offs(offs) {} +std::string Asm::Args::Mem32Ptr64::reg() const { return "["s + m_reg + "]"s; } +std::string Asm::Args::Mem32Ptr64::reg2() const { return "["s + m_reg2 + "]"s; } +int32_t Asm::Args::Mem32Ptr64::offs() const { return m_offs; } + +Asm::Args::Mem64Ptr64::Mem64Ptr64(const std::string& reg, int32_t offs): m_reg(reg), m_offs(offs) {} +Asm::Args::Mem64Ptr64::Mem64Ptr64(const std::string& reg, const std::string& reg2, int32_t offs): m_reg(reg), m_reg2(reg2), m_offs(offs) {} +std::string Asm::Args::Mem64Ptr64::reg() const { return "["s + m_reg + "]"s; } +std::string Asm::Args::Mem64Ptr64::reg2() const { return "["s + m_reg2 + "]"s; } +int32_t Asm::Args::Mem64Ptr64::offs() const { return m_offs; } + namespace { std::unordered_map<std::string, FactoryFunction> ops; |