From a2c6e8305a8e60a0bfbdc4647152b14ad044f16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Strohh=C3=A4cker?= Date: Wed, 19 Jul 2006 10:30:29 +0000 Subject: [PATCH] merge AAM-fixes Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2673 --- src/cpu/instructions.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/cpu/instructions.h b/src/cpu/instructions.h index bcda9acb..93a79584 100644 --- a/src/cpu/instructions.h +++ b/src/cpu/instructions.h @@ -578,10 +578,11 @@ SETFLAGBIT(PF,parity_lookup[reg_al]); #define AAM(op1) \ - if ((Bit8u)op1!=0) { \ - Bit8u BLAH=op1; \ - reg_ah=reg_al / BLAH; \ - reg_al=reg_al % BLAH; \ +{ \ + Bit8u dv=op1; \ + if (dv!=0) { \ + reg_ah=reg_al / dv; \ + reg_al=reg_al % dv; \ SETFLAGBIT(SF,(reg_al & 0x80)); \ SETFLAGBIT(ZF,(reg_al == 0)); \ SETFLAGBIT(PF,parity_lookup[reg_al]); \ @@ -589,7 +590,8 @@ SETFLAGBIT(OF,0); \ SETFLAGBIT(AF,0); \ lflags.type=t_UNKNOWN; \ - } else EXCEPTION(0); + } else EXCEPTION(0); \ +} //Took this from bochs, i seriously hate these weird bcd opcodes