public Branch execute(Processor cpu) { Reg op1 = cpu.regs[op1Index]; cpu.of = cpu.af = cpu.cf = false; cpu.flagResult = (byte) (op1.get8() ^ op2.get8(cpu)); op1.set8((byte) cpu.flagResult); cpu.flagStatus = SZP; return Branch.None; }
public Branch execute(Processor cpu) { Reg op1 = cpu.regs[op1Index]; Reg op2 = cpu.regs[op2Index]; cpu.flagOp1 = (byte) op1.get8(); cpu.flagOp2 = (byte) op2.get8(); cpu.flagResult = (byte) (cpu.flagOp1 + cpu.flagOp2); op1.set8((byte) cpu.flagResult); cpu.flagIns = UCodes.ADD8; cpu.flagStatus = OSZAPC; return Branch.None; }
public Branch execute(Processor cpu) { Reg op1 = cpu.regs[op1Index]; Reg op2 = cpu.regs[op2Index]; boolean incf = cpu.cf(); cpu.flagOp1 = op1.get8(); cpu.flagOp2 = op2.get8(); cpu.flagResult = (byte) (cpu.flagOp1 + cpu.flagOp2 + (incf ? 1 : 0)); op1.set8((byte) cpu.flagResult); cpu.flagIns = UCodes.ADC8; cpu.flagStatus = OSZAPC; return Branch.None; }