@Test public void shouldLoadTheProgramCounterAddressMemoryValueIntoTheDestinyRegister() { z80.setProgramCounter(ANY_16BIT_REGISTER_VALUE); when(mmu.readWord(ANY_16BIT_REGISTER_VALUE)).thenReturn(ANY_MEMORY_WORD_VALUE); Instruction instruction = new Load16BitImmPcInto16BitRegister(z80, mmu, ANY_16BIT_DESTINY_REGISTER); instruction.execute(); assertEquals(ANY_MEMORY_WORD_VALUE, z80.get16BitRegisterValue(ANY_16BIT_DESTINY_REGISTER)); }
@Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.set16BitRegisterValue(destinyRegister, value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(3); }
Load16BitImmPcInto16BitRegister extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.set16BitRegisterValue(destinyRegister, value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(3); } }
Load16BitImmPcInto16BitRegister extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.set16BitRegisterValue(destinyRegister, value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(3); } Load16BitImmPcInto16BitRegister(GBZ80 z80, MMU mmu, Register destinyRegister); }
Load16BitImmPcInto16BitRegister extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.set16BitRegisterValue(destinyRegister, value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(3); } Load16BitImmPcInto16BitRegister(GBZ80 z80, MMU mmu, Register destinyRegister); @Override void execute(); }
Load16BitImmPcInto16BitRegister extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.set16BitRegisterValue(destinyRegister, value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(3); } Load16BitImmPcInto16BitRegister(GBZ80 z80, MMU mmu, Register destinyRegister); @Override void execute();  }