From abb5184ed4950e4e24f3fe4f4205cce8938f03a6 Mon Sep 17 00:00:00 2001 From: SarahW Date: Tue, 30 Apr 2019 21:47:17 +0100 Subject: [PATCH] Loading SS in v86 mode (but not real mode) does reset the stack size. Fixes DOS programs in Windows 9x. --- src/x86seg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/x86seg.c b/src/x86seg.c index 8335897..bd7c6db 100644 --- a/src/x86seg.c +++ b/src/x86seg.c @@ -460,6 +460,8 @@ int loadseg(uint16_t seg, x86seg *s) codegen_flat_ds = 0; if (s == &cpu_state.seg_ss) codegen_flat_ss = 0; + if (s == &cpu_state.seg_ss && (cpu_state.eflags & VM_FLAG)) + set_stack32(0); } if (s == &cpu_state.seg_ds)