1 /* BEGIN INCLUDE FILE gtss_filact_intp7x.incl.pl1 */
 2 /*
 3   Created: (Wardd Multics)  07/13/79 2218.0 mst Fri
 4 */
 5 bcd_message: proc (ml, mw, bp, m);
 6 
 7 /**       Convert message (m) to bcd.
 8           Store in user's buffer (location bmp).
 9           Set ml to this location and mw to number of words
10           in message.
11 
12           Zero ml and mw if not possible.
13 **/
14 dcl  ml                       bit(18) unal parm;
15 dcl  mw                       fixed bin(18)unsigned unal parm;
16 dcl  bp                       ptr parm;
17 dcl  m                        char(*)parm;
18           ml = "0"b;
19           mw = 0;
20 
21           l = length (m);
22           n = divide (l+5, 6, 17, 0);                       /* Number of words. */
23           if n>355 then do;
24                n = 355;
25                l = n*6;
26           end;
27 
28           bmp = addrel (bp, 25);                            /* => 355 FMS buffer portion of 380 word buffer. */
29           call gtss_ascii_bcd_ (addr (m), l, bmp);
30           f = mod (l, 6);                                   /* Characters to fill to word. */
31 
32           if f>0 then msg.last_word.blank = "20"b3;
33           ml = rel (bmp);                                   /* Word offset to message (in caller's buffer). */
34           mw = n;
35           return;
36 dcl  n                        fixed bin;
37 dcl  f                        fixed bin;
38 dcl  l                        fixed bin;
39 
40 dcl  bmp                      ptr;
41 dcl 1 msg aligned based(bmp),
42     2 fill (n-1),
43     2 last_word,
44       3 skip  (f)bit(6)unal,
45       3 blank (6-f)bit(6)unal;
46      end                                                    /* bcd_message */;
47 /*   END INCLUDE FILE gtss_filact_intp7x.incl.pl1 */