Diff for /np2/i286c/i286c_f6.c between versions 1.3 and 1.7

version 1.3, 2003/10/17 11:10:02 version 1.7, 2003/11/24 09:14:01
Line 1 Line 1
 #include        "compiler.h"  #include        "compiler.h"
 #include        "i286.h"  #include        "i286.h"
 #include        "i286c.h"  #include        "i286c.h"
 #include        "i286c.mcr"  
 #include        "memory.h"  #include        "memory.h"
 #include        "nevent.h"  #include        "i286c.mcr"
   
   
 // ------------------------------------------------------------ opecode 0xf6,7  // ------------------------------------------------------------ opecode 0xf6,7
Line 14  I286_F6 _test_ea8_data8(UINT op) { Line 13  I286_F6 _test_ea8_data8(UINT op) {
         UINT    dst;          UINT    dst;
   
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(2);                  I286_WORKCLOCK(2);
                 dst = *(reg8_b20[op]);                  dst = *(REG8_B20(op));
         }          }
         else {          else {
                 I286_CLOCK(6);                  I286_WORKCLOCK(6);
                 dst = i286_memoryread(c_calc_ea_dst[op]());                  dst = i286_memoryread(CALC_EA(op));
         }          }
         GET_PCBYTE(src)          GET_PCBYTE(src)
         ANDBYTE(dst, src)          ANDBYTE(dst, src)
Line 30  I286_F6 _not_ea8(UINT op) { Line 29  I286_F6 _not_ea8(UINT op) {
         UINT32  madr;          UINT32  madr;
   
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(2);                  I286_WORKCLOCK(2);
                 *(reg8_b20[op]) ^= 0xff;                  *(REG8_B20(op)) ^= 0xff;
         }          }
         else {          else {
                 I286_CLOCK(7);                  I286_WORKCLOCK(7);
                 madr = c_calc_ea_dst[op]();                  madr = CALC_EA(op);
                 if (madr >= I286_MEMWRITEMAX) {                  if (madr >= I286_MEMWRITEMAX) {
                         BYTE value = i286_memoryread(madr);                          BYTE value = i286_memoryread(madr);
                         value = ~value;                          value = ~value;
Line 54  I286_F6 _neg_ea8(UINT op) { Line 53  I286_F6 _neg_ea8(UINT op) {
         UINT32  madr;          UINT32  madr;
   
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(2);                  I286_WORKCLOCK(2);
                 out = reg8_b20[op];                  out = REG8_B20(op);
         }          }
         else {          else {
                 I286_CLOCK(7);                  I286_WORKCLOCK(7);
                 madr = c_calc_ea_dst[op]();                  madr = CALC_EA(op);
                 if (madr >= I286_MEMWRITEMAX) {                  if (madr >= I286_MEMWRITEMAX) {
                         src = i286_memoryread(madr);                          src = i286_memoryread(madr);
                         BYTE_NEG(dst, src)                          BYTE_NEG(dst, src)
Line 79  I286_F6 _mul_ea8(UINT op) { Line 78  I286_F6 _mul_ea8(UINT op) {
         UINT    res;          UINT    res;
   
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(13);                  I286_WORKCLOCK(13);
                 src = *(reg8_b20[op]);                  src = *(REG8_B20(op));
         }          }
         else {          else {
                 I286_CLOCK(16);                  I286_WORKCLOCK(16);
                 src = i286_memoryread(c_calc_ea_dst[op]());                  src = i286_memoryread(CALC_EA(op));
         }          }
         BYTE_MUL(res, I286_AL, src)          BYTE_MUL(res, I286_AL, src)
         I286_AX = (UINT16)res;          I286_AX = (UINT16)res;
Line 96  I286_F6 _imul_ea8(UINT op) { Line 95  I286_F6 _imul_ea8(UINT op) {
         SINT32  res;          SINT32  res;
   
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(13);                  I286_WORKCLOCK(13);
                 src = *(reg8_b20[op]);                  src = *(REG8_B20(op));
         }          }
         else {          else {
                 I286_CLOCK(16);                  I286_WORKCLOCK(16);
                 src = i286_memoryread(c_calc_ea_dst[op]());                  src = i286_memoryread(CALC_EA(op));
         }          }
         BYTE_IMUL(res, I286_AL, src)          BYTE_IMUL(res, I286_AL, src)
         I286_AX = (UINT16)res;          I286_AX = (UINT16)res;
Line 115  I286_F6 _div_ea8(UINT op) { Line 114  I286_F6 _div_ea8(UINT op) {
   
         ip = I286_IP;          ip = I286_IP;
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(2);                  I286_WORKCLOCK(2);
                 src = *(reg8_b20[op]);                  src = *(REG8_B20(op));
         }          }
         else {          else {
                 I286_CLOCK(7);                  I286_WORKCLOCK(7);
                 src = i286_memoryread(c_calc_ea_dst[op]());                  src = i286_memoryread(CALC_EA(op));
         }          }
         tmp = I286_AX;          tmp = I286_AX;
         if (tmp < ((UINT16)src << 8)) {          if (tmp < ((UINT16)src << 8)) {
Line 140  I286_F6 _idiv_ea8(UINT op) { Line 139  I286_F6 _idiv_ea8(UINT op) {
   
         ip = I286_IP;          ip = I286_IP;
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(17);                  I286_WORKCLOCK(17);
                 src = *(reg8_b20[op]);                  src = *(REG8_B20(op));
         }          }
         else {          else {
                 I286_CLOCK(25);                  I286_WORKCLOCK(25);
                 src = i286_memoryread(c_calc_ea_dst[op]());                  src = i286_memoryread(CALC_EA(op));
         }          }
         tmp = (SINT16)I286_AX;          tmp = (SINT16)I286_AX;
         if (src) {          if (src) {
Line 166  I286_F6 _test_ea16_data16(UINT op) { Line 165  I286_F6 _test_ea16_data16(UINT op) {
         UINT32  dst;          UINT32  dst;
   
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(2);                  I286_WORKCLOCK(2);
                 dst = *(reg16_b20[op]);                  dst = *(REG16_B20(op));
         }          }
         else {          else {
                 I286_CLOCK(6);                  I286_WORKCLOCK(6);
                 dst = i286_memoryread_w(c_calc_ea_dst[op]());                  dst = i286_memoryread_w(CALC_EA(op));
         }          }
         GET_PCWORD(src)          GET_PCWORD(src)
         ANDWORD(dst, src)          ANDWORD(dst, src)
Line 182  I286_F6 _not_ea16(UINT op) { Line 181  I286_F6 _not_ea16(UINT op) {
         UINT32  madr;          UINT32  madr;
   
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(2);                  I286_WORKCLOCK(2);
                 *(reg16_b20[op]) ^= 0xffff;                  *(REG16_B20(op)) ^= 0xffff;
         }          }
         else {          else {
                 I286_CLOCK(7);                  I286_WORKCLOCK(7);
                 madr = c_calc_ea_dst[op]();                  madr = CALC_EA(op);
                 if (!(INHIBIT_WORDP(madr))) {                  if (!(INHIBIT_WORDP(madr))) {
                         *(mem + madr) ^= 0xffff;                          *(mem + madr) ^= 0xffff;
                 }                  }
Line 207  I286_F6 _neg_ea16(UINT op) { Line 206  I286_F6 _neg_ea16(UINT op) {
         UINT32  madr;          UINT32  madr;
   
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(2);                  I286_WORKCLOCK(2);
                 out = reg16_b20[op];                  out = REG16_B20(op);
         }          }
         else {          else {
                 I286_CLOCK(7);                  I286_WORKCLOCK(7);
                 madr = c_calc_ea_dst[op]();                  madr = CALC_EA(op);
                 if (INHIBIT_WORDP(madr)) {                  if (INHIBIT_WORDP(madr)) {
                         src = i286_memoryread_w(madr);                          src = i286_memoryread_w(madr);
                         WORD_NEG(dst, src)                          WORD_NEG(dst, src)
Line 232  I286_F6 _mul_ea16(UINT op) { Line 231  I286_F6 _mul_ea16(UINT op) {
         UINT32  res;          UINT32  res;
   
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(21);                  I286_WORKCLOCK(21);
                 src = *(reg16_b20[op]);                  src = *(REG16_B20(op));
         }          }
         else {          else {
                 I286_CLOCK(24);                  I286_WORKCLOCK(24);
                 src = i286_memoryread_w(c_calc_ea_dst[op]());                  src = i286_memoryread_w(CALC_EA(op));
         }          }
         WORD_MUL(res, I286_AX, src)          WORD_MUL(res, I286_AX, src)
         I286_AX = (UINT16)res;          I286_AX = (UINT16)res;
Line 250  I286_F6 _imul_ea16(UINT op) { Line 249  I286_F6 _imul_ea16(UINT op) {
         SINT32  res;          SINT32  res;
   
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(21);                  I286_WORKCLOCK(21);
                 src = *(reg16_b20[op]);                  src = *(REG16_B20(op));
         }          }
         else {          else {
                 I286_CLOCK(24);                  I286_WORKCLOCK(24);
                 src = i286_memoryread_w(c_calc_ea_dst[op]());                  src = i286_memoryread_w(CALC_EA(op));
         }          }
         WORD_IMUL(res, I286_AX, src)          WORD_IMUL(res, I286_AX, src)
         I286_AX = (UINT16)res;          I286_AX = (UINT16)res;
Line 270  I286_F6 _div_ea16(UINT op) { Line 269  I286_F6 _div_ea16(UINT op) {
   
         ip = I286_IP;          ip = I286_IP;
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(17);                  I286_WORKCLOCK(17);
                 src = *(reg16_b20[op]);                  src = *(REG16_B20(op));
         }          }
         else {          else {
                 I286_CLOCK(25);                  I286_WORKCLOCK(25);
                 src = i286_memoryread_w(c_calc_ea_dst[op]());                  src = i286_memoryread_w(CALC_EA(op));
         }          }
         tmp = (I286_DX << 16) + I286_AX;          tmp = (I286_DX << 16) + I286_AX;
         if (tmp < (src << 16)) {          if (tmp < (src << 16)) {
Line 296  I286_F6 _idiv_ea16(UINT op) { Line 295  I286_F6 _idiv_ea16(UINT op) {
   
         ip = I286_IP;          ip = I286_IP;
         if (op >= 0xc0) {          if (op >= 0xc0) {
                 I286_CLOCK(17);                  I286_WORKCLOCK(17);
                 src = *(reg16_b20[op]);                  src = *(REG16_B20(op));
         }          }
         else {          else {
                 I286_CLOCK(25);                  I286_WORKCLOCK(25);
                 src = i286_memoryread_w(c_calc_ea_dst[op]());                  src = i286_memoryread_w(CALC_EA(op));
         }          }
         tmp = (SINT32)((I286_DX << 16) + I286_AX);          tmp = (SINT32)((I286_DX << 16) + I286_AX);
         if (src) {          if (src) {

Removed from v.1.3  
changed lines
  Added in v.1.7


RetroPC.NET-CVS <cvs@retropc.net>