public static void SwitchPrgTo(RegisterA a) { //Carry.Clear(); Temp[0].Set(A); Bank.And(0b11100000).Or(Temp[0]); GoSub(_SwitchBanks); }
public static void SwitchChrTo(RegisterA a) { Carry.Clear(); A.ROL().ROL().ROL().ROL().ROL(); Temp[0].Set(A); Bank.And(0b00011111).ADC(Temp[0]); GoSub(_SwitchBanks); }
public void Push(RegisterA a) { if (!_isWriting) { throw new Exception("Push can only be used within a LiveQueue.Write() block"); } Values[_indexReg].Set(a); _indexReg.Inc(); }
public RegisterA MoveRight(RegisterA a = null) { if (a == null) { Index.Set(z => z.Add(1)); } else { Index.Set(z => z.Add(a)); } return(A); }
public RegisterA MoveLeft(RegisterA a = null) { if (a == null) { Index.Set(z => z.Subtract(1)); } else { Index.Set(z => z.Subtract(a)); } return(A); }
public RegisterA MoveDown(RegisterA a = null) { if (a == null) { Index.Set(z => z.Add(Width)); } else { Loop.Descend_Post(X.Set(a), _ => { Index.Set(z => z.Add(Width)); }); } return(A); }
public static RegisterA Divide(this RegisterA a, U8 v) { switch ((int)v) { case 2: return(DivideByTwo()); case 4: return(DivideByFour()); case 8: return(DivideByEight()); case 16: return(DivideBySixteen()); case 32: return(DivideByThirtyTwo()); } throw new NotImplementedException(); }
public static RegisterA Multiply(this RegisterA a, U8 n) { switch ((int)n) { case 2: Carry.Clear(); //return A.RotateLeft(); return(A.ASL()); //no need to CLC case 4: return(A.Multiply(2).Multiply(2)); case 8: return(A.Multiply(4).Multiply(2)); case 16: return(A.Multiply(8).Multiply(2)); default: throw new NotImplementedException(); } }
public override void setValue(int value) { this.value |= RegisterA.getNewCorrectValue(value) == 0; }
public static RegisterA Abs(this RegisterA _) { If.True(A.IsNegative, () => A.Xor(0xFF).Add(1)); return(A); }
public static RegisterA Negate(RegisterA _) { A.Xor(0xFF); Carry.Set(); return(A.ADC(0)); }
public static void SwitchTo(RegisterA a) { GoSub(_SwitchBanks); }