diff options
author | Yuri Zaporozhets <yuriz@qrv-systems.net> | 2024-11-30 21:56:25 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-12-15 11:39:21 -0600 |
commit | 5fb5180a1616b714a289ae4c8ff447e5ee0bddb0 (patch) | |
tree | b173264bbffcc1f9db661977bfc57f4c78dc4913 /drivers/bios_emulator/x86emu/ops.c | |
parent | 82a59b45d3fc720831eaacd5b76c796c00912832 (diff) |
bios_emulator: fix incorrect printing of address in "call near immediate"
In the x86emuOp_call_near_IMM() function the address of CALL is
printed incorrectly when jumping backwards. For example, the correct
disassemble of the bytes below would be:
0000E8DE E8DBFF call 0xe8bc
(verified by ndisasm). But instead the address is printed as "ffffe8bc".
That's because of the following macro:
DECODE_PRINTF2("%04x\n", ip);
while it should be
DECODE_PRINTF2("%04x\n", (u16)ip);
Signed-off-by: Yuri Zaporozhets <yuriz@qrv-systems.net>
Diffstat (limited to 'drivers/bios_emulator/x86emu/ops.c')
-rw-r--r-- | drivers/bios_emulator/x86emu/ops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/bios_emulator/x86emu/ops.c b/drivers/bios_emulator/x86emu/ops.c index 57422ec3d47..31b52df9bfe 100644 --- a/drivers/bios_emulator/x86emu/ops.c +++ b/drivers/bios_emulator/x86emu/ops.c @@ -4200,7 +4200,7 @@ void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1)) DECODE_PRINTF("CALL\t"); ip = (s16) fetch_word_imm(); ip += (s16) M.x86.R_IP; /* CHECK SIGN */ - DECODE_PRINTF2("%04x\n", ip); + DECODE_PRINTF2("%04x\n", (u16)ip); CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip, ""); TRACE_AND_STEP(); push_word(M.x86.R_IP); |