@Test public void shouldLoadTheContentOfTheMemoryPointedByPCIntoTheStackPointer() { z80.setProgramCounter(ANY_PROGRAM_COUNTER); when(mmu.readWord(ANY_PROGRAM_COUNTER)).thenReturn(ANY_16BIT_REGISTER_VALUE); Instruction instruction = new Load16BitImmPcIntoStackPointer(z80, mmu); instruction.execute(); assertEquals(ANY_16BIT_REGISTER_VALUE, z80.getStackPointer()); }
@Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.setStackPointer(value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); }
Load16BitImmPcIntoStackPointer extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.setStackPointer(value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } }
Load16BitImmPcIntoStackPointer extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.setStackPointer(value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } Load16BitImmPcIntoStackPointer(GBZ80 z80, MMU mmu); }
Load16BitImmPcIntoStackPointer extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.setStackPointer(value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } Load16BitImmPcIntoStackPointer(GBZ80 z80, MMU mmu); @Override void execute(); }
Load16BitImmPcIntoStackPointer extends Instruction { @Override public void execute() { int programCounter = z80.getProgramCounter(); int value = mmu.readWord(programCounter); z80.setStackPointer(value); z80.incrementProgramCounterTwice(); z80.setLastInstructionExecutionTime(5); } Load16BitImmPcIntoStackPointer(GBZ80 z80, MMU mmu); @Override void execute();  }