aboutsummaryrefslogtreecommitdiff
path: root/opcodes/pdp11-dis.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-07-01 11:16:33 +0000
committerNick Clifton <nickc@redhat.com>2005-07-01 11:16:33 +0000
commit47b0e7ad8c60ea4b45b22ad5cb376f068991bc88 (patch)
treebb27e86679b3604624116e9a81be6bb3bd7353f2 /opcodes/pdp11-dis.c
parente4e8248d79d8461adf8b0cf22086e85a4c9ee0a4 (diff)
downloadgdb-47b0e7ad8c60ea4b45b22ad5cb376f068991bc88.zip
gdb-47b0e7ad8c60ea4b45b22ad5cb376f068991bc88.tar.gz
gdb-47b0e7ad8c60ea4b45b22ad5cb376f068991bc88.tar.bz2
Update function declarations to ISO C90 formatting
Diffstat (limited to 'opcodes/pdp11-dis.c')
-rw-r--r--opcodes/pdp11-dis.c76
1 files changed, 26 insertions, 50 deletions
diff --git a/opcodes/pdp11-dis.c b/opcodes/pdp11-dis.c
index 61b00a2..f436e87 100644
--- a/opcodes/pdp11-dis.c
+++ b/opcodes/pdp11-dis.c
@@ -1,19 +1,20 @@
/* Print DEC PDP-11 instructions.
- Copyright 2001, 2002, 2004 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
-This file is free software; you can redistribute it and/or modify
-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.
+ This file is free software; you can redistribute it and/or modify
+ 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.
-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.
+ 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.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
#include "sysdep.h"
#include "dis-asm.h"
@@ -22,31 +23,17 @@ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
#define AFTER_INSTRUCTION "\t"
#define OPERAND_SEPARATOR ", "
-#define JUMP 0x1000 /* flag that this operand is used in a jump */
+#define JUMP 0x1000 /* Flag that this operand is used in a jump. */
#define FPRINTF (*info->fprintf_func)
#define F info->stream
-/* sign-extend a 16-bit number in an int */
+/* Sign-extend a 16-bit number in an int. */
#define SIGN_BITS (8 * sizeof (int) - 16)
#define sign_extend(x) (((x) << SIGN_BITS) >> SIGN_BITS)
-static int read_word PARAMS ((bfd_vma memaddr, int *word,
- disassemble_info *info));
-static void print_signed_octal PARAMS ((int n, disassemble_info *info));
-static void print_reg PARAMS ((int reg, disassemble_info *info));
-static void print_freg PARAMS ((int freg, disassemble_info *info));
-static int print_operand PARAMS ((bfd_vma *memaddr, int code,
- disassemble_info *info));
-static int print_foperand PARAMS ((bfd_vma *memaddr, int code,
- disassemble_info *info));
-int print_insn_pdp11 PARAMS ((bfd_vma memaddr, disassemble_info *info));
-
static int
-read_word (memaddr, word, info)
- bfd_vma memaddr;
- int *word;
- disassemble_info *info;
+read_word (bfd_vma memaddr, int *word, disassemble_info *info)
{
int status;
bfd_byte x[2];
@@ -60,9 +47,7 @@ read_word (memaddr, word, info)
}
static void
-print_signed_octal (n, info)
- int n;
- disassemble_info *info;
+print_signed_octal (int n, disassemble_info *info)
{
if (n < 0)
FPRINTF (F, "-%o", -n);
@@ -71,11 +56,9 @@ print_signed_octal (n, info)
}
static void
-print_reg (reg, info)
- int reg;
- disassemble_info *info;
+print_reg (int reg, disassemble_info *info)
{
- /* mask off the addressing mode, if any */
+ /* Mask off the addressing mode, if any. */
reg &= 7;
switch (reg)
@@ -89,18 +72,13 @@ print_reg (reg, info)
}
static void
-print_freg (freg, info)
- int freg;
- disassemble_info *info;
+print_freg (int freg, disassemble_info *info)
{
FPRINTF (F, "fr%d", freg);
}
static int
-print_operand (memaddr, code, info)
- bfd_vma *memaddr;
- int code;
- disassemble_info *info;
+print_operand (bfd_vma *memaddr, int code, disassemble_info *info)
{
int mode = (code >> 3) & 7;
int reg = code & 7;
@@ -120,6 +98,7 @@ print_operand (memaddr, code, info)
if (reg == 7)
{
int data;
+
if (read_word (*memaddr, &data, info) < 0)
return -1;
FPRINTF (F, "$");
@@ -137,6 +116,7 @@ print_operand (memaddr, code, info)
if (reg == 7)
{
int address;
+
if (read_word (*memaddr, &address, info) < 0)
return -1;
FPRINTF (F, "*$%o", address);
@@ -167,6 +147,7 @@ print_operand (memaddr, code, info)
if (reg == 7)
{
bfd_vma address = *memaddr + sign_extend (disp);
+
if (mode == 7)
FPRINTF (F, "*");
if (!(code & JUMP))
@@ -189,10 +170,7 @@ print_operand (memaddr, code, info)
}
static int
-print_foperand (memaddr, code, info)
- bfd_vma *memaddr;
- int code;
- disassemble_info *info;
+print_foperand (bfd_vma *memaddr, int code, disassemble_info *info)
{
int mode = (code >> 3) & 7;
int reg = code & 7;
@@ -209,9 +187,7 @@ print_foperand (memaddr, code, info)
on INFO->STREAM. Returns length of the instruction, in bytes. */
int
-print_insn_pdp11 (memaddr, info)
- bfd_vma memaddr;
- disassemble_info *info;
+print_insn_pdp11 (bfd_vma memaddr, disassemble_info *info)
{
bfd_vma start_memaddr = memaddr;
int opcode;