1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-26 23:52:26 +00:00

Corrected logical flags; now down to 68 failures, all of them on the ED page.

This commit is contained in:
Thomas Harte 2017-05-28 15:09:58 -04:00
parent 743eac8c55
commit 5a4d448cc1
2 changed files with 13 additions and 13 deletions

View File

@ -167,7 +167,7 @@ class FUSETests: XCTestCase {
let name = itemDictionary["name"] as! String
// if name != "ed40" {
// if name != "a0" {
// continue;
// }

View File

@ -703,30 +703,30 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
#pragma mark - Logical
#define set_logical_flags(hf) \
sign_result_ = zero_result_ = bit5_result_ = bit3_result_ = a_; \
set_parity(a_); \
half_carry_flag_ = hf; \
subtract_flag_ = 0; \
carry_flag_ = 0;
case MicroOp::And:
a_ &= *(uint8_t *)operation->source;
half_carry_flag_ = Flag::HalfCarry;
sign_result_ = zero_result_ = bit5_result_ = bit3_result_ = a_;
parity_overflow_flag_ = 0;
set_parity(a_);
set_logical_flags(Flag::HalfCarry);
break;
case MicroOp::Or:
a_ |= *(uint8_t *)operation->source;
half_carry_flag_ = 0;
sign_result_ = zero_result_ = bit5_result_ = bit3_result_ = a_;
parity_overflow_flag_ = 0;
set_parity(a_);
set_logical_flags(0);
break;
case MicroOp::Xor:
a_ ^= *(uint8_t *)operation->source;
half_carry_flag_ = 0;
sign_result_ = zero_result_ = bit5_result_ = bit3_result_ = a_;
parity_overflow_flag_ = 0;
set_parity(a_);
set_logical_flags(0);
break;
#undef set_logical_flags
case MicroOp::CPL:
a_ ^= 0xff;
subtract_flag_ = Flag::Subtract;