public int Execute(CpuState cpuState, IMemory memory) { var low = cpuState.PopStack(memory); var high = cpuState.PopStack(memory); cpuState.Pc = (ushort)((high << 8) | low); ++cpuState.Pc; return 6; }
public int Execute(CpuState cpuState, IMemory memory) { var breakSet = cpuState.IsFlagSet(CpuState.Flags.Break); cpuState.StatusRegister = cpuState.PopStack(memory); cpuState.SetFlag(CpuState.Flags.Break, breakSet); cpuState.StatusRegister |= 1 << 5; var low = cpuState.PopStack(memory); var high = cpuState.PopStack(memory); cpuState.Pc = (ushort)((high << 8) | low); return 6; }
protected override void InternalExecute(CpuState cpuState, IMemory memory, byte arg, Action<byte> write, ref int cycles) { cpuState.A = cpuState.PopStack(memory); cpuState.SetNegativeFlag(cpuState.A); cpuState.SetZeroFlag(cpuState.A); cycles = 4; }
protected override void InternalExecute(CpuState cpuState, IMemory memory, byte arg, Action<byte> write, ref int cycles) { var breakSet = cpuState.IsFlagSet(CpuState.Flags.Break); cpuState.StatusRegister = cpuState.PopStack(memory); cpuState.StatusRegister |= 1 << 5; cpuState.SetFlag(CpuState.Flags.Break, breakSet); cycles = 4; }