diff --git a/lib/3rdparty/softx86/softx86/optable.c b/lib/3rdparty/softx86/softx86/optable.c index 9fed48e2cf8..426f84ae8ef 100644 --- a/lib/3rdparty/softx86/softx86/optable.c +++ b/lib/3rdparty/softx86/softx86/optable.c @@ -217,9 +217,9 @@ Sfx86OpcodeTable optab8086 = { {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 */ diff --git a/lib/3rdparty/softx86/softx86/pushpop.c b/lib/3rdparty/softx86/softx86/pushpop.c index 17d82450718..8f1d12177ae 100644 --- a/lib/3rdparty/softx86/softx86/pushpop.c +++ b/lib/3rdparty/softx86/softx86/pushpop.c @@ -167,6 +167,21 @@ int Sfx86OpcodeExec_push(sx86_ubyte opcode,softx86_ctx* ctx) 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 @@ int Sfx86OpcodeDec_push(sx86_ubyte opcode,softx86_ctx* ctx,char buf[128]) 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; } diff --git a/lib/3rdparty/softx86/softx86_ros.diff b/lib/3rdparty/softx86/softx86_ros.diff new file mode 100644 index 00000000000..75026a2911b --- /dev/null +++ b/lib/3rdparty/softx86/softx86_ros.diff @@ -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; + } +