COMPILATION LISTING OF SEGMENT disassemble Compiled by: Multics PL/I Compiler, Release 28, of March 4, 1983 Compiled at: Honeywell LCPD Phoenix, System M Compiled on: 04/07/83 1222.1 mst Thu Options: optimize map 1 2 /* ****************************************************** 3* * * 4* * * 5* * Copyright (c) 1972 by Massachusetts Institute of * 6* * Technology and Honeywell Information Systems, Inc. * 7* * * 8* * * 9* ****************************************************** */ 10 11 dissassemble: disassemble: procedure ( data_ptr, ret_string, instr_word_num ); 12 13 14 15 /* This procedure is called to produce a character string, symbolic 16** representation of an instruction word (an instruction in object form). 17** 18** Rewritten on Nov 9, 1972 for the 6180 by Bill Silver. 19**/ 20 21 22 23 dcl data_ptr ptr, /* The input pointer to the object instruction 24* * word to be dissassembled. */ 25 26 ret_string char (72) var, /* The return string which will contain the 27* * instruction in symbolic form. */ 28 29 instr_word_num fixed bin; /* The number of the instruction word to be 30* * processed. 31* * 0 => process word 1 - do not return anything 32* * 1 => process word 1 - return the number of 33* * words in this instrruction in instr_word_num 34* * 2-4 => process one of the descriptors. 35* * The data_ptr must still point to the 36* * instruction word. */ 37 38 39 dcl real_ilc fixed bin(18); /* The program offset of the instruction */ 40 /* when it is being taken from the break map */ 41 42 43 dcl 1 op_mnemonic_$op_mnemonic(0:1023) ext static aligned, 44 2 opcode char(6) unal, 45 2 dtype fixed bin(2) unal, 46 2 num_desc fixed bin(5) unal, 47 2 num_words fixed bin(8) unal; 48 49 dcl opcode fixed bin, /* A numeric representation of the opcode. */ 50 51 offset fixed bin(17); /* The value of the instruction offset. */ 52 53 dcl note_offset fixed bin(17); /* result of ic modification. */ 54 55 dcl mnemonic char (6), /* Op code name. */ 56 57 sym_pr char (4), /* Symbolic pointer register field. */ 58 59 sym_tag char (4), /* Symbolic tag field. */ 60 61 note char (24); /* Special message returned with instruction. */ 62 63 64 dcl string_len fixed bin; /* A dummy return variable - length of 65* * string returned by ioa_$rsnnl. */ 66 67 dcl word fixed bin (35) based; /* Used to reference 1 word of data. */ 68 69 dcl ic_word fixed bin (35); /* Word referenced by computed address 70* * of an instruction that has "ic" 71* * modification. */ 72 73 74 dcl out_of_bounds condition; 75 76 dcl ioa_$rsnnl entry options(variable); 77 78 79 dcl ( addrel, fixed, rel, substr ) builtin; 80 /* */ 1 1 /* BEGIN INCLUDE FILE ... db_inst.incl.pl1 Last modified Nov 72 - WSS. */ 1 2 1 3 1 4 /* PL/I definitions of an instruction word. There are two definitions. 1 5** One defines a full 18 bit offset field (now meaningful with 256K segments) 1 6** and the other defines an instruction with a pointer register field and a 1 7** 15 bit offset field. 1 8**/ 1 9 1 10 dcl ilc_ptr ptr; /* Pointer to the instruction word. */ 1 11 1 12 1 13 dcl 1 instr based (ilc_ptr) aligned, 1 14 (2 offset fixed bin (17), /* Full 18 bit offset. No pr field. */ 1 15 2 opcode bit (10), /* Instruction opcode. */ 1 16 2 inhibit bit (1), /* ON => interrupts inhibitted. */ 1 17 2 pr_bit bit (1), /* ON => instruction has pr field. */ 1 18 2 tag bit (6)) unaligned; /* Tag field. */ 1 19 1 20 1 21 dcl 1 instr_pr based (ilc_ptr) aligned, 1 22 (2 pr bit (3), /* Pointer register field. */ 1 23 2 offset fixed bin (14), /* 15 bit offset due to pr field. */ 1 24 2 pad bit (18)) unaligned; 1 25 1 26 1 27 /* END OF INCLUDE FILE ... db_inst.incl.pl1 */ 81 82 /* */ 2 1 /* BEGIN INCLUDE FILE ... db_data_map.incl.pl 1 Last modified Nov 72 for 6180 - WSS. */ 2 2 2 3 2 4 /* Below are references to the tables found in db_data.alm. These are the 2 5** PL/I definitions of these tables. 2 6**/ 2 7 2 8 dcl db_data$n_regs fixed bin external; 2 9 2 10 dcl db_data$names(0:31) char (4) aligned external; 2 11 2 12 dcl db_data$tags(0:63) char (4) aligned external; 2 13 2 14 dcl db_data$fault_names (0:31) char (20) aligned external; 2 15 2 16 dcl db_data$acv_names (16) char (24) aligned external; 2 17 2 18 dcl db_data$ipr_names (7) char (24) aligned external; 2 19 2 20 2 21 2 22 2 23 /* END OF INCLUDE FILE ... db_data_map.incl.pl1 */ 83 84 /* */ 85 real_ilc = fixed(rel(data_ptr), 18); 86 87 join: 88 ilc_ptr = data_ptr; /* Copy argument pointer to instruction. */ 89 90 note = " "; /* We don't usually have to return a note. */ 91 92 93 opcode = fixed(ilc_ptr -> instr.opcode); /* Get numeric value of op code. */ 94 95 mnemonic = op_mnemonic_$op_mnemonic(opcode).opcode; /* Get op code opcode. */ 96 97 98 /* Find out which instruction word we must test. If the word to be tested is greater 99** thane the number of words in the instruction then there is an error. If it is 100** OK then we will transfer to the routine which will process this particular word 101** of the instruction. 102**/ 103 104 if op_mnemonic_$op_mnemonic(opcode).num_words < instr_word_num 105 106 then do; 107 ret_string = "Error in call to disassemble - word number too big."; 108 return; 109 end; 110 111 goto instruction_word ( instr_word_num ); 112 113 114 115 116 instruction_word(0): /* This is the first word of the instruction. */ 117 instruction_word(1): 118 119 120 /* Look for multi-word instruction. */ 121 122 if op_mnemonic_$op_mnemonic(opcode).num_words > 1 123 124 then do; /* This is a multi-word instr. */ 125 call multi_word_instr; 126 return; 127 end; 128 129 130 /* Now get the pr name if there is one. Note, the presence of the pr field 131** will imply that there is a small offset field. 132**/ 133 if ilc_ptr -> instr.pr_bit 134 135 then do; 136 sym_pr = substr( db_data$names( fixed( ilc_ptr->instr_pr.pr ) ), 1,3) || "|"; 137 offset = ilc_ptr -> instr_pr.offset; 138 end; 139 140 else do; 141 sym_pr = " "; 142 offset = ilc_ptr -> instr.offset; 143 end; 144 145 146 147 /* Now get the tag field. Note, some instructions use their tag fields in non 148** standard ways. Also special processing is required for the "ic" modifier. 149**/ 150 151 if op_mnemonic_$op_mnemonic(opcode).num_desc = 0 152 153 then do; /* Standard tag field. */ 154 sym_tag = db_data$tags(fixed(ilc_ptr->instr.tag)); 155 if sym_tag = ",ic" 156 then call ic_modifier; 157 end; 158 159 160 /* Non standard tag field. Get octal representation. */ 161 162 else call ioa_$rsnnl(",^o", sym_tag, string_len, fixed(ilc_ptr->instr.tag, 17)); 163 164 165 166 /* Now generate the return string. */ 167 168 call ioa_$rsnnl("^6o ^w ^8a^a^o^a^a", ret_string, string_len, 169 real_ilc, ilc_ptr -> word, mnemonic, 170 sym_pr, offset, sym_tag, note); 171 172 173 return; 174 175 176 with_ilc: entry(data_ptr, ret_string, instr_word_num, arg_ilc); 177 178 dcl arg_ilc fixed bin(18); 179 180 /* This entry is used when the instruction being disassembled is in the 181** break map. The fourth argument contains the original offset of the instrucion. 182**/ 183 184 185 real_ilc = arg_ilc; 186 go to join; 187 /* */ 188 instruction_word(2): 189 instruction_word(3): 190 instruction_word(4): 191 192 /* make sure we point to the right word */ 193 194 real_ilc = real_ilc + instr_word_num - 1; 195 ilc_ptr = addrel(ilc_ptr, instr_word_num - 1); 196 197 call ioa_$rsnnl ("^6o ^w^-^5x(EIS desc.)", 198 ret_string, string_len, real_ilc, ilc_ptr -> word ); 199 200 return; 201 multi_word_instr: procedure; 202 203 204 /* This procedure returns a string that will print a multi-word instruction. 205** We don't want to actually dissassemble it. We will just print a note telling 206** that it is a multi-word instruction and then the octal representation of the 207** of the instruction word. 208**/ 209 210 211 /* We must test to see if we have to return the number of words in this instruction. 212** If the argument instr_word_num = 0 then the caller does not want us to return 213** this data. 214**/ 215 216 if instr_word_num = 1 217 218 then instr_word_num = op_mnemonic_$op_mnemonic(opcode).num_words; 219 220 221 call ioa_$rsnnl ("^6o ^w ^8a (EIS)", 222 ret_string, string_len, 223 real_ilc, ilc_ptr -> word, mnemonic); 224 225 226 227 end multi_word_instr; 228 /* */ 229 ic_modifier: procedure; 230 231 232 /* This procedure produces a special note which is appended to the end of a 233** dissassembled instruction which uses ic modification. 234**/ 235 236 if ilc_ptr->instr.pr_bit /* If there is a pr field just forget */ 237 then return; /* it. Too complicated and too rare to 238* * worry about. */ 239 240 /* No pr field implies that the computed address of the instruction will be in 241** the procedure segment. We will try to retrieve the word the computed address 242** references. If the computed address is out of the bounds of the segment then 243** we will set up a special note. 244**/ 245 246 on condition (out_of_bounds) 247 248 begin; /* Execute here only if out of bounds 249* * condition signalled. */ 250 251 note = " (address not in seg)"; /* Set up special note. */ 252 253 goto revert_oob_cond; /* Go eliminate the condition. */ 254 255 end; 256 257 258 /* The next statement is executed after the "on" statement. This is where 259** the out of bounds may occur. 260**/ 261 262 ic_word = addrel(ptr(ilc_ptr, real_ilc), offset) -> word; 263 264 265 revert_oob_cond: 266 267 revert condition (out_of_bounds); /* Turn off condition. */ 268 269 /* If note not equal to blank then the condition was signalled and we will 270** just return. If it is still blank then the computed address was within 271** the bounds of the segment. Thus the note will contain the computed 272** address and the word that it references. 273**/ 274 275 if note ^= " " then return; 276 277 note_offset = offset + real_ilc; 278 279 call ioa_$rsnnl ("^- ^6o ^w", note, string_len, note_offset, ic_word); 280 281 282 end ic_modifier; 283 284 285 286 end disassemble; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 04/07/83 1051.5 disassemble.pl1 >spec>on>pl1-dir>disassemble.pl1 81 1 05/06/74 1741.6 db_inst.incl.pl1 >ldd>include>db_inst.incl.pl1 83 2 11/22/74 1603.5 db_data_map.incl.pl1 >ldd>include>db_data_map.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. addrel builtin function dcl 79 ref 195 262 arg_ilc parameter fixed bin(18,0) dcl 178 ref 176 185 data_ptr parameter pointer dcl 23 ref 11 11 85 87 176 db_data$names 000014 external static char(4) array dcl 2-10 ref 136 db_data$tags 000016 external static char(4) array dcl 2-12 ref 154 fixed builtin function dcl 79 ref 85 93 136 154 162 162 ic_word 000117 automatic fixed bin(35,0) dcl 69 set ref 262* 279* ilc_ptr 000120 automatic pointer dcl 1-10 set ref 87* 93 133 136 137 142 154 162 162 168 195* 195 197 221 236 262 instr based structure level 1 dcl 1-13 instr_pr based structure level 1 dcl 1-21 instr_word_num parameter fixed bin(17,0) dcl 23 set ref 11 11 104 111 176 188 195 216 216* ioa_$rsnnl 000012 constant entry external dcl 76 ref 162 168 197 221 279 mnemonic 000104 automatic char(6) unaligned dcl 55 set ref 95* 168* 221* note 000110 automatic char(24) unaligned dcl 55 set ref 90* 168* 251* 275 279* note_offset 000103 automatic fixed bin(17,0) dcl 53 set ref 277* 279* num_desc 1(21) 000010 external static fixed bin(5,0) array level 2 packed unaligned dcl 43 ref 151 num_words 1(27) 000010 external static fixed bin(8,0) array level 2 packed unaligned dcl 43 ref 104 116 216 offset 0(03) based fixed bin(14,0) level 2 in structure "instr_pr" packed unaligned dcl 1-21 in procedure "disassemble" ref 137 offset 000102 automatic fixed bin(17,0) dcl 49 in procedure "disassemble" set ref 137* 142* 168* 262 277 offset based fixed bin(17,0) level 2 in structure "instr" packed unaligned dcl 1-13 in procedure "disassemble" ref 142 op_mnemonic_$op_mnemonic 000010 external static structure array level 1 dcl 43 opcode 000010 external static char(6) array level 2 in structure "op_mnemonic_$op_mnemonic" packed unaligned dcl 43 in procedure "disassemble" ref 95 opcode 000101 automatic fixed bin(17,0) dcl 49 in procedure "disassemble" set ref 93* 95 104 116 151 216 opcode 0(18) based bit(10) level 2 in structure "instr" packed unaligned dcl 1-13 in procedure "disassemble" ref 93 out_of_bounds 000000 stack reference condition dcl 74 ref 246 265 pr based bit(3) level 2 packed unaligned dcl 1-21 ref 136 pr_bit 0(29) based bit(1) level 2 packed unaligned dcl 1-13 ref 133 236 real_ilc 000100 automatic fixed bin(18,0) dcl 39 set ref 85* 168* 185* 188* 188 197* 221* 262 277 rel builtin function dcl 79 ref 85 ret_string parameter varying char(72) dcl 23 set ref 11 11 107* 168* 176 197* 221* string_len 000116 automatic fixed bin(17,0) dcl 64 set ref 162* 168* 197* 221* 279* substr builtin function dcl 79 ref 136 sym_pr 000106 automatic char(4) unaligned dcl 55 set ref 136* 141* 168* sym_tag 000107 automatic char(4) unaligned dcl 55 set ref 154* 155 162* 168* tag 0(30) based bit(6) level 2 packed unaligned dcl 1-13 ref 154 162 162 word based fixed bin(35,0) dcl 67 set ref 168* 197* 221* 262 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. db_data$acv_names external static char(24) array dcl 2-16 db_data$fault_names external static char(20) array dcl 2-14 db_data$ipr_names external static char(24) array dcl 2-18 db_data$n_regs external static fixed bin(17,0) dcl 2-8 NAMES DECLARED BY EXPLICIT CONTEXT. disassemble 000104 constant entry external dcl 11 dissassemble 000114 constant entry external dcl 11 ic_modifier 000517 constant entry internal dcl 229 ref 155 instruction_word 000000 constant label array(0:4) dcl 116 ref 111 join 000127 constant label dcl 87 ref 186 multi_word_instr 000440 constant entry internal dcl 201 ref 125 revert_oob_cond 000564 constant label dcl 265 ref 253 with_ilc 000363 constant entry external dcl 176 NAME DECLARED BY CONTEXT OR IMPLICATION. ptr builtin function ref 262 STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 746 766 633 756 Length 1176 633 20 173 113 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME disassemble 184 external procedure is an external procedure. multi_word_instr internal procedure shares stack frame of external procedure disassemble. ic_modifier 96 internal procedure enables or reverts conditions. on unit on line 246 64 on unit STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME disassemble 000100 real_ilc disassemble 000101 opcode disassemble 000102 offset disassemble 000103 note_offset disassemble 000104 mnemonic disassemble 000106 sym_pr disassemble 000107 sym_tag disassemble 000110 note disassemble 000116 string_len disassemble 000117 ic_word disassemble 000120 ilc_ptr disassemble THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out_desc call_int_this return tra_ext enable ext_entry int_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. ioa_$rsnnl THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. db_data$names db_data$tags op_mnemonic_$op_mnemonic LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 11 000100 85 000121 87 000127 90 000133 93 000136 95 000142 104 000152 107 000162 108 000170 111 000171 116 000173 125 000175 126 000176 133 000177 136 000202 137 000212 138 000216 141 000217 142 000221 151 000224 154 000230 155 000234 157 000245 162 000246 168 000276 173 000355 176 000356 185 000370 186 000373 188 000374 195 000400 197 000404 200 000437 201 000440 216 000441 221 000455 227 000515 229 000516 236 000524 246 000530 251 000544 253 000551 262 000554 265 000564 275 000565 277 000572 279 000575 282 000631 ----------------------------------------------------------- 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