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

    let (swapped_value, flags) = alu_swap_8bit(value, cpu.registers.f);
    cpu.registers.write8(r8, swapped_value);
    cpu.registers.f = flags;

    8
}
/// Swap high and low bits of an 8-bit register.
///
/// Takes 8 cycles
///
/// # Examples
///
/// ```asm
/// SWAP B  ; B = (B & 0x0F << 4) & (B & 0xF0 >> 4)
/// ```
Swap high and low bits of an 8-bit register.
Takes 8 cycles
Swap high and low bits of an 8 - bit register . Takes 8 cycles
pub fn swap_r8(cpu: &mut CPU, r8: &Reg8) -> u8 {
    let value = cpu.registers.read8(r8);
    let (swapped_value, flags) = alu_swap_8bit(value, cpu.registers.f);
    cpu.registers.write8(r8, swapped_value);
    cpu.registers.f = flags;
    8
}
pub fn swap_r8 ( cpu : & mut CPU , r8 : & Reg8 ) -> u8 { let value = cpu . registers . read8 ( r8 ) ; let ( swapped_value , flags ) = alu_swap_8bit ( value , cpu . registers . f ) ; cpu . registers . write8 ( r8 , swapped_value ) ; cpu . registers . f = flags ; 8 }
Swap high and low bits of an 8-bit register.
Swap high and low bits of an 8 - bit register .
cpu
&mut CPU
r8
&Reg8
cpu
&mut CPU
r8
&Reg8
examples
None