diff options
author | Karel Kočí <cynerd@email.cz> | 2017-08-30 23:29:14 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-08-30 23:29:14 +0200 |
commit | c975257cef23d254b1fa9290474268a61509e954 (patch) | |
tree | d7f219fa9fcb5a54cc9ccfc5aa692643ea968562 /qtmips_machine/programmemory.cpp | |
parent | 83e8593d9e36725d2bfb9d450da451e47a93f349 (diff) | |
download | qtmips-c975257cef23d254b1fa9290474268a61509e954.tar.gz qtmips-c975257cef23d254b1fa9290474268a61509e954.tar.bz2 qtmips-c975257cef23d254b1fa9290474268a61509e954.zip |
Some to_string_hex cleanups
Diffstat (limited to 'qtmips_machine/programmemory.cpp')
-rw-r--r-- | qtmips_machine/programmemory.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qtmips_machine/programmemory.cpp b/qtmips_machine/programmemory.cpp index c5ef53a..6759842 100644 --- a/qtmips_machine/programmemory.cpp +++ b/qtmips_machine/programmemory.cpp @@ -5,6 +5,7 @@ #include "instructions/loadstore.h" #include "instructions/nop.h" #include "instructions/shift.h" +#include "utils.h" ProgramMemory::ProgramMemory(ProgramLoader *loader, MemoryAccess *memory) { this->memory = memory; @@ -40,7 +41,7 @@ Instruction *ProgramMemory::at(std::uint32_t address) { } // TODO implement -#define I_UNKNOWN(DATA) do { std::stringstream ss; ss << std::hex << DATA; throw QTMIPS_EXCEPTION(UnsupportedInstruction, "Unknown instruction, can't decode", ss.str()); } while(false); +#define I_UNKNOWN(DATA) throw QTMIPS_EXCEPTION(UnsupportedInstruction, "Unknown instruction, can't decode", to_string_hex(DATA)) #define I_UNSUPPORTED(INST) throw QTMIPS_EXCEPTION(UnsupportedInstruction, "Decoded unsupported unstruction", #INST) Instruction *ProgramMemory::decode_r(std::uint32_t dt) { |