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:
parent
743eac8c55
commit
5a4d448cc1
@ -167,7 +167,7 @@ class FUSETests: XCTestCase {
|
|||||||
|
|
||||||
let name = itemDictionary["name"] as! String
|
let name = itemDictionary["name"] as! String
|
||||||
|
|
||||||
// if name != "ed40" {
|
// if name != "a0" {
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
@ -703,30 +703,30 @@ template <class T> class Processor: public MicroOpScheduler<MicroOp> {
|
|||||||
|
|
||||||
#pragma mark - Logical
|
#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:
|
case MicroOp::And:
|
||||||
a_ &= *(uint8_t *)operation->source;
|
a_ &= *(uint8_t *)operation->source;
|
||||||
half_carry_flag_ = Flag::HalfCarry;
|
set_logical_flags(Flag::HalfCarry);
|
||||||
sign_result_ = zero_result_ = bit5_result_ = bit3_result_ = a_;
|
|
||||||
parity_overflow_flag_ = 0;
|
|
||||||
set_parity(a_);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MicroOp::Or:
|
case MicroOp::Or:
|
||||||
a_ |= *(uint8_t *)operation->source;
|
a_ |= *(uint8_t *)operation->source;
|
||||||
half_carry_flag_ = 0;
|
set_logical_flags(0);
|
||||||
sign_result_ = zero_result_ = bit5_result_ = bit3_result_ = a_;
|
|
||||||
parity_overflow_flag_ = 0;
|
|
||||||
set_parity(a_);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MicroOp::Xor:
|
case MicroOp::Xor:
|
||||||
a_ ^= *(uint8_t *)operation->source;
|
a_ ^= *(uint8_t *)operation->source;
|
||||||
half_carry_flag_ = 0;
|
set_logical_flags(0);
|
||||||
sign_result_ = zero_result_ = bit5_result_ = bit3_result_ = a_;
|
|
||||||
parity_overflow_flag_ = 0;
|
|
||||||
set_parity(a_);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#undef set_logical_flags
|
||||||
|
|
||||||
case MicroOp::CPL:
|
case MicroOp::CPL:
|
||||||
a_ ^= 0xff;
|
a_ ^= 0xff;
|
||||||
subtract_flag_ = Flag::Subtract;
|
subtract_flag_ = Flag::Subtract;
|
||||||
|
Loading…
Reference in New Issue
Block a user