fix: correctly parse jump bytes

Previously only a single byte was read and saved,
but the J-byte means, that the read signed-byte
must be added to the address of the next
instruction.
This commit is contained in:
2025-05-20 10:56:54 +09:00
parent 3fe58e8bac
commit ac78e9705c
2 changed files with 64 additions and 56 deletions

View File

@@ -165,26 +165,26 @@ pub enum Mnemonic {
DEC_Reg(Register),
DEC_Mod(ModRmTarget),
// Jumps
JO(IByte),
JNO(IByte),
JB(IByte),
JNB(IByte),
JZ(IByte),
JNZ(IByte),
JBE(IByte),
JA(IByte),
JS(IByte),
JNS(IByte),
JPE(IByte),
JPO(IByte),
JL(IByte),
JGE(IByte),
JLE(IByte),
JG(IByte),
LOOPNZ(IByte),
LOOPZ(IByte),
LOOP(IByte),
JCXZ(IByte),
JO(isize),
JNO(isize),
JB(isize),
JNB(isize),
JZ(isize),
JNZ(isize),
JBE(isize),
JA(isize),
JS(isize),
JNS(isize),
JPE(isize),
JPO(isize),
JL(isize),
JGE(isize),
JLE(isize),
JG(isize),
LOOPNZ(isize),
LOOPZ(isize),
LOOP(isize),
JCXZ(isize),
// TEST
TEST(ModRmTarget, Register),
@@ -231,7 +231,7 @@ pub enum Mnemonic {
CWD,
// CALL
CALL_p(Pointer),
CALL_v(Word),
CALL_v(isize),
CALL_Mod(ModRmTarget),
// JUMP
JMP_p(Pointer),