--- np2/i286c/i286c_mn.c 2003/10/16 17:57:42 1.1 +++ 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); @@ -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); @@ -917,44 +1003,45 @@ 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 - WORD tmp = I286_SP; + UINT16 tmp; + tmp = I286_SP; REGPUSH0(I286_AX) REGPUSH0(I286_CX) REGPUSH0(I286_DX) @@ -966,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); @@ -979,12 +1066,12 @@ 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; - WORD reg; + UINT vect = 0; + UINT op; + UINT32 madr; + UINT16 reg; I286_CLOCK(13); // ToDo GET_PCBYTE(op); @@ -1005,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); @@ -1017,49 +1104,51 @@ 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 - WORD tmp; + UINT16 tmp; GET_PCWORD(tmp) 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 - 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 +I286FN _push_data8(void) { // 6A: push DATA8 - WORD tmp; + UINT16 tmp; GET_PCBYTES(tmp) 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 - 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 +I286FN _insb(void) { // 6C: insb BYTE dat; @@ -1069,9 +1158,9 @@ I286_P _insb(void) { // 6C: insb I286_DI += STRING_DIR; } -I286_P _insw(void) { // 6D: insw +I286FN _insw(void) { // 6D: insw - WORD dat; + UINT16 dat; I286_CLOCK(5) dat = iocore_inp16(I286_DX); @@ -1079,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; @@ -1089,9 +1178,9 @@ I286_P _outsb(void) { // 6E: outsb iocore_out8(I286_DX, dat); } -I286_P _outsw(void) { // 6F: outsw +I286FN _outsw(void) { // 6F: outsw - WORD dat; + UINT16 dat; I286_CLOCK(3) dat = i286_memoryread_w(I286_SI + DS_FIX); @@ -1099,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) { @@ -1206,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 - WORD *out; - DWORD op, madr, src; + UINT16 *out; + UINT op; + UINT32 madr; + UINT32 src; GET_PCBYTE(op) if (op >= 0xc0) { @@ -1224,16 +1316,18 @@ 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); } -I286_P _calc_ea16_i8(void) { // 83: op EA16, DATA8 +I286FN _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,16 +1342,19 @@ 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); } -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) { @@ -1278,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 - 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,16 +1396,18 @@ 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); } -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) { @@ -1326,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 - WORD *out, *src; - DWORD op, madr; + UINT16 *out; + UINT16 *src; + UINT op; + UINT32 madr; PREPART_EA_REG16P(op, src); if (op >= 0xc0) { @@ -1340,20 +1444,21 @@ 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); } -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) { @@ -1367,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 - WORD src; - DWORD op; + UINT16 src; + UINT op; PREPART_EA_REG16(op, src); if (op >= 0xc0) { @@ -1383,30 +1488,30 @@ 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 - WORD *out; - WORD src; - DWORD op; + UINT16 *out; + UINT16 src; + 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; - WORD tmp; + UINT op; + UINT16 tmp; GET_PCBYTE(op); tmp = *SEGMENTPTR((op >> 3) & 3); @@ -1420,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) @@ -1434,11 +1539,11 @@ 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; - 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; @@ -1475,10 +1580,10 @@ 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; - WORD tmp; + UINT op; + UINT16 tmp; I286_CLOCK(5) REGPOP0(tmp) @@ -1492,103 +1597,103 @@ 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 - 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 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 - 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; } -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) @@ -1598,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; @@ -1657,9 +1762,9 @@ I286_P _movsb(void) { // A4: movsb I286_DI += STRING_DIR; } -I286_P _movsw(void) { // A5: movsw +I286FN _movsw(void) { // A5: movsw - WORD tmp; + UINT16 tmp; I286_CLOCK(5) tmp = i286_memoryread_w(I286_SI + DS_FIX); @@ -1668,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); @@ -1680,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); @@ -1692,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) @@ -1702,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) @@ -1712,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); @@ -1751,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); @@ -1762,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) @@ -1806,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 - WORD *out; - DWORD op, madr; + UINT16 *out; + UINT op; + UINT32 madr; BYTE cl; GET_PCBYTE(op) @@ -1826,16 +1943,16 @@ 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); 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 - WORD ad; + UINT16 ad; I286_CLOCK(11) GET_PCWORD(ad) @@ -1843,16 +1960,16 @@ 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; - WORD ad; + UINT op; + UINT16 ad; I286_CLOCK(3) GET_PCBYTE(op) @@ -1861,17 +1978,17 @@ 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); } } -I286_P _lds_r16_ea(void) { // C5: lds REG16, EA +I286FN _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 { @@ -1888,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) { @@ -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) @@ -1907,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) { @@ -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) @@ -1926,9 +2043,9 @@ I286_P _mov_ea16_data16(void) { // C7 } } -I286_P _enter(void) { // C8: enter DATA16, DATA8 +I286FN _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; @@ -1967,49 +2084,49 @@ 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 - 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 +I286FN _ret_far(void) { // CB: ret far 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 +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) { @@ -2018,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) @@ -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 +I286FN _shift_ea8_1(void) { // D0: shift EA8, 1 BYTE *out; - DWORD op, madr; + UINT op; + UINT32 madr; GET_PCBYTE(op) if (op >= 0xc0) { @@ -2054,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 - WORD *out; - DWORD op, madr; + UINT16 *out; + UINT op; + UINT32 madr; GET_PCBYTE(op) if (op >= 0xc0) { @@ -2071,15 +2190,16 @@ 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); } -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) @@ -2103,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 - WORD *out; - DWORD op, madr; + UINT16 *out; + UINT op; + UINT32 madr; BYTE cl; GET_PCBYTE(op) @@ -2123,14 +2244,14 @@ 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); sft_r16cl_table[(op >> 3) & 7](out, cl); } -I286_P _aam(void) { // D4: AAM +I286FN _aam(void) { // D4: AAM BYTE al; BYTE div; @@ -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 @@ -2150,7 +2271,7 @@ I286_P _aam(void) { // D4: AAM } } -I286_P _aad(void) { // D5: AAD +I286FN _aad(void) { // D5: AAD BYTE mul; @@ -2162,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) @@ -2184,68 +2305,70 @@ 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 - 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 +I286FN _in_ax_data8(void) { // E5: in ax, DATA8 - WORD port; + UINT port; I286_CLOCK(5) GET_PCBYTE(port) I286_AX = iocore_inp16(port); } -I286_P _out_data8_al(void) { // E6: out DATA8, al +I286FN _out_data8_al(void) { // E6: out DATA8, al - WORD port; + UINT port; I286_CLOCK(3) GET_PCBYTE(port); iocore_out8(port, I286_AL); } -I286_P _out_data8_ax(void) { // E7: out DATA8, ax +I286FN _out_data8_ax(void) { // E7: out DATA8, ax - WORD port; + UINT port; I286_CLOCK(3) GET_PCBYTE(port); iocore_out16(port, I286_AX); } -I286_P _call_near(void) { // E8: call near +I286FN _call_near(void) { // E8: call near - WORD ad; + UINT16 ad; I286_CLOCK(7) GET_PCWORD(ad) @@ -2253,170 +2376,171 @@ 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 - WORD ad; + UINT16 ad; I286_CLOCK(7) GET_PCWORD(ad) I286_IP += ad; } -I286_P _jmp_far(void) { // EA: jmp far +I286FN _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 +I286FN _jmp_short(void) { // EB: jmp short - WORD ad; + UINT16 ad; I286_CLOCK(7) GET_PCBYTES(ad) 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 - 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); } } -I286_P _repe(void) { // F3: repe +I286FN _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); } } -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); @@ -2702,68 +2826,68 @@ const I286OP i286op[] = { // ----------------------------------------------------------------- repe -I286_P _repe_segprefix_es(void) { +I286FN _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); } } -I286_P _repe_segprefix_cs(void) { +I286FN _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); } } -I286_P _repe_segprefix_ss(void) { +I286FN _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); } } -I286_P _repe_segprefix_ds(void) { +I286FN _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); @@ -3047,68 +3171,68 @@ const I286OP i286op_repe[] = { // ----------------------------------------------------------------- repne -I286_P _repne_segprefix_es(void) { +I286FN _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); } } -I286_P _repne_segprefix_cs(void) { +I286FN _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); } } -I286_P _repne_segprefix_ss(void) { +I286FN _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); } } -I286_P _repne_segprefix_ds(void) { +I286FN _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