1 /* ***********************************************************
 2    *                                                         *
 3    * Copyright, (C) Honeywell Information Systems Inc., 1982 *
 4    *                                                         *
 5    * Copyright (c) 1972 by Massachusetts Institute of        *
 6    * Technology and Honeywell Information Systems, Inc.      *
 7    *                                                         *
 8    *********************************************************** */
 9 
10 
11 /* procedure to return pointer to reference node of an automatic integer variable
12 
13    Initial Version: 12 December 1971 by BLW
14           Modified: 20 July 1973 by RAB for EIS
15           Modified: 30 March 1980 by RAB for reference.aligned_for_store_ref.
16                     See prepare_operand for details.        */
17 
18 get_variable: proc(pt) returns(ptr);
19 
20 dcl       pt ptr;             /* points at block node */
21 
22 dcl       (p,cb) ptr,
23           null builtin,
24           create_symbol entry(ptr,ptr,bit(3) aligned) returns(ptr);
25 
26 dcl       max_string_len_p    init(24) fixed bin int static;
27 
28 %include block;
29 %include symbol;
30 %include reference;
31 %include data_types;
32 %include declare_type;
33 
34           cb = pt;
35           p = create_symbol(cb,null,(by_compiler));
36           p -> symbol.c_word_size = 1;
37           p -> symbol.c_dcl_size = max_string_len_p;
38 
39           p -> symbol.allocate,
40           p -> symbol.fixed,
41           p -> symbol.binary,
42           p -> symbol.real,
43           p -> symbol.auto = "1"b;
44 
45           p -> symbol.location = cb -> block.last_auto_loc;
46           p -> symbol.allocated = "1"b;
47 
48           cb -> block.last_auto_loc = cb -> block.last_auto_loc + 1;
49 
50           p = p -> symbol.reference;
51 
52           p -> reference.data_type = real_fix_bin_1;
53           p -> reference.aligned_ref,
54           p -> reference.aligned_for_store_ref,
55           p -> reference.allocate,
56           p -> reference.allocated = "1"b;
57 
58           return(p);
59           end;