tc-ns32k.h 3.3 KB

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