--- np2/i286c/i286c_mn.c 2003/10/16 17:57:42 1.1 +++ np2/i286c/i286c_mn.c 2003/10/17 12:49:52 1.4 @@ -81,7 +81,7 @@ I286FN _add_ea_r16(void) { // 01: a if (INHIBIT_WORDP(madr)) { dst = i286_memoryread_w(madr); ADDWORD(res, dst, src); - i286_memorywrite_w(madr, (WORD)res); + i286_memorywrite_w(madr, (UINT16)res); return; } out = (UINT16 *)(mem + madr); @@ -138,7 +138,7 @@ I286FN _add_ax_data16(void) { // 05: I286_CLOCK(3) GET_PCWORD(src); ADDWORD(res, I286_AX, src); - I286_AX = (WORD)res; + I286_AX = (UINT16)res; } I286FN _push_es(void) { // 06: push es @@ -155,7 +155,10 @@ I286FN _pop_es(void) { // 07: pop I286FN _or_ea_r8(void) { // 08: or EA, REG8 BYTE *out; - DWORD op, src, dst, madr; + UINT op; + UINT src; + UINT dst; + UINT32 madr; PREPART_EA_REG8(op, src); if (op >= 0xc0) { @@ -178,8 +181,11 @@ I286FN _or_ea_r8(void) { // 08: or I286FN _or_ea_r16(void) { // 09: or EA, REG16 - WORD *out; - DWORD op, src, dst, madr; + UINT16 *out; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -192,10 +198,10 @@ I286FN _or_ea_r16(void) { // 09: o if (INHIBIT_WORDP(madr)) { dst = i286_memoryread_w(madr); ORWORD(dst, src); - i286_memorywrite_w(madr, (WORD)dst); + i286_memorywrite_w(madr, (UINT16)dst); return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } ORWORD(*out, src); } @@ -203,7 +209,8 @@ I286FN _or_ea_r16(void) { // 09: o I286FN _or_r8_ea(void) { // 0a: or REG8, EA BYTE *out; - DWORD op, src; + UINT op; + UINT src; PREPART_REG8_EA(op, src, out, 2, 7); ORBYTE(*out, src); @@ -211,8 +218,9 @@ I286FN _or_r8_ea(void) { // 0a: or I286FN _or_r16_ea(void) { // 0b: or REG16, EA - WORD *out; - DWORD op, src; + UINT16 *out; + UINT op; + UINT32 src; PREPART_REG16_EA(op, src, out, 2, 7); ORWORD(*out, src); @@ -220,7 +228,7 @@ I286FN _or_r16_ea(void) { // 0b: or I286FN _or_al_data8(void) { // 0c: or al, DATA8 - DWORD src; + UINT src; I286_CLOCK(3) GET_PCBYTE(src); @@ -229,7 +237,7 @@ I286FN _or_al_data8(void) { // 0c: I286FN _or_ax_data16(void) { // 0d: or ax, DATA16 - DWORD src; + UINT32 src; I286_CLOCK(3) GET_PCWORD(src); @@ -244,7 +252,11 @@ I286FN _push_cs(void) { // 0e: pus I286FN _adc_ea_r8(void) { // 10: adc EA, REG8 BYTE *out; - DWORD op, src, dst, res, madr; + UINT op; + UINT src; + UINT dst; + UINT res; + UINT32 madr; PREPART_EA_REG8(op, src); if (op >= 0xc0) { @@ -269,8 +281,12 @@ I286FN _adc_ea_r8(void) { // 10: ad I286FN _adc_ea_r16(void) { // 11: adc EA, REG16 - WORD *out; - DWORD op, src, dst, res, madr; + UINT16 *out; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -283,20 +299,23 @@ I286FN _adc_ea_r16(void) { // 11: a if (INHIBIT_WORDP(madr)) { dst = i286_memoryread_w(madr); ADCWORD(res, dst, src); - i286_memorywrite_w(madr, (WORD)res); + i286_memorywrite_w(madr, (UINT16)res); return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } dst = *out; ADCWORD(res, dst, src); - *out = (WORD)res; + *out = (UINT16)res; } I286FN _adc_r8_ea(void) { // 12: adc REG8, EA BYTE *out; - DWORD op, src, dst, res; + UINT op; + UINT src; + UINT dst; + UINT res; PREPART_REG8_EA(op, src, out, 2, 7); dst = *out; @@ -306,18 +325,22 @@ I286FN _adc_r8_ea(void) { // 12: ad I286FN _adc_r16_ea(void) { // 13: adc REG16, EA - WORD *out; - DWORD op, src, dst, res; + UINT16 *out; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; PREPART_REG16_EA(op, src, out, 2, 7); dst = *out; ADCWORD(res, dst, src); - *out = (WORD)res; + *out = (UINT16)res; } I286FN _adc_al_data8(void) { // 14: adc al, DATA8 - DWORD src, res; + UINT src; + UINT res; I286_CLOCK(3) GET_PCBYTE(src); @@ -327,12 +350,13 @@ I286FN _adc_al_data8(void) { // 14: I286FN _adc_ax_data16(void) { // 15: adc ax, DATA16 - DWORD src, res; + UINT32 src; + UINT32 res; I286_CLOCK(3) GET_PCWORD(src); ADCWORD(res, I286_AX, src); - I286_AX = (WORD)res; + I286_AX = (UINT16)res; } I286FN _push_ss(void) { // 16: push ss @@ -343,7 +367,7 @@ I286FN _push_ss(void) { // 16: pus I286FN _pop_ss(void) { // 17: pop ss REGPOP(I286_SS, 5) - SS_BASE = (DWORD)I286_SS << 4; + SS_BASE = I286_SS << 4; SS_FIX = SS_BASE; NEXT_OPCODE } @@ -351,7 +375,11 @@ I286FN _pop_ss(void) { // 17: pop I286FN _sbb_ea_r8(void) { // 18: sbb EA, REG8 BYTE *out; - DWORD op, src, dst, res, madr; + UINT op; + UINT src; + UINT dst; + UINT res; + UINT32 madr; PREPART_EA_REG8(op, src); if (op >= 0xc0) { @@ -376,8 +404,12 @@ I286FN _sbb_ea_r8(void) { // 18: sb I286FN _sbb_ea_r16(void) { // 19: sbb EA, REG16 - WORD *out; - DWORD op, src, dst, res, madr; + UINT16 *out; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -390,20 +422,23 @@ I286FN _sbb_ea_r16(void) { // 19: s if (INHIBIT_WORDP(madr)) { dst = i286_memoryread_w(madr); SBBWORD(res, dst, src); - i286_memorywrite_w(madr, (WORD)res); + i286_memorywrite_w(madr, (UINT16)res); return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } dst = *out; SBBWORD(res, dst, src); - *out = (WORD)res; + *out = (UINT16)res; } I286FN _sbb_r8_ea(void) { // 1a: sbb REG8, EA BYTE *out; - DWORD op, src, dst, res; + UINT op; + UINT src; + UINT dst; + UINT32 res; PREPART_REG8_EA(op, src, out, 2, 7); dst = *out; @@ -413,18 +448,22 @@ I286FN _sbb_r8_ea(void) { // 1a: sb I286FN _sbb_r16_ea(void) { // 1b: sbb REG16, EA - WORD *out; - DWORD op, src, dst, res; + UINT16 *out; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; PREPART_REG16_EA(op, src, out, 2, 7); dst = *out; SBBWORD(res, dst, src); - *out = (WORD)res; + *out = (UINT16)res; } I286FN _sbb_al_data8(void) { // 1c: adc al, DATA8 - DWORD src, res; + UINT src; + UINT res; I286_CLOCK(3) GET_PCBYTE(src); @@ -434,12 +473,13 @@ I286FN _sbb_al_data8(void) { // 1c: I286FN _sbb_ax_data16(void) { // 1d: adc ax, DATA16 - DWORD src, res; + UINT32 src; + UINT32 res; I286_CLOCK(3) GET_PCWORD(src); SBBWORD(res, I286_AX, src); - I286_AX = (WORD)res; + I286_AX = (UINT16)res; } I286FN _push_ds(void) { // 1e: push ds @@ -450,14 +490,17 @@ I286FN _push_ds(void) { // 1e: pus I286FN _pop_ds(void) { // 1f: pop ds REGPOP(I286_DS, 5) - DS_BASE = (DWORD)I286_DS << 4; + DS_BASE = I286_DS << 4; DS_FIX = DS_BASE; } I286FN _and_ea_r8(void) { // 20: and EA, REG8 BYTE *out; - DWORD op, src, dst, madr; + UINT op; + UINT src; + UINT dst; + UINT32 madr; PREPART_EA_REG8(op, src); if (op >= 0xc0) { @@ -480,8 +523,11 @@ I286FN _and_ea_r8(void) { // 20: an I286FN _and_ea_r16(void) { // 21: and EA, REG16 - WORD *out; - DWORD op, src, dst, madr; + UINT16 *out; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -494,10 +540,10 @@ I286FN _and_ea_r16(void) { // 21: a if (INHIBIT_WORDP(madr)) { dst = i286_memoryread_w(madr); ANDWORD(dst, src); - i286_memorywrite_w(madr, (WORD)dst); + i286_memorywrite_w(madr, (UINT16)dst); return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } ANDWORD(*out, src); } @@ -505,7 +551,8 @@ I286FN _and_ea_r16(void) { // 21: a I286FN _and_r8_ea(void) { // 22: and REG8, EA BYTE *out; - DWORD op, src; + UINT op; + UINT src; PREPART_REG8_EA(op, src, out, 2, 7); ANDBYTE(*out, src); @@ -513,8 +560,9 @@ I286FN _and_r8_ea(void) { // 22: an I286FN _and_r16_ea(void) { // 23: and REG16, EA - WORD *out; - DWORD op, src; + UINT16 *out; + UINT op; + UINT32 src; PREPART_REG16_EA(op, src, out, 2, 7); ANDWORD(*out, src); @@ -522,7 +570,7 @@ I286FN _and_r16_ea(void) { // 23: a I286FN _and_al_data8(void) { // 24: and al, DATA8 - DWORD src; + UINT src; I286_CLOCK(3) GET_PCBYTE(src); @@ -531,7 +579,7 @@ I286FN _and_al_data8(void) { // 24: I286FN _and_ax_data16(void) { // 25: and ax, DATA16 - DWORD src; + UINT32 src; I286_CLOCK(3) GET_PCWORD(src); @@ -542,13 +590,13 @@ I286FN _segprefix_es(void) { // 26: SS_FIX = ES_BASE; DS_FIX = ES_BASE; - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op[op](); REMOVE_PREFIX - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -577,7 +625,11 @@ I286FN _daa(void) { // 27: daa I286FN _sub_ea_r8(void) { // 28: sub EA, REG8 BYTE *out; - DWORD op, src, dst, res, madr; + UINT op; + UINT src; + UINT dst; + UINT res; + UINT32 madr; PREPART_EA_REG8(op, src); if (op >= 0xc0) { @@ -602,8 +654,12 @@ I286FN _sub_ea_r8(void) { // 28: su I286FN _sub_ea_r16(void) { // 29: sub EA, REG16 - WORD *out; - DWORD op, src, dst, res, madr; + UINT16 *out; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -616,20 +672,23 @@ I286FN _sub_ea_r16(void) { // 29: s if (INHIBIT_WORDP(madr)) { dst = i286_memoryread_w(madr); WORD_SUB(res, dst, src); - i286_memorywrite_w(madr, (WORD)res); + i286_memorywrite_w(madr, (UINT16)res); return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } dst = *out; WORD_SUB(res, dst, src); - *out = (WORD)res; + *out = (UINT16)res; } I286FN _sub_r8_ea(void) { // 2a: sub REG8, EA BYTE *out; - DWORD op, src, dst, res; + UINT op; + UINT src; + UINT dst; + UINT res; PREPART_REG8_EA(op, src, out, 2, 7); dst = *out; @@ -639,18 +698,22 @@ I286FN _sub_r8_ea(void) { // 2a: su I286FN _sub_r16_ea(void) { // 2b: sub REG16, EA - WORD *out; - DWORD op, src, dst, res; + UINT16 *out; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; PREPART_REG16_EA(op, src, out, 2, 7); dst = *out; WORD_SUB(res, dst, src); - *out = (WORD)res; + *out = (UINT16)res; } I286FN _sub_al_data8(void) { // 2c: sub al, DATA8 - DWORD src, res; + UINT src; + UINT res; I286_CLOCK(3) GET_PCBYTE(src); @@ -660,25 +723,26 @@ I286FN _sub_al_data8(void) { // 2c: I286FN _sub_ax_data16(void) { // 2d: sub ax, DATA16 - DWORD src, res; + UINT32 src; + UINT32 res; I286_CLOCK(3) GET_PCWORD(src); WORD_SUB(res, I286_AX, src); - I286_AX = (WORD)res; + I286_AX = (UINT16)res; } I286FN _segprefix_cs(void) { // 2e: cs: SS_FIX = CS_BASE; DS_FIX = CS_BASE; - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op[op](); REMOVE_PREFIX - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -694,7 +758,7 @@ I286FN _das(void) { // 2f: das } if ((I286_FLAGL & A_FLAG) || ((I286_AL & 0x0f) > 9)) { I286_FLAGL |= A_FLAG; - I286_FLAGL |= (((DWORD)I286_AL - 6) >> 8) & 1; + I286_FLAGL |= ((I286_AL - 6) >> 8) & 1; I286_AL -= 6; } I286_FLAGL &= A_FLAG | C_FLAG; @@ -704,7 +768,10 @@ I286FN _das(void) { // 2f: das I286FN _xor_ea_r8(void) { // 30: xor EA, REG8 BYTE *out; - DWORD op, src, dst, madr; + UINT op; + UINT src; + UINT dst; + UINT32 madr; PREPART_EA_REG8(op, src); if (op >= 0xc0) { @@ -727,8 +794,11 @@ I286FN _xor_ea_r8(void) { // 30: xo I286FN _xor_ea_r16(void) { // 31: xor EA, REG16 - WORD *out; - DWORD op, src, dst, madr; + UINT16 *out; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -741,10 +811,10 @@ I286FN _xor_ea_r16(void) { // 31: x if (INHIBIT_WORDP(madr)) { dst = i286_memoryread_w(madr); WORD_XOR(dst, src); - i286_memorywrite_w(madr, (WORD)dst); + i286_memorywrite_w(madr, (UINT16)dst); return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } WORD_XOR(*out, src); } @@ -752,7 +822,8 @@ I286FN _xor_ea_r16(void) { // 31: x I286FN _xor_r8_ea(void) { // 32: xor REG8, EA BYTE *out; - DWORD op, src; + UINT op; + UINT src; PREPART_REG8_EA(op, src, out, 2, 7); BYTE_XOR(*out, src); @@ -760,8 +831,9 @@ I286FN _xor_r8_ea(void) { // 32: xo I286FN _xor_r16_ea(void) { // 33: or REG16, EA - WORD *out; - DWORD op, src; + UINT16 *out; + UINT op; + UINT32 src; PREPART_REG16_EA(op, src, out, 2, 7); WORD_XOR(*out, src); @@ -769,7 +841,7 @@ I286FN _xor_r16_ea(void) { // 33: o I286FN _xor_al_data8(void) { // 34: or al, DATA8 - DWORD src; + UINT src; I286_CLOCK(3) GET_PCBYTE(src); @@ -778,7 +850,7 @@ I286FN _xor_al_data8(void) { // 34: I286FN _xor_ax_data16(void) { // 35: or ax, DATA16 - DWORD src; + UINT32 src; I286_CLOCK(3) GET_PCWORD(src); @@ -789,13 +861,13 @@ I286FN _segprefix_ss(void) { // 36: SS_FIX = SS_BASE; DS_FIX = SS_BASE; - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op[op](); REMOVE_PREFIX - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -817,7 +889,10 @@ I286FN _aaa(void) { // 37: aaa I286FN _cmp_ea_r8(void) { // 38: cmp EA, REG8 - DWORD op, src, dst, res; + UINT op; + UINT src; + UINT dst; + UINT res; PREPART_EA_REG8(op, src); if (op >= 0xc0) { @@ -834,7 +909,10 @@ I286FN _cmp_ea_r8(void) { // 38: cm I286FN _cmp_ea_r16(void) { // 39: cmp EA, REG16 - DWORD op, src, dst, res; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -852,7 +930,10 @@ I286FN _cmp_ea_r16(void) { // 39: c I286FN _cmp_r8_ea(void) { // 3a: cmp REG8, EA BYTE *out; - DWORD op, src, dst, res; + UINT op; + UINT src; + UINT dst; + UINT res; PREPART_REG8_EA(op, src, out, 2, 6); dst = *out; @@ -861,8 +942,11 @@ I286FN _cmp_r8_ea(void) { // 3a: cm I286FN _cmp_r16_ea(void) { // 3b: cmp REG16, EA - WORD *out; - DWORD op, src, dst, res; + UINT16 *out; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; PREPART_REG16_EA(op, src, out, 2, 6); dst = *out; @@ -871,7 +955,8 @@ I286FN _cmp_r16_ea(void) { // 3b: c I286FN _cmp_al_data8(void) { // 3c: cmp al, DATA8 - DWORD src, res; + UINT src; + UINT res; I286_CLOCK(3) GET_PCBYTE(src); @@ -880,7 +965,8 @@ I286FN _cmp_al_data8(void) { // 3c: I286FN _cmp_ax_data16(void) { // 3d: cmp ax, DATA16 - DWORD src, res; + UINT32 src; + UINT32 res; I286_CLOCK(3) GET_PCWORD(src); @@ -891,13 +977,13 @@ I286FN _segprefix_ds(void) { // 3e: SS_FIX = DS_BASE; DS_FIX = DS_BASE; - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op[op](); REMOVE_PREFIX - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -953,8 +1039,9 @@ I286_P _pop_di(void) REGPOP(I286_DI, 5) I286_P _pusha(void) { // 60: pusha - WORD tmp = I286_SP; + UINT16 tmp; + tmp = I286_SP; REGPUSH0(I286_AX) REGPUSH0(I286_CX) REGPUSH0(I286_DX) @@ -981,10 +1068,10 @@ I286_P _popa(void) { // 61: popa I286_P _bound(void) { // 62: bound - DWORD vect = 0; - DWORD op; - DWORD madr; - WORD reg; + UINT vect = 0; + UINT op; + UINT32 madr; + UINT16 reg; I286_CLOCK(13); // ToDo GET_PCBYTE(op); @@ -1007,8 +1094,8 @@ I286_P _bound(void) { // 62: bound I286_P _arpl(void) { // 63: arpl - DWORD op; - DWORD tmp; + UINT op; + UINT tmp; GET_PCBYTE(op) tmp = ((op < 0xc0)?1:0); @@ -1019,7 +1106,7 @@ I286_P _arpl(void) { // 63: arpl I286_P _push_data16(void) { // 68: push DATA16 - WORD tmp; + UINT16 tmp; GET_PCWORD(tmp) REGPUSH(tmp, 3) @@ -1027,20 +1114,21 @@ I286_P _push_data16(void) { // 68: pu I286_P _imul_reg_ea_data16(void) { // 69: imul REG, EA, DATA16 - WORD *out; - DWORD op; - short src, dst; - long res; + UINT16 *out; + UINT op; + SINT16 src; + SINT16 dst; + SINT32 res; PREPART_REG16_EA(op, src, out, 21, 24) GET_PCWORD(dst) WORD_IMUL(res, dst, src) - *out = (WORD)res; + *out = (UINT16)res; } I286_P _push_data8(void) { // 6A: push DATA8 - WORD tmp; + UINT16 tmp; GET_PCBYTES(tmp) REGPUSH(tmp, 3) @@ -1048,15 +1136,16 @@ I286_P _push_data8(void) { // 6A: pus I286_P _imul_reg_ea_data8(void) { // 6B: imul REG, EA, DATA8 - WORD *out; - DWORD op; - short src, dst; - long res; + UINT16 *out; + UINT op; + SINT16 src; + SINT16 dst; + SINT32 res; PREPART_REG16_EA(op, src, out, 21, 24) GET_PCBYTES(dst) WORD_IMUL(res, dst, src) - *out = (WORD)res; + *out = (UINT16)res; } I286_P _insb(void) { // 6C: insb @@ -1071,7 +1160,7 @@ I286_P _insb(void) { // 6C: insb I286_P _insw(void) { // 6D: insw - WORD dat; + UINT16 dat; I286_CLOCK(5) dat = iocore_inp16(I286_DX); @@ -1091,7 +1180,7 @@ I286_P _outsb(void) { // 6E: outsb I286_P _outsw(void) { // 6F: outsw - WORD dat; + UINT16 dat; I286_CLOCK(3) dat = i286_memoryread_w(I286_SI + DS_FIX); @@ -1187,7 +1276,8 @@ I286_P _jnle_short(void) { // 7F: jg I286_P _calc_ea8_i8(void) { // 80: op EA8, DATA8 // 82: op EA8, DATA8 BYTE *out; - DWORD op, madr; + UINT op; + UINT32 madr; GET_PCBYTE(op) if (op >= 0xc0) { @@ -1208,8 +1298,10 @@ I286_P _calc_ea8_i8(void) { // 80: o I286_P _calc_ea16_i16(void) { // 81: op EA16, DATA16 - WORD *out; - DWORD op, madr, src; + UINT16 *out; + UINT op; + UINT32 madr; + UINT32 src; GET_PCBYTE(op) if (op >= 0xc0) { @@ -1224,7 +1316,7 @@ I286_P _calc_ea16_i16(void) { // 81: c_op8xext16_table[(op >> 3) & 7](madr, src); return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } GET_PCWORD(src); c_op8xreg16_table[(op >> 3) & 7](out, src); @@ -1232,8 +1324,10 @@ I286_P _calc_ea16_i16(void) { // 81: I286_P _calc_ea16_i8(void) { // 83: op EA16, DATA8 - WORD *out; - DWORD op, madr, src; + UINT16 *out; + UINT op; + UINT32 madr; + UINT32 src; GET_PCBYTE(op) if (op >= 0xc0) { @@ -1248,7 +1342,7 @@ I286_P _calc_ea16_i8(void) { // 83: o c_op8xext16_table[(op >> 3) & 7](madr, src); return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } GET_PCBYTES(src); c_op8xreg16_table[(op >> 3) & 7](out, src); @@ -1257,7 +1351,10 @@ I286_P _calc_ea16_i8(void) { // 83: o I286_P _test_ea_r8(void) { // 84: test EA, REG8 BYTE *out; - DWORD op, src, tmp, madr; + UINT op; + UINT src; + UINT tmp; + UINT32 madr; PREPART_EA_REG8(op, src); if (op >= 0xc0) { @@ -1280,8 +1377,11 @@ I286_P _test_ea_r8(void) { // 84: te I286_P _test_ea_r16(void) { // 85: test EA, REG16 - WORD *out; - DWORD op, src, tmp, madr; + UINT16 *out; + UINT op; + UINT32 src; + UINT32 tmp; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -1296,7 +1396,7 @@ I286_P _test_ea_r16(void) { // 85: t ANDWORD(tmp, src); return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } tmp = *out; ANDWORD(tmp, src); @@ -1304,8 +1404,10 @@ I286_P _test_ea_r16(void) { // 85: t I286_P _xchg_ea_r8(void) { // 86: xchg EA, REG8 - BYTE *out, *src; - DWORD op, madr; + BYTE *out; + BYTE *src; + UINT op; + UINT32 madr; PREPART_EA_REG8P(op, src); if (op >= 0xc0) { @@ -1328,8 +1430,10 @@ I286_P _xchg_ea_r8(void) { // 86: xc I286_P _xchg_ea_r16(void) { // 87: xchg EA, REG16 - WORD *out, *src; - DWORD op, madr; + UINT16 *out; + UINT16 *src; + UINT op; + UINT32 madr; PREPART_EA_REG16P(op, src); if (op >= 0xc0) { @@ -1340,12 +1444,12 @@ I286_P _xchg_ea_r16(void) { // 87: x I286_CLOCK(5); madr = c_calc_ea_dst[op](); if (INHIBIT_WORDP(madr)) { - WORD tmp = i286_memoryread_w(madr); + UINT16 tmp = i286_memoryread_w(madr); i286_memorywrite_w(madr, *src); *src = tmp; return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } SWAPWORD(*out, *src); } @@ -1353,7 +1457,8 @@ I286_P _xchg_ea_r16(void) { // 87: x I286_P _mov_ea_r8(void) { // 88: mov EA, REG8 BYTE src; - DWORD op, madr; + UINT op; + UINT32 madr; PREPART_EA_REG8(op, src) if (op >= 0xc0) { @@ -1369,8 +1474,8 @@ I286_P _mov_ea_r8(void) { // 88: mov I286_P _mov_ea_r16(void) { // 89: mov EA, REG16 - WORD src; - DWORD op; + UINT16 src; + UINT op; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -1387,7 +1492,7 @@ I286_P _mov_r8_ea(void) { // 8A: mov BYTE *out; BYTE src; - DWORD op; + UINT op; PREPART_REG8_EA(op, src, out, 2, 5); *out = src; @@ -1395,9 +1500,9 @@ I286_P _mov_r8_ea(void) { // 8A: mov I286_P _mov_r16_ea(void) { // 8B: mov REG16, EA - WORD *out; - WORD src; - DWORD op; + UINT16 *out; + UINT16 src; + UINT op; PREPART_REG16_EA(op, src, out, 2, 5); *out = src; @@ -1405,8 +1510,8 @@ I286_P _mov_r16_ea(void) { // 8B: mo I286_P _mov_ea_seg(void) { // 8C: mov EA, segreg - DWORD op; - WORD tmp; + UINT op; + UINT16 tmp; GET_PCBYTE(op); tmp = *SEGMENTPTR((op >> 3) & 3); @@ -1422,7 +1527,7 @@ I286_P _mov_ea_seg(void) { // 8C: mo I286_P _lea_r16_ea(void) { // 8D: lea REG16, EA - DWORD op; + UINT op; I286_CLOCK(3) GET_PCBYTE(op) @@ -1436,9 +1541,9 @@ I286_P _lea_r16_ea(void) { // 8D: le I286_P _mov_seg_ea(void) { // 8E: mov segrem, EA - DWORD op; - WORD tmp; - WORD ipbak; + UINT op; + UINT tmp; + UINT16 ipbak; ipbak = I286_IP; GET_PCBYTE(op); @@ -1452,20 +1557,20 @@ I286_P _mov_seg_ea(void) { // 8E: mo } switch(op & 0x18) { case 0x00: // es - I286_ES = tmp; - ES_BASE = (DWORD)tmp << 4; + I286_ES = (UINT16)tmp; + ES_BASE = tmp << 4; break; case 0x10: // ss - I286_SS = tmp; - SS_BASE = (DWORD)tmp << 4; + I286_SS = (UINT16)tmp; + SS_BASE = tmp << 4; SS_FIX = SS_BASE; NEXT_OPCODE break; case 0x18: // ds - I286_DS = tmp; - DS_BASE = (DWORD)tmp << 4; + I286_DS = (UINT16)tmp; + DS_BASE = tmp << 4; DS_FIX = DS_BASE; break; @@ -1477,8 +1582,8 @@ I286_P _mov_seg_ea(void) { // 8E: mo I286_P _pop_ea(void) { // 8F: pop EA - DWORD op; - WORD tmp; + UINT op; + UINT16 tmp; I286_CLOCK(5) REGPOP0(tmp) @@ -1495,16 +1600,16 @@ I286_P _pop_ea(void) { // 8F: pop I286_P _nop(void) { // 90: nop / bios func #if 1 // call BIOS - DWORD adrs; + UINT32 adrs; adrs = ((I286_IP - 1) & 0xffff) + CS_BASE; if ((adrs >= 0xf8000) && (adrs < 0x100000)) { biosfunc(adrs); - ES_BASE = (DWORD)I286_ES << 4; - CS_BASE = (DWORD)I286_CS << 4; - SS_BASE = (DWORD)I286_SS << 4; + ES_BASE = I286_ES << 4; + CS_BASE = I286_CS << 4; + SS_BASE = I286_SS << 4; SS_FIX = SS_BASE; - DS_BASE = (DWORD)I286_DS << 4; + DS_BASE = I286_DS << 4; DS_FIX = DS_BASE; } #endif @@ -1567,13 +1672,13 @@ I286_P _cwd(void) { // 99: cwd I286_P _call_far(void) { // 9A: call far - WORD newip; + UINT16 newip; I286_CLOCK(13) REGPUSH0(I286_CS) GET_PCWORD(newip) GET_PCWORD(I286_CS) - CS_BASE = (DWORD)I286_CS << 4; + CS_BASE = I286_CS << 4; REGPUSH0(I286_IP) I286_IP = newip; } @@ -1612,7 +1717,7 @@ I286_P _lahf(void) { // 9F: lahf I286_P _mov_al_m8(void) { // A0: mov al, m8 - DWORD op; + UINT op; I286_CLOCK(5) GET_PCWORD(op) @@ -1621,7 +1726,7 @@ I286_P _mov_al_m8(void) { // A0: mov I286_P _mov_ax_m16(void) { // A1: mov ax, m16 - DWORD op; + UINT op; I286_CLOCK(5) GET_PCWORD(op) @@ -1630,7 +1735,7 @@ I286_P _mov_ax_m16(void) { // A1: mo I286_P _mov_m8_al(void) { // A2: mov m8, al - DWORD op; + UINT op; I286_CLOCK(3) GET_PCWORD(op) @@ -1639,7 +1744,7 @@ I286_P _mov_m8_al(void) { // A2: mov I286_P _mov_m16_ax(void) { // A3: mov m16, ax - DWORD op; + UINT op; I286_CLOCK(3) GET_PCWORD(op); @@ -1659,7 +1764,7 @@ I286_P _movsb(void) { // A4: movsb I286_P _movsw(void) { // A5: movsw - WORD tmp; + UINT16 tmp; I286_CLOCK(5) tmp = i286_memoryread_w(I286_SI + DS_FIX); @@ -1670,7 +1775,9 @@ I286_P _movsw(void) { // A5: movsw I286_P _cmpsb(void) { // A6: cmpsb - DWORD src, dst, res; + UINT src; + UINT dst; + UINT res; I286_CLOCK(8) dst = i286_memoryread(I286_SI + DS_FIX); @@ -1682,7 +1789,9 @@ I286_P _cmpsb(void) { // A6: cmpsb I286_P _cmpsw(void) { // A7: cmpsw - DWORD src, dst, res; + UINT32 src; + UINT32 dst; + UINT32 res; I286_CLOCK(8) dst = i286_memoryread_w(I286_SI + DS_FIX); @@ -1694,7 +1803,8 @@ I286_P _cmpsw(void) { // A7: cmpsw I286_P _test_al_data8(void) { // A8: test al, DATA8 - DWORD src, dst; + UINT src; + UINT dst; I286_CLOCK(3) GET_PCBYTE(src) @@ -1704,7 +1814,8 @@ I286_P _test_al_data8(void) { // A8: I286_P _test_ax_data16(void) { // A9: test ax, DATA16 - DWORD src, dst; + UINT32 src; + UINT32 dst; I286_CLOCK(3) GET_PCWORD(src) @@ -1742,7 +1853,9 @@ I286_P _lodsw(void) { // AD: lodsw I286_P _scasb(void) { // AE: scasb - DWORD src, dst, res; + UINT src; + UINT dst; + UINT res; I286_CLOCK(7) src = i286_memoryread(I286_DI + ES_BASE); @@ -1753,7 +1866,9 @@ I286_P _scasb(void) { // AE: scasb I286_P _scasw(void) { // AF: scasw - DWORD src, dst, res; + UINT32 src; + UINT32 dst; + UINT32 res; I286_CLOCK(7) src = i286_memoryread_w(I286_DI + ES_BASE); @@ -1782,7 +1897,8 @@ I286_P _mov_di_imm(void) MOVIMM16(I286_D I286_P _shift_ea8_data8(void) { // C0: shift EA8, DATA8 BYTE *out; - DWORD op, madr; + UINT op; + UINT32 madr; BYTE cl; GET_PCBYTE(op) @@ -1808,8 +1924,9 @@ I286_P _shift_ea8_data8(void) { // C0 I286_P _shift_ea16_data8(void) { // C1: shift EA16, DATA8 - WORD *out; - DWORD op, madr; + UINT16 *out; + UINT op; + UINT32 madr; BYTE cl; GET_PCBYTE(op) @@ -1826,7 +1943,7 @@ I286_P _shift_ea16_data8(void) { // C1 sft_e16cl_table[(op >> 3) & 7](madr, cl); return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } GET_PCBYTE(cl); I286_CLOCK(cl); @@ -1835,7 +1952,7 @@ I286_P _shift_ea16_data8(void) { // C1 I286_P _ret_near_data16(void) { // C2: ret near DATA16 - WORD ad; + UINT16 ad; I286_CLOCK(11) GET_PCWORD(ad) @@ -1851,8 +1968,8 @@ I286_P _ret_near(void) { // C3: ret I286_P _les_r16_ea(void) { // C4: les REG16, EA - DWORD op; - WORD ad; + UINT op; + UINT16 ad; I286_CLOCK(3) GET_PCBYTE(op) @@ -1861,7 +1978,7 @@ I286_P _les_r16_ea(void) { // C4: le *(reg16_b53[op]) = i286_memoryread_w(ad + EA_FIX); ad += 2; I286_ES = i286_memoryread_w(ad + EA_FIX); - ES_BASE = (DWORD)I286_ES << 4; + ES_BASE = I286_ES << 4; } else { INT_NUM(6, I286_IP - 2); @@ -1870,8 +1987,8 @@ I286_P _les_r16_ea(void) { // C4: le I286_P _lds_r16_ea(void) { // C5: lds REG16, EA - DWORD op; - WORD ad; + UINT op; + UINT16 ad; I286_CLOCK(3) GET_PCBYTE(op) @@ -1880,7 +1997,7 @@ I286_P _lds_r16_ea(void) { // C5: ld *(reg16_b53[op]) = i286_memoryread_w(ad + EA_FIX); ad += 2; I286_DS = i286_memoryread_w(ad + EA_FIX); - DS_BASE = (DWORD)I286_DS << 4; + DS_BASE = I286_DS << 4; DS_FIX = DS_BASE; } else { @@ -1890,7 +2007,7 @@ I286_P _lds_r16_ea(void) { // C5: ld I286_P _mov_ea8_data8(void) { // C6: mov EA8, DATA8 - DWORD op; + UINT op; GET_PCBYTE(op) if (op >= 0xc0) { @@ -1898,8 +2015,8 @@ I286_P _mov_ea8_data8(void) { // C6: GET_PCBYTE(*(reg8_b53[op])) } else { - WORD ad; - BYTE val; + UINT ad; + BYTE val; I286_CLOCK(3) ad = c_get_ea[op](); GET_PCBYTE(val) @@ -1909,7 +2026,7 @@ I286_P _mov_ea8_data8(void) { // C6: I286_P _mov_ea16_data16(void) { // C7: mov EA16, DATA16 - DWORD op; + UINT op; GET_PCBYTE(op) if (op >= 0xc0) { @@ -1917,8 +2034,8 @@ I286_P _mov_ea16_data16(void) { // C7 GET_PCWORD(*(reg16_b53[op])) } else { - WORD ad; - WORD val; + UINT ad; + UINT16 val; I286_CLOCK(3) ad = c_get_ea[op](); GET_PCWORD(val) @@ -1928,7 +2045,7 @@ I286_P _mov_ea16_data16(void) { // C7 I286_P _enter(void) { // C8: enter DATA16, DATA8 - WORD dimsize; + UINT16 dimsize; BYTE level; GET_PCWORD(dimsize) @@ -1943,7 +2060,7 @@ I286_P _enter(void) { // C8: enter else { level--; if (!level) { // enter level=1 - WORD tmp; + UINT16 tmp; I286_CLOCK(15) tmp = I286_SP; REGPUSH0(tmp) @@ -1951,12 +2068,12 @@ I286_P _enter(void) { // C8: enter I286_SP -= dimsize; } else { // enter level=2-31 - WORD bp; + UINT16 bp; I286_CLOCK(12 + level*4) bp = I286_BP; I286_BP = I286_SP; while(level--) { - WORD val = i286_memoryread_w(bp + SS_BASE); + UINT16 val = i286_memoryread_w(bp + SS_BASE); i286_memorywrite_w(I286_SP + SS_BASE, val); bp -= 2; I286_SP -= 2; @@ -1976,14 +2093,14 @@ I286_P leave(void) { // C9: leave I286_P _ret_far_data16(void) { // CA: ret far DATA16 - WORD ad; + UINT16 ad; I286_CLOCK(15) GET_PCWORD(ad) REGPOP0(I286_IP) REGPOP0(I286_CS) I286_SP += ad; - CS_BASE = (DWORD)I286_CS << 4; + CS_BASE = I286_CS << 4; } I286_P _ret_far(void) { // CB: ret far @@ -1991,7 +2108,7 @@ I286_P _ret_far(void) { // CB: ret I286_CLOCK(15) REGPOP0(I286_IP) REGPOP0(I286_CS) - CS_BASE = (DWORD)I286_CS << 4; + CS_BASE = I286_CS << 4; } I286_P _int_03(void) { // CC: int 3 @@ -2002,7 +2119,7 @@ I286_P _int_03(void) { // CC: int I286_P _int_data8(void) { // CD: int DATA8 - BYTE vect; + UINT vect; I286_CLOCK(23) GET_PCBYTE(vect) @@ -2028,14 +2145,15 @@ I286_P _iret(void) { // CF: iret I286_OV = I286_FLAG & O_FLAG; I286_FLAG &= 0x7ff; I286_TRAP = ((I286_FLAG & 0x300) == 0x300); - CS_BASE = (DWORD)I286_CS << 4; + CS_BASE = I286_CS << 4; I286IRQCHECKTERM } I286_P _shift_ea8_1(void) { // D0: shift EA8, 1 BYTE *out; - DWORD op, madr; + UINT op; + UINT32 madr; GET_PCBYTE(op) if (op >= 0xc0) { @@ -2056,8 +2174,9 @@ I286_P _shift_ea8_1(void) { // D0: sh I286_P _shift_ea16_1(void) { // D1: shift EA16, 1 - WORD *out; - DWORD op, madr; + UINT16 *out; + UINT op; + UINT32 madr; GET_PCBYTE(op) if (op >= 0xc0) { @@ -2071,7 +2190,7 @@ I286_P _shift_ea16_1(void) { // D1: sh sft_e16_table[(op >> 3) & 7](madr); return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } sft_r16_table[(op >> 3) & 7](out); } @@ -2079,7 +2198,8 @@ I286_P _shift_ea16_1(void) { // D1: sh I286_P _shift_ea8_cl(void) { // D2: shift EA8, cl BYTE *out; - DWORD op, madr; + UINT op; + UINT32 madr; BYTE cl; GET_PCBYTE(op) @@ -2105,8 +2225,9 @@ I286_P _shift_ea8_cl(void) { // D2: sh I286_P _shift_ea16_cl(void) { // D3: shift EA16, cl - WORD *out; - DWORD op, madr; + UINT16 *out; + UINT op; + UINT32 madr; BYTE cl; GET_PCBYTE(op) @@ -2123,7 +2244,7 @@ I286_P _shift_ea16_cl(void) { // D3: s sft_e16cl_table[(op >> 3) & 7](madr, cl); return; } - out = (WORD *)(mem + madr); + out = (UINT16 *)(mem + madr); } cl = I286_CL; I286_CLOCK(cl); @@ -2142,7 +2263,7 @@ I286_P _aam(void) { // D4: AAM I286_AH = al / div; I286_AL = al % div; I286_FLAGL &= ~(S_FLAG | Z_FLAG | P_FLAG); - I286_FLAGL |= szpflag_w[I286_AX]; + I286_FLAGL |= WORDSZPF(I286_AX); } else { INT_NUM(0, I286_IP - 2); // 80286 @@ -2175,7 +2296,7 @@ I286_P _xlat(void) { // D7: xlat I286_P _esc(void) { // D8: esc - DWORD op; + UINT op; I286_CLOCK(2) GET_PCBYTE(op) @@ -2209,16 +2330,18 @@ I286_P _jcxz(void) { // E3: jcxz I286_P _in_al_data8(void) { // E4: in al, DATA8 - WORD port; + UINT port; I286_CLOCK(5) GET_PCBYTE(port) + i286reg.inport = CS_BASE + I286_IP; I286_AL = iocore_inp8(port); + i286reg.inport = 0; } I286_P _in_ax_data8(void) { // E5: in ax, DATA8 - WORD port; + UINT port; I286_CLOCK(5) GET_PCBYTE(port) @@ -2227,7 +2350,7 @@ I286_P _in_ax_data8(void) { // E5: i I286_P _out_data8_al(void) { // E6: out DATA8, al - WORD port; + UINT port; I286_CLOCK(3) GET_PCBYTE(port); @@ -2236,7 +2359,7 @@ I286_P _out_data8_al(void) { // E6: o I286_P _out_data8_ax(void) { // E7: out DATA8, ax - WORD port; + UINT port; I286_CLOCK(3) GET_PCBYTE(port); @@ -2245,7 +2368,7 @@ I286_P _out_data8_ax(void) { // E7: o I286_P _call_near(void) { // E8: call near - WORD ad; + UINT16 ad; I286_CLOCK(7) GET_PCWORD(ad) @@ -2255,7 +2378,7 @@ I286_P _call_near(void) { // E8: cal I286_P _jmp_near(void) { // E9: jmp near - WORD ad; + UINT16 ad; I286_CLOCK(7) GET_PCWORD(ad) @@ -2264,18 +2387,18 @@ I286_P _jmp_near(void) { // E9: jmp I286_P _jmp_far(void) { // EA: jmp far - WORD ad; + UINT16 ad; I286_CLOCK(11) GET_PCWORD(ad); GET_PCWORD(I286_CS); - CS_BASE = (DWORD)I286_CS << 4; + CS_BASE = I286_CS << 4; I286_IP = ad; } I286_P _jmp_short(void) { // EB: jmp short - WORD ad; + UINT16 ad; I286_CLOCK(7) GET_PCBYTES(ad) @@ -2313,12 +2436,12 @@ I286_P _lock(void) { // F0: lock I286_P _repne(void) { // F2: repne - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op_repne[op](); - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -2327,12 +2450,12 @@ I286_P _repne(void) { // F2: repne I286_P _repe(void) { // F3: repe - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op_repe[op](); - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -2353,7 +2476,7 @@ I286_P _cmc(void) { // F5: cmc I286_P _ope0xf6(void) { // F6: - DWORD op; + UINT op; GET_PCBYTE(op); c_ope0xf6_table[(op >> 3) & 7](op); @@ -2361,7 +2484,7 @@ I286_P _ope0xf6(void) { // F6: I286_P _ope0xf7(void) { // F7: - DWORD op; + UINT op; GET_PCBYTE(op); c_ope0xf7_table[(op >> 3) & 7](op); @@ -2391,6 +2514,7 @@ I286_P _sti(void) { // FB: sti I286_CLOCK(2) I286_FLAG |= I_FLAG; I286_TRAP = (I286_FLAG & T_FLAG) >> 8; // ToDo + REMAIN_ADJUST(1) } @@ -2408,7 +2532,7 @@ I286_P _std(void) { // FD: std I286_P _ope0xfe(void) { // FE: - DWORD op; + UINT op; GET_PCBYTE(op); c_ope0xfe_table[(op >> 3) & 1](op); @@ -2416,7 +2540,7 @@ I286_P _ope0xfe(void) { // FE: I286_P _ope0xff(void) { // FF: - DWORD op; + UINT op; GET_PCBYTE(op); c_ope0xff_table[(op >> 3) & 7](op); @@ -2706,13 +2830,13 @@ I286_P _repe_segprefix_es(void) { DS_FIX = ES_BASE; SS_FIX = ES_BASE; - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op_repe[op](); REMOVE_PREFIX - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -2723,13 +2847,13 @@ I286_P _repe_segprefix_cs(void) { DS_FIX = CS_BASE; SS_FIX = CS_BASE; - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op_repe[op](); REMOVE_PREFIX - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -2740,13 +2864,13 @@ I286_P _repe_segprefix_ss(void) { DS_FIX = SS_BASE; SS_FIX = SS_BASE; - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op_repe[op](); REMOVE_PREFIX - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -2757,13 +2881,13 @@ I286_P _repe_segprefix_ds(void) { DS_FIX = DS_BASE; SS_FIX = DS_BASE; - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op_repe[op](); REMOVE_PREFIX - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -3051,13 +3175,13 @@ I286_P _repne_segprefix_es(void) { DS_FIX = ES_BASE; SS_FIX = ES_BASE; - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op_repne[op](); REMOVE_PREFIX - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -3068,13 +3192,13 @@ I286_P _repne_segprefix_cs(void) { DS_FIX = CS_BASE; SS_FIX = CS_BASE; - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op_repne[op](); REMOVE_PREFIX - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -3085,13 +3209,13 @@ I286_P _repne_segprefix_ss(void) { DS_FIX = SS_BASE; SS_FIX = SS_BASE; - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op_repne[op](); REMOVE_PREFIX - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -3102,13 +3226,13 @@ I286_P _repne_segprefix_ds(void) { DS_FIX = DS_BASE; SS_FIX = DS_BASE; - i286s.prefix++; - if (i286s.prefix < MAX_PREFIX) { - DWORD op; + i286reg.prefix++; + if (i286reg.prefix < MAX_PREFIX) { + UINT op; GET_PCBYTE(op); i286op_repne[op](); REMOVE_PREFIX - i286s.prefix = 0; + i286reg.prefix = 0; } else { INT_NUM(6, I286_IP); @@ -3389,82 +3513,3 @@ const I286OP i286op_repne[] = { _ope0xff, // FF: }; - - - -// ---- - -#if 0 -void INTR_CALL i286c_interrupt(BYTE vect) { - - BYTE op; - - op = i286_memoryread(I286_IP + CS_BASE); - if (op == 0xf4) { // hlt - I286_IP++; - } - REGPUSH0(REAL_FLAGREG) - REGPUSH0(I286_CS) - REGPUSH0(I286_IP) - I286_IP = GETWORD(mem + vect*4); // real mode! - I286_CS = GETWORD(mem + vect*4 + 2); // real mode! - CS_BASE = (DWORD)I286_CS << 4; - I286_CLOCK(20) -} - - - -void i286c(void) { - - DWORD opcode; - - do { - GET_PCBYTE(opcode); - i286op[opcode](); - } while(nevent.remainclock > 0); -} - -void i286c_withtrap(void) { - - DWORD opcode; - - do { - GET_PCBYTE(opcode); - i286op[opcode](); - if (I286_TRAP) { - i286c_interrupt(1); - } - dma_proc(); - - } while(nevent.remainclock > 0); -} - -void i286c_withdma(void) { - - DWORD opcode; - - do { - GET_PCBYTE(opcode); - i286op[opcode](); - dma_proc(); - } while(nevent.remainclock > 0); -} - - -void i286c_step(void) { - - BYTE opcode; - - I286_OV = I286_FLAG & O_FLAG; - I286_FLAG &= ~(O_FLAG); - - GET_PCBYTE(opcode); - i286op[opcode](); - - I286_FLAG &= ~(O_FLAG); - if (I286_OV) { - I286_FLAG |= (O_FLAG); - } - dma_proc(); -} -#endif