Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* tc-ns32k.h -- Opcode table for National Semi 32k processor |
b3adc24a | 2 | Copyright (C) 1987-2020 Free Software Foundation, Inc. |
252b5132 RH |
3 | |
4 | This file is part of GAS, the GNU Assembler. | |
5 | ||
6 | GAS is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
ec2655a6 | 8 | the Free Software Foundation; either version 3, or (at your option) |
252b5132 RH |
9 | any later version. |
10 | ||
11 | GAS is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GAS; see the file COPYING. If not, write to the Free | |
4b4da160 NC |
18 | Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA |
19 | 02110-1301, USA. */ | |
252b5132 RH |
20 | |
21 | #define TC_NS32K | |
22 | ||
23 | #define TARGET_BYTES_BIG_ENDIAN 0 | |
24 | ||
25 | #define TC_PCREL_ADJUST(F) md_pcrel_adjust(F) | |
ea1562b3 | 26 | extern int md_pcrel_adjust (fragS *); |
252b5132 | 27 | |
252b5132 RH |
28 | #define NO_RELOC BFD_RELOC_NONE |
29 | ||
30 | #define TARGET_ARCH bfd_arch_ns32k | |
31 | ||
ea1562b3 | 32 | #ifndef TARGET_FORMAT /* Maybe defined in te-*.h. */ |
252b5132 RH |
33 | #define TARGET_FORMAT "a.out-pc532-mach" |
34 | #endif | |
252b5132 RH |
35 | |
36 | #define LOCAL_LABELS_FB 1 | |
37 | ||
38 | #include "bit_fix.h" | |
39 | ||
252b5132 RH |
40 | #ifdef SEQUENT_COMPATABILITY |
41 | #define DEF_MODEC 20 | |
42 | #define DEF_MODEL 21 | |
43 | #endif | |
44 | ||
45 | #ifndef DEF_MODEC | |
46 | #define DEF_MODEC 20 | |
47 | #endif | |
48 | ||
49 | #ifndef DEF_MODEL | |
50 | #define DEF_MODEL 20 | |
51 | #endif | |
52 | ||
53 | #define MAX_ARGS 4 | |
54 | #define ARG_LEN 50 | |
55 | ||
56 | #define TC_CONS_FIX_NEW cons_fix_new_ns32k | |
62ebcb5c AM |
57 | extern void cons_fix_new_ns32k (fragS *, int, int, expressionS *, |
58 | bfd_reloc_code_real_type); | |
4eb6b71c NC |
59 | |
60 | /* The NS32x32 has a non 0 nop instruction which should be used in aligns. */ | |
252b5132 RH |
61 | #define NOP_OPCODE 0xa2 |
62 | ||
63 | #define md_operand(x) | |
64 | ||
65 | extern const struct relax_type md_relax_table[]; | |
66 | #define TC_GENERIC_RELAX_TABLE md_relax_table | |
67 | ||
68 | #define TC_FRAG_TYPE \ | |
4eb6b71c NC |
69 | struct \ |
70 | { \ | |
71 | fragS * fr_opcode_fragP; \ | |
72 | unsigned int fr_opcode_offset; \ | |
73 | char fr_bsr; \ | |
74 | } | |
252b5132 | 75 | |
db222310 | 76 | #define TC_FRAG_INIT(X, MAX_BYTES) \ |
252b5132 RH |
77 | do \ |
78 | { \ | |
79 | frag_opcode_frag (X) = NULL; \ | |
80 | frag_opcode_offset (X) = 0; \ | |
4eb6b71c | 81 | frag_bsr (X) = 0; \ |
252b5132 | 82 | } \ |
814f6641 | 83 | while (0) |
252b5132 | 84 | |
4eb6b71c | 85 | /* Accessor macros for things which may move around. */ |
252b5132 RH |
86 | #define frag_opcode_frag(X) (X)->tc_frag_data.fr_opcode_fragP |
87 | #define frag_opcode_offset(X) (X)->tc_frag_data.fr_opcode_offset | |
88 | #define frag_bsr(X) (X)->tc_frag_data.fr_bsr | |
89 | ||
90 | #define TC_FIX_TYPE \ | |
4eb6b71c NC |
91 | struct \ |
92 | { \ | |
93 | fragS * opcode_fragP; \ | |
5bc11336 | 94 | bit_fixS * fx_bit_fixP; \ |
4eb6b71c NC |
95 | unsigned int opcode_offset; \ |
96 | unsigned int bsr : 1; \ | |
5bc11336 | 97 | unsigned int fx_im_disp : 2; \ |
4eb6b71c | 98 | } |
252b5132 RH |
99 | |
100 | /* Accessor macros for things which may move around. | |
101 | See comments in write.h. */ | |
5bc11336 AM |
102 | #define fix_im_disp(X) (X)->tc_fix_data.fx_im_disp |
103 | #define fix_bit_fixP(X) (X)->tc_fix_data.fx_bit_fixP | |
252b5132 RH |
104 | #define fix_opcode_frag(X) (X)->tc_fix_data.opcode_fragP |
105 | #define fix_opcode_offset(X) (X)->tc_fix_data.opcode_offset | |
106 | #define fix_bsr(X) (X)->tc_fix_data.bsr | |
107 | ||
108 | #define TC_INIT_FIX_DATA(X) \ | |
109 | do \ | |
110 | { \ | |
111 | fix_opcode_frag(X) = NULL; \ | |
112 | fix_opcode_offset(X) = 0; \ | |
5bc11336 | 113 | fix_bit_fixP(X) = NULL; \ |
252b5132 | 114 | fix_bsr(X) = 0; \ |
5bc11336 | 115 | fix_im_disp(X) = 0; \ |
252b5132 | 116 | } \ |
814f6641 | 117 | while (0) |
252b5132 | 118 | |
a161fe53 | 119 | #define TC_FIX_DATA_PRINT(FILE, FIX) \ |
252b5132 RH |
120 | do \ |
121 | { \ | |
5bc11336 AM |
122 | fprintf ((FILE), "opcode_frag=%ld, operand offset=%d, bsr=%d, " \ |
123 | "im_disp=%d\n", \ | |
124 | (unsigned long) fix_opcode_frag (FIX), \ | |
125 | fix_opcode_offset (FIX), \ | |
126 | fix_bsr (FIX), \ | |
127 | fix_im_disp (FIX)); \ | |
252b5132 | 128 | } \ |
814f6641 | 129 | while (0) |