[patch] opcodes/h8300-dis.c
Kazu Hirata
kazu@hxi.com
Wed May 31 17:09:00 GMT 2000
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
-------------- next part --------------
2000-05-31 Kazu Hirata <kazu@hxi.com>
* h8300-dis.c (bfd_h8_disassemble_init): Fix a typo.
(bfd_h8_disassemble): Distinguish the operand size of inc/dev.[wl]
correctly. Fix a typo.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h8300-dis.patch
Type: text/x-diff
Size: 841 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20000531/c51d9c2d/attachment.bin>
More information about the Binutils
mailing list