pub fn alu_rotate_left(d8: u8, flags: Flags, through_carry: bool) -> (u8, Flags) {
    let cy = if flags.contains(Flags::CARRY) { 1 } else { 0 };

    let high_bit = (d8 & 0b1000_0000) >> 7;
    let new_low_bit = if through_carry { cy } else { high_bit };
    let rotated_value = (d8 << 1) | new_low_bit;

    let mut new_flags = flags;
    new_flags.set(Flags::ZERO, rotated_value == 0);
    new_flags.set(Flags::SUBTRACT, false);
    new_flags.set(Flags::HALF_CARRY, false);
    new_flags.set(Flags::CARRY, high_bit != 0);

    (rotated_value, new_flags)
}
/// Rotate an 8-bit register to the left.
///
/// If through_carry is true then the high bit will go into the Flags::CARRY flag and the old value of the
/// Flags::CARRY flag will become the new low bit.
/// If it is not true the high bit will become the low bit as well as going into the Flags::CARRY flag.
///
Rotate an 8-bit register to the left.
If through_carry is true then the high bit will go into the Flags::CARRY flag and the old value of the
Flags::CARRY flag will become the new low bit.
If it is not true the high bit will become the low bit as well as going into the Flags::CARRY flag.
Rotate an 8 - bit register to the left . If through_carry is true then the high bit will go into the Flags :: CARRY flag and the old value of the Flags :: CARRY flag will become the new low bit . If it is not true the high bit will become the low bit as well as going into the Flags :: CARRY flag .
pub fn alu_rotate_left(d8: u8, flags: Flags, through_carry: bool) -> (u8, Flags) {
    let cy = if flags.contains(Flags::CARRY) { 1 } else { 0 };
    let high_bit = (d8 & 0b1000_0000) >> 7;
    let new_low_bit = if through_carry { cy } else { high_bit };
    let rotated_value = (d8 << 1) | new_low_bit;
    let mut new_flags = flags;
    new_flags.set(Flags::ZERO, rotated_value == 0);
    new_flags.set(Flags::SUBTRACT, false);
    new_flags.set(Flags::HALF_CARRY, false);
    new_flags.set(Flags::CARRY, high_bit != 0);
    (rotated_value, new_flags)
}
pub fn alu_rotate_left ( d8 : u8 , flags : Flags , through_carry : bool ) -> ( u8 , Flags ) { let cy = if flags . contains ( Flags :: CARRY ) { 1 } else { 0 } ; let high_bit = ( d8 & 0b1000_0000 ) >> 7 ; let new_low_bit = if through_carry { cy } else { high_bit } ; let rotated_value = ( d8 << 1 ) | new_low_bit ; let mut new_flags = flags ; new_flags . set ( Flags :: ZERO , rotated_value == 0 ) ; new_flags . set ( Flags :: SUBTRACT , false ) ; new_flags . set ( Flags :: HALF_CARRY , false ) ; new_flags . set ( Flags :: CARRY , high_bit != 0 ) ; ( rotated_value , new_flags ) }
Rotate an 8-bit register to the left.
Rotate an 8 - bit register to the left .
d8
u8
flags
Flags
through_carry
bool
d8
u8
flags
Flags
through_carry
bool