From 53dfb7da48348999810679908ed3972eacb8909a Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Wed, 13 Nov 2013 19:20:04 +0000 Subject: [PATCH] [FAST486] LOOP and JECXZ use the ADSIZE attribute, not OPSIZE. svn path=/branches/ntvdm/; revision=60977 --- lib/fast486/opcodes.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/fast486/opcodes.c b/lib/fast486/opcodes.c index 518211c762e..de75b50a2ee 100644 --- a/lib/fast486/opcodes.c +++ b/lib/fast486/opcodes.c @@ -4929,7 +4929,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeLoop) ASSERT((Opcode >= 0xE0) && (Opcode <= 0xE2)); NO_LOCK_PREFIX(); - TOGGLE_OPSIZE(Size); + TOGGLE_ADSIZE(Size); if (Size) Condition = ((--State->GeneralRegs[FAST486_REG_ECX].Long) != 0); else Condition = ((--State->GeneralRegs[FAST486_REG_ECX].LowWord) != 0); @@ -4956,7 +4956,8 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeLoop) if (Condition) { /* Move the instruction pointer */ - State->InstPtr.Long += Offset; + if (Size) State->InstPtr.Long += Offset; + else State->InstPtr.LowWord += Offset; } return TRUE; @@ -4972,7 +4973,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeJecxz) ASSERT(Opcode == 0xE3); NO_LOCK_PREFIX(); - TOGGLE_OPSIZE(Size); + TOGGLE_ADSIZE(Size); if (Size) Condition = (State->GeneralRegs[FAST486_REG_ECX].Long == 0); else Condition = (State->GeneralRegs[FAST486_REG_ECX].LowWord == 0); @@ -4987,7 +4988,8 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeJecxz) if (Condition) { /* Move the instruction pointer */ - State->InstPtr.Long += Offset; + if (Size) State->InstPtr.Long += Offset; + else State->InstPtr.LowWord += Offset; } return TRUE;