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
29
30
31
32
33 declare 1 control_entry based unaligned,
34 2 mark bit (1) unaligned,
35 2 echoed bit (1) unaligned,
36 2 end_of_info bit (1) unaligned,
37 2 deleted bit (1) unaligned,
38 2 pad bit (5) unaligned;
39
40
41
42 declare (
43 NORMAL_CONTROL initial ("000000000"b),
44 MARK_CONTROL initial ("100000000"b),
45 ECHOED_CONTROL initial ("010000000"b),
46 END_OF_INFO_CONTROL initial ("001000000"b),
47 DELETED_CONTROL initial ("000100000"b)
48 ) bit (9) unaligned internal static options (constant);
49
50
51 declare 1 data_bits based unaligned,
52 2 pad_1 bit (1) unaligned,
53 2 pad_2 bit (1) unaligned,
54 2 character bit (7) unaligned;
55
56 declare 1 data_char based unaligned,
57 2 character character (1) unaligned;
58
59 declare 1 data_mark based unaligned,
60 2 mark_number fixed bin (9) unsigned unaligned;
61
62
63 declare input_buffer_ptr pointer;
64
65 declare 1 input_buffer aligned based (input_buffer_ptr),
66 2 buffer_length fixed bin (21),
67 2 control_ptr pointer,
68 2 data_ptr pointer,
69 2 n_valid fixed bin (21),
70 2 n_chars_valid fixed bin (21),
71
72 2 n_shifts fixed bin;
73
74 declare 1 control_buffer unaligned based (input_buffer.control_ptr)
75 dimension (input_buffer.buffer_length) like control_entry;
76
77 declare control_buffer_as_chars unaligned based (input_buffer.control_ptr) character (input_buffer.buffer_length);
78 ;
79
80 declare 1 data_buffer unaligned based (input_buffer.data_ptr) dimension (input_buffer.buffer_length)
81 like data_char;
82
83 declare data_buffer_as_chars unaligned based (input_buffer.data_ptr) character (input_buffer.buffer_length);
84
85
86 declare new_buf_size fixed bin (21);
87
88 declare new_data_buf_ptr pointer;
89
90 declare 1 new_data_buf unaligned based (new_data_buf_ptr)
91 dimension (new_buf_size) like data_char;
92
93 declare new_control_buf_ptr pointer;
94
95 declare 1 new_control_buf unaligned based (new_control_buf_ptr)
96 dimension (new_buf_size) like control_entry;
97
98 declare temp_data char(new_buf_size) based;
99