More instruction tests

master
q3k 2014-01-04 14:57:14 +01:00
parent 5b1aee887b
commit cd959b80f7
1 changed files with 18 additions and 0 deletions

View File

@ -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");
}