0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-06-20 08:18:36 +03:00

Fixed instruction handlers and tests for Group1, Group3, and XOR instructions

This commit is contained in:
bird_egop
2025-04-12 21:48:41 +03:00
parent f107b8e763
commit a0e40c8a52
6 changed files with 79 additions and 24 deletions

View File

@ -127,9 +127,17 @@ public class InstructionDecoder
// Get a handler for the opcode
var handler = _handlerFactory.GetHandler(opcode);
if (handler == null || !handler.Decode(opcode, instruction))
bool handlerSuccess = false;
// Try to decode with a handler first
if (handler != null)
{
handlerSuccess = handler.Decode(opcode, instruction);
}
// If no handler is found or decoding fails, create a default instruction
if (!handlerSuccess)
{
// If no handler is found or decoding fails, create a default instruction
instruction.Mnemonic = OpcodeMap.GetMnemonic(opcode);
instruction.Operands = "??";
}