a test can now consist of multiple pdp instructions
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Some checks are pending
CodeQL / Analyze (push) Waiting to run
This commit is contained in:
parent
1bd06643b5
commit
b77c163cac
1 changed files with 11 additions and 5 deletions
16
main.cpp
16
main.cpp
|
@ -144,17 +144,23 @@ int run_cpu_validation(console *const cnsl, const std::string & filename)
|
||||||
b->write_unibus_byte(element.first, element.second);
|
b->write_unibus_byte(element.first, element.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int run_n_instructions = test["before"]["run-n-instructions"].as<int>();
|
||||||
|
|
||||||
int cur_n_errors = 0;
|
int cur_n_errors = 0;
|
||||||
|
|
||||||
// DO!
|
// DO!
|
||||||
c->emulation_start();
|
c->emulation_start();
|
||||||
disassemble(c, nullptr, c->getPC(), false);
|
for(int k=0; k<run_n_instructions; k++) {
|
||||||
if (c->step() == false) {
|
disassemble(c, nullptr, c->getPC(), false);
|
||||||
cnsl->put_string_lf("Treated as an invalid instruction");
|
if (c->step() == false) {
|
||||||
cur_n_errors++;
|
cnsl->put_string_lf("Treated as an invalid instruction");
|
||||||
|
cur_n_errors++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// VERIFY
|
// VERIFY
|
||||||
else {
|
if (cur_n_errors == 0) {
|
||||||
auto after = test["after"];
|
auto after = test["after"];
|
||||||
|
|
||||||
cur_n_errors += !compare_values(cnsl, c->getPC(), get_register_value(after, "PC" ), "PC" );
|
cur_n_errors += !compare_values(cnsl, c->getPC(), get_register_value(after, "PC" ), "PC" );
|
||||||
|
|
Loading…
Add table
Reference in a new issue