diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/x86emu/x86emu.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/sys/dev/x86emu/x86emu.c b/sys/dev/x86emu/x86emu.c index 2ab27ab4d72..21efc90f8c0 100644 --- a/sys/dev/x86emu/x86emu.c +++ b/sys/dev/x86emu/x86emu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x86emu.c,v 1.6 2014/03/29 18:09:31 guenther Exp $ */ +/* $OpenBSD: x86emu.c,v 1.7 2014/06/15 11:00:38 pirofti Exp $ */ /* $NetBSD: x86emu.c,v 1.7 2009/02/03 19:26:29 joerg Exp $ */ /* @@ -3756,12 +3756,19 @@ x86emuOp_out_word_IMM_AX(struct x86emu *emu) static void x86emuOp_call_near_IMM(struct x86emu *emu) { - int16_t ip; - - ip = (int16_t) fetch_word_imm(emu); - ip += (int16_t) emu->x86.R_IP; /* CHECK SIGN */ - push_word(emu, emu->x86.R_IP); - emu->x86.R_IP = ip; + if (emu->x86.mode & SYSMODE_PREFIX_DATA) { + int32_t ip; + ip = (int32_t) fetch_long_imm(emu); + ip += (int32_t) emu->x86.R_EIP; + push_long(emu, emu->x86.R_EIP); + emu->x86.R_EIP = ip; + } else { + int16_t ip; + ip = (int16_t) fetch_word_imm(emu); + ip += (int16_t) emu->x86.R_IP; /* CHECK SIGN */ + push_word(emu, emu->x86.R_IP); + emu->x86.R_IP = ip; + } } /* |