Pristine Ack-5.5
[Ack-5.5.git] / mach / sun3 / ce / misc.c
1 #include <system.h>
2 #include "mach.h"
3 #include "back.h"
4
5 /* The following functions are called from reloc1(), reloc2(), reloc4(),
6  * dump_label().
7  */
8
9 align_word()
10
11 /* Do word allignment.
12  */
13 {
14         switch ( cur_seg) {     
15                 case SEGTXT : return;
16                 case SEGCON : if ( (data - data_area) % 2 != 0) 
17                                         con1( '\0');
18                               return;
19                 case SEGROM : if ( (data - data_area) % 2 != 0) 
20                                         rom1( '\0');
21                               return;
22                 case SEGBSS : if ( nbss % 2 != 0) 
23                                         nbss++;
24                               return;
25                 default     : fprint( STDERR, "align_word() : unknown seg\n");
26                               return;
27         }
28 }
29
30
31 long cur_value()
32
33 /* Return the index of the first free entry.
34  */
35 {
36         switch( cur_seg) {
37                 case SEGTXT: return text - text_area;
38                 case SEGCON: return data - data_area;
39                 case SEGROM: return data - data_area;
40                 case SEGBSS: return nbss;
41                 default    : fprint( STDERR, "cur_value() : unknown seg\n");
42                              return -1L;
43         }
44 }
45