Merge pull request #48 from cooprocks123e/bugfix

Modified "RET imm" to add imm + 1 to the SP instead of imm
This commit is contained in:
Simon Fortier
2017-12-27 19:20:42 -05:00
committed by GitHub

View File

@@ -33,7 +33,7 @@ public class RetInstruction extends Instruction {
@Override
public Status execute(int src, Status status) {
cpu.setIp((char) cpu.getMemory().get(cpu.getRegisterSet().get(7))); //Jmp
cpu.getRegisterSet().set(7, cpu.getRegisterSet().get(7) + src); //Inc SP
cpu.getRegisterSet().set(7, cpu.getRegisterSet().get(7) + src + 1); //Inc SP
return status;
}