ass40.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  3. * See the copyright notice in the ACK home directory, in the file "Copyright".
  4. *
  5. */
  6. #include "ass00.h"
  7. #include "assex.h"
  8. #ifndef NORCSID
  9. static char rcs_id[] = "$Id$" ;
  10. #endif
  11. /*
  12. ** Make scans to do final assignment of instruction sizes & formats
  13. ** to those not already done. assign final values to labels
  14. */
  15. pass_4()
  16. {
  17. register line_t *lnp;
  18. register locl_t *lbp;
  19. int min_l, max_l;
  20. int instr;
  21. pass = 4;
  22. prog_size= 0 ;
  23. for (lnp = pstate.s_fline ; lnp ; lnp= lnp->l_next, line_num++) {
  24. instr = ctrunc(lnp->instr_num);
  25. if ( instr==sp_fpseu ) {
  26. line_num = lnp->ad.ad_ln.ln_first ;
  27. continue ;
  28. }
  29. if ( instr==sp_ilb1 ) {
  30. lbp = lnp->ad.ad_lp;
  31. lbp->l_min= prog_size; lbp->l_defined = YES;
  32. continue ;
  33. }
  34. if (lnp->opoff == NO_OFF)
  35. {
  36. determine_props(lnp, &min_l, &max_l);
  37. if (min_l != max_l)
  38. fatal("no size known");
  39. } else {
  40. min_l = oplength(*(lnp->opoff)) ;
  41. }
  42. prog_size += min_l ;
  43. }
  44. }