COMPILATION LISTING OF SEGMENT parse_answerback_ Compiled by: Multics PL/I Compiler, Release 27d, of October 11, 1982 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 11/12/82 1231.0 mst Fri Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* *********************************************************** */ 9 10 11 /* PARSE_ANSWERBACK_ - Program to determine Multics terminal type 12* from baud rate and answerback code. 13* 14* Written 750211 by PG 15* Modified 750228 by PG to fix bug missing 1050 and 2741 answerbacks. 16* Modified 750307 by PG to look for 110 baud input in lower case. 17* Modified 750922 by PG to handle Correspondence 2741s. 18* Modified 760601 by PG to redefine NL to mean "default" instead of "ASCII". 19**/ 20 21 parse_answerback_: 22 procedure (bv_input, bv_baud_rate, bv_terminal_type, bv_terminal_id); 23 24 /* parameters */ 25 26 dcl (bv_input char (*), /* (Input) String to be parsed */ 27 bv_baud_rate fixed bin, /* (Input) Baud rate of terminal */ 28 bv_terminal_type fixed bin, /* (Input/Output) Computed terminal type */ 29 bv_terminal_id char (*)) parameter; /* (Output) ID from answerback */ 30 31 /* automatic */ 32 33 dcl temp char (4), 34 (idx, jumpx, terminal_type) fixed bin, 35 answerback char (32); 36 37 /* internal static initial */ 38 39 dcl baud_array (11) fixed bin internal static options (constant) initial ( 40 110, 133, 150, 300, 600, 1200, 1800, 2400, 4800, 7200, 9600); 41 42 /* builtins */ 43 44 dcl (hbound, index, lbound, length, substr) builtin; 45 46 /* include files */ 47 1 1 /* BEGIN INCLUDE FILE ... tty_types.incl.pl1 ... Written 750415 by Paul Green */ 1 2 1 3 dcl (TYPE_UNKNOWN initial (0), 1 4 TYPE_1050 initial (1), 1 5 TYPE_2741 initial (2), 1 6 TYPE_TTY37 initial (3), 1 7 TYPE_TN300 initial (4), 1 8 TYPE_ARDS initial (5), 1 9 TYPE_CORR initial (6), 1 10 TYPE_TTY33 initial (7), 1 11 TYPE_TTY38 initial (8), 1 12 TYPE_G115 initial (9), 1 13 TYPE_ASCII initial (11) 1 14 ) fixed bin internal static options (constant); 1 15 1 16 /* END INCLUDE FILE ... tty_types.incl.pl1 */ 48 49 50 /* program */ 51 52 answerback = bv_input; /* copy input, padding to char (32) if necessary */ 53 terminal_type = bv_terminal_type; 54 55 do jumpx = lbound (baud_array, 1) to hbound (baud_array, 1) 56 while (bv_baud_rate ^= baud_array (jumpx)); 57 end; 58 59 if jumpx > hbound (baud_array, 1) /* Strange... */ 60 then go to none; 61 62 go to baud (jumpx); /* Dispatch on baud rate */ 63 64 baud (1): /* 110 BAUD */ 65 terminal_type = TYPE_TTY38; 66 idx = index (answerback, " j") + 2; /* (ttydim translates all input to lower case at 110) */ 67 if idx ^= 2 then go to found; 68 69 terminal_type = TYPE_TN300; 70 idx = index (answerback, " e") + 2; 71 if idx ^= 2 then go to found; 72 73 terminal_type = TYPE_ASCII; 74 idx = index (answerback, " t") + 2; 75 if idx ^= 2 then go to found; 76 77 terminal_type = TYPE_TTY33; 78 go to none; /* default is TTY33 */ 79 80 baud (2): /* 133 BAUD */ 81 if (terminal_type = TYPE_2741) | (terminal_type = TYPE_CORR) then do; 82 idx = index (answerback, "0") + 1; 83 if idx ^= 1 then go to found; 84 85 go to none; 86 end; 87 88 idx = 1; /* use whatever we got */ 89 substr (answerback, 2, 2) = " "; /* but clear out junk */ 90 go to found; /* a 1050 */ 91 92 baud (3): /* 150 BAUD */ 93 terminal_type = TYPE_ASCII; 94 idx = index (answerback, " T") + 2; 95 if idx ^= 2 then go to found; 96 97 terminal_type = TYPE_TN300; 98 idx = index (answerback, " E") + 2; 99 if idx ^= 2 then go to found; 100 101 terminal_type = TYPE_TTY37; 102 idx = index (answerback, " B") + 2; 103 if idx ^= 2 then go to found; 104 105 go to none; /* default is TTY37 */ 106 107 baud (4): /* 300 BAUD */ 108 terminal_type = TYPE_TN300; 109 idx = index (answerback, " E") + 2; 110 if idx ^= 2 then go to found; 111 112 terminal_type = TYPE_ASCII; 113 idx = index (answerback, " T") + 2; 114 if idx ^= 2 then go to found; 115 116 go to none; /* default is ASCII */ 117 118 baud (6): /* 1200 BAUD */ 119 if terminal_type = TYPE_ARDS 120 then go to none; /* 202C6 protocol has no answerbacks */ 121 122 terminal_type = TYPE_TN300; /* if we get here it must be Vadic protocol */ 123 idx = index (answerback, " E") + 2; 124 if idx ^= 2 then go to found; 125 126 terminal_type = TYPE_ASCII; 127 idx = index (answerback, " T") + 2; 128 if idx ^= 2 then go to found; 129 130 go to none; /* default is ASCII */ 131 132 found: /* come here if find an answerback string */ 133 if idx + 2 <= length (answerback) /* if we can get 3 chars from string */ 134 then temp = substr (answerback, idx, 3); 135 else temp = "none"; /* false alarm */ 136 137 bv_terminal_id = temp; /* Convert to char (4) */ 138 bv_terminal_type = terminal_type; 139 return; 140 141 baud (5): /* 600 BAUD */ 142 baud (7): /* 1800 BAUD */ 143 baud (8): /* 2400 BAUD */ 144 baud (9): /* 4800 BAUD */ 145 baud (10): /* 7200 BAUD */ 146 baud (11): /* 9600 BAUD */ 147 none: /* come here if don't find answerback string */ 148 bv_terminal_id = "none"; 149 bv_terminal_type = terminal_type; 150 return; 151 152 end; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/12/82 1043.5 parse_answerback_.pl1 >spec>on>11/12/82>parse_answerback_.pl1 48 1 05/18/77 1734.5 tty_types.incl.pl1 >ldd>include>tty_types.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. TYPE_2741 constant fixed bin(17,0) initial dcl 1-3 ref 80 TYPE_ARDS constant fixed bin(17,0) initial dcl 1-3 ref 118 TYPE_ASCII constant fixed bin(17,0) initial dcl 1-3 ref 73 92 112 126 TYPE_CORR constant fixed bin(17,0) initial dcl 1-3 ref 80 TYPE_TN300 constant fixed bin(17,0) initial dcl 1-3 ref 69 97 107 122 TYPE_TTY33 constant fixed bin(17,0) initial dcl 1-3 ref 77 TYPE_TTY37 constant fixed bin(17,0) initial dcl 1-3 ref 101 TYPE_TTY38 constant fixed bin(17,0) initial dcl 1-3 ref 64 answerback 000104 automatic char(32) unaligned dcl 33 set ref 52* 66 70 74 82 89* 94 98 102 109 113 123 127 132 132 baud_array 000013 constant fixed bin(17,0) initial array dcl 39 ref 55 55 55 59 bv_baud_rate parameter fixed bin(17,0) dcl 26 ref 21 55 bv_input parameter char unaligned dcl 26 ref 21 52 bv_terminal_id parameter char unaligned dcl 26 set ref 21 137* 141* bv_terminal_type parameter fixed bin(17,0) dcl 26 set ref 21 53 138* 149* hbound builtin function dcl 44 ref 55 59 idx 000101 automatic fixed bin(17,0) dcl 33 set ref 66* 67 70* 71 74* 75 82* 83 88* 94* 95 98* 99 102* 103 109* 110 113* 114 123* 124 127* 128 132 132 index builtin function dcl 44 ref 66 70 74 82 94 98 102 109 113 123 127 jumpx 000102 automatic fixed bin(17,0) dcl 33 set ref 55* 55* 59 62 lbound builtin function dcl 44 ref 55 length builtin function dcl 44 ref 132 substr builtin function dcl 44 set ref 89* 132 temp 000100 automatic char(4) unaligned dcl 33 set ref 132* 135* 137 terminal_type 000103 automatic fixed bin(17,0) dcl 33 set ref 53* 64* 69* 73* 77* 80 80 92* 97* 101* 107* 112* 118 122* 126* 138 149 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. TYPE_1050 internal static fixed bin(17,0) initial dcl 1-3 TYPE_G115 internal static fixed bin(17,0) initial dcl 1-3 TYPE_UNKNOWN internal static fixed bin(17,0) initial dcl 1-3 NAMES DECLARED BY EXPLICIT CONTEXT. baud 000000 constant label array(11) dcl 64 ref 62 found 000347 constant label dcl 132 ref 67 71 75 83 90 95 99 103 110 114 124 128 none 000372 constant label dcl 141 ref 59 78 85 105 116 118 130 parse_answerback_ 000036 constant entry external dcl 21 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 432 442 404 442 Length 622 404 10 143 26 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME parse_answerback_ 78 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME parse_answerback_ 000100 temp parse_answerback_ 000101 idx parse_answerback_ 000102 jumpx parse_answerback_ 000103 terminal_type parse_answerback_ 000104 answerback parse_answerback_ THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. return ext_entry_desc 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 21 000031 52 000056 53 000064 55 000066 57 000100 59 000102 62 000105 64 000106 66 000110 67 000121 69 000123 70 000125 71 000136 73 000140 74 000142 75 000153 77 000155 78 000157 80 000160 82 000165 83 000176 85 000200 88 000201 89 000203 90 000205 92 000206 94 000210 95 000221 97 000223 98 000225 99 000236 101 000240 102 000242 103 000253 105 000255 107 000256 109 000260 110 000271 112 000273 113 000275 114 000306 116 000310 118 000311 122 000314 123 000316 124 000327 126 000331 127 000333 128 000344 130 000346 132 000347 135 000357 137 000361 138 000367 139 000371 141 000372 149 000400 150 000402 ----------------------------------------------------------- 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