From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18558 invoked by alias); 3 Jun 2014 08:00:39 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 18546 invoked by uid 89); 3 Jun 2014 08:00:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Jun 2014 08:00:37 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5380a2u028783 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 3 Jun 2014 04:00:36 -0400 Received: from littlehelper.redhat.com (vpn1-6-66.ams2.redhat.com [10.36.6.66]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5380Y2N004540 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO) for ; Tue, 3 Jun 2014 04:00:35 -0400 From: Nick Clifton To: binutils@sourceware.org Subject: Commit: MSP430: Fix disassembly of extended index addressing Date: Tue, 03 Jun 2014 08:00:00 -0000 Message-ID: <87lhte1kym.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00017.txt.bz2 Hi Guys, I am applying the patch below to fix a bug in the MSP430 disassembler. The problem was that the code to decide when extended addressing was being used was checking only the part of the extension word that applied to the addressing mode. This is wrong, because that part of the word might be zero, but extended addressing is still being used. Cheers Nick opcodes/ChangeLog diff --git a/opcodes/msp430-dis.c b/opcodes/msp430-dis.c index 1284bbe..33a9047 100644 --- a/opcodes/msp430-dis.c +++ b/opcodes/msp430-dis.c @@ -427,7 +427,7 @@ msp430_doubleoperand (disassemble_info *info, sprintf (op1, "0x%04x", PS (dst)); sprintf (comm1, "PC rel. 0x%04x", PS ((short) addr + 2 + dst)); - if (extended_dst) + if (extension_word) { dst |= extended_dst << 16; if (dst & 0x80000) @@ -448,7 +448,7 @@ msp430_doubleoperand (disassemble_info *info, cmd_len += 4; *cycles = 6; sprintf (op1, "&0x%04x", PS (dst)); - if (extended_dst) + if (extension_word) { dst |= extended_dst << 16; sprintf (op1, "&0x%05x", dst & 0xfffff); @@ -458,7 +458,7 @@ msp430_doubleoperand (disassemble_info *info, { /* Indexed. */ dst = msp430dis_opcode (addr + 2, info); - if (extended_dst) + if (extension_word) { dst |= extended_dst << 16; if (dst & 0x80000) @@ -519,7 +519,7 @@ msp430_doubleoperand (disassemble_info *info, sprintf (op1, "#%d", dst); if (dst > 9 || dst < 0) sprintf (comm1, "#0x%04x", PS (dst)); - if (extended_src) + if (extension_word) { dst |= extended_src << 16; if (dst & 0x80000) @@ -543,7 +543,7 @@ msp430_doubleoperand (disassemble_info *info, sprintf (op1, "0x%04x", PS (dst)); sprintf (comm1, "PC rel. 0x%04x", PS ((short) addr + 2 + dst)); - if (extended_src) + if (extension_word) { dst |= extended_src << 16; if (dst & 0x80000) @@ -561,7 +561,7 @@ msp430_doubleoperand (disassemble_info *info, cmd_len += 2; sprintf (op1, "&0x%04x", PS (dst)); sprintf (comm1, "0x%04x", PS (dst)); - if (extended_src) + if (extension_word) { dst |= extended_src << 16; sprintf (op1, "&0x%05x", dst & 0xfffff); @@ -580,7 +580,7 @@ msp430_doubleoperand (disassemble_info *info, /* Indexed. */ dst = msp430dis_opcode (addr + 2, info); cmd_len += 2; - if (extended_src) + if (extension_word) { dst |= extended_src << 16; if (dst & 0x80000) @@ -625,7 +625,7 @@ msp430_doubleoperand (disassemble_info *info, sprintf (op2, "0x%04x", PS (dst)); sprintf (comm2, "PC rel. 0x%04x", PS ((short) addr + cmd_len + dst)); - if (extended_dst) + if (extension_word) { dst |= extended_dst << 16; if (dst & 0x80000) @@ -642,7 +642,7 @@ msp430_doubleoperand (disassemble_info *info, dst = msp430dis_opcode (addr + cmd_len, info); cmd_len += 2; sprintf (op2, "&0x%04x", PS (dst)); - if (extended_dst) + if (extension_word) { dst |= extended_dst << 16; sprintf (op2, "&0x%05x", dst & 0xfffff); @@ -656,7 +656,7 @@ msp430_doubleoperand (disassemble_info *info, dst |= -1 << 16; if (dst > 9 || dst < 0) sprintf (comm2, "0x%04x", PS (dst)); - if (extended_dst) + if (extension_word) { dst |= extended_dst << 16; if (dst & 0x80000)