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