label.c 621 B

123456789101112131415161718192021222324252627282930
  1. #include <out.h>
  2. #include "header.h"
  3. #include "back.h"
  4. int Label, Label_waiting;
  5. save_label( lab)
  6. char *lab;
  7. /* It is now not possible to tell where the label belongs to, so store
  8. * the string and remember the returned index to store the missing
  9. * information later on (see dump_label()). Two labels at one address
  10. * is not allowed.
  11. */
  12. {
  13. Label = find_sym( lab, SYMBOL_DEFINITION);
  14. Label_waiting = 1;
  15. }
  16. dump_label()
  17. {
  18. if ( Label_waiting) {
  19. align_word();
  20. symbol_table[ Label].on_valu = cur_value();
  21. symbol_table[ Label].on_type |= ( S_MIN + conv_seg( cur_seg));
  22. Label_waiting = 0;
  23. }
  24. }