From 9c665498456d9438f1fa9353e6064461843c280e Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Thu, 14 Nov 2013 02:54:20 +0000 Subject: [PATCH] [FAST486] Update the register values in REP LODS. svn path=/branches/ntvdm/; revision=60988 --- lib/fast486/opcodes.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/fast486/opcodes.c b/lib/fast486/opcodes.c index de75b50a2ee..a3e16644001 100644 --- a/lib/fast486/opcodes.c +++ b/lib/fast486/opcodes.c @@ -5885,6 +5885,18 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeLods) if (AddressSize) State->GeneralRegs[FAST486_REG_ESI].Long -= (Count - 1) * DataSize; else State->GeneralRegs[FAST486_REG_ESI].LowWord -= (Count - 1) * DataSize; } + + /* Update registers */ + if (OperandSize) + { + State->GeneralRegs[FAST486_REG_ECX].Long = 0; + State->GeneralRegs[FAST486_REG_ESI].Long += Count - 1; + } + else + { + State->GeneralRegs[FAST486_REG_ECX].LowWord = 0; + State->GeneralRegs[FAST486_REG_ESI].LowWord += Count - 1; + } } /* Read from the source operand */