Disassemble CASEx assembler instructions

Hans-Peter Nilsson hp@bitrange.com
Tue Mar 29 15:44:00 GMT 2005


On Mon, 28 Mar 2005, Jan-Benedict Glaw wrote:
> 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.

See also opcodes/cris-dis.c.  Though that case-handling is quite
buggy, I'm afraid.

> 	- 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.

Doesn't this automatically happen if you add the size of
the table when you disassemble the CASEx insn?

> 	- 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.

If this is done, it needs to handle different equations for the
contents of the table: size of each item, counting from the
start of the table or the offset, whether relative or absolute.
Perhaps best handled by the target passing a function pointer.

brgds, H-P



More information about the Binutils mailing list