@Test public void shouldStoreProgramCounterAddressMemoryValueIntoHlAddress() { z80.setProgramCounter(ANY_16BIT_REGISTER_VALUE); when(mmu.readByte(ANY_16BIT_REGISTER_VALUE)).thenReturn(ANY_MEMORY_BYTE_VALUE); Instruction instruction = new Load8BitImmPCIntoHLAddress(z80, mmu); instruction.execute(); verify(mmu).writeByte(z80.get16BitRegisterValue(Register.HL), ANY_MEMORY_BYTE_VALUE); }
@Override public void execute() { byte value = mmu.readByte(z80.getProgramCounter()); int address = z80.get16BitRegisterValue(Register.HL); mmu.writeByte(address, value); z80.incrementProgramCounter(); z80.setLastInstructionExecutionTime(3); }
Load8BitImmPCIntoHLAddress extends Instruction { @Override public void execute() { byte value = mmu.readByte(z80.getProgramCounter()); int address = z80.get16BitRegisterValue(Register.HL); mmu.writeByte(address, value); z80.incrementProgramCounter(); z80.setLastInstructionExecutionTime(3); } }
Load8BitImmPCIntoHLAddress extends Instruction { @Override public void execute() { byte value = mmu.readByte(z80.getProgramCounter()); int address = z80.get16BitRegisterValue(Register.HL); mmu.writeByte(address, value); z80.incrementProgramCounter(); z80.setLastInstructionExecutionTime(3); } Load8BitImmPCIntoHLAddress(GBZ80 z80, MMU mmu); }
Load8BitImmPCIntoHLAddress extends Instruction { @Override public void execute() { byte value = mmu.readByte(z80.getProgramCounter()); int address = z80.get16BitRegisterValue(Register.HL); mmu.writeByte(address, value); z80.incrementProgramCounter(); z80.setLastInstructionExecutionTime(3); } Load8BitImmPCIntoHLAddress(GBZ80 z80, MMU mmu); @Override void execute(); }
Load8BitImmPCIntoHLAddress extends Instruction { @Override public void execute() { byte value = mmu.readByte(z80.getProgramCounter()); int address = z80.get16BitRegisterValue(Register.HL); mmu.writeByte(address, value); z80.incrementProgramCounter(); z80.setLastInstructionExecutionTime(3); } Load8BitImmPCIntoHLAddress(GBZ80 z80, MMU mmu); @Override void execute();  }