|
|
| version 1.35, 2004/02/21 17:52:04 | version 1.41, 2005/05/12 05:10:02 |
|---|---|
| Line 5 | Line 5 |
| #include "iocore.h" | #include "iocore.h" |
| #include "bios.h" | #include "bios.h" |
| #include "i286c.mcr" | #include "i286c.mcr" |
| #if defined(ENABLE_TRAP) | |
| #include "inttrap.h" | |
| #endif | |
| #define MAX_PREFIX 8 | #define MAX_PREFIX 8 |
| Line 32 I286FN _reserved(void) { | Line 35 I286FN _reserved(void) { |
| I286FN _add_ea_r8(void) { // 00: add EA, REG8 | I286FN _add_ea_r8(void) { // 00: add EA, REG8 |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 57 I286FN _add_ea_r8(void) { // 00: ad | Line 60 I286FN _add_ea_r8(void) { // 00: ad |
| } | } |
| dst = *out; | dst = *out; |
| ADDBYTE(res, dst, src); | ADDBYTE(res, dst, src); |
| *out = (BYTE)res; | *out = (UINT8)res; |
| } | } |
| I286FN _add_ea_r16(void) { // 01: add EA, REG16 | I286FN _add_ea_r16(void) { // 01: add EA, REG16 |
| Line 92 I286FN _add_ea_r16(void) { // 01: a | Line 95 I286FN _add_ea_r16(void) { // 01: a |
| I286FN _add_r8_ea(void) { // 02: add REG8, EA | I286FN _add_r8_ea(void) { // 02: add REG8, EA |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 101 I286FN _add_r8_ea(void) { // 02: ad | Line 104 I286FN _add_r8_ea(void) { // 02: ad |
| PREPART_REG8_EA(op, src, out, 2, 7); | PREPART_REG8_EA(op, src, out, 2, 7); |
| dst = *out; | dst = *out; |
| ADDBYTE(res, dst, src); | ADDBYTE(res, dst, src); |
| *out = (BYTE)res; | *out = (UINT8)res; |
| } | } |
| I286FN _add_r16_ea(void) { // 03: add REG16, EA | I286FN _add_r16_ea(void) { // 03: add REG16, EA |
| Line 126 I286FN _add_al_data8(void) { // 04: | Line 129 I286FN _add_al_data8(void) { // 04: |
| I286_WORKCLOCK(3); | I286_WORKCLOCK(3); |
| GET_PCBYTE(src); | GET_PCBYTE(src); |
| ADDBYTE(res, I286_AL, src); | ADDBYTE(res, I286_AL, src); |
| I286_AL = (BYTE)res; | I286_AL = (UINT8)res; |
| } | } |
| I286FN _add_ax_data16(void) { // 05: add ax, DATA16 | I286FN _add_ax_data16(void) { // 05: add ax, DATA16 |
| Line 156 I286FN _pop_es(void) { // 07: pop | Line 159 I286FN _pop_es(void) { // 07: pop |
| I286FN _or_ea_r8(void) { // 08: or EA, REG8 | I286FN _or_ea_r8(void) { // 08: or EA, REG8 |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 180 I286FN _or_ea_r8(void) { // 08: or | Line 183 I286FN _or_ea_r8(void) { // 08: or |
| } | } |
| dst = *out; | dst = *out; |
| ORBYTE(dst, src); | ORBYTE(dst, src); |
| *out = (BYTE)dst; | *out = (UINT8)dst; |
| } | } |
| I286FN _or_ea_r16(void) { // 09: or EA, REG16 | I286FN _or_ea_r16(void) { // 09: or EA, REG16 |
| Line 214 I286FN _or_ea_r16(void) { // 09: o | Line 217 I286FN _or_ea_r16(void) { // 09: o |
| I286FN _or_r8_ea(void) { // 0a: or REG8, EA | I286FN _or_r8_ea(void) { // 0a: or REG8, EA |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 222 I286FN _or_r8_ea(void) { // 0a: or | Line 225 I286FN _or_r8_ea(void) { // 0a: or |
| PREPART_REG8_EA(op, src, out, 2, 7); | PREPART_REG8_EA(op, src, out, 2, 7); |
| dst = *out; | dst = *out; |
| ORBYTE(dst, src); | ORBYTE(dst, src); |
| *out = (BYTE)dst; | *out = (UINT8)dst; |
| } | } |
| I286FN _or_r16_ea(void) { // 0b: or REG16, EA | I286FN _or_r16_ea(void) { // 0b: or REG16, EA |
| Line 247 I286FN _or_al_data8(void) { // 0c: | Line 250 I286FN _or_al_data8(void) { // 0c: |
| GET_PCBYTE(src); | GET_PCBYTE(src); |
| dst = I286_AL; | dst = I286_AL; |
| ORBYTE(dst, src); | ORBYTE(dst, src); |
| I286_AL = (BYTE)dst; | I286_AL = (UINT8)dst; |
| } | } |
| I286FN _or_ax_data16(void) { // 0d: or ax, DATA16 | I286FN _or_ax_data16(void) { // 0d: or ax, DATA16 |
| Line 269 I286FN _push_cs(void) { // 0e: pus | Line 272 I286FN _push_cs(void) { // 0e: pus |
| I286FN _adc_ea_r8(void) { // 10: adc EA, REG8 | I286FN _adc_ea_r8(void) { // 10: adc EA, REG8 |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 294 I286FN _adc_ea_r8(void) { // 10: ad | Line 297 I286FN _adc_ea_r8(void) { // 10: ad |
| } | } |
| dst = *out; | dst = *out; |
| ADCBYTE(res, dst, src); | ADCBYTE(res, dst, src); |
| *out = (BYTE)res; | *out = (UINT8)res; |
| } | } |
| I286FN _adc_ea_r16(void) { // 11: adc EA, REG16 | I286FN _adc_ea_r16(void) { // 11: adc EA, REG16 |
| Line 329 I286FN _adc_ea_r16(void) { // 11: a | Line 332 I286FN _adc_ea_r16(void) { // 11: a |
| I286FN _adc_r8_ea(void) { // 12: adc REG8, EA | I286FN _adc_r8_ea(void) { // 12: adc REG8, EA |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 338 I286FN _adc_r8_ea(void) { // 12: ad | Line 341 I286FN _adc_r8_ea(void) { // 12: ad |
| PREPART_REG8_EA(op, src, out, 2, 7); | PREPART_REG8_EA(op, src, out, 2, 7); |
| dst = *out; | dst = *out; |
| ADCBYTE(res, dst, src); | ADCBYTE(res, dst, src); |
| *out = (BYTE)res; | *out = (UINT8)res; |
| } | } |
| I286FN _adc_r16_ea(void) { // 13: adc REG16, EA | I286FN _adc_r16_ea(void) { // 13: adc REG16, EA |
| Line 363 I286FN _adc_al_data8(void) { // 14: | Line 366 I286FN _adc_al_data8(void) { // 14: |
| I286_WORKCLOCK(3); | I286_WORKCLOCK(3); |
| GET_PCBYTE(src); | GET_PCBYTE(src); |
| ADCBYTE(res, I286_AL, src); | ADCBYTE(res, I286_AL, src); |
| I286_AL = (BYTE)res; | I286_AL = (UINT8)res; |
| } | } |
| I286FN _adc_ax_data16(void) { // 15: adc ax, DATA16 | I286FN _adc_ax_data16(void) { // 15: adc ax, DATA16 |
| Line 395 I286FN _pop_ss(void) { // 17: pop | Line 398 I286FN _pop_ss(void) { // 17: pop |
| I286FN _sbb_ea_r8(void) { // 18: sbb EA, REG8 | I286FN _sbb_ea_r8(void) { // 18: sbb EA, REG8 |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 420 I286FN _sbb_ea_r8(void) { // 18: sb | Line 423 I286FN _sbb_ea_r8(void) { // 18: sb |
| } | } |
| dst = *out; | dst = *out; |
| SBBBYTE(res, dst, src); | SBBBYTE(res, dst, src); |
| *out = (BYTE)res; | *out = (UINT8)res; |
| } | } |
| I286FN _sbb_ea_r16(void) { // 19: sbb EA, REG16 | I286FN _sbb_ea_r16(void) { // 19: sbb EA, REG16 |
| Line 455 I286FN _sbb_ea_r16(void) { // 19: s | Line 458 I286FN _sbb_ea_r16(void) { // 19: s |
| I286FN _sbb_r8_ea(void) { // 1a: sbb REG8, EA | I286FN _sbb_r8_ea(void) { // 1a: sbb REG8, EA |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 464 I286FN _sbb_r8_ea(void) { // 1a: sb | Line 467 I286FN _sbb_r8_ea(void) { // 1a: sb |
| PREPART_REG8_EA(op, src, out, 2, 7); | PREPART_REG8_EA(op, src, out, 2, 7); |
| dst = *out; | dst = *out; |
| SBBBYTE(res, dst, src); | SBBBYTE(res, dst, src); |
| *out = (BYTE)res; | *out = (UINT8)res; |
| } | } |
| I286FN _sbb_r16_ea(void) { // 1b: sbb REG16, EA | I286FN _sbb_r16_ea(void) { // 1b: sbb REG16, EA |
| Line 489 I286FN _sbb_al_data8(void) { // 1c: | Line 492 I286FN _sbb_al_data8(void) { // 1c: |
| I286_WORKCLOCK(3); | I286_WORKCLOCK(3); |
| GET_PCBYTE(src); | GET_PCBYTE(src); |
| SBBBYTE(res, I286_AL, src); | SBBBYTE(res, I286_AL, src); |
| I286_AL = (BYTE)res; | I286_AL = (UINT8)res; |
| } | } |
| I286FN _sbb_ax_data16(void) { // 1d: adc ax, DATA16 | I286FN _sbb_ax_data16(void) { // 1d: adc ax, DATA16 |
| Line 520 I286FN _pop_ds(void) { // 1f: pop | Line 523 I286FN _pop_ds(void) { // 1f: pop |
| I286FN _and_ea_r8(void) { // 20: and EA, REG8 | I286FN _and_ea_r8(void) { // 20: and EA, REG8 |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 544 I286FN _and_ea_r8(void) { // 20: an | Line 547 I286FN _and_ea_r8(void) { // 20: an |
| } | } |
| dst = *out; | dst = *out; |
| ANDBYTE(dst, src); | ANDBYTE(dst, src); |
| *out = (BYTE)dst; | *out = (UINT8)dst; |
| } | } |
| I286FN _and_ea_r16(void) { // 21: and EA, REG16 | I286FN _and_ea_r16(void) { // 21: and EA, REG16 |
| Line 578 I286FN _and_ea_r16(void) { // 21: a | Line 581 I286FN _and_ea_r16(void) { // 21: a |
| I286FN _and_r8_ea(void) { // 22: and REG8, EA | I286FN _and_r8_ea(void) { // 22: and REG8, EA |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 586 I286FN _and_r8_ea(void) { // 22: an | Line 589 I286FN _and_r8_ea(void) { // 22: an |
| PREPART_REG8_EA(op, src, out, 2, 7); | PREPART_REG8_EA(op, src, out, 2, 7); |
| dst = *out; | dst = *out; |
| ANDBYTE(dst, src); | ANDBYTE(dst, src); |
| *out = (BYTE)dst; | *out = (UINT8)dst; |
| } | } |
| I286FN _and_r16_ea(void) { // 23: and REG16, EA | I286FN _and_r16_ea(void) { // 23: and REG16, EA |
| Line 611 I286FN _and_al_data8(void) { // 24: | Line 614 I286FN _and_al_data8(void) { // 24: |
| GET_PCBYTE(src); | GET_PCBYTE(src); |
| dst = I286_AL; | dst = I286_AL; |
| ANDBYTE(dst, src); | ANDBYTE(dst, src); |
| I286_AL = (BYTE)dst; | I286_AL = (UINT8)dst; |
| } | } |
| I286FN _and_ax_data16(void) { // 25: and ax, DATA16 | I286FN _and_ax_data16(void) { // 25: and ax, DATA16 |
| Line 651 I286FN _daa(void) { // 27: daa | Line 654 I286FN _daa(void) { // 27: daa |
| ((I286_AL >= 0x1a) && (I286_FLAGL & C_FLAG)))); | ((I286_AL >= 0x1a) && (I286_FLAGL & C_FLAG)))); |
| if ((I286_FLAGL & A_FLAG) || ((I286_AL & 0x0f) > 9)) { | if ((I286_FLAGL & A_FLAG) || ((I286_AL & 0x0f) > 9)) { |
| I286_FLAGL |= A_FLAG; | I286_FLAGL |= A_FLAG; |
| I286_FLAGL |= (BYTE)((I286_AL + 6) >> 8); | I286_FLAGL |= (UINT8)((I286_AL + 6) >> 8); |
| I286_AL += 6; | I286_AL += 6; |
| } | } |
| if ((I286_FLAGL & C_FLAG) || (I286_AL > 0x9f)) { | if ((I286_FLAGL & C_FLAG) || (I286_AL > 0x9f)) { |
| Line 664 I286FN _daa(void) { // 27: daa | Line 667 I286FN _daa(void) { // 27: daa |
| I286FN _sub_ea_r8(void) { // 28: sub EA, REG8 | I286FN _sub_ea_r8(void) { // 28: sub EA, REG8 |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 689 I286FN _sub_ea_r8(void) { // 28: su | Line 692 I286FN _sub_ea_r8(void) { // 28: su |
| } | } |
| dst = *out; | dst = *out; |
| SUBBYTE(res, dst, src); | SUBBYTE(res, dst, src); |
| *out = (BYTE)res; | *out = (UINT8)res; |
| } | } |
| I286FN _sub_ea_r16(void) { // 29: sub EA, REG16 | I286FN _sub_ea_r16(void) { // 29: sub EA, REG16 |
| Line 724 I286FN _sub_ea_r16(void) { // 29: s | Line 727 I286FN _sub_ea_r16(void) { // 29: s |
| I286FN _sub_r8_ea(void) { // 2a: sub REG8, EA | I286FN _sub_r8_ea(void) { // 2a: sub REG8, EA |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 733 I286FN _sub_r8_ea(void) { // 2a: su | Line 736 I286FN _sub_r8_ea(void) { // 2a: su |
| PREPART_REG8_EA(op, src, out, 2, 7); | PREPART_REG8_EA(op, src, out, 2, 7); |
| dst = *out; | dst = *out; |
| SUBBYTE(res, dst, src); | SUBBYTE(res, dst, src); |
| *out = (BYTE)res; | *out = (UINT8)res; |
| } | } |
| I286FN _sub_r16_ea(void) { // 2b: sub REG16, EA | I286FN _sub_r16_ea(void) { // 2b: sub REG16, EA |
| Line 758 I286FN _sub_al_data8(void) { // 2c: | Line 761 I286FN _sub_al_data8(void) { // 2c: |
| I286_WORKCLOCK(3); | I286_WORKCLOCK(3); |
| GET_PCBYTE(src); | GET_PCBYTE(src); |
| SUBBYTE(res, I286_AL, src); | SUBBYTE(res, I286_AL, src); |
| I286_AL = (BYTE)res; | I286_AL = (UINT8)res; |
| } | } |
| I286FN _sub_ax_data16(void) { // 2d: sub ax, DATA16 | I286FN _sub_ax_data16(void) { // 2d: sub ax, DATA16 |
| Line 807 I286FN _das(void) { // 2f: das | Line 810 I286FN _das(void) { // 2f: das |
| I286FN _xor_ea_r8(void) { // 30: xor EA, REG8 | I286FN _xor_ea_r8(void) { // 30: xor EA, REG8 |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 831 I286FN _xor_ea_r8(void) { // 30: xo | Line 834 I286FN _xor_ea_r8(void) { // 30: xo |
| } | } |
| dst = *out; | dst = *out; |
| XORBYTE(dst, src); | XORBYTE(dst, src); |
| *out = (BYTE)dst; | *out = (UINT8)dst; |
| } | } |
| I286FN _xor_ea_r16(void) { // 31: xor EA, REG16 | I286FN _xor_ea_r16(void) { // 31: xor EA, REG16 |
| Line 865 I286FN _xor_ea_r16(void) { // 31: x | Line 868 I286FN _xor_ea_r16(void) { // 31: x |
| I286FN _xor_r8_ea(void) { // 32: xor REG8, EA | I286FN _xor_r8_ea(void) { // 32: xor REG8, EA |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 873 I286FN _xor_r8_ea(void) { // 32: xo | Line 876 I286FN _xor_r8_ea(void) { // 32: xo |
| PREPART_REG8_EA(op, src, out, 2, 7); | PREPART_REG8_EA(op, src, out, 2, 7); |
| dst = *out; | dst = *out; |
| XORBYTE(dst, src); | XORBYTE(dst, src); |
| *out = (BYTE)dst; | *out = (UINT8)dst; |
| } | } |
| I286FN _xor_r16_ea(void) { // 33: or REG16, EA | I286FN _xor_r16_ea(void) { // 33: or REG16, EA |
| Line 898 I286FN _xor_al_data8(void) { // 34: | Line 901 I286FN _xor_al_data8(void) { // 34: |
| GET_PCBYTE(src); | GET_PCBYTE(src); |
| dst = I286_AL; | dst = I286_AL; |
| XORBYTE(dst, src); | XORBYTE(dst, src); |
| I286_AL = (BYTE)dst; | I286_AL = (UINT8)dst; |
| } | } |
| I286FN _xor_ax_data16(void) { // 35: or ax, DATA16 | I286FN _xor_ax_data16(void) { // 35: or ax, DATA16 |
| Line 958 I286FN _cmp_ea_r8(void) { // 38: cm | Line 961 I286FN _cmp_ea_r8(void) { // 38: cm |
| SUBBYTE(res, dst, src); | SUBBYTE(res, dst, src); |
| } | } |
| else { | else { |
| I286_WORKCLOCK(7); | I286_WORKCLOCK(6); |
| dst = i286_memoryread(CALC_EA(op)); | dst = i286_memoryread(CALC_EA(op)); |
| SUBBYTE(res, dst, src); | SUBBYTE(res, dst, src); |
| } | } |
| Line 978 I286FN _cmp_ea_r16(void) { // 39: c | Line 981 I286FN _cmp_ea_r16(void) { // 39: c |
| SUBWORD(res, dst, src); | SUBWORD(res, dst, src); |
| } | } |
| else { | else { |
| I286_WORKCLOCK(7); | I286_WORKCLOCK(6); |
| dst = i286_memoryread_w(CALC_EA(op)); | dst = i286_memoryread_w(CALC_EA(op)); |
| SUBWORD(res, dst, src); | SUBWORD(res, dst, src); |
| } | } |
| Line 986 I286FN _cmp_ea_r16(void) { // 39: c | Line 989 I286FN _cmp_ea_r16(void) { // 39: c |
| I286FN _cmp_r8_ea(void) { // 3a: cmp REG8, EA | I286FN _cmp_r8_ea(void) { // 3a: cmp REG8, EA |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT dst; | UINT dst; |
| Line 1223 I286FN _arpl(void) { // 63: arpl | Line 1226 I286FN _arpl(void) { // 63: arpl |
| GET_PCBYTE(op) | GET_PCBYTE(op) |
| tmp = ((op < 0xc0)?1:0); | tmp = ((op < 0xc0)?1:0); |
| I286_IP += (BYTE)tmp; | I286_IP += (UINT8)tmp; |
| I286_WORKCLOCK(tmp + 10); | I286_WORKCLOCK(tmp + 10); |
| INT_NUM(6, I286_IP); | INT_NUM(6, I286_IP); |
| } | } |
| Line 1299 I286FN _outsb(void) { // 6E: outsb | Line 1302 I286FN _outsb(void) { // 6E: outsb |
| I286_WORKCLOCK(3); | I286_WORKCLOCK(3); |
| dat = i286_memoryread(I286_SI + DS_FIX); | dat = i286_memoryread(I286_SI + DS_FIX); |
| I286_SI += STRING_DIR; | I286_SI += STRING_DIR; |
| iocore_out8(I286_DX, (BYTE)dat); | iocore_out8(I286_DX, (UINT8)dat); |
| } | } |
| I286FN _outsw(void) { // 6F: outsw | I286FN _outsw(void) { // 6F: outsw |
| Line 1314 I286FN _outsw(void) { // 6F: outsw | Line 1317 I286FN _outsw(void) { // 6F: outsw |
| I286FN _jo_short(void) { // 70: jo short | I286FN _jo_short(void) { // 70: jo short |
| if (!I286_OV) JMPNOP(2) else JMPSHORT(7) | if (!I286_OV) JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _jno_short(void) { // 71: jno short | I286FN _jno_short(void) { // 71: jno short |
| if (I286_OV) JMPNOP(2) else JMPSHORT(7) | if (I286_OV) JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _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) | if (!(I286_FLAGL & C_FLAG)) JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _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) | if (I286_FLAGL & C_FLAG) JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _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) | if (!(I286_FLAGL & Z_FLAG)) JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _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) | if (I286_FLAGL & Z_FLAG) JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _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) | if (!(I286_FLAGL & (Z_FLAG | C_FLAG))) JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _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) | if (I286_FLAGL & (Z_FLAG | C_FLAG)) JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _js_short(void) { // 78: js short | I286FN _js_short(void) { // 78: js short |
| if (!(I286_FLAGL & S_FLAG)) JMPNOP(2) else JMPSHORT(7) | if (!(I286_FLAGL & S_FLAG)) JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _jns_short(void) { // 79: jns short | I286FN _jns_short(void) { // 79: jns short |
| if (I286_FLAGL & S_FLAG) JMPNOP(2) else JMPSHORT(7) | if (I286_FLAGL & S_FLAG) JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _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) | if (!(I286_FLAGL & P_FLAG)) JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _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) | if (I286_FLAGL & P_FLAG) JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _jl_short(void) { // 7C: jl/jnge short | I286FN _jl_short(void) { // 7C: jl/jnge short |
| if (((I286_FLAGL & S_FLAG) == 0) == (I286_OV == 0)) | if (((I286_FLAGL & S_FLAG) == 0) == (I286_OV == 0)) |
| JMPNOP(2) else JMPSHORT(7) | JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _jnl_short(void) { // 7D: jnl/jge short | I286FN _jnl_short(void) { // 7D: jnl/jge short |
| if (((I286_FLAGL & S_FLAG) == 0) != (I286_OV == 0)) | if (((I286_FLAGL & S_FLAG) == 0) != (I286_OV == 0)) |
| JMPNOP(2) else JMPSHORT(7) | JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _jle_short(void) { // 7E: jle/jng short | I286FN _jle_short(void) { // 7E: jle/jng short |
| if ((!(I286_FLAGL & Z_FLAG)) && | if ((!(I286_FLAGL & Z_FLAG)) && |
| (((I286_FLAGL & S_FLAG) == 0) == (I286_OV == 0))) | (((I286_FLAGL & S_FLAG) == 0) == (I286_OV == 0))) |
| JMPNOP(2) else JMPSHORT(7) | JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _jnle_short(void) { // 7F: jg/jnle short | I286FN _jnle_short(void) { // 7F: jg/jnle short |
| if ((I286_FLAGL & Z_FLAG) || | if ((I286_FLAGL & Z_FLAG) || |
| (((I286_FLAGL & S_FLAG) == 0) != (I286_OV == 0))) | (((I286_FLAGL & S_FLAG) == 0) != (I286_OV == 0))) |
| JMPNOP(2) else JMPSHORT(7) | JMPNOP(3) else JMPSHORT(7) |
| } | } |
| I286FN _calc_ea8_i8(void) { // 80: op EA8, DATA8 | I286FN _calc_ea8_i8(void) { // 80: op EA8, DATA8 |
| // 82: op EA8, DATA8 | // 82: op EA8, DATA8 |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT32 madr; | UINT32 madr; |
| Line 1474 I286FN _calc_ea16_i8(void) { // 83: o | Line 1477 I286FN _calc_ea16_i8(void) { // 83: o |
| I286FN _test_ea_r8(void) { // 84: test EA, REG8 | I286FN _test_ea_r8(void) { // 84: test EA, REG8 |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT src; | UINT src; |
| UINT tmp; | UINT tmp; |
| Line 1513 I286FN _test_ea_r16(void) { // 85: t | Line 1516 I286FN _test_ea_r16(void) { // 85: t |
| out = REG16_B20(op); | out = REG16_B20(op); |
| } | } |
| else { | else { |
| I286_WORKCLOCK(7); | I286_WORKCLOCK(6); |
| madr = CALC_EA(op); | madr = CALC_EA(op); |
| if (INHIBIT_WORDP(madr)) { | if (INHIBIT_WORDP(madr)) { |
| tmp = i286_memoryread_w(madr); | tmp = i286_memoryread_w(madr); |
| Line 1528 I286FN _test_ea_r16(void) { // 85: t | Line 1531 I286FN _test_ea_r16(void) { // 85: t |
| I286FN _xchg_ea_r8(void) { // 86: xchg EA, REG8 | I286FN _xchg_ea_r8(void) { // 86: xchg EA, REG8 |
| BYTE *out; | UINT8 *out; |
| BYTE *src; | UINT8 *src; |
| UINT op; | UINT op; |
| UINT32 madr; | UINT32 madr; |
| Line 1542 I286FN _xchg_ea_r8(void) { // 86: xc | Line 1545 I286FN _xchg_ea_r8(void) { // 86: xc |
| I286_WORKCLOCK(5); | I286_WORKCLOCK(5); |
| madr = CALC_EA(op); | madr = CALC_EA(op); |
| if (madr >= I286_MEMWRITEMAX) { | if (madr >= I286_MEMWRITEMAX) { |
| BYTE tmp = i286_memoryread(madr); | UINT8 tmp = i286_memoryread(madr); |
| i286_memorywrite(madr, *src); | i286_memorywrite(madr, *src); |
| *src = tmp; | *src = tmp; |
| return; | return; |
| Line 1580 I286FN _xchg_ea_r16(void) { // 87: x | Line 1583 I286FN _xchg_ea_r16(void) { // 87: x |
| I286FN _mov_ea_r8(void) { // 88: mov EA, REG8 | I286FN _mov_ea_r8(void) { // 88: mov EA, REG8 |
| BYTE src; | UINT8 src; |
| UINT op; | UINT op; |
| UINT32 madr; | UINT32 madr; |
| Line 1614 I286FN _mov_ea_r16(void) { // 89: mo | Line 1617 I286FN _mov_ea_r16(void) { // 89: mo |
| I286FN _mov_r8_ea(void) { // 8A: mov REG8, EA | I286FN _mov_r8_ea(void) { // 8A: mov REG8, EA |
| BYTE *out; | UINT8 *out; |
| BYTE src; | UINT8 src; |
| UINT op; | UINT op; |
| PREPART_REG8_EA(op, src, out, 2, 5); | PREPART_REG8_EA(op, src, out, 2, 5); |
| Line 1887 I286FN _mov_m16_ax(void) { // A3: mo | Line 1890 I286FN _mov_m16_ax(void) { // A3: mo |
| I286FN _movsb(void) { // A4: movsb | I286FN _movsb(void) { // A4: movsb |
| BYTE tmp; | UINT8 tmp; |
| I286_WORKCLOCK(5); | I286_WORKCLOCK(5); |
| tmp = i286_memoryread(I286_SI + DS_FIX); | tmp = i286_memoryread(I286_SI + DS_FIX); |
| Line 2030 I286FN _mov_di_imm(void) MOVIMM16(I286_D | Line 2033 I286FN _mov_di_imm(void) MOVIMM16(I286_D |
| I286FN _shift_ea8_data8(void) { // C0: shift EA8, DATA8 | I286FN _shift_ea8_data8(void) { // C0: shift EA8, DATA8 |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT32 madr; | UINT32 madr; |
| BYTE cl; | UINT8 cl; |
| GET_PCBYTE(op) | GET_PCBYTE(op) |
| if (op >= 0xc0) { | if (op >= 0xc0) { |
| Line 2061 I286FN _shift_ea16_data8(void) { // C1 | Line 2064 I286FN _shift_ea16_data8(void) { // C1 |
| UINT16 *out; | UINT16 *out; |
| UINT op; | UINT op; |
| UINT32 madr; | UINT32 madr; |
| BYTE cl; | UINT8 cl; |
| GET_PCBYTE(op) | GET_PCBYTE(op) |
| if (op >= 0xc0) { | if (op >= 0xc0) { |
| Line 2150 I286FN _mov_ea8_data8(void) { // C6: | Line 2153 I286FN _mov_ea8_data8(void) { // C6: |
| } | } |
| else { // 03/11/23 | else { // 03/11/23 |
| UINT32 ad; | UINT32 ad; |
| BYTE val; | UINT8 val; |
| I286_WORKCLOCK(3); | I286_WORKCLOCK(3); |
| ad = CALC_EA(op); | ad = CALC_EA(op); |
| GET_PCBYTE(val) | GET_PCBYTE(val) |
| Line 2180 I286FN _mov_ea16_data16(void) { // C7 | Line 2183 I286FN _mov_ea16_data16(void) { // C7 |
| I286FN _enter(void) { // C8: enter DATA16, DATA8 | I286FN _enter(void) { // C8: enter DATA16, DATA8 |
| UINT16 dimsize; | UINT16 dimsize; |
| BYTE level; | UINT8 level; |
| GET_PCWORD(dimsize) | GET_PCWORD(dimsize) |
| GET_PCBYTE(level) | GET_PCBYTE(level) |
| Line 2203 I286FN _enter(void) { // C8: enter | Line 2206 I286FN _enter(void) { // C8: enter |
| } | } |
| else { // enter level=2-31 | else { // enter level=2-31 |
| UINT16 bp; | UINT16 bp; |
| I286_WORKCLOCK(12 + level*4); | I286_WORKCLOCK(12 + 4 + level*4); |
| bp = I286_BP; | bp = I286_BP; |
| I286_BP = I286_SP; | I286_BP = I286_SP; |
| while(level--) { | while(level--) { |
| Line 2265 I286FN _int_data8(void) { // CD: int | Line 2268 I286FN _int_data8(void) { // CD: int |
| I286_WORKCLOCK(3); | I286_WORKCLOCK(3); |
| GET_PCBYTE(vect) | GET_PCBYTE(vect) |
| #if 0 // defined(TRACE) | #if defined(ENABLE_TRAP) |
| if ((vect >= 0xa0) && (vect < 0xb0)) { | softinttrap(CPU_CS, CPU_IP - 2, vect); |
| extern void lio_look(UINT vect); | |
| lio_look(vect); | |
| } | |
| #endif | #endif |
| INT_NUM(vect, I286_IP); | INT_NUM(vect, I286_IP); |
| } | } |
| Line 2306 I286FN _iret(void) { // CF: iret | Line 2306 I286FN _iret(void) { // CF: iret |
| I286FN _shift_ea8_1(void) { // D0: shift EA8, 1 | I286FN _shift_ea8_1(void) { // D0: shift EA8, 1 |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT32 madr; | UINT32 madr; |
| Line 2352 I286FN _shift_ea16_1(void) { // D1: sh | Line 2352 I286FN _shift_ea16_1(void) { // D1: sh |
| I286FN _shift_ea8_cl(void) { // D2: shift EA8, cl | I286FN _shift_ea8_cl(void) { // D2: shift EA8, cl |
| BYTE *out; | UINT8 *out; |
| UINT op; | UINT op; |
| UINT32 madr; | UINT32 madr; |
| REG8 cl; | REG8 cl; |
| Line 2408 I286FN _shift_ea16_cl(void) { // D3: s | Line 2408 I286FN _shift_ea16_cl(void) { // D3: s |
| I286FN _aam(void) { // D4: AAM | I286FN _aam(void) { // D4: AAM |
| BYTE al; | UINT8 al; |
| BYTE div; | UINT8 div; |
| I286_WORKCLOCK(16); | I286_WORKCLOCK(16); |
| GET_PCBYTE(div); | GET_PCBYTE(div); |
| Line 2428 I286FN _aam(void) { // D4: AAM | Line 2428 I286FN _aam(void) { // D4: AAM |
| I286FN _aad(void) { // D5: AAD | I286FN _aad(void) { // D5: AAD |
| BYTE mul; | UINT8 mul; |
| I286_WORKCLOCK(14); | I286_WORKCLOCK(14); |
| GET_PCBYTE(mul); | GET_PCBYTE(mul); |
| I286_AL += (BYTE)(I286_AH * mul); | I286_AL += (UINT8)(I286_AH * mul); |
| I286_AH = 0; | I286_AH = 0; |
| I286_FLAGL &= ~(S_FLAG | Z_FLAG | P_FLAG); | I286_FLAGL &= ~(S_FLAG | Z_FLAG | P_FLAG); |
| I286_FLAGL |= BYTESZPF(I286_AL); | I286_FLAGL |= BYTESZPF(I286_AL); |
| Line 3181 const I286OP i286op_repe[] = { | Line 3181 const I286OP i286op_repe[] = { |
| i286c_rep_insb, // 6C: rep insb | i286c_rep_insb, // 6C: rep insb |
| i286c_rep_insw, // 6D: rep insw | i286c_rep_insw, // 6D: rep insw |
| i286c_rep_outsb, // 6E: rep outsb | i286c_rep_outsb, // 6E: rep outsb |
| i286c_rep_outsb, // 6F: rep outsw | i286c_rep_outsw, // 6F: rep outsw |
| _jo_short, // 70: jo short | _jo_short, // 70: jo short |
| _jno_short, // 71: jno short | _jno_short, // 71: jno short |
| Line 3526 const I286OP i286op_repne[] = { | Line 3526 const I286OP i286op_repne[] = { |
| i286c_rep_insb, // 6C: rep insb | i286c_rep_insb, // 6C: rep insb |
| i286c_rep_insw, // 6D: rep insw | i286c_rep_insw, // 6D: rep insw |
| i286c_rep_outsb, // 6E: rep outsb | i286c_rep_outsb, // 6E: rep outsb |
| i286c_rep_outsb, // 6F: rep outsw | i286c_rep_outsw, // 6F: rep outsw |
| _jo_short, // 70: jo short | _jo_short, // 70: jo short |
| _jno_short, // 71: jno short | _jno_short, // 71: jno short |