public object sub(object a, object b) { RTSRegister regA = a as RTSRegister; if (regA == null) { return(null); } RTSRegister reg = b as RTSRegister; if (reg != null && reg.Vars != null) { foreach (var v in reg.Vars.Keys) { regA.removeVar(v); } } return(regA); }
public object add(object a, object b) { RTSRegister regA = a as RTSRegister; if (a != null && regA == null) { return(null); } RTSRegister reg = b as RTSRegister; if (reg != null && reg.Vars != null) { if (regA == null) { regA = new RTSRegister(); } foreach (var v in reg.Vars.Keys) { regA.addVar(v, reg.Vars[v]); } } return(regA); }