OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [opcodes/] [cris-dis.c] - Diff between revs 157 and 225

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 157 Rev 225
Line 1... Line 1...
/* Disassembler code for CRIS.
/* Disassembler code for CRIS.
   Copyright 2000, 2001, 2002, 2004, 2005, 2006, 2007
   Copyright 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009
   Free Software Foundation, Inc.
   Free Software Foundation, Inc.
   Contributed by Axis Communications AB, Lund, Sweden.
   Contributed by Axis Communications AB, Lund, Sweden.
   Written by Hans-Peter Nilsson.
   Written by Hans-Peter Nilsson.
 
 
   This file is part of the GNU opcodes library.
   This file is part of the GNU opcodes library.
Line 579... Line 579...
 
 
static char *
static char *
format_dec (long number, char *outbuffer, int signedp)
format_dec (long number, char *outbuffer, int signedp)
{
{
  last_immediate = number;
  last_immediate = number;
  sprintf (outbuffer, signedp ? "%ld" : "%lu", number);
  if (signedp)
 
    sprintf (outbuffer, "%ld", number);
 
  else
 
    sprintf (outbuffer, "%lu", (unsigned long) number);
 
 
  return outbuffer + strlen (outbuffer);
  return outbuffer + strlen (outbuffer);
}
}
 
 
/* Format the name of the general register regno into outbuffer.  */
/* Format the name of the general register regno into outbuffer.  */
Line 655... Line 658...
               enum cris_disass_family distype,
               enum cris_disass_family distype,
               const struct cris_opcode *prefix_matchedp)
               const struct cris_opcode *prefix_matchedp)
{
{
  /* Each insn is a word plus "immediate" operands.  */
  /* Each insn is a word plus "immediate" operands.  */
  unsigned to_skip = 2;
  unsigned to_skip = 2;
  const char *template = matchedp->args;
  const char *template_name = (const char *) matchedp->args;
  const char *s;
  const char *s;
 
 
  for (s = template; *s; s++)
  for (s = template_name; *s; s++)
    if ((*s == 's' || *s == 'N' || *s == 'Y')
    if ((*s == 's' || *s == 'N' || *s == 'Y')
        && (insn & 0x400) && (insn & 15) == 15
        && (insn & 0x400) && (insn & 15) == 15
        && prefix_matchedp == NULL)
        && prefix_matchedp == NULL)
      {
      {
        /* Immediate via [pc+], so we have to check the size of the
        /* Immediate via [pc+], so we have to check the size of the
           operand.  */
           operand.  */
        int mode_size = 1 << ((insn >> 4) & (*template == 'z' ? 1 : 3));
        int mode_size = 1 << ((insn >> 4) & (*template_name == 'z' ? 1 : 3));
 
 
        if (matchedp->imm_oprnd_size == SIZE_FIX_32)
        if (matchedp->imm_oprnd_size == SIZE_FIX_32)
          to_skip += 4;
          to_skip += 4;
        else if (matchedp->imm_oprnd_size == SIZE_SPEC_REG)
        else if (matchedp->imm_oprnd_size == SIZE_SPEC_REG)
          {
          {

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.