Pristine Ack-5.5
[Ack-5.5.git] / util / ceg / defaults / storage / C_hol_cst.c
1 #define CODE_EXPANDER
2 #include <em.h>
3 #include "mach.h"
4 #include "back.h"
5
6 #if EM_WSIZE == 1
7 #define conEM_WSIZE     con1
8 #define romEM_WSIZE     rom1
9 #define CAST_WSIZE      ONE_BYTE
10 #endif
11 #if EM_WSIZE == 2
12 #define conEM_WSIZE     con2
13 #define romEM_WSIZE     rom2
14 #define CAST_WSIZE      TWO_BYTES
15 #endif
16 #if EM_WSIZE == 4
17 #define conEM_WSIZE     con4
18 #define romEM_WSIZE     rom4
19 #define CAST_WSIZE      FOUR_BYTES
20 #endif
21
22 #if EM_PSIZE == 1
23 #define relocEM_PSIZE   reloc1
24 #endif
25 #if EM_PSIZE == 2
26 #define relocEM_PSIZE   reloc2
27 #endif
28 #if EM_PSIZE == 4
29 #define relocEM_PSIZE   reloc4
30 #endif
31
32 extern int B_holno;
33
34 void
35 C_hol_cst( n, w, i)
36 arith n, w;
37 int i;
38 {
39         if ( i == 0 || w == BSS_INIT) {
40                 switchseg( SEGBSS);
41                 align_word();
42                 symbol_definition( extnd_hol( ++B_holno));
43
44                 bss( n);
45         }
46         else {  
47                 switchseg( SEGCON);
48                 align_word();
49                 symbol_definition( extnd_hol( ++B_holno));
50
51                 for ( i = 0; i < n/EM_WSIZE; i++)
52                         conEM_WSIZE( (CAST_WSIZE) w);
53         }
54 }