This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Disassemble CASEx assembler instructions
- From: Jan-Benedict Glaw <jbglaw at microdata-pos dot de>
- To: binutils at sources dot redhat dot com
- Date: Mon, 28 Mar 2005 12:36:13 +0200
- Subject: Disassemble CASEx assembler instructions
Hi!
IIRC, the HP PA-RISC architecture also has a "case" instruction,
like VAX has one, too. How could this be menaingful disassembled?
Well, the PA-RISC backend seems to not recognize it (of I haven't
really found the code...), but the VAX backend does -- quite
suboptimal. Behing the initial CASEx instruction, there are a number
of displacements (which were currently disassembled as instructions).
As it seems, not a lot of ISAs actually know this type of instruction,
so there's no generic code to handle the displacement table. These
ideas come to mind:
- Let the backend recognize that this is a CASEx opcode and
return (as number of bytes disassembled) the CASEx opcode
plus the size of the whole displacement table. This would
basically dump the whole table in hex and disassembly would
be correct after the table.
- Implement higher-level knowledge of what's about to be
disassembled. Then the backend could signal that there's
a table of /n/ displacements of type /t/, which the backend
in turn could disassemble displacement-for-displacement.
The easy method of at least getting the disassembly of the remainder
of the function correct would be at least to implement the first
solution, which is additionally quite easy to implement.
Comments?
MfG, JBG
--
AWEK microdata GmbH -- Am Wellbach 4 -- 33609 Bielefeld