bios_emulator: fix incorrect printing of address in "call near immediate"
authorYuri Zaporozhets <yuriz@qrv-systems.net>
Sat, 30 Nov 2024 20:56:25 +0000 (21:56 +0100)
committerTom Rini <trini@konsulko.com>
Sun, 15 Dec 2024 17:39:21 +0000 (11:39 -0600)
commit5fb5180a1616b714a289ae4c8ff447e5ee0bddb0
treeb173264bbffcc1f9db661977bfc57f4c78dc4913
parent82a59b45d3fc720831eaacd5b76c796c00912832
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>
drivers/bios_emulator/x86emu/ops.c