예제 #1
0
 public Condition NotEquals(U8 v)
 {
     if (v != 0 || Flags.Zero.LastReg != this)
     {
         CPU6502.CPY(v);
     }
     return(Condition.NotEqualsZero);
 }
예제 #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));
 }
예제 #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);
        }
예제 #4
0
 public Condition LessThan(IOperand o)
 {
     CPU6502.CPY(o);
     return(Condition.IsLessThan);
 }
예제 #5
0
 public Condition NotEquals(IOperand addr)
 {
     CPU6502.CPY(addr);
     return(Condition.NotEqualsZero);
 }