This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
[patch] opcodes/h8300-dis.c
- To: "'binutils at sourceware dot cygnus dot com'" <binutils at sourceware dot cygnus dot com>
- Subject: [patch] opcodes/h8300-dis.c
- From: Kazu Hirata <kazu at hxi dot com>
- Date: Wed, 31 May 2000 20:10:01 -0400
- Cc: "'gnuh8 at pcserv dot demon dot co dot uk'" <gnuh8 at pcserv dot demon dot co dot uk>
Hi,
Attached is a patch for opcodes/h8300-dis.c. The patch fixes incorrect
disassembly of inc.[wl] and dec.[wl]. It also fixes two typos.
/* h8300-hms-gcc -mh -Wall -O2 -fomit-frame-pointer -o incbug.o incbug.c */
void
test ()
{
asm ("inc.w\t#0x01,r0");
asm ("inc.l\t#0x01,er1");
asm ("dec.w\t#0x01,r2");
asm ("dec.l\t#0x01,er3");
}
The C code above results in the disassembly below:
Without the patch:
/* h8300-hms-objdump --no-show-raw-insn -d incbug.o */
00000000 <_test>:
0: 0b 50 inc.w #0x1,r0
2: 0b 71 inc.w #0x1,r1 <- this shuold really be inc.l
#0x1,er1
4: 1b 52 dec.w #0x1,r2
6: 1b 73 dec.w #0x1,r3 <- this shuold really be dec.l
#0x1,er3
8: 54 70 rts
With the patch:
/* h8300-hms-objdump --no-show-raw-insn -d incbug.o */
00000000 <_test>:
0: 0b 50 inc.w #0x1,r0
2: 0b 71 inc.l #0x1,er1 <- good!
4: 1b 52 dec.w #0x1,r2
6: 1b 73 dec.l #0x1,er3 <- good!
8: 54 70 rts
For your information, the instruction manuals for the target are available
at:
H8/300 (You won't find dec.[wl] or inc.[wl] on this chip.)
http://semiconductor.hitachi.com/products/pdf/h33tp001d1.pdf
H8/300H
http://semiconductor.hitachi.com/products/pdf/h3htp002d1.pdf
H8/S
http://semiconductor.hitachi.com/products/pdf/h82tp001d2.pdf
Thanks,
Kazu Hirata
h8300-dis.patch
ChangeLog-h8300-dis