/// <summary> /// Rewrites the effective address of a memory load. /// </summary> /// <param name="mem"></param> /// <returns></returns> private Expression RewriteSrcEa(MemoryOperand mem) { Expression ea; if (mem.Base != null) { ea = binder.EnsureRegister(mem.Base); if (mem.Increment < 0) { m.Assign(ea, m.AddSubSignedInt(ea, mem.Increment)); } if (mem.Offset != null) { ea = m.IAdd(ea, mem.Offset); } if (mem.Increment > 0) { var tmp = binder.CreateTemporary(ea.DataType); m.Assign(tmp, ea); m.Assign(ea, m.AddSubSignedInt(ea, mem.Increment)); ea = tmp; } } else { ea = arch.MakeAddressFromConstant(mem.Offset, false); } return(ea); }
/// <summary> /// Rewrites the effective address of a memory load. /// </summary> /// <param name="mem"></param> /// <returns></returns> private Expression RewriteSrcEa(MemoryOperand mem) { Expression ea; if (mem.Base != null) { if (mem.Increment < 0) { throw new NotImplementedException("predec"); } ea = binder.EnsureRegister(mem.Base); if (mem.Offset != null) { ea = m.IAdd(ea, mem.Offset); } } else { ea = arch.MakeAddressFromConstant(mem.Offset, false); } return(ea); }