Pristine Ack-5.5
[Ack-5.5.git] / util / ceg / ce_back / obj_back / gen2.c
1 #include <system.h>
2 #include "mach.h"
3 #include "back.h"
4  
5 gen2( w)
6 TWO_BYTES w;
7 {
8         switch ( cur_seg) {
9                 case SEGTXT :
10                                 if ((text_cnt -= 2) < 0) mem_text();
11 #ifdef BYTES_REVERSED
12                                 *text++ = w>>8;
13                                 *text++ = w;
14 #else
15                                 *text++ = w;
16                                 *text++ = w>>8;
17 #endif
18                                 return;
19                 case SEGCON  :
20                 case SEGROM  :
21                                 if ((data_cnt -= 2) < 0) mem_data();
22 #ifdef BYTES_REVERSED
23                                 *data++ = w>>8;
24                                 *data++ = w;
25 #else
26                                 *data++ = w;
27                                 *data++ = w>>8;
28 #endif
29                                return;
30                 case SEGBSS  : bss( (arith) 2);
31                                return;
32                 default      : fprint( STDERR, "gen2() : bad seg number\n");
33                                return;
34         }
35 }