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