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 }