From a95b4886e9edba9830457ad5a4e10d6270459fe4 Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Sat, 10 Apr 1999 16:30:12 +0000 Subject: [PATCH] Clear invalid selectors also in CallTo16 relay code. --- miscemu/instr.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/miscemu/instr.c b/miscemu/instr.c index c970ea272dd..3639bf09157 100644 --- a/miscemu/instr.c +++ b/miscemu/instr.c @@ -36,6 +36,7 @@ /* For invalid registers fixup */ extern DWORD CallFrom16_Start,CallFrom16_End; +extern DWORD CALLTO16_Start,CALLTO16_End; /*********************************************************************** @@ -51,15 +52,18 @@ extern DWORD CallFrom16_Start,CallFrom16_End; */ static BOOL INSTR_ReplaceSelector( SIGCONTEXT *context, WORD *sel ) { - if (IS_SELECTOR_SYSTEM(CS_sig(context)) && - (EIP_sig(context) >= (DWORD)&CallFrom16_Start) && - (EIP_sig(context) < (DWORD)&CallFrom16_End)) - { - /* Saved selector may have become invalid when the relay code */ - /* tries to restore it. We simply clear it. */ - *sel = 0; - return TRUE; - } + if ( IS_SELECTOR_SYSTEM(CS_sig(context)) ) + if ( ( EIP_sig(context) >= (DWORD)&CallFrom16_Start && + EIP_sig(context) < (DWORD)&CallFrom16_End ) + || ( EIP_sig(context) >= (DWORD)&CALLTO16_Start && + EIP_sig(context) < (DWORD)&CALLTO16_End ) ) + { + /* Saved selector may have become invalid when the relay code */ + /* tries to restore it. We simply clear it. */ + *sel = 0; + return TRUE; + } + if (*sel == 0x40) { static WORD sys_timer = 0; -- 2.11.4.GIT