ack/util/ceg/ce_back/obj_back/misc.c

46 lines
925 B
C
Raw Normal View History

1987-11-20 10:41:03 +00:00
#include <system.h>
#include "mach.h"
#include "back.h"
/* The following functions are called from reloc1(), reloc2(), reloc4(),
1987-11-25 13:54:01 +00:00
* dump_label().
1987-11-20 10:41:03 +00:00
*/
align_word()
1987-11-25 13:54:01 +00:00
/* Do word allignment.
*/
1987-11-20 10:41:03 +00:00
{
switch ( cur_seg) {
case SEGTXT : return;
case SEGCON : while ( (data - data_area) % EM_WSIZE != 0)
con1( '\0');
return;
case SEGROM : while ( (data - data_area) % EM_WSIZE != 0)
rom1( '\0');
return;
case SEGBSS : while ( nbss % EM_WSIZE != 0)
nbss++;
return;
default : fprint( STDERR, "align_word() : unknown seg\n");
return;
}
}
long cur_value()
1987-11-25 13:54:01 +00:00
/* Return the index of the first free entry.
*/
1987-11-20 10:41:03 +00:00
{
switch( cur_seg) {
case SEGTXT: return text - text_area;
case SEGCON: return data - data_area;
case SEGROM: return data - data_area;
case SEGBSS: return nbss;
default : fprint( STDERR, "cur_value() : unknown seg\n");
return -1L;
}
}