diff options
author | Roland Reichwein <mail@reichwein.it> | 2020-11-20 10:59:18 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2020-11-20 10:59:18 +0100 |
commit | 7250bbe5ae2d2ee6b0334bc462aab73f7d8dac0e (patch) | |
tree | b910e778baa3e2434215abbb50e45e64aa92970c /asm/assembler.cpp | |
parent | 05faf77202d0f8762160f135e714961d2c456cca (diff) |
Assembler bugfixes - tests run successfully now
Diffstat (limited to 'asm/assembler.cpp')
-rw-r--r-- | asm/assembler.cpp | 8 |
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; |