Wed Feb 14 19:01:27 1996 Alan Modra <alan@spri.levels.unisa.edu.au>
* i386-dis.c (onebyte_has_modrm): New static array. (twobyte_has_modrm): New static array. (print_insn_i386): Only fetch the mod/reg/rm byte if it is needed.
This commit is contained in:
parent
95d31c3c8f
commit
03db5a9303
|
@ -1,3 +1,14 @@
|
||||||
|
Wed Feb 14 19:01:27 1996 Alan Modra <alan@spri.levels.unisa.edu.au>
|
||||||
|
|
||||||
|
* i386-dis.c (onebyte_has_modrm): New static array.
|
||||||
|
(twobyte_has_modrm): New static array.
|
||||||
|
(print_insn_i386): Only fetch the mod/reg/rm byte if it is needed.
|
||||||
|
|
||||||
|
Tue Feb 13 15:15:01 1996 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
|
* Makefile.in ($(SHLINK)): Check ts against $(SHLIB), not
|
||||||
|
$(SHLINK).
|
||||||
|
|
||||||
Mon Feb 12 16:26:06 1996 Michael Meissner <meissner@tiktok.cygnus.com>
|
Mon Feb 12 16:26:06 1996 Michael Meissner <meissner@tiktok.cygnus.com>
|
||||||
|
|
||||||
* ppc-opc.c (PPC): Undef, so default defination on Windows NT
|
* ppc-opc.c (PPC): Undef, so default defination on Windows NT
|
||||||
|
|
|
@ -348,23 +348,23 @@ struct dis386 dis386[] = {
|
||||||
{ "outsb", indirDX, Xb },
|
{ "outsb", indirDX, Xb },
|
||||||
{ "outsS", indirDX, Xv },
|
{ "outsS", indirDX, Xv },
|
||||||
/* 70 */
|
/* 70 */
|
||||||
{ "jo", Jb },
|
{ "jo", Jb },
|
||||||
{ "jno", Jb },
|
{ "jno", Jb },
|
||||||
{ "jb", Jb },
|
{ "jb", Jb },
|
||||||
{ "jae", Jb },
|
{ "jae", Jb },
|
||||||
{ "je", Jb },
|
{ "je", Jb },
|
||||||
{ "jne", Jb },
|
{ "jne", Jb },
|
||||||
{ "jbe", Jb },
|
{ "jbe", Jb },
|
||||||
{ "ja", Jb },
|
{ "ja", Jb },
|
||||||
/* 78 */
|
/* 78 */
|
||||||
{ "js", Jb },
|
{ "js", Jb },
|
||||||
{ "jns", Jb },
|
{ "jns", Jb },
|
||||||
{ "jp", Jb },
|
{ "jp", Jb },
|
||||||
{ "jnp", Jb },
|
{ "jnp", Jb },
|
||||||
{ "jl", Jb },
|
{ "jl", Jb },
|
||||||
{ "jnl", Jb },
|
{ "jnl", Jb },
|
||||||
{ "jle", Jb },
|
{ "jle", Jb },
|
||||||
{ "jg", Jb },
|
{ "jg", Jb },
|
||||||
/* 80 */
|
/* 80 */
|
||||||
{ GRP1b },
|
{ GRP1b },
|
||||||
{ GRP1S },
|
{ GRP1S },
|
||||||
|
@ -685,6 +685,44 @@ struct dis386 dis386_twobyte[] = {
|
||||||
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
|
{ "(bad)" }, { "(bad)" }, { "(bad)" }, { "(bad)" },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const unsigned char onebyte_has_modrm[256] = {
|
||||||
|
1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
|
||||||
|
1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
|
||||||
|
1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
|
||||||
|
1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,
|
||||||
|
1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1
|
||||||
|
};
|
||||||
|
|
||||||
|
static const unsigned char twobyte_has_modrm[256] = {
|
||||||
|
1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||||
|
0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1,
|
||||||
|
1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,
|
||||||
|
1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||||
|
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||||
|
};
|
||||||
|
|
||||||
static char obuf[100];
|
static char obuf[100];
|
||||||
static char *obufp;
|
static char *obufp;
|
||||||
static char scratchbuf[100];
|
static char scratchbuf[100];
|
||||||
|
@ -993,7 +1031,8 @@ print_insn_i386 (pc, info)
|
||||||
int enter_instruction;
|
int enter_instruction;
|
||||||
char *first, *second, *third;
|
char *first, *second, *third;
|
||||||
int needcomma;
|
int needcomma;
|
||||||
|
unsigned char need_modrm;
|
||||||
|
|
||||||
struct dis_private priv;
|
struct dis_private priv;
|
||||||
bfd_byte *inbuf = priv.the_buffer;
|
bfd_byte *inbuf = priv.the_buffer;
|
||||||
|
|
||||||
|
@ -1058,20 +1097,22 @@ print_insn_i386 (pc, info)
|
||||||
{
|
{
|
||||||
FETCH_DATA (info, codep + 2);
|
FETCH_DATA (info, codep + 2);
|
||||||
dp = &dis386_twobyte[*++codep];
|
dp = &dis386_twobyte[*++codep];
|
||||||
|
need_modrm = twobyte_has_modrm[*codep];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
dp = &dis386[*codep];
|
{
|
||||||
|
dp = &dis386[*codep];
|
||||||
|
need_modrm = onebyte_has_modrm[*codep];
|
||||||
|
}
|
||||||
codep++;
|
codep++;
|
||||||
|
|
||||||
/* Fetch the mod/reg/rm byte. FIXME: We should be only fetching
|
if (need_modrm)
|
||||||
this if we need it. As it is, this code loses if there is a
|
{
|
||||||
one-byte instruction (without a mod/reg/rm byte) at the end of
|
FETCH_DATA (info, codep + 1);
|
||||||
the address space. */
|
mod = (*codep >> 6) & 3;
|
||||||
|
reg = (*codep >> 3) & 7;
|
||||||
FETCH_DATA (info, codep + 1);
|
rm = *codep & 7;
|
||||||
mod = (*codep >> 6) & 3;
|
}
|
||||||
reg = (*codep >> 3) & 7;
|
|
||||||
rm = *codep & 7;
|
|
||||||
|
|
||||||
if (dp->name == NULL && dp->bytemode1 == FLOATCODE)
|
if (dp->name == NULL && dp->bytemode1 == FLOATCODE)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue