1
2 bcd_message: proc (ml, mw, bp, m);
3
4
5
6
7
8
9
10
11 dcl ml bit(18)unal parm;
12 dcl mw fixed bin(17)unal parm;
13 dcl bp ptr parm;
14 dcl m char(*)parm;
15 ml = "0"b;
16 mw = 0;
17
18 l = length (m);
19 n = divide (l+5, 6, 17, 0);
20 if n>355 then do;
21 n = 355;
22 l = n*6;
23 end;
24
25 bmp = addrel (bp, 25);
26 call gtss_ascii_bcd_ (addr (m), l, bmp);
27 f = mod (l, 6);
28
29 if f>0 then msg.last_word.blank = "20"b3;
30 ml = rel (bmp);
31 mw = n;
32 return;
33 dcl n fixed bin;
34 dcl f fixed bin;
35 dcl l fixed bin;
36
37 dcl bmp ptr;
38 dcl 1 msg aligned based(bmp),
39 2 fill (n-1),
40 2 last_word,
41 3 skip (f)bit(6)unal,
42 3 blank (6-f)bit(6)unal;
43 end ;
44