source: branches/libc-0.6/src/binutils/opcodes/tic4x-dis.c@ 2651

Last change on this file since 2651 was 607, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 20.6 KB
Line 
1/* Print instructions for the Texas TMS320C[34]X, for GDB and GNU Binutils.
2
3 Copyright 2002, 2003 Free Software Foundation, Inc.
4
5 Contributed by Michael P. Hayes ([email protected])
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
20
21#include <math.h>
22#include "libiberty.h"
23#include "dis-asm.h"
24#include "opcode/tic4x.h"
25
26#define TIC4X_DEBUG 0
27
28#define TIC4X_HASH_SIZE 11 /* 11 (bits) and above should give unique entries. */
29#define TIC4X_SPESOP_SIZE 8 /* Max 8. ops for special instructions */
30
31typedef enum
32 {
33 IMMED_SINT,
34 IMMED_SUINT,
35 IMMED_SFLOAT,
36 IMMED_INT,
37 IMMED_UINT,
38 IMMED_FLOAT
39 }
40immed_t;
41
42typedef enum
43 {
44 INDIRECT_SHORT,
45 INDIRECT_LONG,
46 INDIRECT_TIC4X
47 }
48indirect_t;
49
50static int tic4x_version = 0;
51static int tic4x_dp = 0;
52
53static int tic4x_pc_offset
54 PARAMS ((unsigned int));
55static int tic4x_print_char
56 PARAMS ((struct disassemble_info *, char));
57static int tic4x_print_str
58 PARAMS ((struct disassemble_info *, char *));
59static int tic4x_print_register
60 PARAMS ((struct disassemble_info *, unsigned long));
61static int tic4x_print_addr
62 PARAMS ((struct disassemble_info *, unsigned long));
63static int tic4x_print_relative
64 PARAMS ((struct disassemble_info *, unsigned long, long, unsigned long));
65void tic4x_print_ftoa
66 PARAMS ((unsigned int, FILE *, fprintf_ftype));
67static int tic4x_print_direct
68 PARAMS ((struct disassemble_info *, unsigned long));
69static int tic4x_print_immed
70 PARAMS ((struct disassemble_info *, immed_t, unsigned long));
71static int tic4x_print_cond
72 PARAMS ((struct disassemble_info *, unsigned int));
73static int tic4x_print_indirect
74 PARAMS ((struct disassemble_info *, indirect_t, unsigned long));