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/tic54x-dis.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* Disassembly routines for TMS320C54X architecture
    2    Copyright 1999, 2000 Free Software Foundation, Inc.
     2   Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
    33   Contributed by Timothy Wall (twall@cygnus.com)
    44
     
    2626#include "coff/tic54x.h"
    2727
    28 typedef struct _instruction {
    29   int parallel;
    30   template *tm;
    31   partemplate *ptm;
    32 } instruction;
    33 
    34 static int get_insn_size PARAMS ((unsigned short, instruction *));
    35 static int get_instruction PARAMS ((disassemble_info *, bfd_vma,
    36                                     unsigned short, instruction *));
    37 static int print_instruction PARAMS ((disassemble_info *, bfd_vma,
    38                                       unsigned short, char *,
    39                                       enum optype [], int, int));
    40 static int print_parallel_instruction PARAMS ((disassemble_info *, bfd_vma,
    41                                                unsigned short, partemplate *,
    42                                                int));
    43 static int sprint_dual_address (disassemble_info *,char [],
     28static int has_lkaddr (unsigned short, const template *);
     29static int get_insn_size (unsigned short, const template *);
     30static int print_instruction (disassemble_info *, bfd_vma,
     31                              unsigned short, const char *,
     32                              const enum optype [], int, int);
     33static int print_parallel_instruction (disassemble_info *, bfd_vma,
     34                                       unsigned short,
     35                                       const template *, int);
     36static int sprint_dual_address (disassemble_info *,char [],
    4437                                unsigned short);
    45 static int sprint_indirect_address (disassemble_info *,char [], 
     38static int sprint_indirect_address (disassemble_info *,char [],
    4639                                    unsigned short);
    47 static int sprint_direct_address (disassemble_info *,char [], 
     40static int sprint_direct_address (disassemble_info *,char [],
    4841                                  unsigned short);
    4942static int sprint_mmr (disassemble_info *,char [],int);
     
    5245
    5346int
    54 print_insn_tic54x(memaddr, info)
    55   bfd_vma memaddr;
    56   disassemble_info *info;
    57 {
    58   bfd_byte opbuf[2];
     47print_insn_tic54x (bfd_vma memaddr, disassemble_info *info)
     48{
     49  bfd_byte opbuf[2];
    5950  unsigned short opcode;
    6051  int status, size;
    61   instruction insn;
     52  const template* tm;
    6253
    6354  status = (*info->read_memory_func) (memaddr, opbuf, 2, info);
    6455  if (status != 0)
    6556  {
    66     (*info->memory_error_func)(status, memaddr, info);
     57    (*info->memory_error_func) (status, memaddr, info);
    6758    return -1;
    6859  }
    6960
    70   opcode = bfd_getl16(opbuf);
    71   if (!get_instruction (info, memaddr, opcode, &insn))
    72       return -1;
    73 
    74   size = get_insn_size (opcode, &insn);
     61  opcode = bfd_getl16 (opbuf);
     62  tm = tic54x_get_insn (info, memaddr, opcode, &size);
     63
    7564  info->bytes_per_line = 2;
    7665  info->bytes_per_chunk = 2;
     
    7867  info->display_endian = BFD_ENDIAN_LITTLE;
    7968
    80   if (insn.parallel)
     69  if (tm->flags & FL_PAR)
    8170  {
    82     if (!print_parallel_instruction (info, memaddr, opcode, insn.ptm, size))
     71    if (!print_parallel_instruction (info, memaddr, opcode, tm, size))
    8372      return -1;
    8473  }
    8574  else
    8675  {
    87     if (!print_instruction (info, memaddr, opcode, 
    88                             (char *)insn.tm->name,
    89                             insn.tm->operand_types,
    90                             size, (insn.tm->flags & FL_EXT)))
     76    if (!print_instruction (info, memaddr, opcode,
     77                            (char *) tm->name,
     78                            tm->operand_types,
     79                            size, (tm->flags & FL_EXT)))
    9180      return -1;
    9281  }
    9382
    94   return size*2;
    95 }
    96 
    97 static int
    98 has_lkaddr(opcode, tm)
    99   unsigned short opcode;
    100   template *tm;
    101 {
    102   return IS_LKADDR(opcode) &&
    103     (OPTYPE(tm->operand_types[0]) == OP_Smem ||
    104      OPTYPE(tm->operand_types[1]) == OP_Smem ||
    105      OPTYPE(tm->operand_types[2]) == OP_Smem ||
    106      OPTYPE(tm->operand_types[1]) == OP_Sind);
     83  return size * 2;
     84}
     85
     86static int
     87has_lkaddr (unsigned short memdata, const template *tm)
     88{
     89  return (IS_LKADDR (memdata)
     90          && (OPTYPE (tm->operand_types[0]) == OP_Smem
     91              || OPTYPE (tm->operand_types[1]) == OP_Smem
     92              || OPTYPE (tm->operand_types[2]) == OP_Smem
     93              || OPTYPE (tm->operand_types[1]) == OP_Sind
     94              || OPTYPE (tm->operand_types[0]) == OP_Lmem
     95              || OPTYPE (tm->operand_types[1]) == OP_Lmem));
    10796}
    10897
    10998/* always returns 1 (whether an insn template was found) since we provide an
    11099   "unknown instruction" template */
    111 static int
    112 get_instruction (info, addr, opcode, insn)
    113   disassemble_info *info;
    114   bfd_vma addr;
    115   unsigned short opcode;
    116   instruction *insn;
    117 {
    118   template * tm;
    119   partemplate * ptm;
    120 
    121   insn->parallel = 0;
    122   for (tm = (template *)tic54x_optab; tm->name; tm++)
     100const template*
     101tic54x_get_insn (disassemble_info *info, bfd_vma addr,
     102                 unsigned short memdata, int *size)
     103{
     104  const template *tm = NULL;
     105
     106  for (tm = tic54x_optab; tm->name; tm++)
    123107  {
    124     if (tm->opcode == (opcode & tm->mask))
     108    if (tm->opcode == (memdata & tm->mask))
    125109    {
    126110      /* a few opcodes span two words */
     
    130114             pushed one word later */
    131115          bfd_byte opbuf[2];
    132           bfd_vma addr2 = addr + 1 + has_lkaddr(opcode, tm);
    133           int status = (*info->read_memory_func)(addr2, opbuf, 2, info);
     116          bfd_vma addr2 = addr + 1 + has_lkaddr (memdata, tm);
     117          int status = (*info->read_memory_func) (addr2, opbuf, 2, info);
     118          // FIXME handle errors
    134119          if (status == 0)
    135120            {
    136               unsigned short opcode2 = bfd_getl16(opbuf);
    137               if (tm->opcode2 == (opcode2 & tm->mask2))
     121              unsigned short data2 = bfd_getl16 (opbuf);
     122              if (tm->opcode2 == (data2 & tm->mask2))
    138123                {
    139                   insn->tm = tm;
    140                   return 1;
     124                  if (size) *size = get_insn_size (memdata, tm);
     125                  return tm;
    141126                }
    142127            }
     
    144129      else
    145130        {
    146           insn->tm = tm;
    147           return 1;
     131          if (size) *size = get_insn_size (memdata, tm);
     132          return tm;
    148133        }
    149134    }
    150135  }
    151   for (ptm = (partemplate *)tic54x_paroptab; ptm->name; ptm++)
     136  for (tm = (template *) tic54x_paroptab; tm->name; tm++)
    152137  {
    153     if (ptm->opcode == (opcode & ptm->mask))
    154     {
    155       insn->parallel = 1;
    156       insn->ptm = ptm;
    157       return 1;
     138    if (tm->opcode == (memdata & tm->mask))
     139    {
     140      if (size) *size = get_insn_size (memdata, tm);
     141      return tm;
    158142    }
    159143  }
    160144
    161   insn->tm = (template *)&tic54x_unknown_opcode;
    162   return 1;
    163 }
    164 
    165 static int
    166 get_insn_size (opcode, insn)
    167   unsigned short opcode;
    168   instruction *insn;
     145  if (size) *size = 1;
     146  return &tic54x_unknown_opcode;
     147}
     148
     149static int
     150get_insn_size (unsigned short memdata, const template *insn)
    169151{
    170152  int size;
    171153
    172   if (insn->parallel)
     154  if (insn->flags & FL_PAR)
    173155    {
    174156      /* only non-parallel instructions support lk addressing */
    175       size = insn->ptm->words;
     157      size = insn->words;
    176158    }
    177159  else
    178160    {
    179       size = insn->tm->words + has_lkaddr(opcode, insn->tm);
     161      size = insn->words + has_lkaddr (memdata, insn);
    180162    }
    181163
     
    188170  bfd_vma memaddr;
    189171  unsigned short opcode;
    190   char *tm_name;
    191   enum optype tm_operands[];
     172  const char *tm_name;
     173  const enum optype tm_operands[];
    192174  int size;
    193175  int ext;
     
    197179  char operand[4][64] = { {0},{0},{0},{0}, };
    198180  bfd_byte buf[2];
    199   unsigned long opcode2, lkaddr;
     181  unsigned long opcode2 = 0;
     182  unsigned long lkaddr = 0;
    200183  enum optype src = OP_None;
    201184  enum optype dst = OP_None;
     
    207190  if (size > 1)
    208191    {
    209       int status = (*info->read_memory_func) (memaddr+1, buf, 2, info);
     192      int status = (*info->read_memory_func) (memaddr + 1, buf, 2, info);
    210193      if (status != 0)
    211194        return 0;
    212       lkaddr = opcode2 = bfd_getl16(buf);
     195      lkaddr = opcode2 = bfd_getl16 (buf);
    213196      if (size > 2)
    214197        {
    215           status = (*info->read_memory_func) (memaddr+2, buf, 2, info);
     198          status = (*info->read_memory_func) (memaddr + 2, buf, 2, info);
    216199          if (status != 0)
    217200            return 0;
    218           opcode2 = bfd_getl16(buf);
    219         }
    220     }
    221 
    222   for (i=0;i < MAX_OPERANDS && OPTYPE(tm_operands[i]) != OP_None;i++)
     201          opcode2 = bfd_getl16 (buf);
     202        }
     203    }
     204
     205  for (i = 0; i < MAX_OPERANDS && OPTYPE (tm_operands[i]) != OP_None; i++)
    223206    {
    224207      char *next_comma = ",";
    225208      int optional = (tm_operands[i] & OPT) != 0;
    226209
    227       switch (OPTYPE(tm_operands[i]))
     210      switch (OPTYPE (tm_operands[i]))
    228211        {
    229212        case OP_Xmem:
    230           sprint_dual_address (info, operand[i], XMEM(opcode));
     213          sprint_dual_address (info, operand[i], XMEM (opcode));
    231214          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    232215          break;
    233216        case OP_Ymem:
    234           sprint_dual_address (info, operand[i], YMEM(opcode));
     217          sprint_dual_address (info, operand[i], YMEM (opcode));
    235218          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    236219          break;
     
    239222        case OP_Lmem:
    240223          info->fprintf_func (info->stream, "%s", comma);
    241           if (INDIRECT(opcode))
     224          if (INDIRECT (opcode))
    242225            {
    243               if (MOD(opcode) >= 12)
     226              if (MOD (opcode) >= 12)
    244227                {
    245228                  bfd_vma addr = lkaddr;
    246                   int arf = ARF(opcode);
    247                   int mod = MOD(opcode);
     229                  int arf = ARF (opcode);
     230                  int mod = MOD (opcode);
    248231                  if (mod == 15)
    249232                      info->fprintf_func (info->stream, "*(");
    250233                  else
    251                       info->fprintf_func (info->stream, "*%sar%d(", 
     234                      info->fprintf_func (info->stream, "*%sar%d(",
    252235                                          (mod == 13 || mod == 14 ? "+" : ""),
    253236                                          arf);
    254                   (*(info->print_address_func))((bfd_vma)addr, info);
    255                   info->fprintf_func (info->stream, ")%s", 
     237                  (*(info->print_address_func)) ((bfd_vma) addr, info);
     238                  info->fprintf_func (info->stream, ")%s",
    256239                                      mod == 14 ? "%" : "");
    257240                }
     
    272255        case OP_dmad:
    273256          info->fprintf_func (info->stream, "%s", comma);
    274           (*(info->print_address_func))((bfd_vma)opcode2, info);
     257          (*(info->print_address_func)) ((bfd_vma) opcode2, info);
    275258          break;
    276259        case OP_xpmad:
    277260          /* upper 7 bits of address are in the opcode */
    278           opcode2 += ((unsigned long)opcode & 0x7F) << 16;
     261          opcode2 += ((unsigned long) opcode & 0x7F) << 16;
    279262          /* fall through */
    280263        case OP_pmad:
    281264          info->fprintf_func (info->stream, "%s", comma);
    282           (*(info->print_address_func))((bfd_vma)opcode2, info);
     265          (*(info->print_address_func)) ((bfd_vma) opcode2, info);
    283266          break;
    284267        case OP_MMRX:
    285           sprint_mmr (info, operand[i], MMRX(opcode));
     268          sprint_mmr (info, operand[i], MMRX (opcode));
    286269          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    287270          break;
    288271        case OP_MMRY:
    289           sprint_mmr (info, operand[i], MMRY(opcode));
     272          sprint_mmr (info, operand[i], MMRY (opcode));
    290273          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    291274          break;
    292275        case OP_MMR:
    293           sprint_mmr (info, operand[i], MMR(opcode));
     276          sprint_mmr (info, operand[i], MMR (opcode));
    294277          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    295278          break;
    296279        case OP_PA:
    297           sprintf (operand[i], "pa%d", (unsigned)opcode2);
     280          sprintf (operand[i], "pa%d", (unsigned) opcode2);
    298281          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    299282          break;
    300283        case OP_SRC:
    301           src = SRC(ext ? opcode2 : opcode) ? OP_B : OP_A;
     284          src = SRC (ext ? opcode2 : opcode) ? OP_B : OP_A;
    302285          sprintf (operand[i], (src == OP_B) ? "b" : "a");
    303286          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    304287          break;
    305288        case OP_SRC1:
    306           src = SRC1(ext ? opcode2 : opcode) ? OP_B : OP_A;
     289          src = SRC1 (ext ? opcode2 : opcode) ? OP_B : OP_A;
    307290          sprintf (operand[i], (src == OP_B) ? "b" : "a");
    308291          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    309292          break;
    310293        case OP_RND:
    311           dst = DST(opcode) ? OP_B : OP_A;
     294          dst = DST (opcode) ? OP_B : OP_A;
    312295          sprintf (operand[i], (dst == OP_B) ? "a" : "b");
    313296          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    314297          break;
    315298        case OP_DST:
    316           dst = DST(ext ? opcode2 : opcode) ? OP_B : OP_A;
     299          dst = DST (ext ? opcode2 : opcode) ? OP_B : OP_A;
    317300          if (!optional || dst != src)
    318301            {
     
    332315          break;
    333316        case OP_ARX:
    334           sprintf (operand[i],"ar%d", (int)ARX(opcode));
     317          sprintf (operand[i], "ar%d", (int) ARX (opcode));
    335318          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    336319          break;
    337320        case OP_SHIFT:
    338           shift = SHIFT(ext ? opcode2 : opcode);
     321          shift = SHIFT (ext ? opcode2 : opcode);
    339322          if (!optional || shift != 0)
    340323            {
    341               sprintf (operand[i],"%d", shift);
     324              sprintf (operand[i], "%d", shift);
    342325              info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    343326            }
     
    346329          break;
    347330        case OP_SHFT:
    348           shift = SHFT(opcode);
     331          shift = SHFT (opcode);
    349332          if (!optional || shift != 0)
    350333            {
    351               sprintf (operand[i],"%d", (unsigned)shift);
     334              sprintf (operand[i], "%d", (unsigned) shift);
    352335              info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    353336            }
     
    356339          break;
    357340        case OP_lk:
    358           sprintf (operand[i],"#%d", (int)(short)opcode2);
     341          sprintf (operand[i], "#%d", (int) (short) opcode2);
    359342          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    360343          break;
     
    368351          break;
    369352        case OP_k8:
    370           sprintf (operand[i], "%d", (int)((signed char)(opcode & 0xFF)));
     353          sprintf (operand[i], "%d", (int) ((signed char) (opcode & 0xFF)));
    371354          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    372355          break;
     
    380363          break;
    381364        case OP_BITC:
    382           sprintf (operand[i], "%d", (int)(opcode & 0xF));
     365          sprintf (operand[i], "%d", (int) (opcode & 0xF));
    383366          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    384367          break;
     
    396379        {
    397380          const char *code[] = { "eq", "lt", "gt", "neq" };
    398           sprintf (operand[i], code[CC3(opcode)]);
     381          sprintf (operand[i], code[CC3 (opcode)]);
    399382          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    400383          break;
     
    402385        case OP_123:
    403386          {
    404             int code = (opcode>>8) & 0x3;
     387            int code = (opcode >> 8) & 0x3;
    405388            sprintf (operand[i], "%d", (code == 0) ? 1 : (code == 2) ? 2 : 3);
    406389            info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
     
    408391          }
    409392        case OP_k5:
    410           sprintf (operand[i], "#%d", 
    411                    (int)(((signed char)opcode & 0x1F) << 3)>>3);
     393          sprintf (operand[i], "#%d",
     394                   (int) (((signed char) opcode & 0x1F) << 3) >> 3);
    412395          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    413396          break;
    414397        case OP_k8u:
    415           sprintf (operand[i], "#%d", (unsigned)(opcode & 0xFF));
     398          sprintf (operand[i], "#%d", (unsigned) (opcode & 0xFF));
    416399          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    417400          break;
    418401        case OP_k3:
    419           sprintf (operand[i], "#%d", (int)(opcode & 0x7));
     402          sprintf (operand[i], "#%d", (int) (opcode & 0x7));
    420403          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    421404          break;
    422405        case OP_lku:
    423           sprintf (operand[i], "#%d", (unsigned)opcode2);
     406          sprintf (operand[i], "#%d", (unsigned) opcode2);
    424407          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    425408          break;
     
    432415        {
    433416          const char *status0[] = {
    434             "0", "1", "2", "3", "4", "5", "6", "7", "8", 
     417            "0", "1", "2", "3", "4", "5", "6", "7", "8",
    435418            "ovb", "ova", "c", "tc", "13", "14", "15"
    436419          };
    437420          const char *status1[] = {
    438             "0", "1", "2", "3", "4", 
     421            "0", "1", "2", "3", "4",
    439422            "cmpt", "frct", "c16", "sxm", "ovm", "10",
    440423            "intm", "hm", "xf", "cpl", "braf"
    441424          };
    442           sprintf (operand[i], "%s", 
    443                    n ? status1[SBIT(opcode)] : status0[SBIT(opcode)]);
     425          sprintf (operand[i], "%s",
     426                   n ? status1[SBIT (opcode)] : status0[SBIT (opcode)]);
    444427          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    445428          break;
    446429        }
    447430        case OP_12:
    448           sprintf (operand[i], "%d", (int)((opcode >> 9)&1) + 1);
     431          sprintf (operand[i], "%d", (int) ((opcode >> 9) & 1) + 1);
    449432          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    450433          break;
     
    459442        case OP_k9:
    460443          /* FIXME-- this is DP, print the original address? */
    461           sprintf (operand[i], "#%d", (int)(opcode & 0x1FF));
     444          sprintf (operand[i], "#%d", (int) (opcode & 0x1FF));
    462445          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    463446          break;
     
    467450          break;
    468451        case OP_031:
    469           sprintf (operand[i], "%d", (int)(opcode & 0x1F));
     452          sprintf (operand[i], "%d", (int) (opcode & 0x1F));
    470453          info->fprintf_func (info->stream, "%s%s", comma, operand[i]);
    471454          break;
     
    485468  bfd_vma memaddr;
    486469  unsigned short opcode;
    487   partemplate *ptm;
     470  const template *ptm;
    488471  int size;
    489472{
    490   print_instruction (info, memaddr, opcode, 
     473  print_instruction (info, memaddr, opcode,
    491474                     ptm->name, ptm->operand_types, size, 0);
    492475  info->fprintf_func (info->stream, " || ");
    493   return print_instruction (info, memaddr, opcode, 
     476  return print_instruction (info, memaddr, opcode,
    494477                            ptm->parname, ptm->paroperand_types, size, 0);
    495478}
     
    497480static int
    498481sprint_dual_address (info, buf, code)
    499   disassemble_info *info;
     482  disassemble_info *info ATTRIBUTE_UNUSED;
    500483  char buf[];
    501484  unsigned short code;
     
    507490    "*ar%d+0%%",
    508491  };
    509   return sprintf (buf, formats[XMOD(code)], XARX(code));
     492  return sprintf (buf, formats[XMOD (code)], XARX (code));
    510493}
    511494
    512495static int
    513496sprint_indirect_address (info, buf, opcode)
    514   disassemble_info *info;
     497  disassemble_info *info ATTRIBUTE_UNUSED;
    515498  char buf[];
    516499  unsigned short opcode;
     
    530513    "*ar%d+0%%",
    531514  };
    532   return sprintf (buf, formats[MOD(opcode)], ARF(opcode));
     515  return sprintf (buf, formats[MOD (opcode)], ARF (opcode));
    533516}
    534517
    535518static int
    536519sprint_direct_address (info, buf, opcode)
    537   disassemble_info *info;
     520  disassemble_info *info ATTRIBUTE_UNUSED;
    538521  char buf[];
    539522  unsigned short opcode;
    540523{
    541524  /* FIXME -- look up relocation if available */
    542   return sprintf (buf, "0x??%02x", (int)(opcode & 0x7F));
     525  return sprintf (buf, "DP+0x%02x", (int) (opcode & 0x7F));
    543526}
    544527
    545528static int
    546529sprint_mmr (info, buf, mmr)
    547   disassemble_info *info;
     530  disassemble_info *info ATTRIBUTE_UNUSED;
    548531  char buf[];
    549532  int mmr;
    550533{
    551   symbol *reg = (symbol *)mmregs;
     534  symbol *reg = (symbol *) mmregs;
    552535  while (reg->name != NULL)
    553536    {
    554537      if (mmr == reg->value)
    555538        {
    556           sprintf (buf, "%s", (reg+1)->name);
     539          sprintf (buf, "%s", (reg + 1)->name);
    557540          return 1;
    558541        }
     
    565548static int
    566549sprint_cc2 (info, buf, opcode)
    567   disassemble_info *info;
     550  disassemble_info *info ATTRIBUTE_UNUSED;
    568551  char *buf;
    569552  unsigned short opcode;
     
    578561static int
    579562sprint_condition (info, buf, opcode)
    580   disassemble_info *info;
     563  disassemble_info *info ATTRIBUTE_UNUSED;
    581564  char *buf;
    582565  unsigned short opcode;
     
    590573      char acc = (opcode & 0x8) ? 'b' : 'a';
    591574      if (opcode & 0x7)
    592           buf += sprintf (buf, "%c%s%s", acc, cmp[(opcode&0x7)],
    593                           (opcode&0x20) ? ", " : "");
     575          buf += sprintf (buf, "%c%s%s", acc, cmp[(opcode & 0x7)],
     576                          (opcode & 0x20) ? ", " : "");
    594577      if (opcode & 0x20)
    595           buf += sprintf (buf, "%c%s", acc, (opcode&0x10) ? "ov" : "nov");
     578          buf += sprintf (buf, "%c%s", acc, (opcode & 0x10) ? "ov" : "nov");
    596579    }
    597580  else if (opcode & 0x3F)
    598581    {
    599582      if (opcode & 0x30)
    600         buf += sprintf (buf, "%s%s", 
     583        buf += sprintf (buf, "%s%s",
    601584                        ((opcode & 0x30) == 0x30) ? "tc" : "ntc",
    602585                        (opcode & 0x0F) ? ", " : "");
    603586      if (opcode & 0x0C)
    604         buf += sprintf (buf, "%s%s", 
     587        buf += sprintf (buf, "%s%s",
    605588                        ((opcode & 0x0C) == 0x0C) ? "c" : "nc",
    606589                        (opcode & 0x03) ? ", " : "");
    607590      if (opcode & 0x03)
    608         buf += sprintf (buf, "%s", 
     591        buf += sprintf (buf, "%s",
    609592                        ((opcode & 0x03) == 0x03) ? "bio" : "nbio");
    610593    }
Note: See TracChangeset for help on using the changeset viewer.