diff options
Diffstat (limited to 'qtmips_machine/registers.h')
-rw-r--r-- | qtmips_machine/registers.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/qtmips_machine/registers.h b/qtmips_machine/registers.h index a550f4a..905a212 100644 --- a/qtmips_machine/registers.h +++ b/qtmips_machine/registers.h @@ -8,18 +8,22 @@ class Registers : public QObject { Q_OBJECT public: Registers(); + Registers(const Registers*); - std::uint32_t read_pc(); // Return current value of program counter + std::uint32_t read_pc() const; // Return current value of program counter std::uint32_t pc_inc(); // Increment program counter by four bytes std::uint32_t pc_jmp(std::int32_t offset); // Relative jump from current location in program counter void pc_abs_jmp(std::uint32_t address); // Absolute jump in program counter (write to pc) - std::uint32_t read_gp(std::uint8_t i); // Read general-purpose register + std::uint32_t read_gp(std::uint8_t i) const; // Read general-purpose register void write_gp(std::uint8_t i, std::uint32_t value); // Write general-purpose register - std::uint32_t read_hi_lo(bool hi); // true - read HI / false - read LO + std::uint32_t read_hi_lo(bool hi) const; // true - read HI / false - read LO void write_hi_lo(bool hi, std::uint32_t value); + bool operator ==(const Registers &c) const; + signals: + void pc_update(std::uint32_t val); // TODO signals private: |