pub fn complement(cpu: &mut CPU) -> u8 {
    let value = cpu.registers.a;
    cpu.registers.a = !value;

    cpu.registers.f.set(Flags::SUBTRACT, true);
    cpu.registers.f.set(Flags::HALF_CARRY, true);

    4
}
/// Complement A register, flipping all bits.
///
/// Takes 4 cycles.
///
/// # Examples
///
/// ```asm
/// CPL
/// ```
Complement A register, flipping all bits.
Takes 4 cycles.
Complement A register flipping all bits . Takes 4 cycles .
pub fn complement(cpu: &mut CPU) -> u8 {
    let value = cpu.registers.a;
    cpu.registers.a = !value;
    cpu.registers.f.set(Flags::SUBTRACT, true);
    cpu.registers.f.set(Flags::HALF_CARRY, true);
    4
}
pub fn complement ( cpu : & mut CPU ) -> u8 { let value = cpu . registers . a ; cpu . registers . a = ! value ; cpu . registers . f . set ( Flags :: SUBTRACT , true ) ; cpu . registers . f . set ( Flags :: HALF_CARRY , true ) ; 4 }
Complement A register, flipping all bits.
Complement A register flipping all bits .
cpu
&mut CPU
cpu
&mut CPU
examples
None