From 56187112a265a871105be78a56e3cb56ec5c7903 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Fri, 23 Oct 2026 09:03:13 +0100 Subject: [PATCH] Implement WAIT (0x9B) opcode support --- cpu.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cpu.c b/cpu.c index eb9d789..086ee31 100644 --- a/cpu.c +++ b/cpu.c @@ -4260,6 +4260,26 @@ fetch_instruction: } + case 0x9B: /* WAIT / FWAIT */ + + if ((cpu->cr0 & 0x0000000AUL) == 0x0000000AUL) { + + cpu->ip = (uint32_t) old_ip; + + if (cpu->cr0 & 1) { + + if (cpu_protected_interrupt (cpu, 7) != 0) { + return -1; + } + + } else { + handle_interrupt (cpu, 7); + } + + } + + break; + case 0x9C: /* PUSHF (Push Flags onto Stack) */ if (cpu->has_operand_override) { -- 2.34.1