diff --git a/lib/soft386/opcodes.c b/lib/soft386/opcodes.c index 099ef3b3195..120662b0620 100644 --- a/lib/soft386/opcodes.c +++ b/lib/soft386/opcodes.c @@ -1152,12 +1152,13 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeMovRegImm) /* Make sure this is the right instruction */ ASSERT((Opcode & 0xF8) == 0xB8); - if (State->PrefixFlags == SOFT386_PREFIX_OPSIZE) + if (State->PrefixFlags & SOFT386_PREFIX_OPSIZE) { /* The OPSIZE prefix toggles the size */ Size = !Size; } - else if (State->PrefixFlags != 0) + + if (State->PrefixFlags & SOFT386_PREFIX_LOCK) { /* Invalid prefix */ Soft386Exception(State, SOFT386_EXCEPTION_UD);