Author: hbelusca
Date: Sun Jun 16 23:54:30 2013
New Revision: 59248
URL:
http://svn.reactos.org/svn/reactos?rev=59248&view=rev
Log:
[SOFTX86]
Fix some bugs of softx86, see CORE-7250 for more information.
All diffs from the original softx86 code should also be put in softx86_ros.diff.
Added:
branches/ntvdm/lib/3rdparty/softx86/softx86_ros.diff
Modified:
branches/ntvdm/lib/3rdparty/softx86/softx86/optable.c
branches/ntvdm/lib/3rdparty/softx86/softx86/pushpop.c
Modified: branches/ntvdm/lib/3rdparty/softx86/softx86/optable.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/3rdparty/softx86/soft…
==============================================================================
--- branches/ntvdm/lib/3rdparty/softx86/softx86/optable.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/3rdparty/softx86/softx86/optable.c [iso-8859-1] Sun Jun 16 23:54:30
2013
@@ -217,9 +217,9 @@
{Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x66 */
{Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x67 */
- {Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x68 */
+ {Sfx86OpcodeExec_push, Sfx86OpcodeDec_push}, /* 0x68 */
{Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x69 */
- {Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x6A */
+ {Sfx86OpcodeExec_push, Sfx86OpcodeDec_push}, /* 0x6A */
{Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x6B */
{Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x6C */
{Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x6D */
Modified: branches/ntvdm/lib/3rdparty/softx86/softx86/pushpop.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/3rdparty/softx86/soft…
==============================================================================
--- branches/ntvdm/lib/3rdparty/softx86/softx86/pushpop.c [iso-8859-1] (original)
+++ branches/ntvdm/lib/3rdparty/softx86/softx86/pushpop.c [iso-8859-1] Sun Jun 16 23:54:30
2013
@@ -167,6 +167,21 @@
return 1;
}
+ if (opcode == 0x6A) // PUSH imm8
+ {
+ sx86_ubyte b = softx86_fetch_exec_byte(ctx);
+ softx86_stack_pushw(ctx, (sx86_uword)b);
+ return 1;
+ }
+
+ if (opcode == 0x68) // PUSH imm16
+ {
+ sx86_uword w = softx86_fetch_exec_byte(ctx);
+ w |= softx86_fetch_exec_byte(ctx) << 8;
+ softx86_stack_pushw(ctx, w);
+ return 1;
+ }
+
return 0;
}
@@ -199,6 +214,21 @@
if (opcode == 0x9C) { // PUSHF
strcpy(buf,"PUSHF");
+ return 1;
+ }
+
+ if (opcode == 0x6A && ctx->__private->level >= SX86_CPULEVEL_80186) //
PUSH imm8
+ {
+ sx86_ubyte b = softx86_fetch_exec_byte(ctx);
+ sprintf(buf, "PUSH %02Xh", b);
+ return 1;
+ }
+
+ if (opcode == 0x68 && ctx->__private->level >= SX86_CPULEVEL_80186) //
PUSH imm16
+ {
+ sx86_uword w = softx86_fetch_exec_byte(ctx);
+ w |= softx86_fetch_exec_byte(ctx) << 8;
+ sprintf(buf, "PUSH %04Xh", w);
return 1;
}
Added: branches/ntvdm/lib/3rdparty/softx86/softx86_ros.diff
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/3rdparty/softx86/soft…
==============================================================================
--- branches/ntvdm/lib/3rdparty/softx86/softx86_ros.diff (added)
+++ branches/ntvdm/lib/3rdparty/softx86/softx86_ros.diff [iso-8859-1] Sun Jun 16 23:54:30
2013
@@ -0,0 +1,64 @@
+Index: softx86/optable.c
+===================================================================
+--- softx86/optable.c (révision 59247)
++++ softx86/optable.c (copie de travail)
+@@ -217,9 +217,9 @@
+ {Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x66 */
+ {Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x67 */
+
+- {Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x68 */
++ {Sfx86OpcodeExec_push, Sfx86OpcodeDec_push}, /* 0x68 */
+ {Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x69 */
+- {Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x6A */
++ {Sfx86OpcodeExec_push, Sfx86OpcodeDec_push}, /* 0x6A */
+ {Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x6B */
+ {Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x6C */
+ {Sfx86OpcodeExec_default, Sfx86OpcodeDec_default}, /* 0x6D */
+Index: softx86/pushpop.c
+===================================================================
+--- softx86/pushpop.c (révision 59247)
++++ softx86/pushpop.c (copie de travail)
+@@ -167,6 +167,21 @@
+ return 1;
+ }
+
++ if (opcode == 0x6A) // PUSH imm8
++ {
++ sx86_ubyte b = softx86_fetch_exec_byte(ctx);
++ softx86_stack_pushw(ctx, (sx86_uword)b);
++ return 1;
++ }
++
++ if (opcode == 0x68) // PUSH imm16
++ {
++ sx86_uword w = softx86_fetch_exec_byte(ctx);
++ w |= softx86_fetch_exec_byte(ctx) << 8;
++ softx86_stack_pushw(ctx, w);
++ return 1;
++ }
++
+ return 0;
+ }
+
+@@ -202,6 +217,21 @@
+ return 1;
+ }
+
++ if (opcode == 0x6A && ctx->__private->level >= SX86_CPULEVEL_80186) //
PUSH imm8
++ {
++ sx86_ubyte b = softx86_fetch_exec_byte(ctx);
++ sprintf(buf, "PUSH %02Xh", b);
++ return 1;
++ }
++
++ if (opcode == 0x68 && ctx->__private->level >= SX86_CPULEVEL_80186) //
PUSH imm16
++ {
++ sx86_uword w = softx86_fetch_exec_byte(ctx);
++ w |= softx86_fetch_exec_byte(ctx) << 8;
++ sprintf(buf, "PUSH %04Xh", w);
++ return 1;
++ }
++
+ return 0;
+ }
+