Fix flags on the AAM and AAD instructions.

This commit is contained in:
OBattler
2024-10-16 06:56:55 +02:00
parent 0a3f1e3279
commit e8c1dc1bac
2 changed files with 7 additions and 4 deletions

View File

@@ -3154,8 +3154,10 @@ execx86(int cycs)
#else
cpu_src = pfq_fetchb();
#endif
if (x86_div(AL, 0))
set_pzs(16);
if (x86_div(AL, 0)) {
cpu_data = AL;
set_pzs(8);
}
break;
case 0xD5: /*AAD*/
wait(1, 0);
@@ -3169,6 +3171,7 @@ execx86(int cycs)
add(8);
AL = cpu_data;
AH = 0x00;
set_pzs(8);
break;
case 0xD6: /*SALC*/
wait(1, 0);

View File

@@ -24,7 +24,7 @@ opAAD(uint32_t fetchdat)
base = 10;
AL = (AH * base) + AL;
AH = 0;
setznp16(AX);
setznp8(AL);
CLOCK_CYCLES((is486) ? 14 : 19);
PREFETCH_RUN(is486 ? 14 : 19, 2, -1, 0, 0, 0, 0, 0);
return 0;
@@ -39,7 +39,7 @@ opAAM(uint32_t fetchdat)
base = 10;
AH = AL / base;
AL %= base;
setznp16(AX);
setznp8(AL);
CLOCK_CYCLES((is486) ? 15 : 17);
PREFETCH_RUN(is486 ? 15 : 17, 2, -1, 0, 0, 0, 0, 0);
return 0;