From 9cf92379d5fcf0076c25dae0935daab446c992cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Wed, 30 Aug 2017 21:37:53 +0200 Subject: Initial commit Adding work done so far. --- qtmips_machine/programmemory.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 qtmips_machine/programmemory.h (limited to 'qtmips_machine/programmemory.h') diff --git a/qtmips_machine/programmemory.h b/qtmips_machine/programmemory.h new file mode 100644 index 0000000..84b2f31 --- /dev/null +++ b/qtmips_machine/programmemory.h @@ -0,0 +1,22 @@ +#ifndef PROGRAMMEMORY_H +#define PROGRAMMEMORY_H + +#include +#include "programloader.h" +#include "memory.h" +#include "instruction.h" + +class ProgramMemory { +public: + ProgramMemory(ProgramLoader *loader, MemoryAccess *memory); + + Instruction *at(std::uint32_t address); // return instruction isntance for given address + +private: + MemoryAccess *memory; + Instruction *decode_r(std::uint32_t dt); + Instruction *decode_j(std::uint32_t dt); + Instruction *decode_i(std::uint32_t dt); +}; + +#endif // PROGRAMMEMORY_H -- cgit v1.2.3