summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/i386/i386op16.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/i386/i386op16.hxx')
-rw-r--r--src/devices/cpu/i386/i386op16.hxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/devices/cpu/i386/i386op16.hxx b/src/devices/cpu/i386/i386op16.hxx
index cfaa9901dd5..57c6c06cb63 100644
--- a/src/devices/cpu/i386/i386op16.hxx
+++ b/src/devices/cpu/i386/i386op16.hxx
@@ -1185,10 +1185,20 @@ void i386_device::i386_enter16() // Opcode 0xc8
if(level > 0)
{
- for(x=1;x<level-1;x++)
+ for(x=1;x<=level-1;x++)
{
- REG16(BP) -= 2;
- PUSH16(READ16(REG16(BP)));
+ uint32_t addr;
+ if(!STACK_32BIT)
+ {
+ REG16(BP) -= 2;
+ addr = REG16(BP);
+ }
+ else
+ {
+ REG32(EBP) -= 2;
+ addr = REG32(EBP);
+ }
+ PUSH16(READ16(i386_translate(SS, addr, 0)));
}
PUSH16(frameptr);
}