pub fn cp_r8(cpu: &mut CPU, r8: &Reg8) -> u8 {
    let value = cpu.registers.read8(r8);

    cpu.registers.f = alu_cp_8bit(cpu.registers.a, cpu.registers.f, value);

    4
}
/// Subtract 8-bit register from register A, but don't store the result. Zero flag will be set if
/// register A and the 8-bit operand register were equal.
///
/// Takes 4 cycles.
///
/// # Examples
///
/// ```asm
/// CP B ; Flag::RegisterFlags::ZERO true if A == B, Flag::RegisterFlags::CARRY true if A < B
/// ```
Subtract 8-bit register from register A, but don't store the result. Zero flag will be set if
register A and the 8-bit operand register were equal.

Takes 4 cycles.
Subtract 8 - bit register from register A but don ' t store the result . Zero flag will be set if register A and the 8 - bit operand register were equal . Takes 4 cycles .
pub fn cp_r8(cpu: &mut CPU, r8: &Reg8) -> u8 {
    let value = cpu.registers.read8(r8);
    cpu.registers.f = alu_cp_8bit(cpu.registers.a, cpu.registers.f, value);
    4
}
pub fn cp_r8 ( cpu : & mut CPU , r8 : & Reg8 ) -> u8 { let value = cpu . registers . read8 ( r8 ) ; cpu . registers . f = alu_cp_8bit ( cpu . registers . a , cpu . registers . f , value ) ; 4 }
Subtract 8-bit register from register A, but don't store the result.
Subtract 8 - bit register from register A but don ' t store the result .
cpu
&mut CPU
r8
&Reg8
cpu
&mut CPU
r8
&Reg8
examples
```asm
CP B ; Flag::RegisterFlags::ZERO true if A == B, Flag::RegisterFlags::CARRY true if A < B
```
` ` ` asm CP B ; Flag :: RegisterFlags :: ZERO true if A == B Flag :: RegisterFlags :: CARRY true if A < B ` ` `