@Test public void shouldStoreMemoryValuePointerByHLRegisterIntoTheDestinyRegister() { z80.set16BitRegisterValue(Register.HL, ANY_16BIT_REGISTER_VALUE); when(mmu.readByte(ANY_16BIT_REGISTER_VALUE)).thenReturn(ANY_MEMORY_BYTE_VALUE); Instruction instruction = new Load8BitHLAddressInto8BitRegister(z80, mmu, ANY_8BIT_DESTINY_REGISTER); instruction.execute(); assertEquals(ANY_MEMORY_BYTE_VALUE, z80.get8BitRegisterValue(ANY_8BIT_DESTINY_REGISTER)); }
@Override public void execute() { int address = z80.get16BitRegisterValue(Register.HL); byte memoryValue = mmu.readByte(address); z80.set8BitRegisterValue(destinyRegister, memoryValue); z80.setLastInstructionExecutionTime(2); }
Load8BitHLAddressInto8BitRegister extends Instruction { @Override public void execute() { int address = z80.get16BitRegisterValue(Register.HL); byte memoryValue = mmu.readByte(address); z80.set8BitRegisterValue(destinyRegister, memoryValue); z80.setLastInstructionExecutionTime(2); } }
Load8BitHLAddressInto8BitRegister extends Instruction { @Override public void execute() { int address = z80.get16BitRegisterValue(Register.HL); byte memoryValue = mmu.readByte(address); z80.set8BitRegisterValue(destinyRegister, memoryValue); z80.setLastInstructionExecutionTime(2); } Load8BitHLAddressInto8BitRegister(GBZ80 z80, MMU mmu, Register destinyRegister); }
Load8BitHLAddressInto8BitRegister extends Instruction { @Override public void execute() { int address = z80.get16BitRegisterValue(Register.HL); byte memoryValue = mmu.readByte(address); z80.set8BitRegisterValue(destinyRegister, memoryValue); z80.setLastInstructionExecutionTime(2); } Load8BitHLAddressInto8BitRegister(GBZ80 z80, MMU mmu, Register destinyRegister); @Override void execute(); }
Load8BitHLAddressInto8BitRegister extends Instruction { @Override public void execute() { int address = z80.get16BitRegisterValue(Register.HL); byte memoryValue = mmu.readByte(address); z80.set8BitRegisterValue(destinyRegister, memoryValue); z80.setLastInstructionExecutionTime(2); } Load8BitHLAddressInto8BitRegister(GBZ80 z80, MMU mmu, Register destinyRegister); @Override void execute();  }