Pristine Ack-5.5
[Ack-5.5.git] / util / ass / ass40.c
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
7 #include        "ass00.h"
8 #include        "assex.h"
9
10 #ifndef NORCSID
11 static char rcs_id[] = "$Id: ass40.c,v 2.3 1994/06/24 10:15:11 ceriel Exp $" ;
12 #endif
13
14 /*
15 ** Make scans to do final assignment of instruction sizes & formats
16 ** to those not already done. assign final values to labels
17 */
18 pass_4()
19 {
20         register line_t *lnp;
21         register locl_t *lbp;
22         int     min_l, max_l;
23         int     instr;
24
25         pass = 4;
26         prog_size= 0 ;
27         for (lnp = pstate.s_fline ; lnp ; lnp= lnp->l_next, line_num++) {
28                 instr = ctrunc(lnp->instr_num);
29                 if ( instr==sp_fpseu ) {
30                         line_num = lnp->ad.ad_ln.ln_first ;
31                         continue ;
32                 }
33                 if ( instr==sp_ilb1 ) {
34                         lbp = lnp->ad.ad_lp;
35                         lbp->l_min= prog_size; lbp->l_defined = YES;
36                         continue ;
37                 }
38
39                 if (lnp->opoff == NO_OFF)
40                 {
41                         determine_props(lnp, &min_l, &max_l);
42                         if (min_l != max_l)
43                                 fatal("no size known");
44                 } else {
45                         min_l = oplength(*(lnp->opoff)) ;
46                 }
47                 prog_size += min_l ;
48         }
49 }