Back to index

cell-binutils  2.17cvs20070401
tc-ns32k.h
Go to the documentation of this file.
00001 /* tc-ns32k.h -- Opcode table for National Semi 32k processor
00002    Copyright 1987, 1992, 1993, 1994, 1995, 1997, 2000, 2002, 2005
00003    Free Software Foundation, Inc.
00004 
00005    This file is part of GAS, the GNU Assembler.
00006 
00007    GAS is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 2, or (at your option)
00010    any later version.
00011 
00012    GAS is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with GAS; see the file COPYING.  If not, write to the Free
00019    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
00020    02110-1301, USA.  */
00021 
00022 #define TC_NS32K
00023 
00024 #define TARGET_BYTES_BIG_ENDIAN    0
00025 
00026 #define TC_PCREL_ADJUST(F) md_pcrel_adjust(F)
00027 extern int md_pcrel_adjust (fragS *);
00028 
00029 #define NO_RELOC BFD_RELOC_NONE
00030 
00031 #define TARGET_ARCH         bfd_arch_ns32k
00032 
00033 #ifndef TARGET_FORMAT              /* Maybe defined in te-*.h.  */
00034 #define TARGET_FORMAT              "a.out-pc532-mach"
00035 #endif
00036 
00037 #define LOCAL_LABELS_FB 1
00038 
00039 #include "bit_fix.h"
00040 
00041 #ifdef SEQUENT_COMPATABILITY
00042 #define DEF_MODEC 20
00043 #define DEF_MODEL 21
00044 #endif
00045 
00046 #ifndef DEF_MODEC
00047 #define DEF_MODEC 20
00048 #endif
00049 
00050 #ifndef DEF_MODEL
00051 #define DEF_MODEL 20
00052 #endif
00053 
00054 #define MAX_ARGS 4
00055 #define ARG_LEN 50
00056 
00057 #define TC_CONS_FIX_NEW cons_fix_new_ns32k
00058 extern void cons_fix_new_ns32k (fragS *, int, int, expressionS *);
00059 
00060 /* The NS32x32 has a non 0 nop instruction which should be used in aligns.  */
00061 #define NOP_OPCODE 0xa2
00062 
00063 #define md_operand(x)
00064 
00065 extern const struct relax_type md_relax_table[];
00066 #define TC_GENERIC_RELAX_TABLE md_relax_table
00067 
00068 #define TC_FRAG_TYPE                      \
00069   struct                                  \
00070     {                                     \
00071       fragS *      fr_opcode_fragP;              \
00072       unsigned int fr_opcode_offset;             \
00073       char         fr_bsr;                \
00074     }
00075 
00076 #define TC_FRAG_INIT(X)                          \
00077   do                                      \
00078      {                                    \
00079        frag_opcode_frag (X) = NULL;              \
00080        frag_opcode_offset (X) = 0;        \
00081        frag_bsr (X) = 0;                  \
00082      }                                    \
00083   while (0)
00084 
00085 /* Accessor macros for things which may move around.  */
00086 #define frag_opcode_frag(X)   (X)->tc_frag_data.fr_opcode_fragP
00087 #define frag_opcode_offset(X) (X)->tc_frag_data.fr_opcode_offset
00088 #define frag_bsr(X)           (X)->tc_frag_data.fr_bsr
00089 
00090 #define TC_FIX_TYPE                       \
00091   struct                                  \
00092     {                                     \
00093       fragS *      opcode_fragP;          \
00094       unsigned int opcode_offset;         \
00095       unsigned int bsr : 1;               \
00096     }
00097 
00098 /* Accessor macros for things which may move around.
00099    See comments in write.h.  */
00100 #define fix_im_disp(X)       (X)->fx_im_disp
00101 #define fix_bit_fixP(X)      (X)->fx_bit_fixP
00102 #define fix_opcode_frag(X)   (X)->tc_fix_data.opcode_fragP
00103 #define fix_opcode_offset(X) (X)->tc_fix_data.opcode_offset
00104 #define fix_bsr(X)           (X)->tc_fix_data.bsr
00105 
00106 #define TC_INIT_FIX_DATA(X)               \
00107   do                                      \
00108      {                                    \
00109        fix_opcode_frag(X) = NULL;         \
00110        fix_opcode_offset(X) = 0;          \
00111        fix_bsr(X) = 0;                           \
00112      }                                    \
00113   while (0)
00114 
00115 #define TC_FIX_DATA_PRINT(FILE, FIX)                                  \
00116   do                                                           \
00117     {                                                          \
00118       fprintf ((FILE), "opcode_frag=%ld, operand offset=%d, bsr=%d\n",       \
00119              (unsigned long) fix_opcode_frag (FIX),                   \
00120              fix_opcode_offset (FIX),                                 \
00121              fix_bsr (FIX));                                          \
00122     }                                                          \
00123   while (0)