ack/util/ass/ass40.c

48 lines
996 B
C
Raw Permalink Normal View History

1984-07-02 15:35:56 +00:00
/*
1987-03-10 01:26:51 +00:00
* (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
1984-07-02 15:35:56 +00:00
*
*/
#include "ass00.h"
#include "assex.h"
1984-11-08 12:08:31 +00:00
2019-03-17 14:41:25 +00:00
1984-11-08 12:08:31 +00:00
1984-07-02 15:35:56 +00:00
/*
** Make scans to do final assignment of instruction sizes & formats
** to those not already done. assign final values to labels
*/
2019-03-17 14:41:25 +00:00
void pass_4(void)
1984-07-02 15:35:56 +00:00
{
register line_t *lnp;
register locl_t *lbp;
int min_l, max_l;
int instr;
pass = 4;
prog_size= 0 ;
for (lnp = pstate.s_fline ; lnp ; lnp= lnp->l_next, line_num++) {
instr = ctrunc(lnp->instr_num);
if ( instr==sp_fpseu ) {
line_num = lnp->ad.ad_ln.ln_first ;
continue ;
}
if ( instr==sp_ilb1 ) {
lbp = lnp->ad.ad_lp;
lbp->l_min= prog_size; lbp->l_defined = YES;
continue ;
}
if (lnp->opoff == NO_OFF)
{
determine_props(lnp, &min_l, &max_l);
if (min_l != max_l)
fatal("no size known");
} else {
min_l = oplength(*(lnp->opoff)) ;
}
prog_size += min_l ;
}
}