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

    let (shifted_value, flags) = alu_shift_right(value, cpu.registers.f, reset_high_bit);
    cpu.registers.write8(r8, shifted_value);
    cpu.registers.f = flags;

    8
}
/// Shift an 8-bit register to the right.
///
/// If reset_high_bit is true the highest bit after the shift will always be reset.
/// If it is not true the highest bit after the shift will be left as its original value.
///
/// Takes 8 cycles
///
/// # Examples
///
/// ```asm
/// SRA B  ; Shift B right through the carry flag (sets Flag::RegisterFlags::ZERO if rotated result == 0)
/// SRL B  ; Shift B right through the carry flag (sets Flag::RegisterFlags::ZERO if rotated result == 0)
/// ```
Shift an 8-bit register to the right.
If reset_high_bit is true the highest bit after the shift will always be reset.
If it is not true the highest bit after the shift will be left as its original value.

Takes 8 cycles
Shift an 8 - bit register to the right . If reset_high_bit is true the highest bit after the shift will always be reset . If it is not true the highest bit after the shift will be left as its original value . Takes 8 cycles
pub fn shift_right_r8(cpu: &mut CPU, r8: &Reg8, reset_high_bit: bool) -> u8 {
    let value = cpu.registers.read8(r8);
    let (shifted_value, flags) = alu_shift_right(value, cpu.registers.f, reset_high_bit);
    cpu.registers.write8(r8, shifted_value);
    cpu.registers.f = flags;
    8
}
pub fn shift_right_r8 ( cpu : & mut CPU , r8 : & Reg8 , reset_high_bit : bool ) -> u8 { let value = cpu . registers . read8 ( r8 ) ; let ( shifted_value , flags ) = alu_shift_right ( value , cpu . registers . f , reset_high_bit ) ; cpu . registers . write8 ( r8 , shifted_value ) ; cpu . registers . f = flags ; 8 }
Shift an 8-bit register to the right.
Shift an 8 - bit register to the right .
cpu
&mut CPU
r8
&Reg8
reset_high_bit
bool
cpu
&mut CPU
r8
&Reg8
reset_high_bit
bool
examples
```asm
SRA B  ; Shift B right through the carry flag (sets Flag::RegisterFlags::ZERO if rotated result == 0)
SRL B  ; Shift B right through the carry flag (sets Flag::RegisterFlags::ZERO if rotated result == 0)
```
` ` ` asm SRA B ; Shift B right through the carry flag ( sets Flag :: RegisterFlags :: ZERO if rotated result == 0 ) SRL B ; Shift B right through the carry flag ( sets Flag :: RegisterFlags :: ZERO if rotated result == 0 ) ` ` `