private void RewriteBcc(ConditionCode cc, FlagM flags) { emitter.Branch( emitter.Test(cc, orw.FlagGroup(flags)), ((M68kAddressOperand) di.op1).Address, RtlClass.ConditionalTransfer); }
private Identifier Grf(FlagM grf) { return frame.EnsureFlagGroup( (uint) grf, arch.GrfToString((uint) grf), (grf & (grf - 1)) != 0 ? PrimitiveType.Byte : PrimitiveType.Bool); }
private void RewriteBxx(Pdp11Instruction instr, ConditionCode cc, FlagM flags) { this.rtlCluster.Class = RtlClass.Transfer; m.Branch( m.Test(cc, frame.EnsureFlagGroup(arch.GetFlagGroup((uint)flags))), ((AddressOperand)instr.op1).Address, RtlClass.ConditionalTransfer); }
private void RewriteDbcc(ConditionCode cc, FlagM flags) { if (cc != ConditionCode.None) { emitter.Branch( emitter.Test(cc, orw.FlagGroup(flags)), di.Address + 4, RtlClass.ConditionalTransfer); } var src = orw.RewriteSrc(di.op1, di.Address); emitter.Assign(src, emitter.ISub(src, 1)); emitter.Branch( emitter.Ne(src, emitter.Int32(-1)), (Address) orw.RewriteSrc(di.op2, di.Address, true), RtlClass.ConditionalTransfer); }
private void RewriteBranch(ConditionCode cc, FlagM flags) { var flagGrp = binder.EnsureFlagGroup(arch.GetFlagGroup(Registers.CC, (uint)flags)); m.Branch(m.Test(cc, flagGrp), ((AddressOperand)instr.Operands[0]).Address, instr.InstructionClass); }
public Identifier FlagGroup(FlagM flags) { return frame.EnsureFlagGroup((uint)flags, arch.GrfToString((uint)flags), PrimitiveType.Byte); }
protected Identifier FlagGroup(FlagM flags) => binder.EnsureFlagGroup(PICRegisters.STATUS, (uint)flags, arch.GrfToString((uint)flags), PrimitiveType.Byte);
private void AssignCond(FlagM flags, Expression dst) { m.Assign(FlagGroup(flags), m.Cond(dst)); }
private void RewriteBinop(Func <Expression, Expression, BinaryExpression> fn, FlagM grf) { var dst = OpSrc(instr.Operands[0]); var src = OpSrc(instr.Operands[1]); m.Assign(dst, fn(dst, src)); if (grf != 0) { var flg = arch.GetFlagGroup((uint)grf); m.Assign(binder.EnsureFlagGroup(flg), m.Cond(dst)); } }
public Identifier FlagGroup(FlagM flags) { return(binder.EnsureFlagGroup(Registers.ccr, (uint)flags, arch.GrfToString((uint)flags), PrimitiveType.Byte)); }
private static FlagGroupStorage FlagRegister(string name, RegisterStorage freg, FlagM grf) { return(new FlagGroupStorage(freg, (uint)grf, name, PrimitiveType.Bool)); }
private void RewriteBinOp(Func<Expression, Expression, Expression> opGen, FlagM flags) { var opSrc = orw.RewriteSrc(di.op1, di.Address); var opDst = orw.RewriteDst(di.op2, di.Address, opSrc, opGen); emitter.Assign(orw.FlagGroup(flags), emitter.Cond(opDst)); }
private void RewriteLoop(FlagM useFlags, ConditionCode cc) { Identifier cx = orw.AluRegister(Registers.ecx, instrCur.dataWidth); emitter.Assign(cx, emitter.ISub(cx, 1)); if (useFlags != 0) { emitter.Branch( emitter.Cand( emitter.Test(cc, orw.FlagGroup(useFlags)), emitter.Ne0(cx)), OperandAsCodeAddress(instrCur.op1), RtlClass.ConditionalTransfer); ric.Class = RtlClass.ConditionalTransfer; } else { emitter.Branch(emitter.Ne0(cx), OperandAsCodeAddress(instrCur.op1), RtlClass.ConditionalTransfer); ric.Class = RtlClass.ConditionalTransfer; } }
private void AssignFlag(FlagM flag, bool value) { var grf = arch.GetFlagGroup(Registers.ccr, (uint)flag); m.Assign(binder.EnsureFlagGroup(grf), Constant.Bool(value)); }
private static FlagGroupStorage FlagGroup(FlagM bits, string name) => new FlagGroupStorage(Registers.PSW, (uint)bits, name, Registers.PSW.DataType);
private static FlagGroupStorage FlagBit(FlagM bit, string name) => new FlagGroupStorage(Registers.PSW, (uint)bit, name, PrimitiveType.Bool);
public Identifier FlagGroup(FlagM flags) { return(frame.EnsureFlagGroup((uint)flags, arch.GrfToString((uint)flags), PrimitiveType.Byte)); }
private static FlagGroupStorage FlagRegister(string name, RegisterStorage freg, FlagM grf) { var dt = Bits.IsSingleBitSet((uint)grf) ? PrimitiveType.Bool : PrimitiveType.Byte; return(new FlagGroupStorage(freg, (uint)grf, name, dt)); }
private void RewriteBranch(ConditionCode cc, FlagM flags) { emitter.Branch( emitter.Test(cc, FlagGroup(flags)), ((AddressOperand)dasm.Current.Operands[0]).Address, RtlClass.ConditionalTransfer); rtlc.Class = RtlClass.ConditionalTransfer; }
public Identifier FlagGroup(FlagM flags) { return(binder.EnsureFlagGroup(arch.GetFlagGroup((uint)flags)));; }
private void RewriteScc(ConditionCode cc, FlagM flagsUsed) { orw.RewriteMoveDst(instr.Operands[0], instr.Address, PrimitiveType.Byte, orw.FlagGroup(flagsUsed)); }
private Identifier FlagGroup(FlagM flags) { return(frame.EnsureFlagGroup(Registers.psw, (uint)flags, arch.GrfToString((uint)flags), PrimitiveType.Byte)); }
private void AssignCond(FlagM flags, Expression dst) { emitter.Assign(FlagGroup(flags), emitter.Cond(dst)); }
private void RewriteScc(ConditionCode cc, FlagM flagsUsed) { orw.RewriteMoveDst(di.op1, di.Address, PrimitiveType.Byte, orw.FlagGroup(flagsUsed)); }
Identifier FlagGroup(FlagM bits, string name, PrimitiveType type) { var grf = arch.GetFlagGroup((uint)bits); return(binder.EnsureFlagGroup(grf)); }
/// <summary> /// Emits an assignment to a flag-group pseudoregister. /// </summary> /// <param name="v"></param> /// <param name="defFlags">flags defined by the intel instruction</param> private void EmitCcInstr(Expression expr, FlagM defFlags) { m.Assign(orw.FlagGroup(defFlags), new ConditionOf(expr.CloneExpression())); }
private Identifier FlagGroup(FlagM bits, string name, PrimitiveType type) { return(frame.EnsureFlagGroup((uint)bits, name, type)); }
private void RewriteSetBit(FlagM grf, bool value) { m.Assign(binder.EnsureFlagGroup(arch.GetFlagGroup((uint)grf)), Constant.Bool(value)); }
private Identifier FlagGroupStorage(FlagM flags) { var grf = arch.GetFlagGroup(Registers.p, (uint)flags); return(binder.EnsureFlagGroup(grf)); }
private Identifier FlagGroup(FlagM flags) { return(binder.EnsureFlagGroup(arch.GetFlagGroup(Registers.psw, (uint)flags))); }
public Identifier FlagGroup(FlagM flags) { return(binder.EnsureFlagGroup(arch.GetFlagGroup(Registers.f, (uint)flags))); }
/// <summary> /// Emits an assignment to a flag-group pseudoregister. /// </summary> /// <param name="v"></param> /// <param name="defFlags">flags defined by the intel instruction</param> private void EmitCcInstr(Expression expr, FlagM defFlags) { emitter.Assign(orw.FlagGroup(defFlags), new ConditionOf(expr.CloneExpression())); }
private void RewriteLoop(FlagM useFlags, ConditionCode cc) { Identifier cx = orw.AluRegister(Registers.ecx, instrCur.dataWidth); emitter.Assign(cx, emitter.ISub(cx, 1)); if (useFlags != 0) { emitter.Branch( new BinaryExpression(Operator.Cand, PrimitiveType.Bool, new TestCondition(cc, orw.FlagGroup(useFlags)), emitter.Ne0(cx)), OperandAsCodeAddress(instrCur.op1), RtlClass.ConditionalTransfer); } else { emitter.Branch(emitter.Ne0(cx), OperandAsCodeAddress(instrCur.op1), RtlClass.ConditionalTransfer); } }
private void RewriteSetFlag(FlagM flagM, Constant value) { var reg = arch.GetFlagGroup((uint) flagM); state.SetFlagGroup(reg, value); var id = orw.FlagGroup(flagM); emitter.Assign(id, value); }