@Test public void shouldIncrementProgramCounterTwice() { z80.setProgramCounter(ANY_16BIT_REGISTER_VALUE); Instruction instruction = new LoadSPIntoImmPC(z80, mmu); instruction.execute(); assertEquals(ANY_16BIT_REGISTER_VALUE + 2, z80.getProgramCounter()); }
@Override public void execute() { int stackPointer = z80.getStackPointer(); int programCounter = z80.getProgramCounter(); mmu.writeWord(programCounter, stackPointer); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); }
LoadSPIntoImmPC extends Instruction { @Override public void execute() { int stackPointer = z80.getStackPointer(); int programCounter = z80.getProgramCounter(); mmu.writeWord(programCounter, stackPointer); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } }
LoadSPIntoImmPC extends Instruction { @Override public void execute() { int stackPointer = z80.getStackPointer(); int programCounter = z80.getProgramCounter(); mmu.writeWord(programCounter, stackPointer); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } LoadSPIntoImmPC(GBZ80 z80, MMU mmu); }
LoadSPIntoImmPC extends Instruction { @Override public void execute() { int stackPointer = z80.getStackPointer(); int programCounter = z80.getProgramCounter(); mmu.writeWord(programCounter, stackPointer); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } LoadSPIntoImmPC(GBZ80 z80, MMU mmu); @Override void execute(); }
LoadSPIntoImmPC extends Instruction { @Override public void execute() { int stackPointer = z80.getStackPointer(); int programCounter = z80.getProgramCounter(); mmu.writeWord(programCounter, stackPointer); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } LoadSPIntoImmPC(GBZ80 z80, MMU mmu); @Override void execute();  }