From 773fc0a02bc1ceca9bb7e3f9e0dcdaa1d207ca99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 15 Jan 2018 14:43:28 +0100 Subject: Fix program loader test --- qtmips_machine/tests/testprogramloader.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'qtmips_machine') 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) } -- cgit v1.2.3