projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Switch the inferior too in switch_to_program_space_and_thread
[deliverable/binutils-gdb.git]
/
opcodes
/
h8300-dis.c
diff --git
a/opcodes/h8300-dis.c
b/opcodes/h8300-dis.c
index d0e300656d7c682be5b3e3d308a5ff84b1073440..83a82c09bda74d30d75de50a5a5a82c29987372d 100644
(file)
--- a/
opcodes/h8300-dis.c
+++ b/
opcodes/h8300-dis.c
@@
-1,16
+1,17
@@
/* Disassemble h8300 instructions.
/* Disassemble h8300 instructions.
- Copyright 1993, 1994, 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1993-2020 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
+ This file is part of the GNU opcodes library.
+
+ This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version
2 of the License, or
-
(at your option)
any later version.
+ the Free Software Foundation; either version
3, or (at your option)
+ any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
GNU General Public
License for more details.
+ It is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
@@
-22,7
+23,7
@@
#include "sysdep.h"
#define h8_opcodes h8ops
#include "opcode/h8300.h"
#include "sysdep.h"
#define h8_opcodes h8ops
#include "opcode/h8300.h"
-#include "dis
-asm
.h"
+#include "dis
assemble
.h"
#include "opintl.h"
#include "libiberty.h"
#include "opintl.h"
#include "libiberty.h"
@@
-51,19
+52,6
@@
bfd_h8_disassemble_init (void)
for (p = h8_opcodes, pi = h8_instructions; p->name; p++, pi++)
{
for (p = h8_opcodes, pi = h8_instructions; p->name; p++, pi++)
{
- int n1 = 0;
- int n2 = 0;
-
- if ((int) p->data.nib[0] < 16)
- n1 = (int) p->data.nib[0];
- else
- n1 = 0;
-
- if ((int) p->data.nib[1] < 16)
- n2 = (int) p->data.nib[1];
- else
- n2 = 0;
-
/* Just make sure there are an even number of nibbles in it, and
that the count is the same as the length. */
for (i = 0; p->data.nib[i] != (op_type) E; i++)
/* Just make sure there are an even number of nibbles in it, and
that the count is the same as the length. */
for (i = 0; p->data.nib[i] != (op_type) E; i++)
@@
-71,7
+59,8
@@
bfd_h8_disassemble_init (void)
if (i & 1)
{
if (i & 1)
{
- fprintf (stderr, "Internal error, h8_disassemble_init.\n");
+ /* xgettext:c-format */
+ opcodes_error_handler (_("internal error, h8_disassemble_init"));
abort ();
}
abort ();
}
@@
-151,7
+140,8
@@
extract_immediate (FILE *stream,
break;
case L_32:
*len = 32;
break;
case L_32:
*len = 32;
- *cst = (data[0] << 24) + (data[1] << 16) + (data[2] << 8) + data[3];
+ *cst = (((unsigned) data[0] << 24) + (data[1] << 16)
+ + (data[2] << 8) + data[3]);
break;
default:
*len = 0;
break;
default:
*len = 0;
@@
-281,14
+271,14
@@
print_one_arg (disassemble_info *info,
{
outfn (stream, ".%s%d (0x%lx)",
(short) cst > 0 ? "+" : "",
{
outfn (stream, ".%s%d (0x%lx)",
(short) cst > 0 ? "+" : "",
- (short) cst,
+ (short) cst,
(long)(addr + (short) cst + len));
}
else
{
outfn (stream, ".%s%d (0x%lx)",
(char) cst > 0 ? "+" : "",
(long)(addr + (short) cst + len));
}
else
{
outfn (stream, ".%s%d (0x%lx)",
(char) cst > 0 ? "+" : "",
- (char) cst,
+ (char) cst,
(long)(addr + (char) cst + len));
}
}
(long)(addr + (char) cst + len));
}
}
@@
-297,19
+287,19
@@
print_one_arg (disassemble_info *info,
else if ((x & MODE) == INDEXB)
/* Always take low half of reg. */
else if ((x & MODE) == INDEXB)
/* Always take low half of reg. */
- outfn (stream, "@(0x%x:%d,%s.b)", cst, cstlen,
+ outfn (stream, "@(0x%x:%d,%s.b)", cst, cstlen,
regnames[rdisp_n < 8 ? rdisp_n + 8 : rdisp_n]);
else if ((x & MODE) == INDEXW)
/* Always take low half of reg. */
regnames[rdisp_n < 8 ? rdisp_n + 8 : rdisp_n]);
else if ((x & MODE) == INDEXW)
/* Always take low half of reg. */
- outfn (stream, "@(0x%x:%d,%s.w)", cst, cstlen,
+ outfn (stream, "@(0x%x:%d,%s.w)", cst, cstlen,
wregnames[rdisp_n < 8 ? rdisp_n : rdisp_n - 8]);
else if ((x & MODE) == INDEXL)
outfn (stream, "@(0x%x:%d,%s.l)", cst, cstlen, lregnames[rdisp_n]);
else if (x & CTRL)
wregnames[rdisp_n < 8 ? rdisp_n : rdisp_n - 8]);
else if ((x & MODE) == INDEXL)
outfn (stream, "@(0x%x:%d,%s.l)", cst, cstlen, lregnames[rdisp_n]);
else if (x & CTRL)
- outfn (stream, cregnames[rn]);
+ outfn (stream,
"%s",
cregnames[rn]);
else if ((x & MODE) == CCR)
outfn (stream, "ccr");
else if ((x & MODE) == CCR)
outfn (stream, "ccr");
@@
-472,8
+462,8
@@
bfd_h8_disassemble (bfd_vma addr, disassemble_info *info, int mach)
|| (looking_for & MODE) == INDEXW
|| (looking_for & MODE) == INDEXL)
{
|| (looking_for & MODE) == INDEXW
|| (looking_for & MODE) == INDEXL)
{
- extract_immediate (stream, looking_for, thisnib,
- data + len / 2, cst + opnr,
+ extract_immediate (stream, looking_for, thisnib,
+ data + len / 2, cst + opnr,
cstlen + opnr, q);
/* Even address == bra, odd == bra/s. */
if (q->how == O (O_BRAS, SB))
cstlen + opnr, q);
/* Even address == bra, odd == bra/s. */
if (q->how == O (O_BRAS, SB))
@@
-541,8
+531,8
@@
bfd_h8_disassemble (bfd_vma addr, disassemble_info *info, int mach)
{
int i = len / 2;
{
int i = len / 2;
- cst[opnr] = ((
data[i] << 24)
- | (data[i + 1] << 16)
+ cst[opnr] = ((
(unsigned) data[i] << 24)
+ | (data[i + 1] << 16)
| (data[i + 2] << 8)
| (data[i + 3]));
| (data[i + 2] << 8)
| (data[i + 3]));
@@
-552,14
+542,10
@@
bfd_h8_disassemble (bfd_vma addr, disassemble_info *info, int mach)
{
int i = len / 2;
{
int i = len / 2;
- cst[opnr] =
+ cst[opnr] =
(data[i] << 16) | (data[i + 1] << 8) | (data[i + 2]);
cstlen[opnr] = 24;
}
(data[i] << 16) | (data[i + 1] << 8) | (data[i + 2]);
cstlen[opnr] = 24;
}
- else if (looking_for & IGNORE)
- {
- ;
- }
else if (looking_for & DISPREG)
{
dispregno[opnr] = thisnib & 7;
else if (looking_for & DISPREG)
{
dispregno[opnr] = thisnib & 7;
@@
-645,21
+631,21
@@
bfd_h8_disassemble (bfd_vma addr, disassemble_info *info, int mach)
if (args[1] == (op_type) E)
{
/* Short form. */
if (args[1] == (op_type) E)
{
/* Short form. */
- print_one_arg (info, addr, args[0], cst[0],
- cstlen[0], dispregno[0], regno[0],
+ print_one_arg (info, addr, args[0], cst[0],
+ cstlen[0], dispregno[0], regno[0],
pregnames, qi->length);
outfn (stream, ",er%d", dispregno[0]);
}
else
{
outfn (stream, "@(0x%x:%d,", cst[0], cstlen[0]);
pregnames, qi->length);
outfn (stream, ",er%d", dispregno[0]);
}
else
{
outfn (stream, "@(0x%x:%d,", cst[0], cstlen[0]);
- print_one_arg (info, addr, args[1], cst[1],
- cstlen[1], dispregno[1], regno[1],
+ print_one_arg (info, addr, args[1], cst[1],
+ cstlen[1], dispregno[1], regno[1],
pregnames, qi->length);
outfn (stream, ".%c),",
(args[0] & MODE) == INDEXB ? 'b' : 'w');
pregnames, qi->length);
outfn (stream, ".%c),",
(args[0] & MODE) == INDEXB ? 'b' : 'w');
- print_one_arg (info, addr, args[2], cst[2],
- cstlen[2], dispregno[2], regno[2],
+ print_one_arg (info, addr, args[2], cst[2],
+ cstlen[2], dispregno[2], regno[2],
pregnames, qi->length);
}
return qi->length;
pregnames, qi->length);
}
return qi->length;
@@
-681,7
+667,7
@@
bfd_h8_disassemble (bfd_vma addr, disassemble_info *info, int mach)
return qi->length;
}
return qi->length;
}
- for (nargs = 0;
+ for (nargs = 0;
nargs < 3 && args[nargs] != (op_type) E;
nargs++)
{
nargs < 3 && args[nargs] != (op_type) E;
nargs++)
{
This page took
0.029571 seconds
and
4
git commands to generate.