Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/55285 )

Change subject: arch-x86: Handle a special case for MODRM in 16 bit mode.
......................................................................

arch-x86: Handle a special case for MODRM in 16 bit mode.

When the address size is 16 bit, the mod field is 0, and the rm is 6,
there is no base register, only a displacement.

Change-Id: Ib67a6e5ce617d08913b9ca6dee66877f0154ffe1
---
M src/arch/x86/emulenv.cc
1 file changed, 14 insertions(+), 1 deletion(-)



diff --git a/src/arch/x86/emulenv.cc b/src/arch/x86/emulenv.cc
index bfca1e5..44afc5a 100644
--- a/src/arch/x86/emulenv.cc
+++ b/src/arch/x86/emulenv.cc
@@ -82,7 +82,8 @@
                     base = INTREG_RDI;
                     break;
                   case 6:
-                    base = INTREG_RBP;
+                    // There is a special case when mod is 0 and rm is 6.
+ base = machInst.modRM.mod == 0 ? INTREG_T0 : INTREG_RBP;
                     break;
                   case 7:
                     base = INTREG_RBX;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/55285
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ib67a6e5ce617d08913b9ca6dee66877f0154ffe1
Gerrit-Change-Number: 55285
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to