mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 08:49:37 +00:00
Implement, test AND.
This commit is contained in:
parent
0a0d53103d
commit
f618ca6046
@ -200,6 +200,23 @@ void add(IntT &destination, IntT source, Status &status) {
|
||||
destination = result;
|
||||
}
|
||||
|
||||
template <typename IntT>
|
||||
void and_(IntT &destination, IntT source, Status &status) {
|
||||
/*
|
||||
DEST ← DEST AND SRC;
|
||||
*/
|
||||
/*
|
||||
The OF and CF flags are cleared; the SF, ZF, and PF flags are set according to the result.
|
||||
The state of the AF flag is undefined.
|
||||
*/
|
||||
destination &= source;
|
||||
|
||||
status.overflow = 0;
|
||||
status.carry = 0;
|
||||
status.sign = destination & top_bit<IntT>();
|
||||
status.zero = status.parity = destination;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template <Model model, DataSize data_size, typename InstructionT, typename RegistersT, typename MemoryT>
|
||||
@ -368,6 +385,8 @@ template <
|
||||
|
||||
case Operation::ADC: Primitive::adc(destination(), source(), status); break;
|
||||
case Operation::ADD: Primitive::add(destination(), source(), status); break;
|
||||
|
||||
case Operation::AND: Primitive::and_(destination(), source(), status); break;
|
||||
}
|
||||
|
||||
// Write to memory if required to complete this operation.
|
||||
|
@ -269,6 +269,10 @@ struct FailedExecution {
|
||||
@"00.json.gz", @"01.json.gz", @"02.json.gz", @"03.json.gz", @"04.json.gz", @"05.json.gz",
|
||||
@"80.0.json.gz", @"81.0.json.gz", @"83.0.json.gz",
|
||||
|
||||
// AND
|
||||
@"20.json.gz", @"21.json.gz", @"22.json.gz", @"23.json.gz", @"24.json.gz", @"25.json.gz",
|
||||
@"80.4.json.gz", @"81.4.json.gz", @"83.4.json.gz",
|
||||
|
||||
@"37.json.gz", // AAA
|
||||
@"3F.json.gz", // AAS
|
||||
@"D4.json.gz", // AAM
|
||||
|
Loading…
Reference in New Issue
Block a user