how to calculate opcode mask

Eric Christopher echristo@redhat.com
Tue Feb 10 19:27:00 GMT 2004


> I can translate d,v,t into a mask by looking at the definitions in
> include/opcode/mips.h, and doing
>     ~ ((OP_MASK_RD << OP_SH_RD)
>        | (OP_MASK_RS << OP_SH_RS)
>        | (OP_MASK_RT << OP_SH_RT))
> As I said, though, that approach doesn't always work for all
> instructions.

Right. I do it a little easier (IMO :) and just look at the binary for
the instruction and group it together. This also helps when adding new
instructions since you double check that the ops that you have match the
spots in the opcode that you are trying to add.

*shrug*

-eric

-- 
Eric Christopher <echristo@redhat.com>



More information about the Binutils mailing list