12/24/82 -- New features of the PL/I Compiler This info segment contains information on new PL/I features not documented in the current PL/I Language Manual AG94-2. The new features are: (1) wordno builtin function charno builtin function bitno builtin function segno builtin function (2) addbitno builtin function setbitno builtin function addcharno builtin function setcharno builtin function setwordno builtin function addwordno builtin function New Pointer Manipulation Builtins: The following paragraphs describe new builtins for manipulating pointers that effectively replace the char_offset_ family of subroutines. These builtins, like the subroutines, reflect a model of pointer values that is neither that of the PL/I standard nor that of the Multics hardware. Users should read the following section, which describes the model, before using the new facilities. Multics PL/I model of pointers: In PL/I, a pointer may point to an arbitrary element of a structure or array. In the case of unaligned quantities, then, a pointer may point to a location that is not aligned on a 36 bit word boundary. In standard PL/I, no provisions are made for addressing some subportion of a value. In particular, the only way standard PL/I allows a pointer to point to a substring of a string is to use a defined string or array to overlay the desired location. The Multics PL/I pointer manipulation builtins allow the user to consider any segment to be considered as a vector of either bits, characters, or words, and to construct pointers that point to arbitrary elements of the vector. There are three primitive operations: set, add, and extract. Set constructs a pointer to an arbitrary element of a segment. Add takes a pointer and moves it some distance up or down in a segment. Extract returns the position of the pointer in the segment. Note that these are relative to a segment, NOT to some pl1 datum within the segment. The examples below should make this clear. The setwordno, setcharno, and setbitno builtins: A reference to one of these builtins takes the form: R = setcharno (P, O); where P is a scalar pointer value, O is a value convertable to a fixed binary quantity, and R is a pointer value. The result R is a pointer that points to char or bit O if the segment specified by P, where the first character is numbered 0. Note that the offset of P is ignored; an expression like declare 1 s aligned, 2 header aligned like p, 2 chars char (12); s_ptr = setcharno (addr (s.chars), 4); Will NOT result in a pointer to the the 5th character in s.chars. The expression should be: s_ptr = addcharno (addr (s.chars), 4); Builtin functions addwordno, addcharno, and addbitno: A reference to one of these functions takes the form: R = addcharno (P, O); Where P is a scalar pointer value, O is convertable to a fixed binary quantity, and R is a pointer. The result R is the pointer that results when P is moved O characters, words, or bits. O may be negative. The result of the addcharno and addwordno functions is undefined if P does not address a character or word boundary, respectively. The charno, bitno, wordno, and segno functions: These builtins extract information from pointers, and are defined as follows: C = charno (P); P must be a scalar pointer value. The result, C, is a real fixed binary of precision (21, 0), containing the zero origined character address of P. B = bitno (P); P must be a scalar pointer value. The result, B, is a real fixed binary of precision (24, 0), containing the zero origined bit address of P. W = wordno (P); P must be a scalar pointer value. The result, W, is a real fixed binary of precision (18, 0), containing the zero origined word address of P. S = segno (P); P must be a scalar pointer value. The result, S, is a real fixed binary of precision (15, 0), containing the segment number of P. ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved