AltairZ80: i86: Fix bug in AAD instruction.

This commit is contained in:
Howard M. Harte 2022-11-05 19:46:53 -07:00 committed by Paul Koning
parent 3bba1bbe14
commit e1d27aa167

View file

@ -4121,7 +4121,7 @@ static void i86op_opcD3_word_RM_CL(PC_ENV *m)
/* opcode=0xd4*/
static void i86op_aam(PC_ENV *m)
{ uint8 a;
a = fetch_byte_imm(m); /* this is a stupid encoding. */
a = fetch_byte_imm(m);
if (a != 10)
sim_printf("CPU: " ADDRESS_FORMAT " Error decoding AAM: Expected 0x0a but got 0x%2x.\n", m->Sp_regs.IP.I16_reg.x_reg, a);
/* note the type change here --- returning AL and AH in AX. */
@ -4132,6 +4132,10 @@ static void i86op_aam(PC_ENV *m)
/* opcode=0xd5*/
static void i86op_aad(PC_ENV *m)
{
uint8 a;
a = fetch_byte_imm(m);
if (a != 10)
sim_printf("CPU: " ADDRESS_FORMAT " Error decoding AAD: Expected 0x0a but got 0x%2x.\n", m->Sp_regs.IP.I16_reg.x_reg, a);
m->R_AX = aad_word(m,m->R_AX);
DECODE_CLEAR_SEGOVR(m);
}