示例#1
0
        /// <summary>
        /// Matches an "ADC" or "SBB/SBC" pattern.
        /// </summary>
        /// <param name="instr"></param>
        /// <returns>If the match succeeded, returns a partial BinaryExpression
        /// with the left and right side of the ADC/SBC instruction.</returns>
        public AddSubCandidate MatchAdcSbc(Statement stm)
        {
            if (!adcPattern.Match(stm.Instruction))
            {
                return(null);
            }
            if (!IsCarryFlag(adcPattern.CapturedExpressions("cf")))
            {
                return(null);
            }
            var op = adcPattern.CapturedOperators("op2");

            if (!IsIAddOrISub(op))
            {
                return(null);
            }
            return(new AddSubCandidate
            {
                Dst = adcPattern.CapturedExpressions("dst"),
                Op = op,
                Left = adcPattern.CapturedExpressions("left"),
                Right = adcPattern.CapturedExpressions("right"),
                Statement = stm
            });
        }
示例#2
0
 public AddSubCandidate? MatchAddSub(Statement stm)
 {
     if (!addPattern.Match(stm.Instruction))
         return null;
     var op = addPattern.CapturedOperators("op")!;
     if (!IsIAddOrISub(op))
         return null;
     return new AddSubCandidate(
         op,
         addPattern.CapturedExpressions("left")!,
         addPattern.CapturedExpressions("right")!)
     {
         Dst = addPattern.CapturedExpressions("dst")!,
     };
 }
示例#3
0
 /// <summary>
 /// Matches an "ADC" or "SBB/SBC" pattern.
 /// </summary>
 /// <param name="instr"></param>
 /// <returns>If the match succeeded, returns a partial BinaryExpression
 /// with the left and right side of the ADC/SBC instruction.</returns>
 public AddSubCandidate? MatchAdcSbc(Statement stm)
 {
     if (!adcPattern.Match(stm.Instruction))
         return null;
     if (!IsCarryFlag(adcPattern.CapturedExpressions("cf")!))
         return null;
     var op = adcPattern.CapturedOperators("op2")!;
     if (!IsIAddOrISub(op))
         return null;
     return new AddSubCandidate(
         op,
         adcPattern.CapturedExpressions("left")!,
         adcPattern.CapturedExpressions("right")!)
     {
         Dst = adcPattern.CapturedExpressions("dst")!,
         Statement = stm
     };
 }
示例#4
0
        public AddSubCandidate MatchAddSub(Instruction instr)
        {
            if (!addPattern.Match(instr))
            {
                return(null);
            }
            var op = addPattern.CapturedOperators("op");

            if (!IsIAddOrISub(op))
            {
                return(null);
            }
            return(new AddSubCandidate
            {
                Dst = addPattern.CapturedExpressions("dst"),
                Op = op,
                Left = addPattern.CapturedExpressions("left"),
                Right = addPattern.CapturedExpressions("right")
            });
        }