pub(super) fn sub8_flags(a: u8, b: u8) -> (u8, Flags) {
    let mut flags = Flags::SUB;
    if (a & 0xf) < (b & 0xf) {
        flags |= Flags::HALFCARRY;
    }
    let (res, carry) = a.overflowing_sub(b);
    flags |= Flags::check_zero(res) | Flags::check_carry(carry);
    (res, flags)
}
/// Perform 8 bit subtraction, returning an un-masked set of flags:
/// * ZERO is set if the result is zero.
/// * SUB is always set.
/// * CARRY is set if the result underflowed (b > a).
/// * HALFCARRY is set if there was a borrow from bit 4 -> 3.
Perform 8 bit subtraction, returning an un-masked set of flags:
ZERO is set if the result is zero.
SUB is always set.
CARRY is set if the result underflowed (b > a).
HALFCARRY is set if there was a borrow from bit 4 -> 3.
Perform 8 bit subtraction returning an un - masked set of flags : ZERO is set if the result is zero . SUB is always set . CARRY is set if the result underflowed ( b > a ) . HALFCARRY is set if there was a borrow from bit 4 - > 3 .
pub(super) fn sub8_flags(a: u8, b: u8) -> (u8, Flags) {
    let mut flags = Flags::SUB;
    if (a & 0xf) < (b & 0xf) {
        flags |= Flags::HALFCARRY;
    }
    let (res, carry) = a.overflowing_sub(b);
    flags |= Flags::check_zero(res) | Flags::check_carry(carry);
    (res, flags)
}
pub ( super ) fn sub8_flags ( a : u8 , b : u8 ) -> ( u8 , Flags ) { let mut flags = Flags :: SUB ; if ( a & 0xf ) < ( b & 0xf ) { flags |= Flags :: HALFCARRY ; } let ( res , carry ) = a . overflowing_sub ( b ) ; flags |= Flags :: check_zero ( res ) | Flags :: check_carry ( carry ) ; ( res , flags ) }
Perform 8 bit subtraction, returning an un-masked set of flags:
 ZERO is set if the result is zero.
Perform 8 bit subtraction returning an un - masked set of flags : ZERO is set if the result is zero .
a
u8
b
u8
a
u8
b
u8