1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-30 04:50:08 +00:00

Fixes memptr for IN C, (C).

This commit is contained in:
Thomas Harte 2020-02-26 22:19:37 -05:00
parent 3b0df172a7
commit ec82c075be
2 changed files with 13 additions and 3 deletions

View File

@ -805,9 +805,19 @@ template < class T,
subtract_flag_ = half_carry_result_ = 0;
sign_result_ = zero_result_ = bit53_result_ = *static_cast<uint8_t *>(operation->source);
set_parity(sign_result_);
set_did_compute_flags(); // deliberate fallthrough
case MicroOp::SetOutFlags:
set_did_compute_flags();
if(operation_ == 0xdb) {
// IN A, (n)
memptr_.full = bc_.full + 1;
} else {
// IN r, (C)
// TODO: this surely isn't right?
++memptr_.full;
}
break;
case MicroOp::SetOutFlags:
memptr_.full = bc_.full + 1;
break;

View File

@ -244,7 +244,7 @@ void ProcessorStorage::install_default_instruction_set() {
}
void ProcessorStorage::assemble_ed_page(InstructionPage &target) {
#define IN_C(r) StdInstr(Input(bc_, r), {MicroOp::SetInFlags, &r})
#define IN_C(r) StdInstr({MicroOp::Move16, &bc_.full, &memptr_.full}, Input(bc_, r), {MicroOp::SetInFlags, &r})
#define OUT_C(r) StdInstr(Output(bc_, r), {MicroOp::SetOutFlags, &r})
#define IN_OUT(r) IN_C(r), OUT_C(r)