pub fn jump_conditional_d16(cpu: &mut CPU, opcode: u8) -> u8 {
    // Read 16-bit jump target address
    let jump_target = cpu.fetch16();

    // Test if the condition matches and if we need to jump
    if opcode_flag_test(opcode, cpu.registers.f) {
        // Jump PC to that target address
        cpu.registers.pc = jump_target;

        16
    } else {
        12
    }
}
/// Jump to a different address using 16-bit data as an address if a given flag status condition
/// matches.
///
/// Takes 16 cycles if condition matches, 12 if it doesn't match.
///
/// # Examples
///
/// ```asm
/// JP NZ $0150 ; IF !Flags::RegisterFlags::ZERO { PC <- 0x0150 }
/// ```
Jump to a different address using 16-bit data as an address if a given flag status condition
matches.

Takes 16 cycles if condition matches, 12 if it doesn't match.
Jump to a different address using 16 - bit data as an address if a given flag status condition matches . Takes 16 cycles if condition matches 12 if it doesn ' t match .
pub fn jump_conditional_d16(cpu: &mut CPU, opcode: u8) -> u8 {
    // Read 16-bit jump target address
    let jump_target = cpu.fetch16();
    // Test if the condition matches and if we need to jump
    if opcode_flag_test(opcode, cpu.registers.f) {
        // Jump PC to that target address
        cpu.registers.pc = jump_target;
        16
    } else {
        12
    }
}
pub fn jump_conditional_d16 ( cpu : & mut CPU , opcode : u8 ) -> u8 { // Read 16-bit jump target address let jump_target = cpu . fetch16 ( ) ; // Test if the condition matches and if we need to jump if opcode_flag_test ( opcode , cpu . registers . f ) { // Jump PC to that target address cpu . registers . pc = jump_target ; 16 } else { 12 } }
Jump to a different address using 16-bit data as an address if a given flag status condition
matches.
Jump to a different address using 16 - bit data as an address if a given flag status condition matches .
cpu
&mut CPU
opcode
u8
cpu
&mut CPU
opcode
u8
examples
None