aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/programmemory.h
blob: 158adb18706669305a95f37a1dfe5ac14b885106 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef PROGRAMMEMORY_H
#define PROGRAMMEMORY_H

#include <vector>
#include "programloader.h"
#include "memory.h"
#include "instruction.h"

class ProgramMemory {
public:
    ProgramMemory(MemoryAccess *memory);

    void load(ProgramLoader *l);
    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