fn dec8(ctx: &mut impl CpuContext, operand: Operand8) {
    // Dec doesn't set the carry flag.
    const MASK: Flags = Flags::all().difference(Flags::CARRY);

    let val = operand.read(ctx);
    let (res, flags) = sub8_flags(val, 1);
    trace!("Evaluating DEC {} ({} => {})", operand, val, res);
    ctx.cpustate_mut().regs.flags.merge(flags, MASK);
    operand.write(ctx, res);
}
/// Implements 8 bit decrement instruction.
Implements 8 bit decrement instruction.
Implements 8 bit decrement instruction .
fn dec8(ctx: &mut impl CpuContext, operand: Operand8) {
    // Dec doesn't set the carry flag.
    const MASK: Flags = Flags::all().difference(Flags::CARRY);
    let val = operand.read(ctx);
    let (res, flags) = sub8_flags(val, 1);
    trace!("Evaluating DEC {} ({} => {})", operand, val, res);
    ctx.cpustate_mut().regs.flags.merge(flags, MASK);
    operand.write(ctx, res);
}
fn dec8 ( ctx : & mut impl CpuContext , operand : Operand8 ) { // Dec doesn't set the carry flag. const MASK : Flags = Flags :: all ( ) . difference ( Flags :: CARRY ) ; let val = operand . read ( ctx ) ; let ( res , flags ) = sub8_flags ( val , 1 ) ; trace ! ( " " operand val res ) ; ctx . cpustate_mut ( ) . regs . flags . merge ( flags , MASK ) ; operand . write ( ctx , res ) ; }
Implements 8 bit decrement instruction.
Implements 8 bit decrement instruction .
ctx
&mut impl CpuContext
operand
Operand8
ctx
&mut impl CpuContext
operand
Operand8