1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 
26 
27 
28 get_reference: proc returns(ptr);
29 
30 dcl       (p,q) ptr,
31           n fixed bin,
32           (cg_stat$first_ref,cg_stat$next_ref,cg_stat$m_s_p) ptr ext,
33           create_list entry(fixed bin) returns(ptr),
34           create_reference entry(ptr) returns(ptr),
35           (state_man$flush_ref,state_man$flush_address) entry(ptr);
36 
37 dcl       (null,string) builtin;
38 
39 %include list;
40 %include cg_reference;
41 %include boundary;
42 
43           if cg_stat$next_ref = null
44           then do;
45                q = create_list(2);
46                p, q -> element(2) = create_reference(null);
47                q -> element(1) = cg_stat$first_ref;
48                cg_stat$first_ref = q;
49                goto l1;
50                end;
51 
52           q = cg_stat$next_ref;
53           p = q -> element(2);
54           cg_stat$next_ref = q -> element(1);
55 
56           p -> reference.offset,
57           p -> reference.symbol,
58           p -> reference.qualifier,
59           p -> reference.length = null;
60 
61           p -> reference.c_offset,
62           p -> reference.c_length,
63           p -> reference.data_type = 0;
64 
65           p -> reference.value_in.storage = "0"b;
66           p -> reference.store_ins = "0"b;
67 
68           if cg_stat$m_s_p ^= null
69           then do;
70                if string(p -> reference.address_in.b) then call state_man$flush_address(p);
71                if string(p -> reference.value_in) then call state_man$flush_ref(p);
72                end;
73 
74 l1:       string(p -> reference.bits) = "11"b;    
75           string(p -> reference.relocation) = "0"b;
76           string(p -> reference.more_bits) = "0"b;
77 
78           p -> reference.padded_for_store_ref,
79           p -> reference.aligned_for_store_ref = "1"b;
80 
81           p -> reference.c_f_offset = 0;
82 
83           p -> reference.units = word_;
84 
85           string(p -> reference.address) = "0000000000000000000000000001"b;     
86           string(p -> reference.info) = "0"b;
87           p -> reference.array_ref, p -> reference.varying_ref, p -> reference.shared = "0"b;
88 
89           p -> reference.ref_count = 1;
90 
91           return(p);
92 
93           end;