public void OpLoad(Register Dest, int value) { Dest.Value = value; cpu.Flags.SetNZ(Dest); }
/// <summary> /// Read memory at specified address. Optionally use bank register /// to select the relevant bank. /// </summary> /// <param name="Address"></param> /// <param name="bank"></param> /// <returns></returns> private int GetAbsolute(int Address, Register bank, int bytes) { return((bytes == 1) ? cpu.Memory.ReadByte(bank.GetLongAddress(Address)) : cpu.Memory.ReadWord(bank.GetLongAddress(Address))); }
/// <summary> /// Returns a pointer from memory. /// JMP ($xxxx) reads a two-byte address from bank 0. It jumps to that address in the current /// program bank (meaning it adds PBR to get the final address.) /// </summary> /// <param name="Address">Address of pointer. Final value is address pointer references.</param> /// <param name="block"></param> /// <returns></returns> public int GetAbsoluteIndirectAddress(int Address, Register bank) { int ptr = cpu.Memory.ReadWord(Address); return(bank.GetLongAddress(ptr)); }
public void SetNZ(Register Reg) { Zero = Reg.Value == 0; SetN(Reg); }
private int GetAbsoluteLongIndexed(int Address, Register Index) { return((cpu.A.Width == 1) ? cpu.Memory.ReadByte(Address + Index.Value) : cpu.Memory.ReadWord(Address + Index.Value)); }
public void SetZ(Register X) { Zero = X.Value == 0; }
/// <summary> /// Get a direct page address. Offsets the register's value by 8 bits, then adds /// the supplied address. /// </summary> /// <param name="address"></param> /// <returns></returns> public int GetLongAdddress(Register index) { return((this.Value << 8) | index.Value); }
public void PullInto(Register Register) { Register.Value = Pull(Register.Width); }
public void Push(Register Reg) { Push(Reg.Value, Reg.Width); }
public void Push(Register Reg, int Offset) { Push(Reg.Value + Offset, Reg.Width); }