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); } }
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_SFT _sar_e16_cl(UINT32 madr, REG8 cl) { UINT32 src; UINT32 dst; src = i286_memoryread_w(madr); WORD_SARCL(dst, src, cl) i286_memorywrite_w(madr, (REG16)dst); }
I286_SFT _sar_e16_1(UINT32 madr) { UINT32 src; UINT32 dst; src = i286_memoryread_w(madr); WORD_SAR1(dst, src) i286_memorywrite_w(madr, (REG16)dst); }
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 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; } }