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

simplify reading logic

This commit is contained in:
bird_egop
2025-04-13 23:22:30 +03:00
parent 0ea3294c61
commit 00547ed273
13 changed files with 31 additions and 79 deletions

View File

@ -45,8 +45,7 @@ public class JmpRel32Handler : InstructionHandler
}
// Read the relative offset
int offset = BitConverter.ToInt32(CodeBuffer, position);
Decoder.SetPosition(position + 4);
uint offset = Decoder.ReadUInt32();
// Calculate the target address
uint targetAddress = (uint)(position + offset + 4);

View File

@ -74,8 +74,7 @@ public class TwoByteConditionalJumpHandler : InstructionHandler
}
// Read the relative offset (32-bit)
int offset = BitConverter.ToInt32(CodeBuffer, position);
Decoder.SetPosition(position + 4);
uint offset = Decoder.ReadUInt32();
// Calculate the target address
uint targetAddress = (uint)(position + offset + 4);