1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-25 18:30:07 +00:00

Don't write to the PC with logical operations.

This commit is contained in:
Thomas Harte 2024-03-05 09:32:35 -05:00
parent 871c5467d7
commit ed586e80bc

View File

@ -183,7 +183,7 @@ struct Executor {
// this case to update those PSR flags which are not protected by virtue of the
// processor mode."
if(fields.destination() == 15) {
if(fields.destination() == 15 && !is_logical(flags.operation())) {
if constexpr (is_comparison(flags.operation())) {
registers_.set_status(pc_proxy);
} else {
@ -201,7 +201,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) {
if(fields.destination() == 15 && !is_logical(flags.operation())) {
registers_.set_pc(pc_proxy);
}
}