--- np2/i286c/i286c_mn.c 2003/10/17 07:17:20 1.2 +++ np2/i286c/i286c_mn.c 2003/10/17 22:50:02 1.5 @@ -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); @@ -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) { @@ -179,7 +182,10 @@ I286FN _or_ea_r8(void) { // 08: or I286FN _or_ea_r16(void) { // 09: or EA, REG16 UINT16 *out; - DWORD op, src, dst, madr; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -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); @@ -212,7 +219,8 @@ I286FN _or_r8_ea(void) { // 0a: or I286FN _or_r16_ea(void) { // 0b: or REG16, EA UINT16 *out; - DWORD op, src; + 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) { @@ -270,7 +282,11 @@ I286FN _adc_ea_r8(void) { // 10: ad I286FN _adc_ea_r16(void) { // 11: adc EA, REG16 UINT16 *out; - DWORD op, src, dst, res, madr; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -296,7 +312,10 @@ I286FN _adc_ea_r16(void) { // 11: a 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; @@ -307,7 +326,10 @@ I286FN _adc_r8_ea(void) { // 12: ad I286FN _adc_r16_ea(void) { // 13: adc REG16, EA UINT16 *out; - DWORD op, src, dst, res; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; PREPART_REG16_EA(op, src, out, 2, 7); dst = *out; @@ -317,7 +339,8 @@ I286FN _adc_r16_ea(void) { // 13: a I286FN _adc_al_data8(void) { // 14: adc al, DATA8 - DWORD src, res; + UINT src; + UINT res; I286_CLOCK(3) GET_PCBYTE(src); @@ -327,7 +350,8 @@ 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); @@ -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) { @@ -377,7 +405,11 @@ I286FN _sbb_ea_r8(void) { // 18: sb I286FN _sbb_ea_r16(void) { // 19: sbb EA, REG16 UINT16 *out; - DWORD op, src, dst, res, madr; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -403,7 +435,10 @@ I286FN _sbb_ea_r16(void) { // 19: s 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; @@ -414,7 +449,10 @@ I286FN _sbb_r8_ea(void) { // 1a: sb I286FN _sbb_r16_ea(void) { // 1b: sbb REG16, EA UINT16 *out; - DWORD op, src, dst, res; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; PREPART_REG16_EA(op, src, out, 2, 7); dst = *out; @@ -424,7 +462,8 @@ I286FN _sbb_r16_ea(void) { // 1b: s I286FN _sbb_al_data8(void) { // 1c: adc al, DATA8 - DWORD src, res; + UINT src; + UINT res; I286_CLOCK(3) GET_PCBYTE(src); @@ -434,7 +473,8 @@ 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); @@ -457,7 +497,10 @@ I286FN _pop_ds(void) { // 1f: pop 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) { @@ -481,7 +524,10 @@ I286FN _and_ea_r8(void) { // 20: an I286FN _and_ea_r16(void) { // 21: and EA, REG16 UINT16 *out; - DWORD op, src, dst, madr; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -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); @@ -514,7 +561,8 @@ I286FN _and_r8_ea(void) { // 22: an I286FN _and_r16_ea(void) { // 23: and REG16, EA UINT16 *out; - DWORD op, src; + 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); @@ -544,7 +592,7 @@ I286FN _segprefix_es(void) { // 26: DS_FIX = ES_BASE; i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op[op](); REMOVE_PREFIX @@ -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) { @@ -603,7 +655,11 @@ I286FN _sub_ea_r8(void) { // 28: su I286FN _sub_ea_r16(void) { // 29: sub EA, REG16 UINT16 *out; - DWORD op, src, dst, res, madr; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -629,7 +685,10 @@ I286FN _sub_ea_r16(void) { // 29: s 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; @@ -640,7 +699,10 @@ I286FN _sub_r8_ea(void) { // 2a: su I286FN _sub_r16_ea(void) { // 2b: sub REG16, EA UINT16 *out; - DWORD op, src, dst, res; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 res; PREPART_REG16_EA(op, src, out, 2, 7); dst = *out; @@ -650,7 +712,8 @@ I286FN _sub_r16_ea(void) { // 2b: s I286FN _sub_al_data8(void) { // 2c: sub al, DATA8 - DWORD src, res; + UINT src; + UINT res; I286_CLOCK(3) GET_PCBYTE(src); @@ -660,7 +723,8 @@ 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); @@ -674,7 +738,7 @@ I286FN _segprefix_cs(void) { // 2e: DS_FIX = CS_BASE; i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op[op](); REMOVE_PREFIX @@ -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) { @@ -728,7 +795,10 @@ I286FN _xor_ea_r8(void) { // 30: xo I286FN _xor_ea_r16(void) { // 31: xor EA, REG16 UINT16 *out; - DWORD op, src, dst, madr; + UINT op; + UINT32 src; + UINT32 dst; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -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); @@ -761,7 +832,8 @@ I286FN _xor_r8_ea(void) { // 32: xo I286FN _xor_r16_ea(void) { // 33: or REG16, EA UINT16 *out; - DWORD op, src; + 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); @@ -791,7 +863,7 @@ I286FN _segprefix_ss(void) { // 36: DS_FIX = SS_BASE; i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op[op](); REMOVE_PREFIX @@ -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; @@ -862,7 +943,10 @@ I286FN _cmp_r8_ea(void) { // 3a: cm I286FN _cmp_r16_ea(void) { // 3b: cmp REG16, EA UINT16 *out; - DWORD op, src, dst, res; + 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); @@ -893,7 +979,7 @@ I286FN _segprefix_ds(void) { // 3e: DS_FIX = DS_BASE; i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op[op](); REMOVE_PREFIX @@ -917,41 +1003,41 @@ I286FN _aas(void) { // 3f: aas } } -I286_P _inc_ax(void) INCWORD(I286_AX, 2) // 40: inc ax -I286_P _inc_cx(void) INCWORD(I286_CX, 2) // 41: inc cx -I286_P _inc_dx(void) INCWORD(I286_DX, 2) // 42: inc dx -I286_P _inc_bx(void) INCWORD(I286_BX, 2) // 43: inc bx -I286_P _inc_sp(void) INCWORD(I286_SP, 2) // 44: inc sp -I286_P _inc_bp(void) INCWORD(I286_BP, 2) // 45: inc bp -I286_P _inc_si(void) INCWORD(I286_SI, 2) // 46: inc si -I286_P _inc_di(void) INCWORD(I286_DI, 2) // 47: inc di -I286_P _dec_ax(void) DECWORD(I286_AX, 2) // 48: dec ax -I286_P _dec_cx(void) DECWORD(I286_CX, 2) // 49: dec cx -I286_P _dec_dx(void) DECWORD(I286_DX, 2) // 4a: dec dx -I286_P _dec_bx(void) DECWORD(I286_BX, 2) // 4b: dec bx -I286_P _dec_sp(void) DECWORD(I286_SP, 2) // 4c: dec sp -I286_P _dec_bp(void) DECWORD(I286_BP, 2) // 4d: dec bp -I286_P _dec_si(void) DECWORD(I286_SI, 2) // 4e: dec si -I286_P _dec_di(void) DECWORD(I286_DI, 2) // 4f: dec di - -I286_P _push_ax(void) REGPUSH(I286_AX, 3) // 50: push ax -I286_P _push_cx(void) REGPUSH(I286_CX, 3) // 51: push cx -I286_P _push_dx(void) REGPUSH(I286_DX, 3) // 52: push dx -I286_P _push_bx(void) REGPUSH(I286_BX, 3) // 53: push bx -I286_P _push_sp(void) SP_PUSH(I286_SP, 3) // 54: push sp -I286_P _push_bp(void) REGPUSH(I286_BP, 3) // 55: push bp -I286_P _push_si(void) REGPUSH(I286_SI, 3) // 56: push si -I286_P _push_di(void) REGPUSH(I286_DI, 3) // 57: push di -I286_P _pop_ax(void) REGPOP(I286_AX, 5) // 58: pop ax -I286_P _pop_cx(void) REGPOP(I286_CX, 5) // 59: pop cx -I286_P _pop_dx(void) REGPOP(I286_DX, 5) // 5A: pop dx -I286_P _pop_bx(void) REGPOP(I286_BX, 5) // 5B: pop bx -I286_P _pop_sp(void) REGPOP(I286_SP, 5) // 5C: pop sp -I286_P _pop_bp(void) REGPOP(I286_BP, 5) // 5D: pop bp -I286_P _pop_si(void) REGPOP(I286_SI, 5) // 5E: pop si -I286_P _pop_di(void) REGPOP(I286_DI, 5) // 5F: pop di +I286FN _inc_ax(void) INCWORD(I286_AX, 2) // 40: inc ax +I286FN _inc_cx(void) INCWORD(I286_CX, 2) // 41: inc cx +I286FN _inc_dx(void) INCWORD(I286_DX, 2) // 42: inc dx +I286FN _inc_bx(void) INCWORD(I286_BX, 2) // 43: inc bx +I286FN _inc_sp(void) INCWORD(I286_SP, 2) // 44: inc sp +I286FN _inc_bp(void) INCWORD(I286_BP, 2) // 45: inc bp +I286FN _inc_si(void) INCWORD(I286_SI, 2) // 46: inc si +I286FN _inc_di(void) INCWORD(I286_DI, 2) // 47: inc di +I286FN _dec_ax(void) DECWORD(I286_AX, 2) // 48: dec ax +I286FN _dec_cx(void) DECWORD(I286_CX, 2) // 49: dec cx +I286FN _dec_dx(void) DECWORD(I286_DX, 2) // 4a: dec dx +I286FN _dec_bx(void) DECWORD(I286_BX, 2) // 4b: dec bx +I286FN _dec_sp(void) DECWORD(I286_SP, 2) // 4c: dec sp +I286FN _dec_bp(void) DECWORD(I286_BP, 2) // 4d: dec bp +I286FN _dec_si(void) DECWORD(I286_SI, 2) // 4e: dec si +I286FN _dec_di(void) DECWORD(I286_DI, 2) // 4f: dec di + +I286FN _push_ax(void) REGPUSH(I286_AX, 3) // 50: push ax +I286FN _push_cx(void) REGPUSH(I286_CX, 3) // 51: push cx +I286FN _push_dx(void) REGPUSH(I286_DX, 3) // 52: push dx +I286FN _push_bx(void) REGPUSH(I286_BX, 3) // 53: push bx +I286FN _push_sp(void) SP_PUSH(I286_SP, 3) // 54: push sp +I286FN _push_bp(void) REGPUSH(I286_BP, 3) // 55: push bp +I286FN _push_si(void) REGPUSH(I286_SI, 3) // 56: push si +I286FN _push_di(void) REGPUSH(I286_DI, 3) // 57: push di +I286FN _pop_ax(void) REGPOP(I286_AX, 5) // 58: pop ax +I286FN _pop_cx(void) REGPOP(I286_CX, 5) // 59: pop cx +I286FN _pop_dx(void) REGPOP(I286_DX, 5) // 5A: pop dx +I286FN _pop_bx(void) REGPOP(I286_BX, 5) // 5B: pop bx +I286FN _pop_sp(void) REGPOP(I286_SP, 5) // 5C: pop sp +I286FN _pop_bp(void) REGPOP(I286_BP, 5) // 5D: pop bp +I286FN _pop_si(void) REGPOP(I286_SI, 5) // 5E: pop si +I286FN _pop_di(void) REGPOP(I286_DI, 5) // 5F: pop di -I286_P _pusha(void) { // 60: pusha +I286FN _pusha(void) { // 60: pusha UINT16 tmp; @@ -967,7 +1053,7 @@ I286_P _pusha(void) { // 60: pusha I286_CLOCK(17) } -I286_P _popa(void) { // 61: popa +I286FN _popa(void) { // 61: popa REGPOP0(I286_DI); REGPOP0(I286_SI); @@ -980,11 +1066,11 @@ I286_P _popa(void) { // 61: popa I286_CLOCK(19) } -I286_P _bound(void) { // 62: bound +I286FN _bound(void) { // 62: bound - DWORD vect = 0; - DWORD op; - DWORD madr; + UINT vect = 0; + UINT op; + UINT32 madr; UINT16 reg; I286_CLOCK(13); // ToDo @@ -1006,10 +1092,10 @@ I286_P _bound(void) { // 62: bound INT_NUM(vect, I286_IP); } -I286_P _arpl(void) { // 63: arpl +I286FN _arpl(void) { // 63: arpl - DWORD op; - DWORD tmp; + UINT op; + UINT tmp; GET_PCBYTE(op) tmp = ((op < 0xc0)?1:0); @@ -1018,7 +1104,7 @@ I286_P _arpl(void) { // 63: arpl INT_NUM(6, I286_IP); } -I286_P _push_data16(void) { // 68: push DATA16 +I286FN _push_data16(void) { // 68: push DATA16 UINT16 tmp; @@ -1026,12 +1112,13 @@ I286_P _push_data16(void) { // 68: pu REGPUSH(tmp, 3) } -I286_P _imul_reg_ea_data16(void) { // 69: imul REG, EA, DATA16 +I286FN _imul_reg_ea_data16(void) { // 69: imul REG, EA, DATA16 UINT16 *out; - DWORD op; - short src, dst; - long res; + UINT op; + SINT16 src; + SINT16 dst; + SINT32 res; PREPART_REG16_EA(op, src, out, 21, 24) GET_PCWORD(dst) @@ -1039,7 +1126,7 @@ I286_P _imul_reg_ea_data16(void) { // 6 *out = (UINT16)res; } -I286_P _push_data8(void) { // 6A: push DATA8 +I286FN _push_data8(void) { // 6A: push DATA8 UINT16 tmp; @@ -1047,12 +1134,13 @@ I286_P _push_data8(void) { // 6A: pus REGPUSH(tmp, 3) } -I286_P _imul_reg_ea_data8(void) { // 6B: imul REG, EA, DATA8 +I286FN _imul_reg_ea_data8(void) { // 6B: imul REG, EA, DATA8 UINT16 *out; - DWORD op; - short src, dst; - long res; + UINT op; + SINT16 src; + SINT16 dst; + SINT32 res; PREPART_REG16_EA(op, src, out, 21, 24) GET_PCBYTES(dst) @@ -1060,7 +1148,7 @@ I286_P _imul_reg_ea_data8(void) { // 6B *out = (UINT16)res; } -I286_P _insb(void) { // 6C: insb +I286FN _insb(void) { // 6C: insb BYTE dat; @@ -1070,7 +1158,7 @@ I286_P _insb(void) { // 6C: insb I286_DI += STRING_DIR; } -I286_P _insw(void) { // 6D: insw +I286FN _insw(void) { // 6D: insw UINT16 dat; @@ -1080,7 +1168,7 @@ I286_P _insw(void) { // 6D: insw I286_DI += STRING_DIRx2; } -I286_P _outsb(void) { // 6E: outsb +I286FN _outsb(void) { // 6E: outsb BYTE dat; @@ -1090,7 +1178,7 @@ I286_P _outsb(void) { // 6E: outsb iocore_out8(I286_DX, dat); } -I286_P _outsw(void) { // 6F: outsw +I286FN _outsw(void) { // 6F: outsw UINT16 dat; @@ -1100,95 +1188,96 @@ I286_P _outsw(void) { // 6F: outsw iocore_out16(I286_DX, dat); } -I286_P _jo_short(void) { // 70: jo short +I286FN _jo_short(void) { // 70: jo short if (!I286_OV) JMPNOP(2) else JMPSHORT(7) } -I286_P _jno_short(void) { // 71: jno short +I286FN _jno_short(void) { // 71: jno short if (I286_OV) JMPNOP(2) else JMPSHORT(7) } -I286_P _jc_short(void) { // 72: jnae/jb/jc short +I286FN _jc_short(void) { // 72: jnae/jb/jc short if (!(I286_FLAGL & C_FLAG)) JMPNOP(2) else JMPSHORT(7) } -I286_P _jnc_short(void) { // 73: jae/jnb/jnc short +I286FN _jnc_short(void) { // 73: jae/jnb/jnc short if (I286_FLAGL & C_FLAG) JMPNOP(2) else JMPSHORT(7) } -I286_P _jz_short(void) { // 74: je/jz short +I286FN _jz_short(void) { // 74: je/jz short if (!(I286_FLAGL & Z_FLAG)) JMPNOP(2) else JMPSHORT(7) } -I286_P _jnz_short(void) { // 75: jne/jnz short +I286FN _jnz_short(void) { // 75: jne/jnz short if (I286_FLAGL & Z_FLAG) JMPNOP(2) else JMPSHORT(7) } -I286_P _jna_short(void) { // 76: jna/jbe short +I286FN _jna_short(void) { // 76: jna/jbe short if (!(I286_FLAGL & (Z_FLAG | C_FLAG))) JMPNOP(2) else JMPSHORT(7) } -I286_P _ja_short(void) { // 77: ja/jnbe short +I286FN _ja_short(void) { // 77: ja/jnbe short if (I286_FLAGL & (Z_FLAG | C_FLAG)) JMPNOP(2) else JMPSHORT(7) } -I286_P _js_short(void) { // 78: js short +I286FN _js_short(void) { // 78: js short if (!(I286_FLAGL & S_FLAG)) JMPNOP(2) else JMPSHORT(7) } -I286_P _jns_short(void) { // 79: jns short +I286FN _jns_short(void) { // 79: jns short if (I286_FLAGL & S_FLAG) JMPNOP(2) else JMPSHORT(7) } -I286_P _jp_short(void) { // 7A: jp/jpe short +I286FN _jp_short(void) { // 7A: jp/jpe short if (!(I286_FLAGL & P_FLAG)) JMPNOP(2) else JMPSHORT(7) } -I286_P _jnp_short(void) { // 7B: jnp/jpo short +I286FN _jnp_short(void) { // 7B: jnp/jpo short if (I286_FLAGL & P_FLAG) JMPNOP(2) else JMPSHORT(7) } -I286_P _jl_short(void) { // 7C: jl/jnge short +I286FN _jl_short(void) { // 7C: jl/jnge short if (((I286_FLAGL & S_FLAG) == 0) == (I286_OV == 0)) JMPNOP(2) else JMPSHORT(7) } -I286_P _jnl_short(void) { // 7D: jnl/jge short +I286FN _jnl_short(void) { // 7D: jnl/jge short if (((I286_FLAGL & S_FLAG) == 0) != (I286_OV == 0)) JMPNOP(2) else JMPSHORT(7) } -I286_P _jle_short(void) { // 7E: jle/jng short +I286FN _jle_short(void) { // 7E: jle/jng short if ((!(I286_FLAGL & Z_FLAG)) && (((I286_FLAGL & S_FLAG) == 0) == (I286_OV == 0))) JMPNOP(2) else JMPSHORT(7) } -I286_P _jnle_short(void) { // 7F: jg/jnle short +I286FN _jnle_short(void) { // 7F: jg/jnle short if ((I286_FLAGL & Z_FLAG) || (((I286_FLAGL & S_FLAG) == 0) != (I286_OV == 0))) JMPNOP(2) else JMPSHORT(7) } -I286_P _calc_ea8_i8(void) { // 80: op EA8, DATA8 +I286FN _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) { @@ -1207,10 +1296,12 @@ I286_P _calc_ea8_i8(void) { // 80: o c_op8xreg8_table[(op >> 3) & 7](out); } -I286_P _calc_ea16_i16(void) { // 81: op EA16, DATA16 +I286FN _calc_ea16_i16(void) { // 81: op EA16, DATA16 UINT16 *out; - DWORD op, madr, src; + UINT op; + UINT32 madr; + UINT32 src; GET_PCBYTE(op) if (op >= 0xc0) { @@ -1231,10 +1322,12 @@ I286_P _calc_ea16_i16(void) { // 81: c_op8xreg16_table[(op >> 3) & 7](out, src); } -I286_P _calc_ea16_i8(void) { // 83: op EA16, DATA8 +I286FN _calc_ea16_i8(void) { // 83: op EA16, DATA8 UINT16 *out; - DWORD op, madr, src; + UINT op; + UINT32 madr; + UINT32 src; GET_PCBYTE(op) if (op >= 0xc0) { @@ -1255,10 +1348,13 @@ I286_P _calc_ea16_i8(void) { // 83: o c_op8xreg16_table[(op >> 3) & 7](out, src); } -I286_P _test_ea_r8(void) { // 84: test EA, REG8 +I286FN _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) { @@ -1279,10 +1375,13 @@ I286_P _test_ea_r8(void) { // 84: te ANDBYTE(tmp, src); } -I286_P _test_ea_r16(void) { // 85: test EA, REG16 +I286FN _test_ea_r16(void) { // 85: test EA, REG16 UINT16 *out; - DWORD op, src, tmp, madr; + UINT op; + UINT32 src; + UINT32 tmp; + UINT32 madr; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -1303,10 +1402,12 @@ I286_P _test_ea_r16(void) { // 85: t ANDWORD(tmp, src); } -I286_P _xchg_ea_r8(void) { // 86: xchg EA, REG8 +I286FN _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) { @@ -1327,10 +1428,12 @@ I286_P _xchg_ea_r8(void) { // 86: xc SWAPBYTE(*out, *src); } -I286_P _xchg_ea_r16(void) { // 87: xchg EA, REG16 +I286FN _xchg_ea_r16(void) { // 87: xchg EA, REG16 - UINT16 *out, *src; - DWORD op, madr; + UINT16 *out; + UINT16 *src; + UINT op; + UINT32 madr; PREPART_EA_REG16P(op, src); if (op >= 0xc0) { @@ -1341,7 +1444,7 @@ 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; @@ -1351,10 +1454,11 @@ I286_P _xchg_ea_r16(void) { // 87: x SWAPWORD(*out, *src); } -I286_P _mov_ea_r8(void) { // 88: mov EA, REG8 +I286FN _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) { @@ -1368,10 +1472,10 @@ I286_P _mov_ea_r8(void) { // 88: mov } } -I286_P _mov_ea_r16(void) { // 89: mov EA, REG16 +I286FN _mov_ea_r16(void) { // 89: mov EA, REG16 UINT16 src; - DWORD op; + UINT op; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -1384,29 +1488,29 @@ I286_P _mov_ea_r16(void) { // 89: mo } } -I286_P _mov_r8_ea(void) { // 8A: mov REG8, EA +I286FN _mov_r8_ea(void) { // 8A: mov REG8, EA BYTE *out; BYTE src; - DWORD op; + UINT op; PREPART_REG8_EA(op, src, out, 2, 5); *out = src; } -I286_P _mov_r16_ea(void) { // 8B: mov REG16, EA +I286FN _mov_r16_ea(void) { // 8B: mov REG16, EA UINT16 *out; UINT16 src; - DWORD op; + UINT op; PREPART_REG16_EA(op, src, out, 2, 5); *out = src; } -I286_P _mov_ea_seg(void) { // 8C: mov EA, segreg +I286FN _mov_ea_seg(void) { // 8C: mov EA, segreg - DWORD op; + UINT op; UINT16 tmp; GET_PCBYTE(op); @@ -1421,9 +1525,9 @@ I286_P _mov_ea_seg(void) { // 8C: mo } } -I286_P _lea_r16_ea(void) { // 8D: lea REG16, EA +I286FN _lea_r16_ea(void) { // 8D: lea REG16, EA - DWORD op; + UINT op; I286_CLOCK(3) GET_PCBYTE(op) @@ -1435,9 +1539,9 @@ I286_P _lea_r16_ea(void) { // 8D: le } } -I286_P _mov_seg_ea(void) { // 8E: mov segrem, EA +I286FN _mov_seg_ea(void) { // 8E: mov segrem, EA - DWORD op; + UINT op; UINT tmp; UINT16 ipbak; @@ -1476,9 +1580,9 @@ I286_P _mov_seg_ea(void) { // 8E: mo } } -I286_P _pop_ea(void) { // 8F: pop EA +I286FN _pop_ea(void) { // 8F: pop EA - DWORD op; + UINT op; UINT16 tmp; I286_CLOCK(5) @@ -1493,7 +1597,7 @@ I286_P _pop_ea(void) { // 8F: pop } } -I286_P _nop(void) { // 90: nop / bios func +I286FN _nop(void) { // 90: nop / bios func #if 1 // call BIOS UINT32 adrs; @@ -1512,61 +1616,61 @@ I286_P _nop(void) { // 90: nop / b I286_CLOCK(3) } -I286_P _xchg_ax_cx(void) { // 91: xchg ax, cx +I286FN _xchg_ax_cx(void) { // 91: xchg ax, cx I286_CLOCK(3); SWAPWORD(I286_AX, I286_CX); } -I286_P _xchg_ax_dx(void) { // 92: xchg ax, dx +I286FN _xchg_ax_dx(void) { // 92: xchg ax, dx I286_CLOCK(3); SWAPWORD(I286_AX, I286_DX); } -I286_P _xchg_ax_bx(void) { // 93: xchg ax, bx +I286FN _xchg_ax_bx(void) { // 93: xchg ax, bx I286_CLOCK(3); SWAPWORD(I286_AX, I286_BX); } -I286_P _xchg_ax_sp(void) { // 94: xchg ax, sp +I286FN _xchg_ax_sp(void) { // 94: xchg ax, sp I286_CLOCK(3); SWAPWORD(I286_AX, I286_SP); } -I286_P _xchg_ax_bp(void) { // 95: xchg ax, bp +I286FN _xchg_ax_bp(void) { // 95: xchg ax, bp I286_CLOCK(3); SWAPWORD(I286_AX, I286_BP); } -I286_P _xchg_ax_si(void) { // 96: xchg ax, si +I286FN _xchg_ax_si(void) { // 96: xchg ax, si I286_CLOCK(3); SWAPWORD(I286_AX, I286_SI); } -I286_P _xchg_ax_di(void) { // 97: xchg ax, di +I286FN _xchg_ax_di(void) { // 97: xchg ax, di I286_CLOCK(3); SWAPWORD(I286_AX, I286_DI); } -I286_P _cbw(void) { // 98: cbw +I286FN _cbw(void) { // 98: cbw I286_CLOCK(2) I286_AX = __CBW(I286_AL); } -I286_P _cwd(void) { // 99: cwd +I286FN _cwd(void) { // 99: cwd I286_CLOCK(2) I286_DX = ((I286_AH & 0x80)?0xffff:0x0000); } -I286_P _call_far(void) { // 9A: call far +I286FN _call_far(void) { // 9A: call far UINT16 newip; @@ -1579,17 +1683,17 @@ I286_P _call_far(void) { // 9A: call I286_IP = newip; } -I286_P _wait(void) { // 9B: wait +I286FN _wait(void) { // 9B: wait I286_CLOCK(2) } -I286_P _pushf(void) { // 9C: pushf +I286FN _pushf(void) { // 9C: pushf REGPUSH(REAL_FLAGREG, 3) } -I286_P _popf(void) { // 9D: popf +I286FN _popf(void) { // 9D: popf I286_CLOCK(5) REGPOP0(I286_FLAG) @@ -1599,55 +1703,55 @@ I286_P _popf(void) { // 9D: popf I286IRQCHECKTERM } -I286_P _sahf(void) { // 9E: sahf +I286FN _sahf(void) { // 9E: sahf I286_CLOCK(2) I286_FLAGL = I286_AH; } -I286_P _lahf(void) { // 9F: lahf +I286FN _lahf(void) { // 9F: lahf I286_CLOCK(2) I286_AH = I286_FLAGL; } -I286_P _mov_al_m8(void) { // A0: mov al, m8 +I286FN _mov_al_m8(void) { // A0: mov al, m8 - DWORD op; + UINT op; I286_CLOCK(5) GET_PCWORD(op) I286_AL = i286_memoryread(DS_FIX + op); } -I286_P _mov_ax_m16(void) { // A1: mov ax, m16 +I286FN _mov_ax_m16(void) { // A1: mov ax, m16 - DWORD op; + UINT op; I286_CLOCK(5) GET_PCWORD(op) I286_AX = i286_memoryread_w(DS_FIX + op); } -I286_P _mov_m8_al(void) { // A2: mov m8, al +I286FN _mov_m8_al(void) { // A2: mov m8, al - DWORD op; + UINT op; I286_CLOCK(3) GET_PCWORD(op) i286_memorywrite(DS_FIX + op, I286_AL); } -I286_P _mov_m16_ax(void) { // A3: mov m16, ax +I286FN _mov_m16_ax(void) { // A3: mov m16, ax - DWORD op; + UINT op; I286_CLOCK(3) GET_PCWORD(op); i286_memorywrite_w(DS_FIX + op, I286_AX); } -I286_P _movsb(void) { // A4: movsb +I286FN _movsb(void) { // A4: movsb BYTE tmp; @@ -1658,7 +1762,7 @@ I286_P _movsb(void) { // A4: movsb I286_DI += STRING_DIR; } -I286_P _movsw(void) { // A5: movsw +I286FN _movsw(void) { // A5: movsw UINT16 tmp; @@ -1669,9 +1773,11 @@ I286_P _movsw(void) { // A5: movsw I286_DI += STRING_DIRx2; } -I286_P _cmpsb(void) { // A6: cmpsb +I286FN _cmpsb(void) { // A6: cmpsb - DWORD src, dst, res; + UINT src; + UINT dst; + UINT res; I286_CLOCK(8) dst = i286_memoryread(I286_SI + DS_FIX); @@ -1681,9 +1787,11 @@ I286_P _cmpsb(void) { // A6: cmpsb I286_DI += STRING_DIR; } -I286_P _cmpsw(void) { // A7: cmpsw +I286FN _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); @@ -1693,9 +1801,10 @@ I286_P _cmpsw(void) { // A7: cmpsw I286_DI += STRING_DIRx2; } -I286_P _test_al_data8(void) { // A8: test al, DATA8 +I286FN _test_al_data8(void) { // A8: test al, DATA8 - DWORD src, dst; + UINT src; + UINT dst; I286_CLOCK(3) GET_PCBYTE(src) @@ -1703,9 +1812,10 @@ I286_P _test_al_data8(void) { // A8: ANDBYTE(dst, src) } -I286_P _test_ax_data16(void) { // A9: test ax, DATA16 +I286FN _test_ax_data16(void) { // A9: test ax, DATA16 - DWORD src, dst; + UINT32 src; + UINT32 dst; I286_CLOCK(3) GET_PCWORD(src) @@ -1713,37 +1823,39 @@ I286_P _test_ax_data16(void) { // A9: ANDWORD(dst, src) } -I286_P _stosb(void) { // AA: stosw +I286FN _stosb(void) { // AA: stosw I286_CLOCK(3) i286_memorywrite(I286_DI + ES_BASE, I286_AL); I286_DI += STRING_DIR; } -I286_P _stosw(void) { // AB: stosw +I286FN _stosw(void) { // AB: stosw I286_CLOCK(3) i286_memorywrite_w(I286_DI + ES_BASE, I286_AX); I286_DI += STRING_DIRx2; } -I286_P _lodsb(void) { // AC: lodsb +I286FN _lodsb(void) { // AC: lodsb I286_CLOCK(5) I286_AL = i286_memoryread(I286_SI + DS_FIX); I286_SI += STRING_DIR; } -I286_P _lodsw(void) { // AD: lodsw +I286FN _lodsw(void) { // AD: lodsw I286_CLOCK(5) I286_AX = i286_memoryread_w(I286_SI + DS_FIX); I286_SI += STRING_DIRx2; } -I286_P _scasb(void) { // AE: scasb +I286FN _scasb(void) { // AE: scasb - DWORD src, dst, res; + UINT src; + UINT dst; + UINT res; I286_CLOCK(7) src = i286_memoryread(I286_DI + ES_BASE); @@ -1752,9 +1864,11 @@ I286_P _scasb(void) { // AE: scasb I286_DI += STRING_DIR; } -I286_P _scasw(void) { // AF: scasw +I286FN _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); @@ -1763,27 +1877,28 @@ I286_P _scasw(void) { // AF: scasw I286_DI += STRING_DIRx2; } -I286_P _mov_al_imm(void) MOVIMM8(I286_AL) // B0: mov al, imm8 -I286_P _mov_cl_imm(void) MOVIMM8(I286_CL) // B1: mov cl, imm8 -I286_P _mov_dl_imm(void) MOVIMM8(I286_DL) // B2: mov dl, imm8 -I286_P _mov_bl_imm(void) MOVIMM8(I286_BL) // B3: mov bl, imm8 -I286_P _mov_ah_imm(void) MOVIMM8(I286_AH) // B4: mov ah, imm8 -I286_P _mov_ch_imm(void) MOVIMM8(I286_CH) // B5: mov ch, imm8 -I286_P _mov_dh_imm(void) MOVIMM8(I286_DH) // B6: mov dh, imm8 -I286_P _mov_bh_imm(void) MOVIMM8(I286_BH) // B7: mov bh, imm8 -I286_P _mov_ax_imm(void) MOVIMM16(I286_AX) // B8: mov ax, imm16 -I286_P _mov_cx_imm(void) MOVIMM16(I286_CX) // B9: mov cx, imm16 -I286_P _mov_dx_imm(void) MOVIMM16(I286_DX) // BA: mov dx, imm16 -I286_P _mov_bx_imm(void) MOVIMM16(I286_BX) // BB: mov bx, imm16 -I286_P _mov_sp_imm(void) MOVIMM16(I286_SP) // BC: mov sp, imm16 -I286_P _mov_bp_imm(void) MOVIMM16(I286_BP) // BD: mov bp, imm16 -I286_P _mov_si_imm(void) MOVIMM16(I286_SI) // BE: mov si, imm16 -I286_P _mov_di_imm(void) MOVIMM16(I286_DI) // BF: mov di, imm16 +I286FN _mov_al_imm(void) MOVIMM8(I286_AL) // B0: mov al, imm8 +I286FN _mov_cl_imm(void) MOVIMM8(I286_CL) // B1: mov cl, imm8 +I286FN _mov_dl_imm(void) MOVIMM8(I286_DL) // B2: mov dl, imm8 +I286FN _mov_bl_imm(void) MOVIMM8(I286_BL) // B3: mov bl, imm8 +I286FN _mov_ah_imm(void) MOVIMM8(I286_AH) // B4: mov ah, imm8 +I286FN _mov_ch_imm(void) MOVIMM8(I286_CH) // B5: mov ch, imm8 +I286FN _mov_dh_imm(void) MOVIMM8(I286_DH) // B6: mov dh, imm8 +I286FN _mov_bh_imm(void) MOVIMM8(I286_BH) // B7: mov bh, imm8 +I286FN _mov_ax_imm(void) MOVIMM16(I286_AX) // B8: mov ax, imm16 +I286FN _mov_cx_imm(void) MOVIMM16(I286_CX) // B9: mov cx, imm16 +I286FN _mov_dx_imm(void) MOVIMM16(I286_DX) // BA: mov dx, imm16 +I286FN _mov_bx_imm(void) MOVIMM16(I286_BX) // BB: mov bx, imm16 +I286FN _mov_sp_imm(void) MOVIMM16(I286_SP) // BC: mov sp, imm16 +I286FN _mov_bp_imm(void) MOVIMM16(I286_BP) // BD: mov bp, imm16 +I286FN _mov_si_imm(void) MOVIMM16(I286_SI) // BE: mov si, imm16 +I286FN _mov_di_imm(void) MOVIMM16(I286_DI) // BF: mov di, imm16 -I286_P _shift_ea8_data8(void) { // C0: shift EA8, DATA8 +I286FN _shift_ea8_data8(void) { // C0: shift EA8, DATA8 BYTE *out; - DWORD op, madr; + UINT op; + UINT32 madr; BYTE cl; GET_PCBYTE(op) @@ -1807,10 +1922,11 @@ I286_P _shift_ea8_data8(void) { // C0 sft_r8cl_table[(op >> 3) & 7](out, cl); } -I286_P _shift_ea16_data8(void) { // C1: shift EA16, DATA8 +I286FN _shift_ea16_data8(void) { // C1: shift EA16, DATA8 UINT16 *out; - DWORD op, madr; + UINT op; + UINT32 madr; BYTE cl; GET_PCBYTE(op) @@ -1834,7 +1950,7 @@ I286_P _shift_ea16_data8(void) { // C1 sft_r16cl_table[(op >> 3) & 7](out, cl); } -I286_P _ret_near_data16(void) { // C2: ret near DATA16 +I286FN _ret_near_data16(void) { // C2: ret near DATA16 UINT16 ad; @@ -1844,15 +1960,15 @@ I286_P _ret_near_data16(void) { // C2 I286_SP += ad; } -I286_P _ret_near(void) { // C3: ret near +I286FN _ret_near(void) { // C3: ret near I286_CLOCK(11) REGPOP0(I286_IP) } -I286_P _les_r16_ea(void) { // C4: les REG16, EA +I286FN _les_r16_ea(void) { // C4: les REG16, EA - DWORD op; + UINT op; UINT16 ad; I286_CLOCK(3) @@ -1869,9 +1985,9 @@ I286_P _les_r16_ea(void) { // C4: le } } -I286_P _lds_r16_ea(void) { // C5: lds REG16, EA +I286FN _lds_r16_ea(void) { // C5: lds REG16, EA - DWORD op; + UINT op; UINT16 ad; I286_CLOCK(3) @@ -1881,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 { @@ -1889,9 +2005,9 @@ I286_P _lds_r16_ea(void) { // C5: ld } } -I286_P _mov_ea8_data8(void) { // C6: mov EA8, DATA8 +I286FN _mov_ea8_data8(void) { // C6: mov EA8, DATA8 - DWORD op; + UINT op; GET_PCBYTE(op) if (op >= 0xc0) { @@ -1899,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) @@ -1908,9 +2024,9 @@ I286_P _mov_ea8_data8(void) { // C6: } } -I286_P _mov_ea16_data16(void) { // C7: mov EA16, DATA16 +I286FN _mov_ea16_data16(void) { // C7: mov EA16, DATA16 - DWORD op; + UINT op; GET_PCBYTE(op) if (op >= 0xc0) { @@ -1927,7 +2043,7 @@ I286_P _mov_ea16_data16(void) { // C7 } } -I286_P _enter(void) { // C8: enter DATA16, DATA8 +I286FN _enter(void) { // C8: enter DATA16, DATA8 UINT16 dimsize; BYTE level; @@ -1968,14 +2084,14 @@ I286_P _enter(void) { // C8: enter } } -I286_P leave(void) { // C9: leave +I286FN leave(void) { // C9: leave I286_CLOCK(5) I286_SP = I286_BP; REGPOP0(I286_BP) } -I286_P _ret_far_data16(void) { // CA: ret far DATA16 +I286FN _ret_far_data16(void) { // CA: ret far DATA16 UINT16 ad; @@ -1987,7 +2103,7 @@ I286_P _ret_far_data16(void) { // CA: CS_BASE = I286_CS << 4; } -I286_P _ret_far(void) { // CB: ret far +I286FN _ret_far(void) { // CB: ret far I286_CLOCK(15) REGPOP0(I286_IP) @@ -1995,22 +2111,22 @@ I286_P _ret_far(void) { // CB: ret CS_BASE = I286_CS << 4; } -I286_P _int_03(void) { // CC: int 3 +I286FN _int_03(void) { // CC: int 3 I286_CLOCK(23) INT_NUM(3, I286_IP); } -I286_P _int_data8(void) { // CD: int DATA8 +I286FN _int_data8(void) { // CD: int DATA8 - BYTE vect; + UINT vect; I286_CLOCK(23) GET_PCBYTE(vect) INT_NUM(vect, I286_IP); } -I286_P _into(void) { // CE: into +I286FN _into(void) { // CE: into I286_CLOCK(4) if (I286_OV) { @@ -2019,7 +2135,7 @@ I286_P _into(void) { // CE: into } } -I286_P _iret(void) { // CF: iret +I286FN _iret(void) { // CF: iret extirq_pop(); I286_CLOCK(31) @@ -2033,10 +2149,11 @@ I286_P _iret(void) { // CF: iret I286IRQCHECKTERM } -I286_P _shift_ea8_1(void) { // D0: shift EA8, 1 +I286FN _shift_ea8_1(void) { // D0: shift EA8, 1 BYTE *out; - DWORD op, madr; + UINT op; + UINT32 madr; GET_PCBYTE(op) if (op >= 0xc0) { @@ -2055,10 +2172,11 @@ I286_P _shift_ea8_1(void) { // D0: sh sft_r8_table[(op >> 3) & 7](out); } -I286_P _shift_ea16_1(void) { // D1: shift EA16, 1 +I286FN _shift_ea16_1(void) { // D1: shift EA16, 1 UINT16 *out; - DWORD op, madr; + UINT op; + UINT32 madr; GET_PCBYTE(op) if (op >= 0xc0) { @@ -2077,10 +2195,11 @@ I286_P _shift_ea16_1(void) { // D1: sh sft_r16_table[(op >> 3) & 7](out); } -I286_P _shift_ea8_cl(void) { // D2: shift EA8, cl +I286FN _shift_ea8_cl(void) { // D2: shift EA8, cl BYTE *out; - DWORD op, madr; + UINT op; + UINT32 madr; BYTE cl; GET_PCBYTE(op) @@ -2104,10 +2223,11 @@ I286_P _shift_ea8_cl(void) { // D2: sh sft_r8cl_table[(op >> 3) & 7](out, cl); } -I286_P _shift_ea16_cl(void) { // D3: shift EA16, cl +I286FN _shift_ea16_cl(void) { // D3: shift EA16, cl UINT16 *out; - DWORD op, madr; + UINT op; + UINT32 madr; BYTE cl; GET_PCBYTE(op) @@ -2131,7 +2251,7 @@ I286_P _shift_ea16_cl(void) { // D3: s sft_r16cl_table[(op >> 3) & 7](out, cl); } -I286_P _aam(void) { // D4: AAM +I286FN _aam(void) { // D4: AAM BYTE al; BYTE div; @@ -2143,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 @@ -2151,7 +2271,7 @@ I286_P _aam(void) { // D4: AAM } } -I286_P _aad(void) { // D5: AAD +I286FN _aad(void) { // D5: AAD BYTE mul; @@ -2163,20 +2283,20 @@ I286_P _aad(void) { // D5: AAD I286_FLAGL |= szpcflag[I286_AL]; } -I286_P _setalc(void) { // D6: setalc (80286) +I286FN _setalc(void) { // D6: setalc (80286) I286_AL = ((I286_FLAGL & C_FLAG)?0xff:0); } -I286_P _xlat(void) { // D7: xlat +I286FN _xlat(void) { // D7: xlat I286_CLOCK(5) I286_AL = i286_memoryread(((I286_AL + I286_BX) & 0xffff) + DS_FIX); } -I286_P _esc(void) { // D8: esc +I286FN _esc(void) { // D8: esc - DWORD op; + UINT op; I286_CLOCK(2) GET_PCBYTE(op) @@ -2185,30 +2305,30 @@ I286_P _esc(void) { // D8: esc } } -I286_P _loopnz(void) { // E0: loopnz +I286FN _loopnz(void) { // E0: loopnz I286_CX--; if ((!I286_CX) || (I286_FLAGL & Z_FLAG)) JMPNOP(4) else JMPSHORT(8) } -I286_P _loopz(void) { // E1: loopz +I286FN _loopz(void) { // E1: loopz I286_CX--; if ((!I286_CX) || (!(I286_FLAGL & Z_FLAG))) JMPNOP(4) else JMPSHORT(8) } -I286_P _loop(void) { // E2: loop +I286FN _loop(void) { // E2: loop I286_CX--; if (!I286_CX) JMPNOP(4) else JMPSHORT(8) } -I286_P _jcxz(void) { // E3: jcxz +I286FN _jcxz(void) { // E3: jcxz if (I286_CX) JMPNOP(4) else JMPSHORT(8) } -I286_P _in_al_data8(void) { // E4: in al, DATA8 +I286FN _in_al_data8(void) { // E4: in al, DATA8 UINT port; @@ -2219,7 +2339,7 @@ I286_P _in_al_data8(void) { // E4: i i286reg.inport = 0; } -I286_P _in_ax_data8(void) { // E5: in ax, DATA8 +I286FN _in_ax_data8(void) { // E5: in ax, DATA8 UINT port; @@ -2228,7 +2348,7 @@ I286_P _in_ax_data8(void) { // E5: i I286_AX = iocore_inp16(port); } -I286_P _out_data8_al(void) { // E6: out DATA8, al +I286FN _out_data8_al(void) { // E6: out DATA8, al UINT port; @@ -2237,7 +2357,7 @@ I286_P _out_data8_al(void) { // E6: o iocore_out8(port, I286_AL); } -I286_P _out_data8_ax(void) { // E7: out DATA8, ax +I286FN _out_data8_ax(void) { // E7: out DATA8, ax UINT port; @@ -2246,7 +2366,7 @@ I286_P _out_data8_ax(void) { // E7: o iocore_out16(port, I286_AX); } -I286_P _call_near(void) { // E8: call near +I286FN _call_near(void) { // E8: call near UINT16 ad; @@ -2256,7 +2376,7 @@ I286_P _call_near(void) { // E8: cal I286_IP += ad; } -I286_P _jmp_near(void) { // E9: jmp near +I286FN _jmp_near(void) { // E9: jmp near UINT16 ad; @@ -2265,7 +2385,7 @@ I286_P _jmp_near(void) { // E9: jmp I286_IP += ad; } -I286_P _jmp_far(void) { // EA: jmp far +I286FN _jmp_far(void) { // EA: jmp far UINT16 ad; @@ -2276,7 +2396,7 @@ I286_P _jmp_far(void) { // EA: jmp I286_IP = ad; } -I286_P _jmp_short(void) { // EB: jmp short +I286FN _jmp_short(void) { // EB: jmp short UINT16 ad; @@ -2285,40 +2405,40 @@ I286_P _jmp_short(void) { // EB: jmp I286_IP += ad; } -I286_P _in_al_dx(void) { // EC: in al, dx +I286FN _in_al_dx(void) { // EC: in al, dx I286_CLOCK(5) I286_AL = iocore_inp8(I286_DX); } -I286_P _in_ax_dx(void) { // ED: in ax, dx +I286FN _in_ax_dx(void) { // ED: in ax, dx I286_CLOCK(5) I286_AX = iocore_inp16(I286_DX); } -I286_P _out_dx_al(void) { // EE: out dx, al +I286FN _out_dx_al(void) { // EE: out dx, al I286_CLOCK(3) iocore_out8(I286_DX, I286_AL); } -I286_P _out_dx_ax(void) { // EF: out dx, ax +I286FN _out_dx_ax(void) { // EF: out dx, ax I286_CLOCK(3) iocore_out16(I286_DX, I286_AX); } -I286_P _lock(void) { // F0: lock +I286FN _lock(void) { // F0: lock // F1: lock I286_CLOCK(2) } -I286_P _repne(void) { // F2: repne +I286FN _repne(void) { // F2: repne i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op_repne[op](); i286reg.prefix = 0; @@ -2328,11 +2448,11 @@ I286_P _repne(void) { // F2: repne } } -I286_P _repe(void) { // F3: repe +I286FN _repe(void) { // F3: repe i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op_repe[op](); i286reg.prefix = 0; @@ -2342,84 +2462,85 @@ I286_P _repe(void) { // F3: repe } } -I286_P _hlt(void) { // F4: hlt +I286FN _hlt(void) { // F4: hlt nevent.remainclock = -1; I286_IP--; } -I286_P _cmc(void) { // F5: cmc +I286FN _cmc(void) { // F5: cmc I286_CLOCK(2) I286_FLAGL ^= C_FLAG; } -I286_P _ope0xf6(void) { // F6: +I286FN _ope0xf6(void) { // F6: - DWORD op; + UINT op; GET_PCBYTE(op); c_ope0xf6_table[(op >> 3) & 7](op); } -I286_P _ope0xf7(void) { // F7: +I286FN _ope0xf7(void) { // F7: - DWORD op; + UINT op; GET_PCBYTE(op); c_ope0xf7_table[(op >> 3) & 7](op); } -I286_P _clc(void) { // F8: clc +I286FN _clc(void) { // F8: clc I286_CLOCK(2) I286_FLAGL &= ~C_FLAG; } -I286_P _stc(void) { // F9: stc +I286FN _stc(void) { // F9: stc I286_CLOCK(2) I286_FLAGL |= C_FLAG; } -I286_P _cli(void) { // FA: cli +I286FN _cli(void) { // FA: cli I286_CLOCK(2) I286_FLAG &= ~I_FLAG; I286_TRAP = 0; } -I286_P _sti(void) { // FB: sti +I286FN _sti(void) { // FB: sti I286_CLOCK(2) I286_FLAG |= I_FLAG; I286_TRAP = (I286_FLAG & T_FLAG) >> 8; // ToDo + REMAIN_ADJUST(1) } -I286_P _cld(void) { // FC: cld +I286FN _cld(void) { // FC: cld I286_CLOCK(2) I286_FLAG &= ~D_FLAG; } -I286_P _std(void) { // FD: std +I286FN _std(void) { // FD: std I286_CLOCK(2) I286_FLAG |= D_FLAG; } -I286_P _ope0xfe(void) { // FE: +I286FN _ope0xfe(void) { // FE: - DWORD op; + UINT op; GET_PCBYTE(op); c_ope0xfe_table[(op >> 3) & 1](op); } -I286_P _ope0xff(void) { // FF: +I286FN _ope0xff(void) { // FF: - DWORD op; + UINT op; GET_PCBYTE(op); c_ope0xff_table[(op >> 3) & 7](op); @@ -2705,13 +2826,13 @@ const I286OP i286op[] = { // ----------------------------------------------------------------- repe -I286_P _repe_segprefix_es(void) { +I286FN _repe_segprefix_es(void) { DS_FIX = ES_BASE; SS_FIX = ES_BASE; i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op_repe[op](); REMOVE_PREFIX @@ -2722,13 +2843,13 @@ I286_P _repe_segprefix_es(void) { } } -I286_P _repe_segprefix_cs(void) { +I286FN _repe_segprefix_cs(void) { DS_FIX = CS_BASE; SS_FIX = CS_BASE; i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op_repe[op](); REMOVE_PREFIX @@ -2739,13 +2860,13 @@ I286_P _repe_segprefix_cs(void) { } } -I286_P _repe_segprefix_ss(void) { +I286FN _repe_segprefix_ss(void) { DS_FIX = SS_BASE; SS_FIX = SS_BASE; i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op_repe[op](); REMOVE_PREFIX @@ -2756,13 +2877,13 @@ I286_P _repe_segprefix_ss(void) { } } -I286_P _repe_segprefix_ds(void) { +I286FN _repe_segprefix_ds(void) { DS_FIX = DS_BASE; SS_FIX = DS_BASE; i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op_repe[op](); REMOVE_PREFIX @@ -3050,13 +3171,13 @@ const I286OP i286op_repe[] = { // ----------------------------------------------------------------- repne -I286_P _repne_segprefix_es(void) { +I286FN _repne_segprefix_es(void) { DS_FIX = ES_BASE; SS_FIX = ES_BASE; i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op_repne[op](); REMOVE_PREFIX @@ -3067,13 +3188,13 @@ I286_P _repne_segprefix_es(void) { } } -I286_P _repne_segprefix_cs(void) { +I286FN _repne_segprefix_cs(void) { DS_FIX = CS_BASE; SS_FIX = CS_BASE; i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op_repne[op](); REMOVE_PREFIX @@ -3084,13 +3205,13 @@ I286_P _repne_segprefix_cs(void) { } } -I286_P _repne_segprefix_ss(void) { +I286FN _repne_segprefix_ss(void) { DS_FIX = SS_BASE; SS_FIX = SS_BASE; i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op_repne[op](); REMOVE_PREFIX @@ -3101,13 +3222,13 @@ I286_P _repne_segprefix_ss(void) { } } -I286_P _repne_segprefix_ds(void) { +I286FN _repne_segprefix_ds(void) { DS_FIX = DS_BASE; SS_FIX = DS_BASE; i286reg.prefix++; if (i286reg.prefix < MAX_PREFIX) { - DWORD op; + UINT op; GET_PCBYTE(op); i286op_repne[op](); REMOVE_PREFIX @@ -3392,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 = 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