how to calculate opcode mask
Shinpei Kato
shinny@j02.itscom.net
Tue Feb 10 12:16:00 GMT 2004
Hi, there.
I'm porting GAS to the new CPU that is similar to MIPS.
So I'm refering to binutils-2.14/opcodes/mips-opc.c to add several new
instructions.
However I have one thing I can't understand.
That is how I can caluculate a mask member of the type "mips_opcode".
For instance, please see followings.
const struct mips_opcode mips_builtin_opcodes[] =
{
:
:
{"add", "d,v,t", 0x00000020, 0xfc0007ff, WR_d|RD_s|RD_t, I1},
:
:
}
This is the mips_builtin_opcodes definition in mips-opc.c.
0x0000000020 is a match member.
0x7c0007ff is a mask member.
I can understand a match member because it's just opcode but not a mask
member.
0xfc007ff means "d,v,t", doesn't it? But how can we calculate 0xfc0007ff
from "d,v,t"?
I hope your help.
Regards,
Shinpei Kato
More information about the Binutils
mailing list