@Test public void shouldIncrementProgramCounterTwice() { z80.setProgramCounter(ANY_16BIT_REGISTER_VALUE); Instruction instruction = new Load8BitImmPCWordIntoA(z80, mmu); instruction.execute(); assertEquals(ANY_16BIT_REGISTER_VALUE + 2, z80.getProgramCounter()); }
@Override public void execute() { int programCounter = z80.getProgramCounter(); int address = mmu.readWord(programCounter); byte value = mmu.readByte(address); z80.set8BitRegisterValue(Register.A, value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(4); }
Load8BitImmPCWordIntoA extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int address = mmu.readWord(programCounter); byte value = mmu.readByte(address); z80.set8BitRegisterValue(Register.A, value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(4); } }
Load8BitImmPCWordIntoA extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int address = mmu.readWord(programCounter); byte value = mmu.readByte(address); z80.set8BitRegisterValue(Register.A, value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(4); } Load8BitImmPCWordIntoA(GBZ80 z80, MMU mmu); }
Load8BitImmPCWordIntoA extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int address = mmu.readWord(programCounter); byte value = mmu.readByte(address); z80.set8BitRegisterValue(Register.A, value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(4); } Load8BitImmPCWordIntoA(GBZ80 z80, MMU mmu); @Override void execute(); }
Load8BitImmPCWordIntoA extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int address = mmu.readWord(programCounter); byte value = mmu.readByte(address); z80.set8BitRegisterValue(Register.A, value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(4); } Load8BitImmPCWordIntoA(GBZ80 z80, MMU mmu); @Override void execute();  }