Diff for /np2/i286c/i286c_mn.c between versions 1.24 and 1.26

version 1.24, 2003/12/12 01:04:40 version 1.26, 2003/12/25 19:26:55
Line 22 Line 22
                         I286_REMCLOCK = (c);                                                            \                          I286_REMCLOCK = (c);                                                            \
                 }                  }
   
   // ---- select...
   
   static UINT32 segselect(UINT sel) {
   
           I286DTR *dtr;
           UINT32  addr;
           UINT32  ret;
   
           dtr = (sel & 4)?&I286_IDTR:&I286_GDTR;
           addr = (dtr->base24 << 16) + dtr->base + (sel & (~7));
           ret = i286_memoryread_w(addr+2);
           ret += i286_memoryread(addr+4) << 16;
           TRACEOUT(("PE - select %.4x %.8x", sel, ret));
           return(ret);
   }
   
   
 // ----  // ----
   
 I286FN _reserved(void) {  I286FN _reserved(void) {
   
         I286_WORKCLOCK(23);                                                     // ToDo  
         INT_NUM(6, I286_IP - 1);          INT_NUM(6, I286_IP - 1);
 }  }
   
Line 148  I286FN _push_es(void) {       // 06: pus Line 163  I286FN _push_es(void) {       // 06: pus
   
 I286FN _pop_es(void) {                                                  // 07: pop es  I286FN _pop_es(void) {                                                  // 07: pop es
   
         REGPOP(I286_ES, 5)          UINT    tmp;
         ES_BASE = (UINT32)I286_ES << 4;  
           REGPOP(tmp, 5)
           I286_ES = tmp;
           if (!(I286_MSW & 1)) {
                   ES_BASE = tmp << 4;
                   NEXT_OPCODE
           }
           else {
                   ES_BASE = segselect(tmp);
           }
 }  }
   
 I286FN _or_ea_r8(void) {                                                // 08: or EA, REG8  I286FN _or_ea_r8(void) {                                                // 08: or EA, REG8
Line 382  I286FN _push_ss(void) {       // 16: pus Line 406  I286FN _push_ss(void) {       // 16: pus
   
 I286FN _pop_ss(void) {                                                  // 17: pop ss  I286FN _pop_ss(void) {                                                  // 17: pop ss
   
         REGPOP(I286_SS, 5)          UINT    tmp;
         SS_BASE = I286_SS << 4;          UINT32  base;
         SS_FIX = SS_BASE;  
         NEXT_OPCODE          REGPOP(tmp, 5)
           I286_SS = tmp;
           if (!(I286_MSW & 1)) {
                   SS_BASE = tmp << 4;
                   SS_FIX = tmp << 4;
                   NEXT_OPCODE
           }
           else {
                   base = segselect(tmp);
                   SS_BASE = base;
                   SS_FIX = base;
                   NEXT_OPCODE
           }
 }  }
   
 I286FN _sbb_ea_r8(void) {                                               // 18: sbb EA, REG8  I286FN _sbb_ea_r8(void) {                                               // 18: sbb EA, REG8
Line 505  I286FN _push_ds(void) {       // 1e: pus Line 541  I286FN _push_ds(void) {       // 1e: pus
   
 I286FN _pop_ds(void) {                                                  // 1f: pop ds  I286FN _pop_ds(void) {                                                  // 1f: pop ds
   
         REGPOP(I286_DS, 5)          UINT    tmp;
         DS_BASE = I286_DS << 4;          UINT32  base;
         DS_FIX = DS_BASE;  
           REGPOP(tmp, 5)
           I286_DS = tmp;
           if (!(I286_MSW & 1)) {
                   DS_BASE = tmp << 4;
                   DS_FIX = tmp << 4;
                   NEXT_OPCODE
           }
           else {
                   base = segselect(tmp);
                   DS_BASE = base;
                   DS_FIX = base;
                   NEXT_OPCODE
           }
 }  }
   
 I286FN _and_ea_r8(void) {                                               // 20: and EA, REG8  I286FN _and_ea_r8(void) {                                               // 20: and EA, REG8
Line 1659  I286FN _mov_seg_ea(void) {     // 8E: mo Line 1708  I286FN _mov_seg_ea(void) {     // 8E: mo
   
         UINT    op;          UINT    op;
         UINT    tmp;          UINT    tmp;
           UINT32  base;
         UINT16  ipbak;          UINT16  ipbak;
   
         ipbak = I286_IP;          ipbak = I286_IP;
Line 1671  I286FN _mov_seg_ea(void) {     // 8E: mo Line 1721  I286FN _mov_seg_ea(void) {     // 8E: mo
                 I286_WORKCLOCK(5);                  I286_WORKCLOCK(5);
                 tmp = i286_memoryread_w(CALC_EA(op));                  tmp = i286_memoryread_w(CALC_EA(op));
         }          }
           if (!(I286_MSW & 1)) {
                   base = tmp << 4;
           }
           else {
                   base = segselect(tmp);
           }
   
         switch(op & 0x18) {          switch(op & 0x18) {
                 case 0x00:                      // es                  case 0x00:                      // es
                         I286_ES = (UINT16)tmp;                          I286_ES = (UINT16)tmp;
                         ES_BASE = tmp << 4;                          ES_BASE = base;
                         break;                          break;
   
                 case 0x10:                      // ss                  case 0x10:                      // ss
                         I286_SS = (UINT16)tmp;                          I286_SS = (UINT16)tmp;
                         SS_BASE = tmp << 4;                          SS_BASE = base;
                         SS_FIX = SS_BASE;                          SS_FIX = base;
                         NEXT_OPCODE                          NEXT_OPCODE
                         break;                          break;
   
                 case 0x18:                      // ds                  case 0x18:                      // ds
                         I286_DS = (UINT16)tmp;                          I286_DS = (UINT16)tmp;
                         DS_BASE = tmp << 4;                          DS_BASE = base;
                         DS_FIX = DS_BASE;                          DS_FIX = base;
                         break;                          break;
   
                 default:                        // cs                  default:                        // cs
Line 2245  I286FN _ret_far(void) {      // CB: ret  Line 2302  I286FN _ret_far(void) {      // CB: ret 
   
 I286FN _int_03(void) {                                          // CC:  int             3  I286FN _int_03(void) {                                          // CC:  int             3
   
         I286_WORKCLOCK(23);          I286_WORKCLOCK(3);
         INT_NUM(3, I286_IP);          INT_NUM(3, I286_IP);
 }  }
   
Line 2253  I286FN _int_data8(void) {     // CD: int Line 2310  I286FN _int_data8(void) {     // CD: int
   
         UINT    vect;          UINT    vect;
   
         I286_WORKCLOCK(23);          I286_WORKCLOCK(3);
         GET_PCBYTE(vect)          GET_PCBYTE(vect)
         INT_NUM(vect, I286_IP);          INT_NUM(vect, I286_IP);
 }  }
Line 2262  I286FN _into(void) {      // CE: into Line 2319  I286FN _into(void) {      // CE: into
   
         I286_WORKCLOCK(4);          I286_WORKCLOCK(4);
         if (I286_OV) {          if (I286_OV) {
                 I286_WORKCLOCK(24 - 4);  
                 INT_NUM(4, I286_IP);                  INT_NUM(4, I286_IP);
         }          }
 }  }

Removed from v.1.24  
changed lines
  Added in v.1.26


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