Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/opcodes/m10300-dis.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* Disassemble MN10300 instructions.
    2    Copyright 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
     2   Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
    33
    44This program is free software; you can redistribute it and/or modify
     
    2020
    2121#include "sysdep.h"
    22 #include "opcode/mn10300.h" 
     22#include "opcode/mn10300.h"
    2323#include "dis-asm.h"
    2424#include "opintl.h"
     
    3030#define HAVE_AM30 (info->mach == AM30)
    3131
    32 int 
     32int
    3333print_insn_mn10300 (memaddr, info)
    3434     bfd_vma memaddr;
     
    104104        {
    105105          (*info->memory_error_func) (status, memaddr, info);
    106            return -1;
     106          return -1;
    107107        }
    108108      insn = bfd_getb16 (buffer);
     
    112112  /* These are three byte insns.  */
    113113  else if ((insn & 0xff) == 0xf8
    114            || (insn & 0xff) == 0xcc 
     114           || (insn & 0xff) == 0xcc
    115115           || (insn & 0xff) == 0xf9
    116116           || (insn & 0xf3) == 0x01
     
    141141          return -1;
    142142        }
    143       insn |= *(unsigned char *)buffer;
     143      insn |= *(unsigned char *) buffer;
    144144      consume = 3;
    145145    }
     
    250250      else
    251251        mysize = 7;
    252        
     252
    253253      if ((op->mask & insn) == op->opcode
    254254          && size == (unsigned int) mysize
     
    260260          unsigned int nocomma;
    261261          int paren = 0;
    262          
     262
    263263          if (op->format == FMT_D1 || op->format == FMT_S1)
    264264            extra_shift = 8;
     
    364364                  return;
    365365                }
    366               extension = *(unsigned char *)buffer;
     366              extension = *(unsigned char *) buffer;
    367367            }
    368368          else if (size == 6 && op->format == FMT_D8)
     
    375375                  return;
    376376                }
    377               insn |= *(unsigned char *)buffer;
     377              insn |= *(unsigned char *) buffer;
    378378
    379379              status = (*info->read_memory_func) (memaddr + 3, buffer, 2, info);
     
    427427              insn |= (temp >> 8) & 0xffffff;
    428428              extension = (temp & 0xff) << 16;
    429              
     429
    430430              status = (*info->read_memory_func) (memaddr + 5, buffer, 2, info);
    431431              if (status != 0)
     
    450450              insn |= (temp >> 16) & 0xffff;
    451451              extension = (temp & 0xffff) << 8;
    452              
     452
    453453              status = (*info->read_memory_func) (memaddr + 6, buffer, 1, info);
    454454              if (status != 0)
     
    457457                  return;
    458458                }
    459               extension |= *(unsigned char *)buffer;
     459              extension |= *(unsigned char *) buffer;
    460460            }
    461461
     
    485485                  temp &= ((1 << (32 - operand->bits)) - 1);
    486486                  value |= temp;
    487                   value = ((value ^ (((unsigned long)1) << 31))
    488                            - (((unsigned long)1) << 31));
     487                  value = ((value ^ (((unsigned long) 1) << 31))
     488                           - (((unsigned long) 1) << 31));
    489489                }
    490490              else if ((operand->flags & MN10300_OPERAND_24BIT) != 0)
     
    513513                  /* These are properly extended by the code above.  */
    514514                  && ((operand->flags & MN10300_OPERAND_24BIT) == 0))
    515                 value = ((value ^ (((unsigned long)1) << (operand->bits - 1)))
    516                          - (((unsigned long)1) << (operand->bits - 1)));
     515                value = ((value ^ (((unsigned long) 1) << (operand->bits - 1)))
     516                         - (((unsigned long) 1) << (operand->bits - 1)));
    517517
    518518              if (!nocomma
     
    522522
    523523              nocomma = 0;
    524                
     524
    525525              if ((operand->flags & MN10300_OPERAND_DREG) != 0)
    526526                {
    527527                  value = ((insn >> (operand->shift + extra_shift))
    528528                           & ((1 << operand->bits) - 1));
    529                   (*info->fprintf_func) (info->stream, "d%d", (int)value);
     529                  (*info->fprintf_func) (info->stream, "d%d", (int) value);
    530530                }
    531531
     
    534534                  value = ((insn >> (operand->shift + extra_shift))
    535535                           & ((1 << operand->bits) - 1));
    536                   (*info->fprintf_func) (info->stream, "a%d", (int)value);
     536                  (*info->fprintf_func) (info->stream, "a%d", (int) value);
    537537                }
    538538
     
    551551                           & ((1 << operand->bits) - 1));
    552552                  if (value < 8)
    553                     (*info->fprintf_func) (info->stream, "r%d", (int)value);
     553                    (*info->fprintf_func) (info->stream, "r%d", (int) value);
    554554                  else if (value < 12)
    555                     (*info->fprintf_func) (info->stream, "a%d", (int)value - 8);
     555                    (*info->fprintf_func) (info->stream, "a%d", (int) value - 8);
    556556                  else
    557                     (*info->fprintf_func) (info->stream, "d%d", (int)value - 12);
     557                    (*info->fprintf_func) (info->stream, "d%d", (int) value - 12);
    558558                }
    559559
     
    565565                    (*info->fprintf_func) (info->stream, "sp", value);
    566566                  else
    567                   (*info->fprintf_func) (info->stream, "xr%d", (int)value);
     567                    (*info->fprintf_func) (info->stream, "xr%d", (int) value);
    568568                }
    569569
     
    671671                }
    672672
    673               else 
    674                 (*info->fprintf_func) (info->stream, "%ld", (long)value);
     673              else
     674                (*info->fprintf_func) (info->stream, "%ld", (long) value);
    675675            }
    676676          /* All done. */
Note: See TracChangeset for help on using the changeset viewer.