summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2014-11-01 08:57:11 -0500
committer cracyc <cracyc@users.noreply.github.com>2014-11-01 08:59:58 -0500
commitff9eb8418257c9fc40f8fa8493739713ae3f5c67 (patch)
treed9d2865202911e4b066a4a85a164aea8192cb9b5
parent384f7653e14008e2e1df580591b7cd07cabf7001 (diff)
i386: call with expand down stack [Carl]
-rw-r--r--src/emu/cpu/i386/i386.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/emu/cpu/i386/i386.c b/src/emu/cpu/i386/i386.c
index b9593ddfed7..32374631565 100644
--- a/src/emu/cpu/i386/i386.c
+++ b/src/emu/cpu/i386/i386.c
@@ -1686,17 +1686,17 @@ void i386_device::i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect,
}
if (operand32 != 0) // if 32-bit
{
- if(REG32(ESP) < 8)
+ if(i386_limit_check(SS, REG32(ESP) - 8))
{
- logerror("CALL: Stack has no room for return address.\n");
+ logerror("CALL (%08x): Stack has no room for return address.\n",m_pc);
FAULT(FAULT_SS,0) // #SS(0)
}
}
else
{
- if(REG16(SP) < 4)
+ if(i386_limit_check(SS, (REG16(SP) - 4) & 0xffff))
{
- logerror("CALL: Stack has no room for return address.\n");
+ logerror("CALL (%08x): Stack has no room for return address.\n",m_pc);
FAULT(FAULT_SS,0) // #SS(0)
}
}
@@ -1944,7 +1944,7 @@ void i386_device::i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect,
/* same privilege */
if (operand32 != 0) // if 32-bit
{
- if(REG32(ESP) < 8)
+ if(i386_limit_check(SS, REG32(ESP) - 8))
{
logerror("CALL: Stack has no room for return address.\n");
FAULT(FAULT_SS,0) // #SS(0)
@@ -1954,7 +1954,7 @@ void i386_device::i386_protected_mode_call(UINT16 seg, UINT32 off, int indirect,
}
else
{
- if(REG16(SP) < 4)
+ if(i386_limit_check(SS, (REG16(SP) - 4) & 0xffff))
{
logerror("CALL: Stack has no room for return address.\n");
FAULT(FAULT_SS,0) // #SS(0)