I286FN v30shift_ea8_data8(void) { // C0: shift EA8, DATA8 UINT8 *out; UINT op; UINT32 madr; REG8 cl; GET_PCBYTE(op) if (op >= 0xc0) { I286_WORKCLOCK(5); out = REG8_B20(op); } else { I286_WORKCLOCK(8); madr = CALC_EA(op); if (madr >= I286_MEMWRITEMAX) { GET_PCBYTE(cl) I286_WORKCLOCK(cl); if (!(op & 0x20)) { // rotate if (!(op & 0x10)) { cl = rotatebase16[cl]; } else { // rotate with carry cl = rotatebase09[cl]; } } else { cl = max(cl, 9); } sft_e8cl_table[(op >> 3) & 7](madr, cl); return; } out = mem + madr; }
I286_F6 _dec_ea8(UINT op) { UINT32 madr; UINT8 *out; REG8 res; if (op >= 0xc0) { I286_WORKCLOCK(2); out = REG8_B20(op); } else { I286_WORKCLOCK(7); madr = CALC_EA(op); if (madr >= I286_MEMWRITEMAX) { res = i286_memoryread(madr); DECBYTE(res) i286_memorywrite(madr, res); return; } out = mem + madr; } res = *out; DECBYTE(res) *out = (UINT8)res; }
I286_F6 _dec_ea16(UINT op) { UINT32 madr; UINT16 *out; REG16 res; if (op >= 0xc0) { I286_WORKCLOCK(2); out = REG16_B20(op); } else { I286_WORKCLOCK(7); madr = CALC_EA(op); if (INHIBIT_WORDP(madr)) { res = i286_memoryread_w(madr); DECWORD(res) i286_memorywrite_w(madr, res); return; } out = (UINT16 *)(mem + madr); } res = *out; DECWORD(res) *out = (UINT16)res; }
I286_F6 _jmp_ea16(UINT op) { if (op >= 0xc0) { I286_WORKCLOCK(7); I286_IP = *(REG16_B20(op)); } else { I286_WORKCLOCK(11); I286_IP = i286_memoryread_w(CALC_EA(op)); } }
I286_F6 _push_ea16(UINT op) { UINT16 src; if (op >= 0xc0) { I286_WORKCLOCK(3); src = *(REG16_B20(op)); } else { I286_WORKCLOCK(5); src = i286_memoryread_w(CALC_EA(op)); } REGPUSH0(src); }
I286_F6 _call_ea16(UINT op) { UINT16 src; if (op >= 0xc0) { I286_WORKCLOCK(7); src = *(REG16_B20(op)); } else { I286_WORKCLOCK(11); src = i286_memoryread_w(CALC_EA(op)); } REGPUSH0(I286_IP); I286_IP = src; }
I286FN v30_popf(void) { // 9D: popf I286_WORKCLOCK(5); REGPOP0(I286_FLAG) I286_FLAG |= 0xf000; I286_OV = I286_FLAG & O_FLAG; I286_FLAG &= (0xfff ^ O_FLAG); I286_TRAP = ((I286_FLAG & 0x300) == 0x300); I286IRQCHECKTERM }
I286FN v30mov_seg_ea(void) { // 8E: mov segrem, EA UINT op; UINT tmp; UINT16 ipbak; ipbak = I286_IP; GET_PCBYTE(op); if (op >= 0xc0) { I286_WORKCLOCK(2); tmp = *(REG16_B20(op)); } else { I286_WORKCLOCK(5); tmp = i286_memoryread_w(CALC_EA(op)); } switch(op & 0x18) { case 0x00: // es I286_ES = (UINT16)tmp; ES_BASE = tmp << 4; break; case 0x08: // cs I286_CS = (UINT16)tmp; CS_BASE = tmp << 4; break; case 0x10: // ss I286_SS = (UINT16)tmp; SS_BASE = tmp << 4; SS_FIX = SS_BASE; NEXT_OPCODE break; case 0x18: // ds I286_DS = (UINT16)tmp; DS_BASE = tmp << 4; DS_FIX = DS_BASE; break; } }
I286_F6 _pop_ea16(UINT op) { UINT16 src; REGPOP0(src); I286_WORKCLOCK(5); if (op >= 0xc0) { *(REG16_B20(op)) = src; } else { i286_memorywrite_w(CALC_EA(op), src); } }
I286_F6 _jmp_far_ea16(UINT op) { UINT32 seg; UINT ad; I286_WORKCLOCK(11); if (op < 0xc0) { ad = GET_EA(op, &seg); I286_IP = i286_memoryread_w(seg + ad); I286_CS = i286_memoryread_w(seg + LOW16(ad + 2)); CS_BASE = SEGSELECT(I286_CS); } else { INT_NUM(6, I286_IP - 2); } }
I286FN v30_reserved(void) { I286_WORKCLOCK(2); }