]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
the following small patch adds support for the (ancient and horrible)
authorJulian Seward <jseward@acm.org>
Wed, 2 Apr 2003 20:10:56 +0000 (20:10 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 2 Apr 2003 20:10:56 +0000 (20:10 +0000)
XLAT instruction. Microsoft in their infinite wisdom use it in their OLE
dispatch code...  (from Adam Gundy <arg@cyberscience.com>)

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1493

coregrind/vg_to_ucode.c

index 835c3088bb4720f6c2e444df5fad8db7386f47ab..d320d4b33dd8d0486d25e0d4e405c4875d8c10ef 100644 (file)
@@ -4367,6 +4367,25 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd )
       codegen_xchg_eAX_Reg ( cb, sz, opc - 0x90 );
       break;
 
+   /* ------------------------ XLAT ----------------------- */
+
+   case 0xD7: /* XLAT */
+      t1 = newTemp(cb); t2 = newTemp(cb);
+      uInstr2(cb, GET, sz, ArchReg, R_EBX, TempReg, t1); /* get eBX */
+      handleSegOverride( cb, sorb, t1 );               /* make t1 DS:eBX */
+      uInstr2(cb, GET, 1, ArchReg, R_AL, TempReg, t2); /* get AL */
+      /* Widen %AL to 32 bits, so it's all defined when we add it. */
+      uInstr1(cb, WIDEN, 4, TempReg, t2);
+      LAST_UINSTR(cb).extra4b = 1;
+      LAST_UINSTR(cb).signed_widen = False;
+      uInstr2(cb, ADD, sz, TempReg, t2, TempReg, t1);  /* add AL to eBX */
+      uInstr2(cb, LOAD, 1, TempReg, t1,  TempReg, t2); /* get byte at t1 into t2 */
+      uInstr2(cb, PUT, 1, TempReg, t2, ArchReg, R_AL); /* put byte into AL */
+
+      if (dis)
+         VG_(printf)("xlat%c [ebx]\n", nameISize(sz));
+      break;
+
    /* ------------------------ (Grp1 extensions) ---------- */
 
    case 0x80: /* Grp1 Ib,Eb */