COMPILATION LISTING OF SEGMENT cv_bin_ Compiled by: Multics PL/I Compiler, Release 32f, of October 9, 1989 Compiled at: Bull HN, Phoenix AZ, System-M Compiled on: 11/11/89 1008.1 mst Sat Options: optimize map 1 /****^ ****************************************************** 2* * * 3* * Copyright, (C) Honeywell Bull Inc., 1987 * 4* * * 5* * Copyright (c) 1987 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* * Copyright (c) 1972 by Massachusetts Institute of * 9* * Technology and Honeywell Information Systems, Inc. * 10* * * 11* ****************************************************** */ 12 13 /* cv_bin .......... procedure to convert binary integer to ascii in decimal, octal or other specified base */ 14 /* Converted to v2pl1, Nov 73, RE Mullen */ 15 16 17 cv_bin_: procedure(a_n, a_string, a_base); 18 19 20 declare a_n fixed bin(17), /* binary integer to be converted */ 21 a_string char(12) aligned, /* character string in which to return ascii */ 22 a_base fixed bin(17); /* conversion base */ 23 24 declare (addr, divide, fixed, mod) builtin; 25 26 declare base fixed bin(17), /* temporary storage */ 27 p ptr, 28 (n, i, z) fixed bin(17), 29 (minus bit(1), 30 bin_4 fixed bin (4)) aligned; 31 32 declare digits (0:15) char (1) unal init ("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f") static options (constant); 33 34 declare word(3) char(4) based aligned; /* based array for initializing a_string */ 35 36 declare 1 c based aligned, /* based, aligned, packed character array */ 37 2 a(0:11) char(1) unaligned; 38 39 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 40 41 42 base = a_base; /* primary entry, initialize conversion base */ 43 /* if base > 10 | base <= 0 44* then signal condition(cv_bin_base_error); */ 45 go to common; 46 47 48 dec: entry(a_n, a_string); /* entry to convert to decimal base */ 49 50 base = 10; /* initialize conversion base to 10 */ 51 go to common; 52 53 54 oct: entry(a_n, a_string); /* entry to convert to octal base */ 55 56 base = 8; /* initialize conversion base to 8 */ 57 58 59 common: p = addr(a_string); /* get pointer to string (must be alligned) */ 60 p -> word(1), p -> word(2), p -> word(3) = " "; /* initialize output string to blanks */ 61 n = a_n; 62 63 if n < 0 /* check for and adjust negative number */ 64 then do; 65 66 n = -n; 67 minus = "1"b; 68 end; 69 70 else minus = "0"b; 71 72 z = -1; /* Initialize to force at least one traversal of loop */ 73 74 do i = 11 by -1 to 0 while(n ^= z); /* convert into string, last digit(11) first */ 75 76 bin_4 = fixed(mod(n,base),4); 77 p -> c.a(i) = digits (bin_4); 78 n = divide(n, base, 17, 0); 79 80 z = 0; /* Clear flag that forces "0" if zero value */ 81 82 end; 83 84 if minus 85 then if i >= 0 /* value of "i" is correct for insertion of "-" */ 86 then p -> c.a(i) = "-"; /* magnitude converted, add - sign if necessary */ 87 /* else signal condition(cv_bin_minus_or_size); */ 88 89 end cv_bin_; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/11/89 0803.8 cv_bin_.pl1 >spec>install>1110>cv_bin_.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. a based char(1) array level 2 packed packed unaligned dcl 36 set ref 77* 84* a_base parameter fixed bin(17,0) dcl 20 ref 17 42 a_n parameter fixed bin(17,0) dcl 20 ref 17 48 54 61 a_string parameter char(12) dcl 20 set ref 17 48 54 59 addr builtin function dcl 24 ref 59 base 000100 automatic fixed bin(17,0) dcl 26 set ref 42* 50* 56* 76 78 bin_4 000110 automatic fixed bin(4,0) dcl 26 set ref 76* 77 c based structure level 1 dcl 36 digits 000000 constant char(1) initial array packed unaligned dcl 32 ref 77 divide builtin function dcl 24 ref 78 fixed builtin function dcl 24 ref 76 i 000105 automatic fixed bin(17,0) dcl 26 set ref 74* 77* 84 84 minus 000107 automatic bit(1) dcl 26 set ref 67* 70* 84 mod builtin function dcl 24 ref 76 n 000104 automatic fixed bin(17,0) dcl 26 set ref 61* 63 66* 66 74 76 78* 78 p 000102 automatic pointer dcl 26 set ref 59* 60 60 60 77 84 word based char(4) array dcl 34 set ref 60* 60* 60* z 000106 automatic fixed bin(17,0) dcl 26 set ref 72* 74 80* NAMES DECLARED BY EXPLICIT CONTEXT. common 000051 constant label dcl 59 ref 45 51 cv_bin_ 000013 constant entry external dcl 17 dec 000030 constant entry external dcl 48 oct 000042 constant entry external dcl 54 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 166 176 133 176 Length 340 133 10 125 33 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME cv_bin_ 73 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME cv_bin_ 000100 base cv_bin_ 000102 p cv_bin_ 000104 n cv_bin_ 000105 i cv_bin_ 000106 z cv_bin_ 000107 minus cv_bin_ 000110 bin_4 cv_bin_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. return_mac mdfx1 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 17 000007 42 000020 45 000023 48 000024 50 000035 51 000037 54 000040 56 000047 59 000051 60 000054 61 000060 63 000062 66 000063 67 000065 68 000067 70 000070 72 000071 74 000073 76 000103 77 000106 78 000113 80 000116 82 000117 84 000122 89 000132 ----------------------------------------------------------- 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