COMPILATION LISTING OF SEGMENT mu_data_align Compiled by: Multics PL/I Compiler, Release 28e, of February 14, 1985 Compiled at: Honeywell Multics Op. - System M Compiled on: 04/18/85 1041.4 mst Thu Options: optimize map 1 /* *********************************************************** 2* * * 3* * * 4* * Copyright, (C) Honeywell Information Systems Inc., 1981 * 5* * * 6* * * 7* *********************************************************** */ 8 9 /* ****************************************************** 10* * * 11* * * 12* * Copyright (c) 1972 by Massachusetts Institute of * 13* * Technology and Honeywell Information Systems, Inc. * 14* * * 15* * * 16* ****************************************************** */ 17 18 /* HISTORY: 19* 20* Originally written by Jim Gray - - December 1979 21* 22**/ 23 24 mu_data_align: align_data_item: procedure (desc_ptr, base_to_pad) returns (fixed bin); 25 26 /* DESCRIPTION: 27* 28* given a pointer to a standard multics pl1 data argument descriptor, 29* and a current storage offset at which data is to be placed, 30* this routine calculates from the data type, and the given address 31* the number of padding bits needed to properly align the data 32* on either a byte, word, or double word boundary, as required 33* by the data type definition, and routines such as assign_. 34* currently the data types that assign_ can handle are supported 35* by this routine(i.e. 1-12, 19-22, 33-34, 43-46) 36* 37**/ 38 39 /* PARAMETERS: 40* 41* desc_ptr - - (input) pointer, points to the standard multics pl1 argument 42* descriptor for the data to be byte/word/even_word aligned using the given address 43* 44* base_to_pad - - (input) fixed bin(35), the current address(offset), of the last 45* data item, after which the data item described by the input descriptor 46* is to be placed, for the first data item, base_to_pad = 0. 47* 48* needed_bits - - (output) fixed bin, the number of bits to add to base_to_pad, 49* in order to obtain the correct byte/word/even_word alignment for the 50* data type as described by the input descriptor. 51* 52**/ 53 54 /* using the declared alignment and data type for this attribute, 55* return the number of bits necessary to put the data on a boundary 56* as defined by pl1, such as byte, word or double word aligned, for using that type. 57* directly in such operations as the any_to_any convert via assign_ 58* without having to do a bit move to get the proper alignment. 59* this makes data storage in the tuple a true representation of the pl1 60* attributes of unaligned and aligned for complete user choice 61* in the trade off between speed and space. */ 62 63 needed_bits = 0; /* initialize */ 64 65 if desc_ptr = null () then ; 66 else if descriptor.packed then do; /* unaligned */ 67 68 if ^(descriptor.type = 21 | (descriptor.type >= 9 & descriptor.type <= 12) /* char or decimal */ 69 | (descriptor.type >= 43 & descriptor.type <= 46)) then ; /* packed decimal */ 70 else needed_bits = pad (BYTE, base_to_pad); 71 72 end; 73 else do; /* aligned */ 74 75 if (descriptor.type >= 9 & descriptor.type <= 12) | /* decimal */ 76 (descriptor.type >= 43 & descriptor.type <= 46) | /* packed decimal */ 77 (descriptor.type >= 19 & descriptor.type <= 22) | /* bit or char */ 78 descriptor.type = 1 | descriptor.type = 3 | descriptor.type = 33 then /* binary short */ 79 needed_bits = pad (WORD, base_to_pad); 80 81 else if descriptor.type = 2 | descriptor.type = 34 | /* binary long */ 82 (descriptor.type >= 4 & descriptor.type <= 8) then /* binary complex */ 83 needed_bits = pad (DOUBLE_WORD, base_to_pad); 84 else ; /* none needed otherwise */ 85 86 end; 87 88 return (needed_bits); 89 90 91 declare needed_bits fixed bin; /* number of bits needed to get the alignment */ 92 declare base_to_pad fixed bin (35); /* original value to be padded out */ 93 94 pad: procedure (pad_size, pad_base) returns (fixed bin); 95 96 /* routine to return the number of bits necessary to pad a bit count 97* out to an alignment boundary of 9(byte), 36(word), or 72(double word) bits 98* as determined by the pad size input */ 99 100 if mod (pad_base, pad_size) = 0 then 101 number_of_bits = 0; 102 else do; 103 104 number_of_bits = pad_size - mod (pad_base, pad_size); 105 106 end; 107 108 return (number_of_bits); 109 110 111 declare pad_size fixed bin; /* either 9 or 36 or 72 */ 112 declare pad_base fixed bin (35); /* current bit length to be padded */ 113 declare number_of_bits fixed bin; /* what has to be added to get to the desired boundary */ 114 115 end; 116 117 declare mod builtin; 118 declare null builtin; 119 declare BYTE fixed bin init (9) internal static options (constant); /* byte boundary = 9 bits */ 120 declare WORD fixed bin init (36) int static options (constant); /* word boundary = 36 bits */ 121 declare DOUBLE_WORD fixed bin init (72) int static options (constant); /* double word boundary = 72 bits */ 122 1 1 /* BEGIN mdbm_descriptor.incl.pl1 -- jaw 5/31/78 */ 1 2 /* modified by Jim Gray - - Nov. 1979, to change type from fixed bin(5) to 1 3* unsigned fixed bin(6), so new packed decimal data types could be handled. 1 4* also the duplicate mrds_descriptor.incl.pl1 was eliminated. */ 1 5 1 6 dcl 1 descriptor based (desc_ptr), /* map of Multics descriptor */ 1 7 2 version bit (1) unal, /* DBM handles vers. 1 only */ 1 8 2 type unsigned fixed bin (6) unal, /* data type */ 1 9 2 packed bit (1) unal, /* on if data item is packed */ 1 10 2 number_dims bit (4) unal, /* dimensions */ 1 11 2 size, /* size for string data */ 1 12 3 scale bit (12) unal, /* scale for num. data */ 1 13 3 precision bit (12) unal, /* prec. for num. data */ 1 14 2 array_info (num_dims), 1 15 3 lower_bound fixed bin (35), /* lower bound of dimension */ 1 16 3 upper_bound fixed bin (35), /* upper bound of dimension */ 1 17 3 multiplier fixed bin (35); /* element separation */ 1 18 1 19 dcl desc_ptr ptr; 1 20 dcl num_dims fixed bin init (0) ; /* more useful form of number_dims */ 1 21 1 22 /* END mdbm_descriptor.incl.pl1 */ 1 23 1 24 123 124 125 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/18/85 0908.1 mu_data_align.pl1 >special_ldd>online>mrds.pbf-04/18/85>mu_data_align.pl1 123 1 10/14/83 1608.6 mdbm_descriptor.incl.pl1 >ldd>include>mdbm_descriptor.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. BYTE 000001 constant fixed bin(17,0) initial dcl 119 set ref 70* DOUBLE_WORD 000000 constant fixed bin(17,0) initial dcl 121 set ref 81* WORD 000003 constant fixed bin(17,0) initial dcl 120 set ref 75* base_to_pad parameter fixed bin(35,0) dcl 92 set ref 24 24 70* 75* 81* desc_ptr parameter pointer dcl 1-19 ref 24 24 65 66 68 68 68 68 68 75 75 75 75 75 75 75 75 75 81 81 81 81 descriptor based structure level 1 unaligned dcl 1-6 mod builtin function dcl 117 ref 100 104 needed_bits 000100 automatic fixed bin(17,0) dcl 91 set ref 63* 70* 75* 81* 88 null builtin function dcl 118 ref 65 num_dims 000101 automatic fixed bin(17,0) initial dcl 1-20 set ref 1-20* number_of_bits 000110 automatic fixed bin(17,0) dcl 113 set ref 100* 104* 108 packed 0(07) based bit(1) level 2 packed unaligned dcl 1-6 ref 66 pad_base parameter fixed bin(35,0) dcl 112 ref 94 100 104 pad_size parameter fixed bin(17,0) dcl 111 ref 94 100 104 104 type 0(01) based fixed bin(6,0) level 2 packed unsigned unaligned dcl 1-6 ref 68 68 68 68 68 75 75 75 75 75 75 75 75 75 81 81 81 81 NAMES DECLARED BY EXPLICIT CONTEXT. align_data_item 000020 constant entry external dcl 24 mu_data_align 000031 constant entry external dcl 24 pad 000173 constant entry internal dcl 94 ref 70 75 81 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 250 260 213 260 Length 446 213 10 151 34 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME align_data_item 87 external procedure is an external procedure. pad internal procedure shares stack frame of external procedure align_data_item. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME align_data_item 000100 needed_bits align_data_item 000101 num_dims align_data_item 000110 number_of_bits pad THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. return mod_fx1 ext_entry NO EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 1 20 000011 24 000014 63 000037 65 000040 66 000046 68 000052 70 000071 72 000103 75 000104 81 000145 88 000167 94 000173 100 000175 104 000204 108 000207 ----------------------------------------------------------- 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