Example #1
0
 public Storage VisitStackLocalStorage(StackLocalStorage local)
 {
     if (define)
     {
         if (liveStackVars.ContainsKey(local))
         {
             defBitSize = liveStackVars[local];
             liveStackVars.Remove(local);
         }
         defOffset = 0;
     }
     else
     {
         if (liveStackVars.ContainsKey(local))
         {
             liveStackVars[local] =
                 Math.Max(useBitSize, liveStackVars[local]);
         }
         else
         {
             liveStackVars.Add(local, useBitSize);
         }
     }
     return(null);
 }
Example #2
0
 public void Setup()
 {
     f          = new Frame(PrimitiveType.Word16);
     varOff     = (StackLocalStorage)f.EnsureStackLocal(-4, PrimitiveType.Word16).Storage;
     varSeg     = (StackLocalStorage)f.EnsureStackLocal(-2, PrimitiveType.SegmentSelector).Storage;
     varPointer = (StackLocalStorage)f.EnsureStackLocal(-4, PrimitiveType.Ptr32).Storage;
 }
Example #3
0
 public Storage VisitStackLocalStorage(StackLocalStorage local)
 {
     if (defining)
     {
         regDefs[local] = value;
     }
     else
     {
         value = null;
         regDefs.TryGetValue(local, out value);
     }
     return(local);
 }
Example #4
0
        private Expression EffectiveAddress(Identifier id)
        {
            Identifier        fp    = proc.Frame.FramePointer;
            StackLocalStorage local = id.Storage as StackLocalStorage;

            int            offset = local.StackOffset + proc.Frame.FrameOffset;
            BinaryOperator op;

            if (offset < 0)
            {
                offset = -offset;
                op     = Operator.ISub;
            }
            else
            {
                op = Operator.IAdd;
            }
            PrimitiveType p  = (PrimitiveType)fp.DataType;
            Expression    ea = new BinaryExpression(op, fp.DataType,
                                                    fp, Constant.Create(PrimitiveType.Create(Domain.SignedInt, p.Size), offset));

            return(ea);
        }
Example #5
0
 public Identifier VisitStackLocalStorage(StackLocalStorage local)
 {
     throw new NotImplementedException();
 }
Example #6
0
 public bool VisitStackLocalStorage(StackLocalStorage local, bool defining)
 {
     return(true);
 }
Example #7
0
 public Identifier VisitStackLocalStorage(StackLocalStorage loc)
 {
     return(frame.EnsureStackLocal(loc.StackOffset, loc.DataType));
 }
Example #8
0
 public bool VisitStackLocalStorage(StackLocalStorage local)
 {
     return(liveState.LiveStorages.ContainsKey(local));
 }
Example #9
0
 public string VisitStackLocalStorage(StackLocalStorage local)
 {
     return("local");
 }
Example #10
0
 public Storage VisitStackLocalStorage(StackLocalStorage local)
 {
     return(null);
 }
Example #11
0
 public Expression VisitStackLocalStorage(StackLocalStorage local)
 {
     throw new NotImplementedException();
 }
Example #12
0
 public Storage VisitStackLocalStorage(StackLocalStorage local)
 {
     ctx.StackState[local.StackOffset] = value;
     return(local);
 }
Example #13
0
 public void Setup()
 {
     f = new Frame(PrimitiveType.Word16);
     varOff = (StackLocalStorage) f.EnsureStackLocal(-4, PrimitiveType.Word16).Storage;
     varSeg = (StackLocalStorage) f.EnsureStackLocal(-2, PrimitiveType.SegmentSelector).Storage;
     varPointer = (StackLocalStorage) f.EnsureStackLocal(-4, PrimitiveType.Pointer32).Storage;
 }