* dwarf2read.c (struct die_info): Doc fix.
[deliverable/binutils-gdb.git] / opcodes / i860-dis.c
index 69a106d41cab5b7b04715f4f996fdb745af0cbc3..d95c7e96f09ee94beb1ba45f958ddf17cd2f809c 100644 (file)
@@ -1,5 +1,5 @@
 /* Disassembler for the i860.
-   Copyright 2000 Free Software Foundation, Inc.
+   Copyright 2000, 2003 Free Software Foundation, Inc.
 
    Contributed by Jason Eckhardt <jle@cygnus.com>.
 
@@ -37,15 +37,13 @@ static const char *const frnames[] =
   "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
   "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31"};
 
-/* Control/status register names (encoded as 0..5 in the instruction).  */
+/* Control/status register names (encoded as 0..11 in the instruction).
+   Registers bear, ccr, p0, p1, p2 and p3 are XP only.  */
 static const char *const crnames[] = 
- {"fir", "psr", "dirbase", "db", "fsr", "epsr", "", ""};
+ {"fir", "psr", "dirbase", "db", "fsr", "epsr", "bear", "ccr",
+  "p0", "p1", "p2", "p3", "--", "--", "--", "--" };
 
 
-/* Prototypes.  */
-static int sign_ext            PARAMS((unsigned int, int)); 
-static void print_br_address   PARAMS((disassemble_info *, bfd_vma, long));
-
 
 /* True if opcode is xor, xorh, and, andh, or, orh, andnot, andnoth.  */
 #define BITWISE_OP(op)  ((op) == 0x30 || (op) == 0x31          \
@@ -58,9 +56,7 @@ static void print_br_address  PARAMS((disassemble_info *, bfd_vma, long));
 
 /* Sign extend N-bit number.  */
 static int
-sign_ext (x, n)
-     unsigned int x;
-     int n;
+sign_ext (unsigned int x, int n)
 {
   int t;
   t = x >> (n - 1);
@@ -72,10 +68,7 @@ sign_ext (x, n)
 /* Print a PC-relative branch offset.  VAL is the sign extended value
    from the branch instruction.  */
 static void
-print_br_address (info, memaddr, val)
-     disassemble_info *info;
-     bfd_vma memaddr;
-     long val;
+print_br_address (disassemble_info *info, bfd_vma memaddr, long val)
 {
 
   long adj = (long)memaddr + 4 + (val << 2);
@@ -94,9 +87,7 @@ print_br_address (info, memaddr, val)
 
 /* Print one instruction.  */
 int
-print_insn_i860 (memaddr, info)
-     bfd_vma memaddr;
-     disassemble_info *info;
+print_insn_i860 (bfd_vma memaddr, disassemble_info *info)
 {
   bfd_byte buff[4];
   unsigned int insn, i;
@@ -190,7 +181,7 @@ print_insn_i860 (memaddr, info)
            /* Control register.  */
            case 'c':
              (*info->fprintf_func) (info->stream, "%s%s", I860_REG_PREFIX,
-                                    crnames[(insn >> 21) & 0x7]);
+                                    crnames[(insn >> 21) & 0xf]);
              break;
 
            /* 16-bit immediate (sign extend, except for bitwise ops).  */
This page took 0.0236 seconds and 4 git commands to generate.