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

version 1.25, 2003/12/17 01:57:41 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);
   }
   
   
 // ----  // ----
   
Line 147  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 381  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 504  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 1658  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 1670  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

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


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