Esempio n. 1
0
 public Condition NotEquals(U8 v)
 {
     if (v != 0 || Flags.Zero.LastReg != this)
     {
         CPU6502.CPY(v);
     }
     return(Condition.NotEqualsZero);
 }
Esempio n. 2
0
 public static void Init()
 {
     //Copy funcs to those RAM chunks
     Y.Set(0);
     Loop.Do_old(_ => {
         AddrWriteVerify[Y].Set(A.Set(LabelFor(_WriteVerify)[Y]));
         Y.Increment();
         CPU6502.CPY(_lenTotalRamLength);
     }).While(() => Y.NotEquals(0));
 }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="start">Inclusive</param>
        /// <param name="length">Exclusive</param>
        /// <param name="block"></param>
        public static void Repeat(IndexingRegister reg, int length, Action <LoopLabels> block)
        {
            var labels = new LoopLabels();
            //X.Reset();
            var lblStart = Labels.New();

            Context.Write(lblStart);
            Context.New(() => {
                var before = reg.State.Hash;
                block.Invoke(labels);
                reg.State.Verify(before);
                Context.Write(labels.ContinueLabel);
                reg.Inc();
                if (Context.StartBranchable)
                {
                    if (length < 256)
                    {
                        if (reg is RegisterX)
                        {
                            CPU6502.CPX((U8)length);
                        }
                        else
                        {
                            CPU6502.CPY((U8)length);
                        }
                    }
                    CPU6502.BNE(Context.Start);
                }
                else
                {
                    //TODO: verify this works!
                    if (length < 256)
                    {
                        if (reg is RegisterX)
                        {
                            CPU6502.CPX((U8)length);
                        }
                        else
                        {
                            CPU6502.CPY((U8)length);
                        }
                    }
                    CPU6502.BEQ(3);
                    GoTo(lblStart);
                }
            });
            Context.Write(labels.BreakLabel);
        }
Esempio n. 4
0
 public Condition LessThan(IOperand o)
 {
     CPU6502.CPY(o);
     return(Condition.IsLessThan);
 }
Esempio n. 5
0
 public Condition NotEquals(IOperand addr)
 {
     CPU6502.CPY(addr);
     return(Condition.NotEqualsZero);
 }