--- np2/i386c/ia32/groups.c 2003/12/11 15:06:50 1.2 +++ np2/i386c/ia32/groups.c 2011/01/15 17:17:23 1.8 @@ -1,5 +1,3 @@ -/* $Id: groups.c,v 1.2 2003/12/11 15:06:50 monaka Exp $ */ - /* * Copyright (c) 2002-2003 NONAKA Kimihiro * All rights reserved. @@ -12,8 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -38,14 +34,15 @@ void Grp1_EbIb(void) { - BYTE *out; - DWORD op, madr, src; + UINT8 *out; + UINT32 madr; + UINT32 op, src; int idx; GET_PCBYTE(op); idx = (op >> 3) & 7; if (op >= 0xc0) { - CPU_WORKCLOCK(3); + CPU_WORKCLOCK(2); out = reg8_b20[op]; GET_PCBYTE(src); (*insttable_G1EbIb[idx])(out, src); @@ -60,14 +57,15 @@ Grp1_EbIb(void) void Grp1_EwIb(void) { - WORD *out; - DWORD op, madr, src; + UINT16 *out; + UINT32 madr, src; + UINT32 op; int idx; GET_PCBYTE(op); idx = (op >> 3) & 7; if (op >= 0xc0) { - CPU_WORKCLOCK(3); + CPU_WORKCLOCK(2); out = reg16_b20[op]; GET_PCBYTES(src); (*insttable_G1EwIx[idx])(out, src); @@ -82,14 +80,15 @@ Grp1_EwIb(void) void Grp1_EdIb(void) { - DWORD *out; - DWORD op, madr, src; + UINT32 *out; + UINT32 madr, src; + UINT32 op; int idx; GET_PCBYTE(op); idx = (op >> 3) & 7; if (op >= 0xc0) { - CPU_WORKCLOCK(3); + CPU_WORKCLOCK(2); out = reg32_b20[op]; GET_PCBYTESD(src); (*insttable_G1EdIx[idx])(out, src); @@ -104,14 +103,15 @@ Grp1_EdIb(void) void Grp1_EwIw(void) { - WORD *out; - DWORD op, madr, src; + UINT16 *out; + UINT32 madr, src; + UINT32 op; int idx; GET_PCBYTE(op); idx = (op >> 3) & 7; if (op >= 0xc0) { - CPU_WORKCLOCK(3); + CPU_WORKCLOCK(2); out = reg16_b20[op]; GET_PCWORD(src); (*insttable_G1EwIx[idx])(out, src); @@ -126,14 +126,15 @@ Grp1_EwIw(void) void Grp1_EdId(void) { - DWORD *out; - DWORD op, madr, src; + UINT32 *out; + UINT32 madr, src; + UINT32 op; int idx; GET_PCBYTE(op); idx = (op >> 3) & 7; if (op >= 0xc0) { - CPU_WORKCLOCK(3); + CPU_WORKCLOCK(2); out = reg32_b20[op]; GET_PCDWORD(src); (*insttable_G1EdIx[idx])(out, src); @@ -150,10 +151,11 @@ Grp1_EdId(void) void Grp2_EbIb(void) { - BYTE *out; - DWORD op, madr; + UINT8 *out; + UINT32 madr; + UINT32 op; + UINT32 cl; int idx; - BYTE cl; GET_PCBYTE(op); idx = (op >> 3) & 7; @@ -175,10 +177,11 @@ Grp2_EbIb(void) void Grp2_EwIb(void) { - WORD *out; - DWORD op, madr; + UINT16 *out; + UINT32 madr; + UINT32 op; + UINT32 cl; int idx; - BYTE cl; GET_PCBYTE(op); idx = (op >> 3) & 7; @@ -200,10 +203,11 @@ Grp2_EwIb(void) void Grp2_EdIb(void) { - DWORD *out; - DWORD op, madr; + UINT32 *out; + UINT32 madr; + UINT32 op; + UINT32 cl; int idx; - BYTE cl; GET_PCBYTE(op); idx = (op >> 3) & 7; @@ -225,7 +229,7 @@ Grp2_EdIb(void) void Grp2_Eb(void) { - DWORD op; + UINT32 op; int idx; GET_PCBYTE(op); @@ -242,7 +246,7 @@ Grp2_Eb(void) void Grp2_Ew(void) { - DWORD op; + UINT32 op; int idx; GET_PCBYTE(op); @@ -259,7 +263,7 @@ Grp2_Ew(void) void Grp2_Ed(void) { - DWORD op; + UINT32 op; int idx; GET_PCBYTE(op); @@ -276,10 +280,11 @@ Grp2_Ed(void) void Grp2_EbCL(void) { - BYTE *out; - DWORD op, madr; + UINT8 *out; + UINT32 madr; + UINT32 op; + UINT32 cl; int idx; - BYTE cl; GET_PCBYTE(op); idx = (op >> 3) & 7; @@ -287,13 +292,15 @@ Grp2_EbCL(void) CPU_WORKCLOCK(5); out = reg8_b20[op]; cl = CPU_CL; - CPU_WORKCLOCK(cl & 0x1f); + cl &= 0x1f; + CPU_WORKCLOCK(cl); (*insttable_G2EbCL[idx])(out, cl); } else { CPU_WORKCLOCK(8); madr = calc_ea_dst(op); cl = CPU_CL; - CPU_WORKCLOCK(cl & 0x1f); + cl &= 0x1f; + CPU_WORKCLOCK(cl); (*insttable_G2EbCL_ext[idx])(madr, cl); } } @@ -301,10 +308,11 @@ Grp2_EbCL(void) void Grp2_EwCL(void) { - WORD *out; - DWORD op, madr; + UINT16 *out; + UINT32 madr; + UINT32 op; + UINT32 cl; int idx; - BYTE cl; GET_PCBYTE(op); idx = (op >> 3) & 7; @@ -312,13 +320,15 @@ Grp2_EwCL(void) CPU_WORKCLOCK(5); out = reg16_b20[op]; cl = CPU_CL; - CPU_WORKCLOCK(cl & 0x1f); + cl &= 0x1f; + CPU_WORKCLOCK(cl); (*insttable_G2EwCL[idx])(out, cl); } else { CPU_WORKCLOCK(8); madr = calc_ea_dst(op); cl = CPU_CL; - CPU_WORKCLOCK(cl & 0x1f); + cl &= 0x1f; + CPU_WORKCLOCK(cl); (*insttable_G2EwCL_ext[idx])(madr, cl); } } @@ -326,10 +336,11 @@ Grp2_EwCL(void) void Grp2_EdCL(void) { - DWORD *out; - DWORD op, madr; + UINT32 *out; + UINT32 madr; + UINT32 op; + UINT32 cl; int idx; - BYTE cl; GET_PCBYTE(op); idx = (op >> 3) & 7; @@ -337,13 +348,15 @@ Grp2_EdCL(void) CPU_WORKCLOCK(5); out = reg32_b20[op]; cl = CPU_CL; - CPU_WORKCLOCK(cl & 0x1f); + cl &= 0x1f; + CPU_WORKCLOCK(cl); (*insttable_G2EdCL[idx])(out, cl); } else { CPU_WORKCLOCK(8); madr = calc_ea_dst(op); cl = CPU_CL; - CPU_WORKCLOCK(cl & 0x1f); + cl &= 0x1f; + CPU_WORKCLOCK(cl); (*insttable_G2EdCL_ext[idx])(madr, cl); } } @@ -353,8 +366,7 @@ Grp2_EdCL(void) void Grp3_Eb(void) { - - DWORD op; + UINT32 op; GET_PCBYTE(op); (*insttable_G3Eb[(op >> 3) & 7])(op); @@ -363,8 +375,7 @@ Grp3_Eb(void) void Grp3_Ew(void) { - - DWORD op; + UINT32 op; GET_PCBYTE(op); (*insttable_G3Ew[(op >> 3) & 7])(op); @@ -373,8 +384,7 @@ Grp3_Ew(void) void Grp3_Ed(void) { - - DWORD op; + UINT32 op; GET_PCBYTE(op); (*insttable_G3Ed[(op >> 3) & 7])(op); @@ -385,7 +395,7 @@ Grp3_Ed(void) void Grp4(void) { - DWORD op; + UINT32 op; GET_PCBYTE(op); (*insttable_G4[(op >> 3) & 7])(op); @@ -396,7 +406,7 @@ Grp4(void) void Grp5_Ew(void) { - DWORD op; + UINT32 op; GET_PCBYTE(op); (*insttable_G5Ew[(op >> 3) & 7])(op); @@ -405,7 +415,7 @@ Grp5_Ew(void) void Grp5_Ed(void) { - DWORD op; + UINT32 op; GET_PCBYTE(op); (*insttable_G5Ed[(op >> 3) & 7])(op); @@ -414,41 +424,23 @@ Grp5_Ed(void) /* group 6 */ void -Grp6_16(void) -{ - DWORD op; - - GET_PCBYTE(op); - (*insttable_G6_16[(op >> 3) & 7])(op); -} - -void -Grp6_32(void) +Grp6(void) { - DWORD op; + UINT32 op; GET_PCBYTE(op); - (*insttable_G6_32[(op >> 3) & 7])(op); + (*insttable_G6[(op >> 3) & 7])(op); } /* group 7 */ void -Grp7_16(void) -{ - DWORD op; - - GET_PCBYTE(op); - (*insttable_G7_16[(op >> 3) & 7])(op); -} - -void -Grp7_32(void) +Grp7(void) { - DWORD op; + UINT32 op; GET_PCBYTE(op); - (*insttable_G7_32[(op >> 3) & 7])(op); + (*insttable_G7[(op >> 3) & 7])(op); } @@ -456,7 +448,7 @@ Grp7_32(void) void Grp8_EwIb(void) { - DWORD op; + UINT32 op; GET_PCBYTE(op); (*insttable_G8EwIb[(op >> 3) & 7])(op); @@ -465,7 +457,7 @@ Grp8_EwIb(void) void Grp8_EdIb(void) { - DWORD op; + UINT32 op; GET_PCBYTE(op); (*insttable_G8EdIb[(op >> 3) & 7])(op); @@ -476,7 +468,7 @@ Grp8_EdIb(void) void Grp9(void) { - DWORD op; + UINT32 op; GET_PCBYTE(op); (*insttable_G9[(op >> 3) & 7])(op);