OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [sw/] [utils/] [or32-idecode/] [or32-dis.c] - Diff between revs 6 and 673

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

Rev 6 Rev 673
Line 27... Line 27...
//#include "safe-ctype.h"
//#include "safe-ctype.h"
#include <ctype.h>
#include <ctype.h>
#include <string.h>
#include <string.h>
#include <stdlib.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#define EXTEND28(x) ((x) & (unsigned long) 0x08000000 ? ((x) | (unsigned long) 0xf0000000) : ((x)))
#define EXTEND28(x) ((x) & 0x08000000UL ? ((x) | ~0x0fffffffUL) : ((x)))
 
 
/* Now find the four bytes of INSN_CH and put them in *INSN.  */
/* Now find the four bytes of INSN_CH and put them in *INSN.  */
 
 
static void
static void
find_bytes_big (unsigned char *insn_ch, unsigned long *insn)
find_bytes_big (unsigned char *insn_ch, unsigned long *insn)
Line 99... Line 99...
      }
      }
    else if ((*enc == '0') || (*enc == '1'))
    else if ((*enc == '0') || (*enc == '1'))
      {
      {
        opc_pos--;
        opc_pos--;
        if (param_ch == *enc)
        if (param_ch == *enc)
          ret |= 1 << opc_pos;
          ret |= 1UL << opc_pos;
        enc++;
        enc++;
      }
      }
    else if (*enc == param_ch)
    else if (*enc == param_ch)
      {
      {
        opc_pos--;
        opc_pos--;
Line 119... Line 119...
          {
          {
#if DEBUG
#if DEBUG
            printf ("\n  ret=%x opc_pos=%x, param_pos=%x\n",
            printf ("\n  ret=%x opc_pos=%x, param_pos=%x\n",
                    ret, opc_pos, param_pos);
                    ret, opc_pos, param_pos);
#endif
#endif
            ret |= 0xffffffff << letter_range(param_ch);
            ret |= -1L << letter_range(param_ch);
#if DEBUG
#if DEBUG
            printf ("\n  after conversion to signed: ret=%x\n", ret);
            printf ("\n  after conversion to signed: ret=%x\n", ret);
#endif
#endif
          }
          }
        enc++;
        enc++;

powered by: WebSVN 2.1.0

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