コード例 #1
0
 public void OpLoad(Register Dest, int value)
 {
     Dest.Value = value;
     cpu.Flags.SetNZ(Dest);
 }
コード例 #2
0
 /// <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)));
 }
コード例 #3
0
        /// <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));
        }
コード例 #4
0
ファイル: Flags.cs プロジェクト: bzuidgeest/FoenixIDE
 public void SetNZ(Register Reg)
 {
     Zero = Reg.Value == 0;
     SetN(Reg);
 }
コード例 #5
0
 private int GetAbsoluteLongIndexed(int Address, Register Index)
 {
     return((cpu.A.Width == 1) ? cpu.Memory.ReadByte(Address + Index.Value) : cpu.Memory.ReadWord(Address + Index.Value));
 }
コード例 #6
0
ファイル: Flags.cs プロジェクト: bzuidgeest/FoenixIDE
 public void SetZ(Register X)
 {
     Zero = X.Value == 0;
 }
コード例 #7
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);
 }
コード例 #8
0
 public void PullInto(Register Register)
 {
     Register.Value = Pull(Register.Width);
 }
コード例 #9
0
 public void Push(Register Reg)
 {
     Push(Reg.Value, Reg.Width);
 }
コード例 #10
0
 public void Push(Register Reg, int Offset)
 {
     Push(Reg.Value + Offset, Reg.Width);
 }