From cd959b80f7cb7e3c11813b5b4e77fcda95f84371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergiusz=20=27q3k=27=20Baza=C5=84ski?= Date: Sat, 4 Jan 2014 14:57:14 +0100 Subject: [PATCH] More instruction tests --- test_main.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test_main.cpp b/test_main.cpp index 82e1a78..71a20f6 100644 --- a/test_main.cpp +++ b/test_main.cpp @@ -116,4 +116,22 @@ int main(int argc, char **argv) test_alu_instruction_vf(0xA4, 0x00, 0x812E, (0xA4<<1)&0xFF, 0x01); printf("SHL (zero) "); test_alu_instruction_vf(0x24, 0x00, 0x812E, (0x24<<1)&0xFF, 0x00); + + printf("PC increment: "); + reset(); + run_instruction(0x0000); // NOP + step3(); + if (top->v->pc != 0x2) + printf(" FAIL!\n"); + else + printf(" OK.\n"); + + printf("JMP imm INS 1456: "); + reset(); + run_instruction(0x1456); + step3(); + if (top->v->pc != 0x456) + printf(" FAIL!\n"); + else + printf(" OK.\n"); }