09/11/84 fortran typeless builtins This segment describes Fortran's new typeless intrinsic functions and how they are used. Explanation of typeless data type: There are six builtin functions, "and", "or", "xor", "bool", "compl", and "fld", that return their results in a special data mode called "typeless". This data mode is treated as a one word bit-string (36 bits). Typeless arithmetic: There are no typeless variables or constants, only typeless expressions. Typeless entities can only exist as the result of one of the six typeless functions and can only be combined with integer or other typeless entities. Typeless expressions may contain the basic mathematical operators ("+", "-", "/", and "*"). When typeless values are combined in this way, the operations are performed in the same manner as integer arithmetic. As an example, the expression: (bool (i) + 4) * 9 adds the typeless value (which is the same as the integer value) of "i" to 4 and then multiplies the result by 9. If "i" was, for example, the integer 3, the value of the above expression would be the bit-string whose integer value was 63 (3+4=7, 7*9=63). With the arithmetic operators the result is always typeless; with relational operators, the result is logical. Typeless assignments: Assignments of this data type can only be to variables one word in length (scalar or subscripted). Whenever the right side of an equals operation yields a typeless result, the assignment operation is typeless. This means that the 36 bit string representing the value on the right hand side is stored without conversion into the location indicated by the left hand side. The left hand side must have a real, integer, or character*4 data type. For example, if "r" is a real variable, the statement: r = bool(r) + 1 adds one to the least significant bit of the real value of "r", using an integer add, and stores the new value as a bit-string in "r". Assignments to logical variables are allowed but are treated differently. The result is .TRUE. if any bits are set, or .FALSE. if all the bits are zero. The individual functions: and (a1, a2, ...) Bit by bit logical product of two or more arguments. All arguments must have a one word data type. or (a1, a2, ...) Bit by bit logical sum of two or more arguments. All arguments must have a one word data type. xor (a1, a2, ...) Bit by bit "exclusive or" of two or more arguments. All of the arguments must have a one word data type. bool (a1) Returns the single argument as a typeless bit-string. The argument must have a one word data type. compl (a1) Returns a typeless bit-string which is the one's complement of the single argument. The argument must have a one word data type. fld (i1, i2, a) Used to manipulate bit-strings. The first two arguments are integer expressions where 0<= "i1" <=35, 1<= "i2" <=36, and (i1 + i2) <= 36. The third argument must have a one word data type. This function extracts a field of "i2" bits from a 36 bit string represented by "a" starting with the bit indicated by "i1" (counted from left to right where the 0'th bit is the leftmost). The resulting field is right-justified and the remaining bits are set to zero. This intrinsic function can also appear as a pseudo-variable on the left hand side of an assignment statement. When the fld intrinsic is used in this manner, it must not be the first executable statement of the program or it will be interpreted as a statement function. The fld pseudo-variable is defined as follows: fld (i1, i2, a) = b where "i1" and "i2" are integer expressions as described above; "a" is a scalar or subscripted variable; and "b" is an expression. The "i2" rightmost bits of expression "b" will be inserted into "a" beginning at bit position "i1". Other related functions: The following are integer functions with integer arguments that perform bit shifting operations and are therefore related to the typeless functions. The first argument of these functions can be a typeless expression. ils (i1, i2) The first argument (which may be either a typeless or integer expression) is shifted left by the number of bit positions indicated by the second argument (which is an integer expression). The function returns an integer value. irs (i1, i2) The first argument is shifted right (with sign extension) by the number of bit positions indicated by the second argument. ilr (i1, i2) The first argument is rotated left by the number of bit positions indicated by the second argument. irl (i1, i2) The first argument is shifted right (without sign extension) by the number of bit positions indicated by the second argument. ----------------------------------------------------------- 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