about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-06-18 14:24:44 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-06-18 14:24:44 +0200
commit8c3fbe26ad7100ed37c6c35aa564cde87a9882a7 (patch)
treed1b97e7631c0f56b5819d1c8f32f5ae7d27665a3 /src
parentaf2699ec216da0c2f26af827e33e528a72a8d4f8 (diff)
downloadbox64-8c3fbe26ad7100ed37c6c35aa564cde87a9882a7.tar.gz
box64-8c3fbe26ad7100ed37c6c35aa564cde87a9882a7.zip
[32BITS] Fixed some issue reading rex in 32bits mode
Diffstat (limited to 'src')
-rw-r--r--src/emu/x64run64.c9
-rw-r--r--src/emu/x64run66.c9
-rw-r--r--src/emu/x64run6664.c9
-rw-r--r--src/emu/x64run66f0.c9
-rw-r--r--src/emu/x64run67.c9
5 files changed, 25 insertions, 20 deletions
diff --git a/src/emu/x64run64.c b/src/emu/x64run64.c
index b1fb52b7..942c551f 100644
--- a/src/emu/x64run64.c
+++ b/src/emu/x64run64.c
@@ -57,10 +57,11 @@ uintptr_t Run64(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
         rep = opcode-0xF1;

         opcode = F8;

     }

-    while(opcode>=0x40 && opcode<=0x4f) {

-        rex.rex = opcode;

-        opcode = F8;

-    }

+    if(!rex.is32bits)

+        while(opcode>=0x40 && opcode<=0x4f) {

+            rex.rex = opcode;

+            opcode = F8;

+        }

 

     switch(opcode) {

         #define GO(B, OP)                                   \

diff --git a/src/emu/x64run66.c b/src/emu/x64run66.c
index 508ca243..642cfd74 100644
--- a/src/emu/x64run66.c
+++ b/src/emu/x64run66.c
@@ -56,10 +56,11 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
     }

 

     rex.rex = 0;

-    while(opcode>=0x40 && opcode<=0x4f) {

-        rex.rex = opcode;

-        opcode = F8;

-    }

+    if(!rex.is32bits)

+        while(opcode>=0x40 && opcode<=0x4f) {

+            rex.rex = opcode;

+            opcode = F8;

+        }

 

     switch(opcode) {

     #define GO(B, OP)                                               \

diff --git a/src/emu/x64run6664.c b/src/emu/x64run6664.c
index 668507a4..c9cb9de0 100644
--- a/src/emu/x64run6664.c
+++ b/src/emu/x64run6664.c
@@ -40,10 +40,11 @@ uintptr_t Run6664(x64emu_t *emu, rex_t rex, int seg, uintptr_t addr)
     opcode = F8;

     // REX prefix before the F0 are ignored

     rex.rex = 0;

-    while(opcode>=0x40 && opcode<=0x4f) {

-        rex.rex = opcode;

-        opcode = F8;

-    }

+    if(!rex.is32bits)

+        while(opcode>=0x40 && opcode<=0x4f) {

+            rex.rex = opcode;

+            opcode = F8;

+        }

 

     switch(opcode) {

 

diff --git a/src/emu/x64run66f0.c b/src/emu/x64run66f0.c
index a880593c..86e6a8dd 100644
--- a/src/emu/x64run66f0.c
+++ b/src/emu/x64run66f0.c
@@ -47,10 +47,11 @@ uintptr_t Run66F0(x64emu_t *emu, rex_t rex, uintptr_t addr)
     opcode = F8;
     // REX prefix before the F0 are ignored
     rex.rex = 0;
-    while(opcode>=0x40 && opcode<=0x4f) {
-        rex.rex = opcode;
-        opcode = F8;
-    }
+    if(!rex.is32bits)
+        while(opcode>=0x40 && opcode<=0x4f) {
+            rex.rex = opcode;
+            opcode = F8;
+        }
 
     if(rex.w) return RunF0(emu, rex, addr);
 
diff --git a/src/emu/x64run67.c b/src/emu/x64run67.c
index 7a03342f..951ee72e 100644
--- a/src/emu/x64run67.c
+++ b/src/emu/x64run67.c
@@ -46,10 +46,11 @@ uintptr_t Run67(x64emu_t *emu, rex_t rex, int rep, uintptr_t addr)
 

     // REX prefix before the 67 are ignored

     rex.rex = 0;

-    while(opcode>=0x40 && opcode<=0x4f) {

-        rex.rex = opcode;

-        opcode = F8;

-    }

+    if(!rex.is32bits)

+        while(opcode>=0x40 && opcode<=0x4f) {

+            rex.rex = opcode;

+            opcode = F8;

+        }

     while((opcode==0xF2) || (opcode==0xF3)) {

         rep = opcode-0xF1;

         opcode = F8;