pub fn load_reg_a_high_mem_d8(cpu: &mut CPU) -> u8 {
    // Address is offset plus 8-bit data
    let addr = 0xFF00 + u16::from(cpu.fetch8());

    // Read 8-bit value
    let value = cpu.mmu.read8(addr);

    cpu.registers.a = value;

    12
}
/// Load the A register with a value from memory, using an 8-bit value added to 0xFF00 as an
/// address.
///
/// Takes 12 cycles.
///
/// # Examples
///
/// ```asm
/// LDH A, ($DA) ; A <- memory[0xFFDA]
/// ```
Load the A register with a value from memory, using an 8-bit value added to 0xFF00 as an
address.

Takes 12 cycles.
Load the A register with a value from memory using an 8 - bit value added to 0xFF00 as an address . Takes 12 cycles .
pub fn load_reg_a_high_mem_d8(cpu: &mut CPU) -> u8 {
    // Address is offset plus 8-bit data
    let addr = 0xFF00 + u16::from(cpu.fetch8());
    // Read 8-bit value
    let value = cpu.mmu.read8(addr);
    cpu.registers.a = value;
    12
}
pub fn load_reg_a_high_mem_d8 ( cpu : & mut CPU ) -> u8 { // Address is offset plus 8-bit data let addr = 0xFF00 + u16 :: from ( cpu . fetch8 ( ) ) ; // Read 8-bit value let value = cpu . mmu . read8 ( addr ) ; cpu . registers . a = value ; 12 }
Load the A register with a value from memory, using an 8-bit value added to 0xFF00 as an
address.
Load the A register with a value from memory using an 8 - bit value added to 0xFF00 as an address .
cpu
&mut CPU
cpu
&mut CPU
examples
None