@Test(expected = IllegalArgumentException.class) public void shouldNotAccept8BitRegistersAsDestinyRegister() { Instruction instruction = new Pop16BitRegister(z80, mmu, ANY_8BIT_DESTINY_REGISTER); instruction.execute(); }
@Override public void execute() { if (destinyRegister == Register.AF) { int registerValue = popTwice(); z80.set16BitRegisterValue(destinyRegister, registerValue & 0xFF00); } else { int registerValue = popTwice(); z80.set16BitRegisterValue(destinyRegister, registerValue); } z80.setLastInstructionExecutionTime(3); }
Pop16BitRegister extends Instruction { @Override public void execute() { if (destinyRegister == Register.AF) { int registerValue = popTwice(); z80.set16BitRegisterValue(destinyRegister, registerValue & 0xFF00); } else { int registerValue = popTwice(); z80.set16BitRegisterValue(destinyRegister, registerValue); } z80.setLastInstructionExecutionTime(3); } }
Pop16BitRegister extends Instruction { @Override public void execute() { if (destinyRegister == Register.AF) { int registerValue = popTwice(); z80.set16BitRegisterValue(destinyRegister, registerValue & 0xFF00); } else { int registerValue = popTwice(); z80.set16BitRegisterValue(destinyRegister, registerValue); } z80.setLastInstructionExecutionTime(3); } Pop16BitRegister(GBZ80 z80, MMU mmu, Register destinyRegister); }
Pop16BitRegister extends Instruction { @Override public void execute() { if (destinyRegister == Register.AF) { int registerValue = popTwice(); z80.set16BitRegisterValue(destinyRegister, registerValue & 0xFF00); } else { int registerValue = popTwice(); z80.set16BitRegisterValue(destinyRegister, registerValue); } z80.setLastInstructionExecutionTime(3); } Pop16BitRegister(GBZ80 z80, MMU mmu, Register destinyRegister); @Override void execute(); }
Pop16BitRegister extends Instruction { @Override public void execute() { if (destinyRegister == Register.AF) { int registerValue = popTwice(); z80.set16BitRegisterValue(destinyRegister, registerValue & 0xFF00); } else { int registerValue = popTwice(); z80.set16BitRegisterValue(destinyRegister, registerValue); } z80.setLastInstructionExecutionTime(3); } Pop16BitRegister(GBZ80 z80, MMU mmu, Register destinyRegister); @Override void execute();  }