mirror of
https://github.com/sampletext32/ParkanPlayground.git
synced 2025-06-20 08:18:36 +03:00
Unified ADC accumulator handlers into a single handler
This commit is contained in:
@ -23,7 +23,13 @@ public class MovMemRegHandler : InstructionHandler
|
||||
/// <returns>True if this handler can decode the opcode</returns>
|
||||
public override bool CanHandle(byte opcode)
|
||||
{
|
||||
return opcode == 0x88 || opcode == 0x89;
|
||||
// For 8-bit operations (0x88), no prefix check needed
|
||||
if (opcode == 0x88)
|
||||
return true;
|
||||
|
||||
// For 32-bit operations (0x89), only handle when operand size prefix is NOT present
|
||||
// This ensures 16-bit handlers get priority when the prefix is present
|
||||
return opcode == 0x89 && !Decoder.HasOperandSizePrefix();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -23,7 +23,13 @@ public class MovRegMemHandler : InstructionHandler
|
||||
/// <returns>True if this handler can decode the opcode</returns>
|
||||
public override bool CanHandle(byte opcode)
|
||||
{
|
||||
return opcode == 0x8A || opcode == 0x8B;
|
||||
// For 8-bit operations (0x8A), no prefix check needed
|
||||
if (opcode == 0x8A)
|
||||
return true;
|
||||
|
||||
// For 32-bit operations (0x8B), only handle when operand size prefix is NOT present
|
||||
// This ensures 16-bit handlers get priority when the prefix is present
|
||||
return opcode == 0x8B && !Decoder.HasOperandSizePrefix();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -34,7 +34,7 @@ public class MovRm32Imm32Handler : InstructionHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
// Peek at the ModR/M byte without advancing the position
|
||||
// Peak at the ModR/M byte without advancing the position
|
||||
var reg = ModRMDecoder.PeakModRMReg();
|
||||
|
||||
// MOV r/m8, imm8 only uses reg=0
|
||||
|
@ -35,7 +35,7 @@ public class MovRm8Imm8Handler : InstructionHandler
|
||||
return false;
|
||||
}
|
||||
|
||||
// Peek at the ModR/M byte without advancing the position
|
||||
// Peak at the ModR/M byte without advancing the position
|
||||
var reg = ModRMDecoder.PeakModRMReg();
|
||||
|
||||
// MOV r/m8, imm8 only uses reg=0
|
||||
|
Reference in New Issue
Block a user