mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-08-04 02:16:33 +03:00
fixes and removed unused code
This commit is contained in:
@@ -35,13 +35,10 @@ public class DisplacementMemoryOperand : MemoryOperand
|
||||
/// </summary>
|
||||
public override string ToString()
|
||||
{
|
||||
string sign = Displacement >= 0 ? "+" : "";
|
||||
string sign = Displacement >= 0 ? "+" : "-";
|
||||
var registerName = ModRMDecoder.GetRegisterName(BaseRegister, 32);
|
||||
|
||||
// Format small displacements (< 256) with at least 2 digits
|
||||
string formattedDisplacement = Math.Abs(Displacement) < 256
|
||||
? $"0x{Math.Abs(Displacement):X2}"
|
||||
: $"0x{Math.Abs(Displacement):X}";
|
||||
|
||||
string formattedDisplacement = $"0x{Displacement:X2}";
|
||||
|
||||
return $"{GetSizePrefix()}[{registerName}{sign}{formattedDisplacement}]";
|
||||
}
|
||||
|
@@ -56,8 +56,8 @@ public class ScaledIndexMemoryOperand : MemoryOperand
|
||||
|
||||
if (Displacement != 0)
|
||||
{
|
||||
string sign = Displacement > 0 ? "+" : "";
|
||||
dispPart = $"{sign}0x{Math.Abs(Displacement):X}";
|
||||
string sign = Displacement > 0 ? "+" : "-";
|
||||
dispPart = $"{sign}0x{Math.Abs(Displacement):X2}";
|
||||
}
|
||||
|
||||
return $"{GetSizePrefix()}[{baseRegPart}{indexPart}{dispPart}]";
|
||||
|
Reference in New Issue
Block a user