Commit | Line | Data |
---|---|---|
026df7c5 | 1 | /* tc-tic4x.h -- Assemble for the Texas TMS320C[34]X. |
5a49b8ac | 2 | Copyright (C) 1997, 2002, 2003, 2005, 2007, 2008 |
ec2655a6 | 3 | Free Software Foundation. Inc. |
026df7c5 NC |
4 | |
5 | Contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz) | |
6 | ||
7 | This file is part of GAS, the GNU Assembler. | |
8 | ||
9 | GAS is free software; you can redistribute it and/or modify | |
10 | it under the terms of the GNU General Public License as published by | |
ec2655a6 | 11 | the Free Software Foundation; either version 3, or (at your option) |
026df7c5 NC |
12 | any later version. |
13 | ||
14 | GAS is distributed in the hope that it will be useful, | |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | GNU General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU General Public License | |
20 | along with GAS; see the file COPYING. If not, write to | |
ec2655a6 NC |
21 | the Free Software Foundation, 51 Franklin Street - Fifth Floor, |
22 | Boston, MA 02110-1301, USA. */ | |
026df7c5 NC |
23 | |
24 | #define TC_TIC4X | |
be33c5dd | 25 | #define TIC4X |
026df7c5 | 26 | |
026df7c5 NC |
27 | #define TARGET_ARCH bfd_arch_tic4x |
28 | ||
29 | #define WORKING_DOT_WORD | |
30 | ||
31 | /* There are a number of different formats used for local labels. gas | |
32 | expects local labels either of the form `10$:' or `n:', where n is | |
33 | a single digit. When LOCAL_LABEL_DOLLARS is defined labels of the | |
34 | form `10$:' are expected. When LOCAL_LABEL_FB is defined labels of | |
35 | the form `n:' are expected. The latter are expected to be referred | |
36 | to using `nf' for a forward reference of `nb' for a backward | |
37 | reference. | |
38 | ||
39 | The local labels expected by the TI tools are of the form `$n:', | |
40 | where the colon is optional. Now the $ character is considered to | |
41 | be valid symbol name character, so gas doesn't recognise our local | |
42 | symbols by default. Defining LEX_DOLLAR to be 1 means that gas | |
43 | won't allow labels starting with $ and thus the hook | |
44 | tc_unrecognized_line() will be called from read.c. We can thus | |
45 | parse lines starting with $n as having local labels. | |
46 | ||
47 | The other problem is the forward reference of local labels. If a | |
48 | symbol is undefined, symbol_make() calls the md_undefined_symbol() | |
49 | hook where we create a local label if recognised. */ | |
50 | ||
51 | /* Don't stick labels starting with 'L' into symbol table of COFF file. */ | |
52 | #define LOCAL_LABEL(name) ((name)[0] == '$' || (name)[0] == 'L') | |
53 | ||
54 | #define TARGET_BYTES_BIG_ENDIAN 0 | |
55 | #define OCTETS_PER_BYTE_POWER 2 | |
56 | ||
57 | #define TARGET_ARCH bfd_arch_tic4x | |
026df7c5 | 58 | |
f17c130b | 59 | #define TIC_NOP_OPCODE 0x0c800000 |
247b1fe6 | 60 | |
026df7c5 NC |
61 | #define reloc_type int |
62 | ||
63 | #define NO_RELOC 0 | |
64 | ||
a1f3c24c SS |
65 | /* '||' denotes parallel instruction */ |
66 | #define DOUBLEBAR_PARALLEL 1 | |
67 | ||
026df7c5 NC |
68 | /* Labels are not required to have a colon for a suffix. */ |
69 | #define LABELS_WITHOUT_COLONS 1 | |
70 | ||
71 | /* Use $ as the section program counter (SPC). */ | |
72 | #define DOLLAR_DOT | |
73 | ||
74 | /* Accept numbers with a suffix, e.g. 0ffffh, 1010b. */ | |
75 | #define NUMBERS_WITH_SUFFIX 1 | |
76 | ||
5a49b8ac | 77 | extern int tic4x_unrecognized_line (int); |
be33c5dd | 78 | #define tc_unrecognized_line(c) tic4x_unrecognized_line (c) |
026df7c5 NC |
79 | |
80 | #define md_number_to_chars number_to_chars_littleendian | |
81 | ||
5a49b8ac | 82 | extern int tic4x_do_align (int, const char *, int, int); |
be33c5dd | 83 | #define md_do_align(n,fill,len,max,label) if( tic4x_do_align (n,fill,len,max) ) goto label; |
026df7c5 NC |
84 | |
85 | /* Start of line hook to remove parallel instruction operator || */ | |
5a49b8ac | 86 | extern void tic4x_start_line (void); |
be33c5dd | 87 | #define md_start_line_hook() tic4x_start_line() |
026df7c5 | 88 | |
5a49b8ac | 89 | extern void tic4x_cleanup (void); |
be33c5dd | 90 | #define md_cleanup() tic4x_cleanup() |
026df7c5 | 91 | |
5a49b8ac | 92 | extern void tic4x_end (void); |
be33c5dd | 93 | #define md_end() tic4x_end() |
026df7c5 | 94 |