mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
i386: fix enter insn (nw)
This commit is contained in:
parent
4187ef61d0
commit
85c7144e0d
@ -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);
|
||||
}
|
||||
|
@ -1030,10 +1030,20 @@ void i386_device::i386_enter32() // Opcode 0xc8
|
||||
|
||||
if(level > 0)
|
||||
{
|
||||
for(x=1;x<level-1;x++)
|
||||
for(x=1;x<=level-1;x++)
|
||||
{
|
||||
REG32(EBP) -= 4;
|
||||
PUSH32(READ32(REG32(EBP)));
|
||||
uint32_t addr;
|
||||
if(!STACK_32BIT)
|
||||
{
|
||||
REG16(BP) -= 4;
|
||||
addr = REG16(BP);
|
||||
}
|
||||
else
|
||||
{
|
||||
REG32(EBP) -= 4;
|
||||
addr = REG32(EBP);
|
||||
}
|
||||
PUSH32(READ32(i386_translate(SS, addr, 0)));
|
||||
}
|
||||
PUSH32(frameptr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user