write.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* write.h -> write.c
  2. Copyright (C) 1987 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 1, 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
  14. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
  15. /* The bit_fix was implemented to support machines that need variables
  16. to be inserted in bitfields other than 1, 2 and 4 bytes.
  17. Furthermore it gives us a possibillity to mask in bits in the symbol
  18. when it's fixed in the objectcode and check the symbols limits.
  19. The or-mask is used to set the huffman bits in displacements for the
  20. ns32k port.
  21. The acbi, addqi, movqi, cmpqi instruction requires an assembler that
  22. can handle bitfields. Ie handle an expression, evaluate it and insert
  23. the result in an some bitfield. ( ex: 5 bits in a short field of a opcode)
  24. */
  25. struct bit_fix {
  26. int fx_bit_size; /* Length of bitfield */
  27. int fx_bit_offset; /* Bit offset to bitfield */
  28. long fx_bit_base; /* Where do we apply the bitfix.
  29. If this is zero, default is assumed. */
  30. long fx_bit_base_adj;/* Adjustment of base */
  31. long fx_bit_max; /* Signextended max for bitfield */
  32. long fx_bit_min; /* Signextended min for bitfield */
  33. long fx_bit_add; /* Or mask, used for huffman prefix */
  34. };
  35. typedef struct bit_fix bit_fixS;
  36. /*
  37. * FixSs may be built up in any order.
  38. */
  39. struct fix
  40. {
  41. fragS * fx_frag; /* Which frag? */
  42. long int fx_where; /* Where is the 1st byte to fix up? */
  43. symbolS * fx_addsy; /* NULL or Symbol whose value we add in. */
  44. symbolS * fx_subsy; /* NULL or Symbol whose value we subtract. */
  45. long int fx_offset; /* Absolute number we add in. */
  46. struct fix * fx_next; /* NULL or -> next fixS. */
  47. short int fx_size; /* How many bytes are involved? */
  48. char fx_pcrel; /* TRUE: pc-relative. */
  49. char fx_pcrel_adjust;/* pc-relative offset adjust */
  50. char fx_im_disp; /* TRUE: value is a displacement */
  51. bit_fixS * fx_bit_fixP; /* IF NULL no bitfix's to do */
  52. char fx_bsr; /* sequent-hack */
  53. #ifdef SPARC
  54. char fx_r_type; /* Sparc hacks */
  55. long fx_addnumber;
  56. #endif
  57. };
  58. typedef struct fix fixS;
  59. COMMON fixS * text_fix_root; /* Chains fixSs. */
  60. COMMON fixS * data_fix_root; /* Chains fixSs. */
  61. COMMON fixS ** seg_fix_rootP; /* -> one of above. */
  62. bit_fixS *bit_fix_new();
  63. /* end: write.h */