--- src/include/cpu.h Wed Jun 26 21:58:32 2002 +++ src/include/cpu.h Sat Jul 27 23:12:23 2002 @@ -198,6 +198,10 @@ #define set_TF() (_EFLAGS |= TF) #define clear_TF() (_EFLAGS &= ~TF) #define isset_TF() ((_EFLAGS & TF) != 0) + /* alignment flag */ +#define set_AC() (_EFLAGS |= AC) +#define clear_AC() (_EFLAGS &= ~AC) +#define isset_AC() ((_EFLAGS & AC) != 0) /* Virtual Interrupt Pending flag */ #define set_VIP() (_EFLAGS |= VIP) #define clear_VIP() (_EFLAGS &= ~VIP) --- src/emu-i386/do_vm86.c Fri Jul 26 21:16:46 2002 +++ src/emu-i386/do_vm86.c Sun Jul 28 00:06:46 2002 @@ -506,6 +506,14 @@ pic_iret(); break; case VM86_INTx: + /* + * AC flag gets cleared by the INT instruction and is not restored + * by IRET because it resides in the higher word of eflags and + * hence not saved in the stack. + * However we can't clear it in real_run_int() et al because + * it is not cleared by hardware interrupts (???) + */ + clear_AC(); #ifdef USE_MHPDBG mhp_debug(DBG_INTx + (VM86_ARG(retval) << 8), 0, 0); #endif --- src/dosext/dpmi/dpmi.c Sun Jun 23 23:42:23 2002 +++ src/dosext/dpmi/dpmi.c Sun Jul 28 00:07:35 2002 @@ -2240,6 +2227,14 @@ pic_iret(); break; case VM86_INTx: + /* + * AC flag gets cleared by the INT instruction and is not restored + * by IRET because it resides in the higher word of eflags and + * hence not saved in the stack. + * However we can't clear it in real_run_int() et al because + * it is not cleared by hardware interrupts (???) + */ + clear_AC(); #ifdef X86_EMULATOR D_printf("DPMI: Return from vm86() for interrupt\n"); #endif