summaryrefslogtreecommitdiffhomepage
path: root/asm/assembler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'asm/assembler.cpp')
-rw-r--r--asm/assembler.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/asm/assembler.cpp b/asm/assembler.cpp
index b555125..4eb37f0 100644
--- a/asm/assembler.cpp
+++ b/asm/assembler.cpp
@@ -2,6 +2,14 @@
using namespace std::string_literals;
+Asm::Args::Immediate32::Immediate32(const Asm::Args::Immediate64& imm64)
+{
+ if (imm64.value() < 0x100000000)
+ m_value = static_cast<uint32_t>(imm64.value());
+ else
+ throw std::runtime_error("Immediate32: Constructed from too big Immediate64");
+}
+
namespace {
std::unordered_map<std::string, FactoryFunction> ops;