aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/registers.cpp
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-12-12 18:53:02 +0100
committerKarel Kočí <cynerd@email.cz>2017-12-12 18:53:02 +0100
commit15398c34d38489bf14a100bbf01fb9fb4c7e46cb (patch)
tree7121325d9ba6d1166b7faa4b8664bdcac875d995 /qtmips_machine/registers.cpp
parent36853877b262bd47417be1637a1854ae3145384e (diff)
downloadqtmips-15398c34d38489bf14a100bbf01fb9fb4c7e46cb.tar.gz
qtmips-15398c34d38489bf14a100bbf01fb9fb4c7e46cb.tar.bz2
qtmips-15398c34d38489bf14a100bbf01fb9fb4c7e46cb.zip
Implement branch and jump instructions
Diffstat (limited to 'qtmips_machine/registers.cpp')
-rw-r--r--qtmips_machine/registers.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/qtmips_machine/registers.cpp b/qtmips_machine/registers.cpp
index 5bb852e..a18421e 100644
--- a/qtmips_machine/registers.cpp
+++ b/qtmips_machine/registers.cpp
@@ -46,6 +46,10 @@ void Registers::pc_abs_jmp(std::uint32_t address) {
this->pc = address;
}
+void Registers::pc_abs_jmp_28(std::uint32_t address) {
+ this->pc_abs_jmp((pc & 0xF0000000) | (address & 0x0FFFFFFF));
+}
+
std::uint32_t Registers::read_gp(std::uint8_t i) const {
SANITY_ASSERT(i < 32, QString("Trying to read from register ") + QString(i));
if (!i) // $0 always reads as 0