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/] [avr-dis.c] - Diff between revs 157 and 225

Show entire file | Details | Blame | View Log

Rev 157 Rev 225
Line 1... Line 1...
/* Disassemble AVR instructions.
/* Disassemble AVR instructions.
   Copyright 1999, 2000, 2002, 2004, 2005, 2006, 2007
   Copyright 1999, 2000, 2002, 2004, 2005, 2006, 2007, 2008
   Free Software Foundation, Inc.
   Free Software Foundation, Inc.
 
 
   Contributed by Denis Chertykov <denisc@overta.ru>
   Contributed by Denis Chertykov <denisc@overta.ru>
 
 
   This file is part of libopcodes.
   This file is part of libopcodes.
Line 107... Line 107...
            case 0x100c: xyz = "X";  break;
            case 0x100c: xyz = "X";  break;
            case 0x100d: xyz = "X+"; break;
            case 0x100d: xyz = "X+"; break;
            case 0x100e: xyz = "-X"; break;
            case 0x100e: xyz = "-X"; break;
            default: xyz = "??"; ok = 0;
            default: xyz = "??"; ok = 0;
          }
          }
        sprintf (buf, xyz);
        strcpy (buf, xyz);
 
 
        if (AVR_UNDEF_P (insn))
        if (AVR_UNDEF_P (insn))
          sprintf (comment, _("undefined"));
          sprintf (comment, _("undefined"));
      }
      }
      break;
      break;
Line 147... Line 147...
      *sym_addr = ((((insn & 1) | ((insn & 0x1f0) >> 3)) << 16) | insn2) * 2;
      *sym_addr = ((((insn & 1) | ((insn & 0x1f0) >> 3)) << 16) | insn2) * 2;
      /* See PR binutils/2454.  Ideally we would like to display the hex
      /* See PR binutils/2454.  Ideally we would like to display the hex
         value of the address only once, but this would mean recoding
         value of the address only once, but this would mean recoding
         objdump_print_address() which would affect many targets.  */
         objdump_print_address() which would affect many targets.  */
      sprintf (buf, "%#lx", (unsigned long) *sym_addr);
      sprintf (buf, "%#lx", (unsigned long) *sym_addr);
      sprintf (comment, comment_start);
      strcpy (comment, comment_start);
      break;
      break;
 
 
    case 'L':
    case 'L':
      {
      {
        int rel_addr = (((insn & 0xfff) ^ 0x800) - 0x800) * 2;
        int rel_addr = (((insn & 0xfff) ^ 0x800) - 0x800) * 2;
        sprintf (buf, ".%+-8d", rel_addr);
        sprintf (buf, ".%+-8d", rel_addr);
        *sym = 1;
        *sym = 1;
        *sym_addr = pc + 2 + rel_addr;
        *sym_addr = pc + 2 + rel_addr;
        sprintf (comment, comment_start);
        strcpy (comment, comment_start);
      }
      }
      break;
      break;
 
 
    case 'l':
    case 'l':
      {
      {
        int rel_addr = ((((insn >> 3) & 0x7f) ^ 0x40) - 0x40) * 2;
        int rel_addr = ((((insn >> 3) & 0x7f) ^ 0x40) - 0x40) * 2;
 
 
        sprintf (buf, ".%+-8d", rel_addr);
        sprintf (buf, ".%+-8d", rel_addr);
        *sym = 1;
        *sym = 1;
        *sym_addr = pc + 2 + rel_addr;
        *sym_addr = pc + 2 + rel_addr;
        sprintf (comment, comment_start);
        strcpy (comment, comment_start);
      }
      }
      break;
      break;
 
 
    case 'i':
    case 'i':
      sprintf (buf, "0x%04X", insn2);
      sprintf (buf, "0x%04X", insn2);

powered by: WebSVN 2.1.0

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