aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-01-15 14:43:28 +0100
committerKarel Kočí <cynerd@email.cz>2018-01-15 14:43:28 +0100
commit773fc0a02bc1ceca9bb7e3f9e0dcdaa1d207ca99 (patch)
tree2eb8fc2178fe18b6abda9b02491fd5cf507a4bd6
parented851a24951417b2493211835f9e488448890be6 (diff)
downloadqtmips-773fc0a02bc1ceca9bb7e3f9e0dcdaa1d207ca99.tar.gz
qtmips-773fc0a02bc1ceca9bb7e3f9e0dcdaa1d207ca99.tar.bz2
qtmips-773fc0a02bc1ceca9bb7e3f9e0dcdaa1d207ca99.zip
Fix program loader test
-rw-r--r--qtmips_machine/tests/testprogramloader.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/qtmips_machine/tests/testprogramloader.cpp b/qtmips_machine/tests/testprogramloader.cpp
index 057bf3f..bf084f4 100644
--- a/qtmips_machine/tests/testprogramloader.cpp
+++ b/qtmips_machine/tests/testprogramloader.cpp
@@ -15,8 +15,7 @@ void MachineTests::program_loader() {
// addi $1, $0, 6
QCOMPARE(Instruction(m.read_word(PC_INIT)), Instruction(8, 0, 1, 6));
- // j 80020000
- // TODO wtf to je relativni skok asi tady
- //QCOMPARE(Instruction(m.read_word(PC_INIT + 4)), Instruction(2, PC_INIT));
+ // j (8)0020000 (only 28 bits are used and they are logically shifted left by 2)
+ QCOMPARE(Instruction(m.read_word(PC_INIT + 4)), Instruction(2, 0x20000 >> 2));
// TODO add some more code to data and do more compares (for example more sections)
}