aboutsummaryrefslogtreecommitdiff
path: root/qtmips_machine/tests/testcore.cpp
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2017-11-25 16:39:10 +0100
committerKarel Kočí <cynerd@email.cz>2017-11-25 16:39:10 +0100
commit0d7da86ea5e5187dca2e843549c33f761e35f068 (patch)
tree5dd1df523fd7665a78532c52043dac7117cfb23d /qtmips_machine/tests/testcore.cpp
parent8f6d939e8d0fdec39c53da65cfb89f288d99eb82 (diff)
downloadqtmips-0d7da86ea5e5187dca2e843549c33f761e35f068.tar.gz
qtmips-0d7da86ea5e5187dca2e843549c33f761e35f068.tar.bz2
qtmips-0d7da86ea5e5187dca2e843549c33f761e35f068.zip
Add crude implementation of MOV* instructions
I don't like how it's implemented but I have no other idea atm.
Diffstat (limited to 'qtmips_machine/tests/testcore.cpp')
-rw-r--r--qtmips_machine/tests/testcore.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/qtmips_machine/tests/testcore.cpp b/qtmips_machine/tests/testcore.cpp
index 835dd2c..27a49b4 100644
--- a/qtmips_machine/tests/testcore.cpp
+++ b/qtmips_machine/tests/testcore.cpp
@@ -127,6 +127,8 @@ static void core_regs_data() {
Registers regs_init;
regs_init.write_hi_lo(true, 24);
regs_init.write_hi_lo(false, 28);
+ regs_init.write_gp(24, 55);
+ regs_init.write_gp(25, 56);
regs_init.write_gp(27, 21);
regs_init.write_gp(28, 22);
Registers regs_res(regs_init);
@@ -148,6 +150,20 @@ static void core_regs_data() {
QTest::newRow("MTLO") << Instruction(0, 28, 0, 0, 0, 19) \
<< regs_init \
<< regs_res;
+ regs_res.write_hi_lo(false, 28);
+ QTest::newRow("MOVZ-F") << Instruction(0, 24, 24, 25, 0, 10) \
+ << regs_init \
+ << regs_res;
+ QTest::newRow("MOVN-F") << Instruction(0, 24, 1, 25, 0, 11) \
+ << regs_init \
+ << regs_res;
+ regs_res.write_gp(25, 55);
+ QTest::newRow("MOVZ-T") << Instruction(0, 24, 1, 25, 0, 10) \
+ << regs_init \
+ << regs_res;
+ QTest::newRow("MOVN-T") << Instruction(0, 24, 24, 25, 0, 11) \
+ << regs_init \
+ << regs_res;
}
}