1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-21 21:33:54 +00:00

Fix MOV as unconditional branch.

This commit is contained in:
Thomas Harte 2024-03-07 10:31:26 -05:00
parent 7cdceb7b4f
commit a0f0f73bde
2 changed files with 4 additions and 6 deletions

View File

@ -184,10 +184,8 @@ struct Executor {
// processor mode."
if(fields.destination() == 15) {
if constexpr (is_comparison(flags.operation())) {
registers_.set_status(conditions);
} else {
registers_.set_status(pc_proxy);
registers_.set_status(conditions);
if constexpr (!is_comparison(flags.operation())) {
registers_.set_pc(pc_proxy);
}
} else {
@ -201,7 +199,7 @@ struct Executor {
}
} else {
// "If the S flag is clear when Rd is R15, only the 24 PC bits of R15 will be written."
if(fields.destination() == 15 && !is_logical(flags.operation())) {
if(fields.destination() == 15 && !is_comparison(flags.operation())) {
registers_.set_pc(pc_proxy);
}
}

View File

@ -572,7 +572,7 @@ class ConcreteMachine:
// static bool log = false;
// if(log) {
// logger.info().append("%08x: %08x", executor_.pc(), instruction);
// logger.info().append("%08x: %08x [r14:%08x]", executor_.pc(), instruction, executor_.registers()[14]);
// }
InstructionSet::ARM::execute<arm_model>(instruction, executor_);
}