From 745c9f3eb52bd614c08926e9939ad396aa0bc361 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 8 Aug 2022 02:24:20 +0200 Subject: [PATCH] Another fix. --- src/cpu/x86_ops_bcd.h | 7 ++++++- src/cpu/x86seg.c | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/cpu/x86_ops_bcd.h b/src/cpu/x86_ops_bcd.h index 2f64cbaf8..efb0de264 100644 --- a/src/cpu/x86_ops_bcd.h +++ b/src/cpu/x86_ops_bcd.h @@ -32,7 +32,12 @@ static int opAAM(uint32_t fetchdat) { int base = getbytef(); - if (!base || !cpu_isintel) base = 10; + if (base == 0) { + x86de(NULL, 0); + return 1; + } + + if (!cpu_isintel) base = 10; AH = AL / base; AL %= base; diff --git a/src/cpu/x86seg.c b/src/cpu/x86seg.c index c9398dd69..2fda437e7 100644 --- a/src/cpu/x86seg.c +++ b/src/cpu/x86seg.c @@ -168,8 +168,12 @@ x86_doabrt(int x86_abrt) void x86de(char *s, uint16_t error) { +#ifdef BAD_CODE cpu_state.abrt = ABRT_DE; abrt_error = error; +#else + x86_int(0); +#endif }