diff options
author | Karel Kočí <cynerd@email.cz> | 2017-08-30 21:37:53 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-08-30 21:42:02 +0200 |
commit | 9cf92379d5fcf0076c25dae0935daab446c992cd (patch) | |
tree | dd09a2e996db1e5a8117f01bec76f1e93eaca6e1 /qtmips_machine/programmemory.h | |
download | qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.tar.gz qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.tar.bz2 qtmips-9cf92379d5fcf0076c25dae0935daab446c992cd.zip |
Initial commit
Adding work done so far.
Diffstat (limited to 'qtmips_machine/programmemory.h')
-rw-r--r-- | qtmips_machine/programmemory.h | 22 |
1 files changed, 22 insertions, 0 deletions
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 <vector> +#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 |