COMPILATION LISTING OF SEGMENT vrmu_data_align Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell Multics Op. - System M Compiled on: 11/21/84 1437.0 mst Wed 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* Renamed for vfile_relmgr_ by R. Harvey -- November 1982 22* 23**/ 24 25 vrmu_data_align: align_data_item: procedure (desc_ptr, base_to_pad) returns (fixed bin); 26 27 /* DESCRIPTION: 28* 29* given a pointer to a standard multics pl1 data argument descriptor, 30* and a current storage offset at which data is to be placed, 31* this routine calculates from the data type, and the given address 32* the number of padding bits needed to properly align the data 33* on either a byte, word, or double word boundary, as required 34* by the data type definition, and routines such as assign_. 35* currently the data types that assign_ can handle are supported 36* by this routine(i.e. 1-12, 19-22, 33-34, 43-46) 37* 38**/ 39 40 /* PARAMETERS: 41* 42* desc_ptr - - (input) pointer, points to the standard multics pl1 argument 43* descriptor for the data to be byte/word/even_word aligned using the given address 44* 45* base_to_pad - - (input) fixed bin(35), the current address(offset), of the last 46* data item, after which the data item described by the input descriptor 47* is to be placed, for the first data item, base_to_pad = 0. 48* 49* needed_bits - - (output) fixed bin, the number of bits to add to base_to_pad, 50* in order to obtain the correct byte/word/even_word alignment for the 51* data type as described by the input descriptor. 52* 53**/ 54 55 /* using the declared alignment and data type for this attribute, 56* return the number of bits necessary to put the data on a boundary 57* as defined by pl1, such as byte, word or double word aligned, for using that type. 58* directly in such operations as the any_to_any convert via assign_ 59* without having to do a bit move to get the proper alignment. 60* this makes data storage in the tuple a true representation of the pl1 61* attributes of unaligned and aligned for complete user choice 62* in the trade off between speed and space. */ 63 64 needed_bits = 0; /* initialize */ 65 66 if desc_ptr = null () then ; 67 else if descriptor.packed then do; /* unaligned */ 68 69 if ^(descriptor.type = 21 | (descriptor.type >= 9 & descriptor.type <= 12) /* char or decimal */ 70 | (descriptor.type >= 43 & descriptor.type <= 46)) then ; /* packed decimal */ 71 else needed_bits = pad (BYTE, base_to_pad); 72 73 end; 74 else do; /* aligned */ 75 76 if (descriptor.type >= 9 & descriptor.type <= 12) | /* decimal */ 77 (descriptor.type >= 43 & descriptor.type <= 46) | /* packed decimal */ 78 (descriptor.type >= 19 & descriptor.type <= 22) | /* bit or char */ 79 descriptor.type = 1 | descriptor.type = 3 | descriptor.type = 33 then /* binary short */ 80 needed_bits = pad (WORD, base_to_pad); 81 82 else if descriptor.type = 2 | descriptor.type = 34 | /* binary long */ 83 (descriptor.type >= 4 & descriptor.type <= 8) then /* binary complex */ 84 needed_bits = pad (DOUBLE_WORD, base_to_pad); 85 else ; /* none needed otherwise */ 86 87 end; 88 89 return (needed_bits); 90 91 92 declare null builtin; 93 declare needed_bits fixed bin; /* number of bits needed to get the alignment */ 94 declare base_to_pad fixed bin (35); /* original value to be padded out */ 95 96 pad: procedure (pad_size, pad_base) returns (fixed bin); 97 98 /* routine to return the number of bits necessary to pad a bit count 99* out to an alignment boundary of 9(byte), 36(word), or 72(double word) bits 100* as determined by the pad size input */ 101 102 if mod (pad_base, pad_size) = 0 then 103 number_of_bits = 0; 104 else do; 105 106 number_of_bits = pad_size - mod (pad_base, pad_size); 107 108 end; 109 110 return (number_of_bits); 111 112 113 declare mod builtin; 114 declare pad_size fixed bin; /* either 9 or 36 or 72 */ 115 declare pad_base fixed bin (35); /* current bit length to be padded */ 116 declare number_of_bits fixed bin; /* what has to be added to get to the desired boundary */ 117 118 end; 119 120 declare BYTE fixed bin init (9) internal static options (constant); /* byte boundary = 9 bits */ 121 declare WORD fixed bin init (36) int static options (constant); /* word boundary = 36 bits */ 122 declare DOUBLE_WORD fixed bin init (72) int static options (constant); /* double word boundary = 72 bits */ 123 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 124 125 126 end vrmu_data_align; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/21/84 0934.0 vrmu_data_align.pl1 >special_ldd>online>mrds_install>vrmu_data_align.pl1 124 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 120 set ref 71* DOUBLE_WORD 000000 constant fixed bin(17,0) initial dcl 122 set ref 82* WORD 000003 constant fixed bin(17,0) initial dcl 121 set ref 76* base_to_pad parameter fixed bin(35,0) dcl 94 set ref 25 25 71* 76* 82* desc_ptr parameter pointer dcl 1-19 ref 25 25 66 67 69 69 69 69 69 76 76 76 76 76 76 76 76 76 82 82 82 82 descriptor based structure level 1 unaligned dcl 1-6 mod builtin function dcl 113 ref 102 106 needed_bits 000100 automatic fixed bin(17,0) dcl 93 set ref 64* 71* 76* 82* 89 null builtin function dcl 92 ref 66 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 116 set ref 102* 106* 110 packed 0(07) based bit(1) level 2 packed unaligned dcl 1-6 ref 67 pad_base parameter fixed bin(35,0) dcl 115 ref 96 102 106 pad_size parameter fixed bin(17,0) dcl 114 ref 96 102 106 106 type 0(01) based fixed bin(6,0) level 2 packed unsigned unaligned dcl 1-6 ref 69 69 69 69 69 76 76 76 76 76 76 76 76 76 82 82 82 82 NAMES DECLARED BY EXPLICIT CONTEXT. align_data_item 000020 constant entry external dcl 25 pad 000173 constant entry internal dcl 96 ref 71 76 82 vrmu_data_align 000031 constant entry external dcl 25 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 444 213 10 150 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 25 000014 64 000037 66 000040 67 000046 69 000052 71 000071 73 000103 76 000104 82 000145 89 000167 96 000173 102 000175 106 000204 110 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