@Test public void shouldPushTheValueOfTheSourceRegisterIntoTheMemoryPointedByTheStackPointer() { z80.set16BitRegisterValue(ANY_16BIT_SOURCE_REGISTER, ANY_16BIT_REGISTER_VALUE); z80.setStackPointer(ANY_STACK_POINTER_VALUE); Instruction instruction = new Push16BitRegister(z80, mmu, ANY_16BIT_SOURCE_REGISTER); instruction.execute(); byte firstPart = (ANY_16BIT_REGISTER_VALUE >> 8) & 0xFF; verify(mmu).writeByte(ANY_STACK_POINTER_VALUE - 1, firstPart); byte secondPart = ANY_16BIT_REGISTER_VALUE & 0xFF; verify(mmu).writeByte(ANY_STACK_POINTER_VALUE - 2, secondPart); }
@Override public void execute() { int registerValue = z80.get16BitRegisterValue(sourceRegister); pushTwice(registerValue); z80.setLastInstructionExecutionTime(4); }
Push16BitRegister extends Instruction { @Override public void execute() { int registerValue = z80.get16BitRegisterValue(sourceRegister); pushTwice(registerValue); z80.setLastInstructionExecutionTime(4); } }
Push16BitRegister extends Instruction { @Override public void execute() { int registerValue = z80.get16BitRegisterValue(sourceRegister); pushTwice(registerValue); z80.setLastInstructionExecutionTime(4); } Push16BitRegister(GBZ80 z80, MMU mmu, Register sourceRegister); }
Push16BitRegister extends Instruction { @Override public void execute() { int registerValue = z80.get16BitRegisterValue(sourceRegister); pushTwice(registerValue); z80.setLastInstructionExecutionTime(4); } Push16BitRegister(GBZ80 z80, MMU mmu, Register sourceRegister); @Override void execute(); }
Push16BitRegister extends Instruction { @Override public void execute() { int registerValue = z80.get16BitRegisterValue(sourceRegister); pushTwice(registerValue); z80.setLastInstructionExecutionTime(4); } Push16BitRegister(GBZ80 z80, MMU mmu, Register sourceRegister); @Override void execute();  }