From ccbc6f2a8bea1f4c596ba5e5dc4cd558d62af3f6 Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Fri, 12 Sep 2003 16:28:20 +0000 Subject: [PATCH] Fix some issues with opcodes saving 32-bit results where they should save 16-bit Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1248 --- src/cpu/core_normal/prefix_66_0f.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cpu/core_normal/prefix_66_0f.h b/src/cpu/core_normal/prefix_66_0f.h index 8a61ae72..7496d841 100644 --- a/src/cpu/core_normal/prefix_66_0f.h +++ b/src/cpu/core_normal/prefix_66_0f.h @@ -25,8 +25,8 @@ Bitu saveval; if (!which) CPU_SLDT(saveval); else CPU_STR(saveval); - if (rm >= 0xc0) {GetEArd;*eard=saveval;} - else {GetEAa;SaveMd(eaa,saveval);} + if (rm >= 0xc0) {GetEArw;*earw=(Bit16u)saveval;} + else {GetEAa;SaveMw(eaa,saveval);} } break; case 0x02:case 0x03:case 0x04:case 0x05: @@ -57,13 +57,13 @@ switch (which) { case 0x00: /* SGDT */ CPU_SGDT(limit,base); - SaveMw(eaa,limit); - SaveMd(eaa+2,base); + SaveMw(eaa,(Bit16u)limit); + SaveMd(eaa+2,(Bit32u)base); break; case 0x01: /* SIDT */ CPU_SIDT(limit,base); - SaveMw(eaa,limit); - SaveMd(eaa+2,base); + SaveMw(eaa,(Bit16u)limit); + SaveMd(eaa+2,(Bit32u)base); break; case 0x02: /* LGDT */ CPU_LGDT(LoadMw(eaa),LoadMd(eaa+2)); @@ -73,22 +73,22 @@ break; case 0x04: /* SMSW */ CPU_SMSW(limit); - SaveMw(eaa,limit); + SaveMw(eaa,(Bit16u)limit); break; case 0x06: /* LMSW */ limit=LoadMw(eaa); - if (!CPU_LMSW(limit)) goto decode_end; + if (!CPU_LMSW((Bit16u)limit)) goto decode_end; break; } } else { - GetEArw;Bitu limit; + GetEArd;Bitu limit; switch (which) { case 0x04: /* SMSW */ CPU_SMSW(limit); - *earw=limit; + *eard=(Bit32u)limit; break; case 0x06: /* LMSW */ - if (!CPU_LMSW(*earw)) goto decode_end; + if (!CPU_LMSW(*eard)) goto decode_end; break; default: LOG(LOG_CPU,LOG_ERROR)("Illegal group 7 RM subfunction %d",which);