pub(super) fn add8_flags(a: u8, b: u8) -> (u8, Flags) {
    let mut flags = Flags::empty();
    if (a & 0xf) + (b & 0xf) > 0xf {
        flags |= Flags::HALFCARRY;
    }
    let (res, carry) = a.overflowing_add(b);
    flags |= Flags::check_zero(res) | Flags::check_carry(carry);
    (res, flags)
}
/// Perform 8 bit addition, returning an un-masked set of flags:
/// * ZERO is set if the result is zero.
/// * SUB never set.
/// * CARRY is set if the result overflowed.
/// * HALFCARRY is set if there was an overflow from bit 3 -> 4.
Perform 8 bit addition, returning an un-masked set of flags:
ZERO is set if the result is zero.
SUB never set.
CARRY is set if the result overflowed.
HALFCARRY is set if there was an overflow from bit 3 -> 4.
Perform 8 bit addition returning an un - masked set of flags : ZERO is set if the result is zero . SUB never set . CARRY is set if the result overflowed . HALFCARRY is set if there was an overflow from bit 3 - > 4 .
pub(super) fn add8_flags(a: u8, b: u8) -> (u8, Flags) {
    let mut flags = Flags::empty();
    if (a & 0xf) + (b & 0xf) > 0xf {
        flags |= Flags::HALFCARRY;
    }
    let (res, carry) = a.overflowing_add(b);
    flags |= Flags::check_zero(res) | Flags::check_carry(carry);
    (res, flags)
}
pub ( super ) fn add8_flags ( a : u8 , b : u8 ) -> ( u8 , Flags ) { let mut flags = Flags :: empty ( ) ; if ( a & 0xf ) + ( b & 0xf ) > 0xf { flags |= Flags :: HALFCARRY ; } let ( res , carry ) = a . overflowing_add ( b ) ; flags |= Flags :: check_zero ( res ) | Flags :: check_carry ( carry ) ; ( res , flags ) }
Perform 8 bit addition, returning an un-masked set of flags:
 ZERO is set if the result is zero.
Perform 8 bit addition returning an un - masked set of flags : ZERO is set if the result is zero .
a
u8
b
u8
a
u8
b
u8