From bbd22d76bed388be541dd160db15161300ea6306 Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Mon, 13 Oct 2025 15:40:58 +0800 Subject: [INTERP] Fixed 16bit PUSH/POP opcodes (#3064) --- src/emu/x64run66.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/emu') diff --git a/src/emu/x64run66.c b/src/emu/x64run66.c index 49e9ce18..10d62acb 100644 --- a/src/emu/x64run66.c +++ b/src/emu/x64run66.c @@ -205,7 +205,8 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0x55: case 0x56: case 0x57: /* PUSH Reg */ - tmp16u = emu->regs[opcode&7].word[0]; + tmp8u = (opcode&7)+(rex.b<<3); + tmp16u = emu->regs[tmp8u].word[0]; Push16(emu, tmp16u); break; case 0x58: @@ -216,7 +217,7 @@ uintptr_t Run66(x64emu_t *emu, rex_t rex, uintptr_t addr) case 0x5D: case 0x5E: case 0x5F: /* POP Reg */ - tmp8u = opcode&7; + tmp8u = (opcode&7)+(rex.b<<3); emu->regs[tmp8u].word[0] = Pop16(emu); break; case 0x60: /* PUSHA */ -- cgit 1.4.1