This is the mail archive of the
cgen@sources.redhat.com
mailing list for the CGEN project.
Re: Disassembly of instruction with 4 bit opcode
- From: Ben Elliston <bje at redhat dot com>
- To: "Michael Chapman" <Michael dot Chapman at synopsys dot com>
- Cc: <cgen at sources dot redhat dot com>
- Date: 04 Nov 2002 23:33:15 +1100
- Subject: Re: Disassembly of instruction with 4 bit opcode
- References: <NEBBIAJILEHBJOLKLAGOAECICJAA.michaelc@synopsys.com>
Hi Michael,
>>>>> "Michael" == Michael Chapman <Michael.Chapman@synopsys.com> writes:
Michael> The problem is with the "call" instructions which use only
Michael> 4 bits of the opcode using the remained for the address.
Michael> Everything is strictly little endian with the opcode always
Michael> appearing in the least significant 8 bits (or 4 bits in the
Michael> case of call) of the instruction. When I dissassemble the
Michael> following (listing output from the assembler)
[...]
Michael> 10: cc 00 *unknown*
Investigate using something like this in your <arch>.opc file:
/* Override disassembly hashing - there are variable bits in the top
byte of these instructions. */
#define CGEN_DIS_HASH_SIZE 8
#define CGEN_DIS_HASH(buf,value) (((* (unsigned char*) (buf)) >> 5) % CGEN_DIS_HASH_SIZE)
Cheers, Ben