?? RIGHT := 110 ??                                                                                            
?? NEWTITLE := 'NOS/VE Dump Analyzer : Common Analyzer Routines' ??                                           
MODULE dum$common_analyzer_routines;                                                                          
                                                                                                              
{ PURPOSE:                                                                                                    
{   This module contains the common routines for the analyze_dump utility.                                    
                                                                                                              
?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??                                      
?? PUSH (LISTEXT := ON) ??                                                                                    
*copyc clt$data_value                                                                                         
*copyc dst$r_pointer                                                                                          
*copyc due$exception_condition_codes                                                                          
*copyc dut$default_parameter_list                                                                             
*copyc dut$dft_data_types                                                                                     
*copyc dut$did_record_type                                                                                    
*copyc dut$dump_information                                                                                   
?? POP ??                                                                                                     
*copyc clp$change_pdt                                                                                         
*copyc clp$convert_integer_to_rjstring                                                                        
*copyc clp$convert_integer_to_string                                                                          
*copyc clp$evaluate_parameters                                                                                
*copyc clp$horizontal_tab_display                                                                             
*copyc clp$new_display_line                                                                                   
*copyc clp$put_display                                                                                        
*copyc clp$put_partial_display                                                                                
*copyc dup$access_real_memory                                                                                 
*copyc osp$append_status_integer                                                                              
*copyc osp$append_status_parameter                                                                            
*copyc osp$format_message                                                                                     
*copyc osp$get_message_level                                                                                  
*copyc osp$set_status_abnormal                                                                                
?? EJECT ??                                                                                                   
*copyc duv$default_parameters                                                                                 
*copyc duv$dump_environment_p                                                                                 
*copyc duv$execution_environment                                                                              
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??                                      
                                                                                                              
  TYPE                                                                                                        
    t$dump_information = RECORD                                                                               
      determined: boolean,                                                                                    
      data: dut$dump_information,                                                                             
    RECEND;                                                                                                   
?? EJECT ??                                                                                                   
  VAR                                                                                                         
    v$control_codes_to_space: [READ] string (256) := '            '                                           
      CAT '                     !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkl'
      CAT 'mnopqrstuvwxyz{|}~                                                                                '
      CAT '                                                 ',                                                
                                                                                                              
    v$dump_information: t$dump_information := [FALSE, [duc$di_dt_unknown,                                     
          [[duc$di_ic_unknown, 0, duc$di_im_unknown], [duc$di_ic_unknown, 0, duc$di_im_unknown]],             
          duc$di_tt_unknown]];                                                                                
                                                                                                              
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'determine_dump_type', EJECT ??                                                                
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure determines the dump type.  The IOU model number must be first known.                       
                                                                                                              
  PROCEDURE determine_dump_type;                                                                              
                                                                                                              
    VAR                                                                                                       
      cell_p: ^cell,                                                                                          
      local_status: ost$status,                                                                               
      memory_p: ^cell,                                                                                        
      new_byte_size: ost$segment_length,                                                                      
      restart_file_seq_p: ^SEQ ( * ),                                                                         
      utility_p: ^dut$did_identifier_entry;                                                                   
                                                                                                              
    IF NOT duv$dump_environment_p^.dump_identifier.available THEN                                             
      dup$access_real_memory (1, 0, memory_p, new_byte_size, local_status);                                   
      IF NOT local_status.normal THEN                                                                         
        v$dump_information.data.dump_type := duc$di_dt_dual_state;                                            
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      IF v$dump_information.data.iou [0].model = duc$di_im_i0_5x THEN                                         
        v$dump_information.data.dump_type := duc$di_dt_es0;                                                   
      ELSE                                                                                                    
        v$dump_information.data.dump_type := duc$di_dt_edd;                                                   
      IFEND;                                                                                                  
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    restart_file_seq_p := duv$execution_environment.data_file_p^.segment_pointer.sequence_pointer;            
    cell_p := #ADDRESS (#RING (restart_file_seq_p), #SEGMENT (restart_file_seq_p),                            
          duv$dump_environment_p^.dump_identifier.first_byte);                                                
    RESET restart_file_seq_p TO cell_p;                                                                       
    NEXT utility_p IN restart_file_seq_p;                                                                     
    IF utility_p = NIL THEN                                                                                   
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
    IF utility_p^.value = duc$did_edd_dump THEN                                                               
      v$dump_information.data.dump_type := duc$di_dt_edd;                                                     
    ELSEIF utility_p^.value = duc$did_dual_state_dump THEN                                                    
      v$dump_information.data.dump_type := duc$di_dt_dual_state;                                              
    ELSEIF utility_p^.value = duc$did_es0_dump THEN                                                           
      v$dump_information.data.dump_type := duc$di_dt_es0;                                                     
    ELSEIF utility_p^.value = duc$did_cy2000_dump THEN                                                        
      v$dump_information.data.dump_type := duc$di_dt_cy2000;                                                  
    ELSE                                                                                                      
      v$dump_information.data.dump_type := duc$di_dt_unknown;                                                 
    IFEND;                                                                                                    
                                                                                                              
  PROCEND determine_dump_type;                                                                                
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'determine_iou_information', EJECT ??                                                          
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure determines information about the iou(s).                                                   
                                                                                                              
  PROCEDURE determine_iou_information;                                                                        
                                                                                                              
    VAR                                                                                                       
      iou_index: 0 .. duc$de_maximum_ious,                                                                    
      register: dut$de_maintenance_register;                                                                  
                                                                                                              
    FOR iou_index := 0 TO duc$de_maximum_ious DO                                                              
      dup$retrieve_register (duc$de_iou, iou_index, 10(16), register);                                        
      IF register.available THEN                                                                              
        IF (register.value [duc$de_model_byte_number] >= 50(16)) AND                                          
              (register.value [duc$de_model_byte_number] <= 5F(16)) THEN                                      
          v$dump_information.data.iou [iou_index].model := duc$di_im_i0_5x;                                   
          v$dump_information.data.iou [iou_index].class := duc$di_ic_iou_16k;                                 
          v$dump_information.data.iou [iou_index].pp_word_size := 16384;                                      
        ELSEIF (register.value [duc$de_model_byte_number] >= 10(16)) AND                                      
              (register.value [duc$de_model_byte_number] <= 16(16)) THEN                                      
          v$dump_information.data.iou [iou_index].model := duc$di_im_i1_1x;                                   
          v$dump_information.data.iou [iou_index].class := duc$di_ic_iou_4k;                                  
          v$dump_information.data.iou [iou_index].pp_word_size := 4096;                                       
        ELSEIF register.value [duc$de_model_byte_number] = 20(16) THEN                                        
          v$dump_information.data.iou [iou_index].model := duc$di_im_i2_20;                                   
          v$dump_information.data.iou [iou_index].class := duc$di_ic_iou_4k;                                  
          v$dump_information.data.iou [iou_index].pp_word_size := 4096;                                       
        ELSEIF register.value [duc$de_model_byte_number] = 40(16) THEN                                        
          v$dump_information.data.iou [iou_index].model := duc$di_im_i4_40;                                   
          v$dump_information.data.iou [iou_index].class := duc$di_ic_iou_8k;                                  
          v$dump_information.data.iou [iou_index].pp_word_size := 8192;                                       
        ELSEIF register.value [duc$de_model_byte_number] = 42(16) THEN                                        
          v$dump_information.data.iou [iou_index].model := duc$di_im_i4_42;                                   
          v$dump_information.data.iou [iou_index].class := duc$di_ic_iou_8k;                                  
          v$dump_information.data.iou [iou_index].pp_word_size := 8192;                                       
        ELSEIF register.value [duc$de_model_byte_number] = 43(16) THEN                                        
          v$dump_information.data.iou [iou_index].model := duc$di_im_i4_43;                                   
          v$dump_information.data.iou [iou_index].class := duc$di_ic_iou_8k;                                  
          v$dump_information.data.iou [iou_index].pp_word_size := 8192;                                       
        ELSEIF register.value [duc$de_model_byte_number] = 44(16) THEN                                        
          v$dump_information.data.iou [iou_index].model := duc$di_im_i4_44;                                   
          v$dump_information.data.iou [iou_index].class := duc$di_ic_iou_8k;                                  
          v$dump_information.data.iou [iou_index].pp_word_size := 8192;                                       
        ELSEIF register.value [duc$de_model_byte_number] = 46(16) THEN                                        
          v$dump_information.data.iou [iou_index].model := duc$di_im_i4_46;                                   
          v$dump_information.data.iou [iou_index].class := duc$di_ic_iou_8k;                                  
          v$dump_information.data.iou [iou_index].pp_word_size := 8192;                                       
        ELSE                                                                                                  
          v$dump_information.data.iou [iou_index].model := duc$di_im_unknown;                                 
          v$dump_information.data.iou [iou_index].class := duc$di_ic_unknown;                                 
          v$dump_information.data.iou [iou_index].pp_word_size := 0;                                          
        IFEND;                                                                                                
      IFEND;                                                                                                  
    FOREND;                                                                                                   
                                                                                                              
  PROCEND determine_iou_information;                                                                          
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'determine_tape_type', EJECT ??                                                                
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure determines the tape type.                                                                  
                                                                                                              
  PROCEDURE determine_tape_type;                                                                              
                                                                                                              
    VAR                                                                                                       
      cell_p: ^cell,                                                                                          
      edd_data_p: ^dut$did_edd_data,                                                                          
      restart_file_seq_p: ^SEQ ( * ),                                                                         
      utility_p: ^dut$did_identifier_entry;                                                                   
                                                                                                              
    IF NOT duv$dump_environment_p^.dump_identifier.available THEN                                             
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    restart_file_seq_p := duv$execution_environment.data_file_p^.segment_pointer.sequence_pointer;            
    cell_p := #ADDRESS (#RING (restart_file_seq_p), #SEGMENT (restart_file_seq_p),                            
          duv$dump_environment_p^.dump_identifier.first_byte);                                                
    RESET restart_file_seq_p TO cell_p;                                                                       
    NEXT utility_p IN restart_file_seq_p;                                                                     
    IF utility_p = NIL THEN                                                                                   
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    IF utility_p^.value = duc$did_dual_state_dump THEN                                                        
      v$dump_information.data.tape_type := duc$di_tt_unknown;                                                 
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    NEXT edd_data_p IN restart_file_seq_p;                                                                    
    IF edd_data_p = NIL THEN                                                                                  
      v$dump_information.data.tape_type := duc$di_tt_unknown;                                                 
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    IF edd_data_p^.tape_information.tape_type.value = 1 THEN                                                  
      v$dump_information.data.tape_type := duc$di_tt_1;                                                       
    ELSEIF edd_data_p^.tape_information.tape_type.value = 2 THEN                                              
      v$dump_information.data.tape_type := duc$di_tt_2;                                                       
    ELSEIF edd_data_p^.tape_information.tape_type.value = 3 THEN                                              
      v$dump_information.data.tape_type := duc$di_tt_3;                                                       
    ELSEIF edd_data_p^.tape_information.tape_type.value = 4 THEN                                              
      v$dump_information.data.tape_type := duc$di_tt_4;                                                       
    ELSEIF edd_data_p^.tape_information.tape_type.value = 40(8) THEN                                          
      v$dump_information.data.tape_type := duc$di_tt_40;                                                      
    ELSEIF edd_data_p^.tape_information.tape_type.value = 41(8) THEN                                          
      v$dump_information.data.tape_type := duc$di_tt_41;                                                      
    ELSE                                                                                                      
      v$dump_information.data.tape_type := duc$di_tt_unknown;                                                 
    IFEND;                                                                                                    
                                                                                                              
  PROCEND determine_tape_type;                                                                                
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$determine_dump_information', EJECT ??                                                     
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure returns information about the dump.                                                        
                                                                                                              
  PROCEDURE [XDCL] dup$determine_dump_information                                                             
    (VAR dump_information: dut$dump_information);                                                             
                                                                                                              
    IF v$dump_information.determined THEN                                                                     
      dump_information := v$dump_information.data;                                                            
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    determine_iou_information;                                                                                
    determine_dump_type;                                                                                      
    determine_tape_type;                                                                                      
    v$dump_information.determined := TRUE;                                                                    
    dump_information := v$dump_information.data;                                                              
                                                                                                              
  PROCEND dup$determine_dump_information;                                                                     
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$display_data', EJECT ??                                                                   
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure displays the requested data in numeric format and/or ascii format.                         
                                                                                                              
  PROCEDURE [XDCL] dup$display_data                                                                           
    (    display_option_list_p: ^clt$data_value;                                                              
         cm_word_structure: boolean;                                                                          
         radix: 8 .. 16;                                                                                      
         address: ost$segment_length;                                                                         
         total_units: integer;                                                                                
     VAR display_control: clt$display_control;                                                                
     VAR restart_file_seq_p: ^SEQ ( * );                                                                      
     VAR end_of_input_file: boolean;                                                                          
     VAR status: ost$status);                                                                                 
                                                                                                              
    CONST                                                                                                     
      c$cm_bytes_in_item = 8,                                                                                 
      c$cm_size_of_address = 8,                                                                               
      c$cm_size_of_address_8 = 10,                                                                            
      c$cm_space_for_numeric_byte = 2,                                                                        
      c$cm_space_for_numeric_word = 30,                                                                       
                                                                                                              
      c$pp_bytes_per_item = c$pp_bytes_per_word * c$pp_words_per_item,                                        
      c$pp_bytes_per_word = 2,                                                                                
      c$pp_size_of_address = 5,                                                                               
      c$pp_words_per_item = 8,                                                                                
                                                                                                              
      c$spaces_bet_ad_and_display = 2;                                                                        
                                                                                                              
    TYPE                                                                                                      
      t$byte = PACKED RECORD                                                                                  
        left_part: 0 .. 0f(16),                                                                               
        right_part: 0 .. 0f(16),                                                                              
      RECEND,                                                                                                 
                                                                                                              
      t$cm_word_or_set = RECORD                                                                               
        CASE boolean OF                                                                                       
        = TRUE =                                                                                              
          word_part: integer,                                                                                 
        = FALSE =                                                                                             
          set_part: t$cm_word_set,                                                                            
        CASEND,                                                                                               
      RECEND,                                                                                                 
                                                                                                              
      t$cm_word_set = SET OF 0 .. 63,                                                                         
                                                                                                              
      t$display_code_cm = PACKED RECORD                                                                       
        CASE boolean OF                                                                                       
        = TRUE =                                                                                              
          whole_data: integer,                                                                                
        = FALSE =                                                                                             
          unused: 0 .. 0f(16),                                                                                
          data_1: PACKED ARRAY [1 .. 5] OF 0 .. 77(8),                                                        
          data_2: PACKED ARRAY [1 .. 5] OF 0 .. 77(8),                                                        
        CASEND,                                                                                               
      RECEND,                                                                                                 
                                                                                                              
      t$display_code_pp = PACKED RECORD                                                                       
        CASE boolean OF                                                                                       
        = TRUE =                                                                                              
          whole_data: 0 .. 0ffff(16),                                                                         
        = FALSE =                                                                                             
          unused: 0 .. 0f(16),                                                                                
          data: PACKED ARRAY [1 .. 2] OF 0 .. 77(8),                                                          
        CASEND,                                                                                               
      RECEND,                                                                                                 
                                                                                                              
      t$pp_word = PACKED RECORD                                                                               
        CASE boolean OF                                                                                       
        = TRUE =                                                                                              
          modifier: 0 .. 0f(16),                                                                              
          twelve_bits: 0 .. 0fff(16),                                                                         
        = FALSE =                                                                                             
          value: 0 .. 0ffff(16),                                                                              
        CASEND,                                                                                               
      RECEND;                                                                                                 
                                                                                                              
    VAR                                                                                                       
      display_code_conversion: [STATIC] ARRAY [0 .. 77(8)] OF char := [' ', 'A', 'B', 'C', 'D', 'E', 'F',     
            'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',    
            'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '-', '*', '/', '(', ')', '$', '=',    
            ' ', ',', '.', '#', '[', ']', '%', '"', '_', '!', '&', '''', '?', '<', '>', '@', '\', '^', ';'],  
      hex_chars: [STATIC] ARRAY [0 .. 0f(16)] OF char := ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9',   
            'A', 'B', 'C', 'D', 'E', 'F'];                                                                    
                                                                                                              
    VAR                                                                                                       
      ascii_display: boolean,                                                                                 
      ascii_item_p: ^string ( * ),                                                                            
      ascii_tab_column: 1 .. 256,                                                                             
      byte_count: 1 .. 2,                                                                                     
      byte_data_p: ^0 .. 0ff(16),                                                                             
      byte_p: ^t$byte,                                                                                        
      char_index: 0 .. 0ff(16),                                                                               
      cm_word_index: 1 .. 22,                                                                                 
      cm_word_or_set_p: ^t$cm_word_or_set,                                                                    
      cm_word_string: string (22),                                                                            
      current_item: 1 .. 63,                                                                                  
      current_pp_word: 1 .. c$pp_words_per_item,                                                              
      display_address: integer,                                                                               
      display_code_cm: t$display_code_cm,                                                                     
      display_code_display: boolean,                                                                          
      display_code_pp: t$display_code_pp,                                                                     
      half_half_words: 1 .. 2,                                                                                
      half_words: 1 .. 2,                                                                                     
      ignore_status: ost$status,                                                                              
      index: 0 .. 0ff(16),                                                                                    
      integer_p: ^integer,                                                                                    
      integer_string: ost$string,                                                                             
      items_per_line: 0 .. 100,                                                                               
      line_buffer_p: ^string ( * ),                                                                           
      line_index: 1 .. 256,                                                                                   
      list_p: ^clt$data_value,                                                                                
      local_status: ost$status,                                                                               
      numeric_display: boolean,                                                                               
      option_p: ^clt$data_value,                                                                              
      page_width: amt$page_width,                                                                             
      pp_ascii_units: 0 .. 132,                                                                               
      pp_word_data_p: ^0 .. 0ffff(16),                                                                        
      pp_word_p: ^t$pp_word,                                                                                  
      previous_line_p: ^string ( * ),                                                                         
      repeated_lines: integer,                                                                                
      reset_mark_p: ^cell,                                                                                    
      size_of_address: 5 .. 10,                                                                               
      space_for_ascii_item: 0 .. 132,                                                                         
      space_for_numeric_item: 0 .. 132,                                                                       
      space_for_numeric_word: 4 .. 6,                                                                         
      temp_cm_word_or_set: t$cm_word_or_set,                                                                  
      units_displayed: integer,                                                                               
      units_this_line: 0 .. 132;                                                                              
                                                                                                              
    status.normal := TRUE;                                                                                    
    end_of_input_file := FALSE;                                                                               
                                                                                                              
    IF cm_word_structure THEN                                                                                 
      IF radix = 16 THEN                                                                                      
        size_of_address := c$cm_size_of_address;                                                              
      ELSE                                                                                                    
        size_of_address := c$cm_size_of_address_8;                                                            
      IFEND;                                                                                                  
    ELSE                                                                                                      
      size_of_address := c$pp_size_of_address;                                                                
    IFEND;                                                                                                    
                                                                                                              
    { Determine whether to display the numeric and/or the ascii/display code data.  If ASCII and DISPLAY_CODE 
    { are both selected only ASCII will be displayed.                                                         
                                                                                                              
    numeric_display := FALSE;                                                                                 
    ascii_display := FALSE;                                                                                   
    display_code_display := FALSE;                                                                            
    list_p := display_option_list_p;                                                                          
    WHILE list_p <> NIL DO                                                                                    
      option_p := list_p^.element_value;                                                                      
      list_p := list_p^.link;                                                                                 
      IF option_p^.keyword_value = 'NUMERIC' THEN                                                             
        numeric_display := TRUE;                                                                              
      ELSEIF option_p^.keyword_value = 'ASCII' THEN                                                           
        ascii_display := TRUE;                                                                                
      ELSEIF option_p^.keyword_value = 'DISPLAY_CODE' THEN                                                    
        display_code_display := TRUE;                                                                         
      IFEND;                                                                                                  
    WHILEND;                                                                                                  
    IF ascii_display AND display_code_display THEN                                                            
      display_code_display := FALSE;                                                                          
    IFEND;                                                                                                    
                                                                                                              
    { Setup the page width for the output file.                                                               
                                                                                                              
    IF display_control.page_width > 132 THEN                                                                  
      page_width := 132;                                                                                      
    ELSEIF display_control.page_width < 40 THEN                                                               
      page_width := 40;                                                                                       
    ELSE                                                                                                      
      page_width := display_control.page_width;                                                               
    IFEND;                                                                                                    
                                                                                                              
    { Determine the size of the numeric item and the ascii item.                                              
                                                                                                              
    IF cm_word_structure THEN                                                                                 
      IF numeric_display THEN                                                                                 
        IF radix = 16 THEN                                                                                    
          space_for_numeric_item := c$cm_bytes_in_item * c$cm_space_for_numeric_byte + 6;                     
        ELSE                                                                                                  
          space_for_numeric_item := c$cm_space_for_numeric_word;                                              
        IFEND;                                                                                                
      ELSE                                                                                                    
        space_for_numeric_item := 0;                                                                          
      IFEND;                                                                                                  
      IF ascii_display OR display_code_display THEN                                                           
        space_for_ascii_item := c$cm_bytes_in_item;                                                           
      ELSE                                                                                                    
        space_for_ascii_item := 0;                                                                            
      IFEND;                                                                                                  
    ELSE  { pp_word_structure                                                                                 
      IF numeric_display THEN                                                                                 
        IF radix < 16 THEN                                                                                    
          space_for_numeric_word := 6;                                                                        
        ELSE                                                                                                  
          space_for_numeric_word := 4;                                                                        
        IFEND;                                                                                                
        space_for_numeric_item := c$pp_words_per_item * (space_for_numeric_word + 1);                         
      ELSE                                                                                                    
        space_for_numeric_item := 0;                                                                          
      IFEND;                                                                                                  
      IF ascii_display OR display_code_display THEN                                                           
        space_for_ascii_item := c$pp_bytes_per_item;                                                          
      ELSE                                                                                                    
        space_for_ascii_item := 0;                                                                            
      IFEND;                                                                                                  
    IFEND;                                                                                                    
                                                                                                              
    { Determine how many items will be displayed per line.                                                    
                                                                                                              
    items_per_line := (page_width - size_of_address - c$spaces_bet_ad_and_display) DIV                        
          (space_for_ascii_item + space_for_numeric_item);                                                    
    IF items_per_line = 0 THEN                                                                                
      items_per_line := 1;                                                                                    
      page_width := size_of_address + c$spaces_bet_ad_and_display + space_for_ascii_item +                    
            space_for_numeric_item;                                                                           
    IFEND;                                                                                                    
    ascii_tab_column := size_of_address + c$spaces_bet_ad_and_display +                                       
          (items_per_line * space_for_numeric_item) + 1;                                                      
                                                                                                              
    { Reserve space to hold a line for the output file.                                                       
                                                                                                              
    PUSH line_buffer_p: [page_width];                                                                         
    PUSH previous_line_p: [page_width];                                                                       
    IF (line_buffer_p = NIL) OR (previous_line_p = NIL) THEN                                                  
      osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);                            
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    previous_line_p^ := ' ';                                                                                  
    repeated_lines := 0;                                                                                      
    display_address := address;                                                                               
    units_displayed := 0;                                                                                     
    units_this_line := items_per_line * space_for_ascii_item;                                                 
                                                                                                              
    WHILE TRUE DO                                                                                             
      line_buffer_p^ := ' ';                                                                                  
      line_index := 1;                                                                                        
                                                                                                              
      { Place the display address in the temporary output line.                                               
                                                                                                              
      line_buffer_p^ (line_index, size_of_address) := 'XXXXX';                                                
      clp$convert_integer_to_rjstring (display_address, radix, FALSE, '0',                                    
            line_buffer_p^ (line_index, size_of_address), ignore_status);                                     
      line_index := line_index + size_of_address + c$spaces_bet_ad_and_display;                               
                                                                                                              
      { Mark the spot in the restart file so that it can be reset to display the ascii portion                
      { after the numeric portion has been displayed.                                                         
                                                                                                              
      NEXT reset_mark_p IN restart_file_seq_p;                                                                
      IF reset_mark_p = NIL THEN                                                                              
        end_of_input_file := TRUE;                                                                            
        osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);                          
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      RESET restart_file_seq_p TO reset_mark_p;                                                               
                                                                                                              
      { Add the numeric portion to the temporary output line.                                                 
                                                                                                              
      IF numeric_display THEN                                                                                 
        units_this_line := 0;                                                                                 
        pp_ascii_units := 0;                                                                                  
                                                                                                              
       /format_numeric/                                                                                       
        BEGIN                                                                                                 
          IF cm_word_structure THEN                                                                           
            IF radix = 16 THEN                                                                                
              FOR current_item := 1 TO items_per_line DO                                                      
                FOR half_words := 1 TO 2 DO                                                                   
                  FOR half_half_words := 1 TO 2 DO                                                            
                    FOR byte_count := 1 TO 2 DO                                                               
                      NEXT byte_p IN restart_file_seq_p;                                                      
                      IF byte_p = NIL THEN                                                                    
                        osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);          
                        RETURN;  {---->                                                                       
                      IFEND;                                                                                  
                      line_buffer_p^ (line_index) := hex_chars [byte_p^.left_part];                           
                      line_buffer_p^ (line_index + 1) := hex_chars [byte_p^.right_part];                      
                      line_index := line_index + 2;                                                           
                      units_this_line := units_this_line + 1;                                                 
                      units_displayed := units_displayed + 1;                                                 
                      IF units_displayed >= total_units THEN                                                  
                        line_index := ascii_tab_column;                                                       
                        EXIT /format_numeric/;  {---->                                                        
                      IFEND;                                                                                  
                    FOREND;                                                                                   
                    line_index := line_index + 1;                                                             
                  FOREND;                                                                                     
                FOREND;                                                                                       
                line_index := line_index + 2;                                                                 
              FOREND;                                                                                         
                                                                                                              
            ELSE  { cm_word_structure and radix <> 16 }                                                       
                                                                                                              
              FOR current_item := 1 TO items_per_line DO                                                      
                NEXT cm_word_or_set_p IN restart_file_seq_p;                                                  
                IF cm_word_or_set_p = NIL THEN                                                                
                  osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);                
                  RETURN;  {---->                                                                             
                IFEND;                                                                                        
                IF (radix = 8) AND (cm_word_or_set_p^.word_part < 0) THEN                                     
                  temp_cm_word_or_set.set_part := cm_word_or_set_p^.set_part - $t$cm_word_set[0];             
                  cm_word_string := 'XXXXXXXXXXXXXXXXXXXXXX';                                                 
                  clp$convert_integer_to_rjstring (temp_cm_word_or_set.word_part, radix, FALSE, '0',          
                        cm_word_string, ignore_status);                                                       
                  cm_word_string (1) := '1';                                                                  
                ELSEIF radix = 8  THEN                                                                        
                  cm_word_string := 'XXXXXXXXXXXXXXXXXXXXXX';                                                 
                  clp$convert_integer_to_rjstring (cm_word_or_set_p^.word_part, radix, FALSE, '0',            
                        cm_word_string, ignore_status);                                                       
                ELSE                                                                                          
                  clp$convert_integer_to_string (cm_word_or_set_p^.word_part, radix, FALSE, integer_string,   
                        ignore_status);                                                                       
                  cm_word_string := ' ';                                                                      
                  cm_word_string (STRLENGTH(cm_word_string) - integer_string.size + 1, integer_string.size) :=
                        integer_string.value (1, integer_string.size);                                        
                IFEND;                                                                                        
                line_buffer_p^ (line_index, 2) := cm_word_string (1, 2);                                      
                line_index := line_index + 3;                                                                 
                FOR half_words := 1 TO 2 DO                                                                   
                  FOR half_half_words := 1 TO 2 DO                                                            
                    cm_word_index := 3 + ((half_words - 1) * 10) + ((half_half_words - 1) * 5);               
                    line_buffer_p^ (line_index, 5) := cm_word_string (cm_word_index, 5);                      
                    line_index := line_index + 6;                                                             
                  FOREND;                                                                                     
                  line_index := line_index + 1;                                                               
                FOREND;                                                                                       
                line_index := line_index + 1;                                                                 
                units_this_line := units_this_line + 8;                                                       
                units_displayed := units_displayed + 8;                                                       
                IF units_displayed >= total_units THEN                                                        
                  line_index := ascii_tab_column;                                                             
                  EXIT /format_numeric/;  {---->                                                              
                IFEND;                                                                                        
              FOREND;                                                                                         
            IFEND;                                                                                            
                                                                                                              
          ELSE  { pp_word_structure                                                                           
                                                                                                              
            FOR current_item := 1 TO items_per_line DO                                                        
              FOR current_pp_word := 1 TO c$pp_words_per_item DO                                              
                NEXT pp_word_p IN restart_file_seq_p;                                                         
                IF pp_word_p = NIL THEN                                                                       
                  osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);                
                  RETURN;  {---->                                                                             
                IFEND;                                                                                        
                IF pp_word_p^.value = 0 THEN                                                                  
                  line_buffer_p^ (line_index + (space_for_numeric_word - 4), 4) := '----';                    
                ELSEIF (radix = 8) AND (pp_word_p^.modifier = 0) THEN                                         
                  line_buffer_p^ (line_index + 2, 4) := 'XXXX';                                               
                  clp$convert_integer_to_rjstring (pp_word_p^.twelve_bits, 8, FALSE, '0',                     
                        line_buffer_p^ (line_index + 2, 4), ignore_status);                                   
                ELSE                                                                                          
                  line_buffer_p^ (line_index, space_for_numeric_word) := 'XXXXXX';                            
                  clp$convert_integer_to_rjstring (pp_word_p^.value, radix, FALSE, '0',                       
                        line_buffer_p^ (line_index, space_for_numeric_word), ignore_status);                  
                IFEND;                                                                                        
                line_index := line_index + space_for_numeric_word + 1;                                        
                pp_ascii_units := pp_ascii_units + 2;                                                         
                units_this_line := units_this_line + 1;                                                       
                units_displayed := units_displayed + 1;                                                       
                IF units_displayed >= total_units THEN                                                        
                  line_index := ascii_tab_column;                                                             
                  EXIT /format_numeric/;                                                                      
                IFEND;                                                                                        
              FOREND;                                                                                         
            FOREND;                                                                                           
          IFEND;                                                                                              
        END /format_numeric/;                                                                                 
      IFEND;                                                                                                  
                                                                                                              
      { Add the ascii portion to the temporary output line.                                                   
                                                                                                              
      IF ascii_display THEN                                                                                   
        IF NOT numeric_display THEN                                                                           
          IF (total_units - units_displayed) < units_this_line THEN                                           
            units_this_line := total_units - units_displayed;                                                 
          IFEND;                                                                                              
          units_displayed := units_displayed + units_this_line;                                               
          pp_ascii_units := units_this_line;                                                                  
        IFEND;                                                                                                
        RESET restart_file_seq_p TO reset_mark_p;                                                             
        IF cm_word_structure THEN                                                                             
          NEXT ascii_item_p: [units_this_line] IN restart_file_seq_p;                                         
        ELSE                                                                                                  
          NEXT ascii_item_p: [pp_ascii_units] IN restart_file_seq_p;                                          
        IFEND;                                                                                                
        IF ascii_item_p = NIL THEN                                                                            
          osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);                        
          RETURN;  {---->                                                                                     
        IFEND;                                                                                                
        IF cm_word_structure THEN                                                                             
          #TRANSLATE (v$control_codes_to_space, ascii_item_p^, line_buffer_p^ (line_index, units_this_line)); 
        ELSE                                                                                                  
          #TRANSLATE (v$control_codes_to_space, ascii_item_p^, line_buffer_p^ (line_index, pp_ascii_units));  
        IFEND;                                                                                                
      IFEND;                                                                                                  
                                                                                                              
      { Add the display code portion to the temporary output line.                                            
                                                                                                              
      IF display_code_display THEN                                                                            
        IF NOT numeric_display THEN                                                                           
          IF (total_units - units_displayed) < units_this_line THEN                                           
            units_this_line := total_units - units_displayed;                                                 
          IFEND;                                                                                              
          units_displayed := units_displayed + units_this_line;                                               
          pp_ascii_units := units_this_line;                                                                  
        IFEND;                                                                                                
        RESET restart_file_seq_p TO reset_mark_p;                                                             
        IF cm_word_structure THEN                                                                             
          FOR index := 1 TO (units_this_line DIV 8) DO                                                        
            NEXT integer_p IN restart_file_seq_p;                                                             
            display_code_cm.whole_data := integer_p^;                                                         
            FOR char_index := 1 TO 5 DO                                                                       
              line_buffer_p^ (line_index) := display_code_conversion [display_code_cm.data_1 [char_index]];   
              line_index := line_index + 1;                                                                   
             FOREND;                                                                                          
            FOR char_index := 1 TO 5 DO                                                                       
              line_buffer_p^ (line_index) := display_code_conversion [display_code_cm.data_2 [char_index]];   
              line_index := line_index + 1;                                                                   
             FOREND;                                                                                          
           FOREND;                                                                                            
        ELSE                                                                                                  
          FOR index := 1 TO (pp_ascii_units DIV 2) DO                                                         
            NEXT pp_word_data_p IN restart_file_seq_p;                                                        
            display_code_pp.whole_data := pp_word_data_p^;                                                    
            FOR char_index := 1 TO 2 DO                                                                       
              line_buffer_p^ (line_index) := display_code_conversion [display_code_pp.data [char_index]];     
              line_index := line_index + 1;                                                                   
             FOREND;                                                                                          
           FOREND;                                                                                            
        IFEND;                                                                                                
      IFEND;                                                                                                  
                                                                                                              
      { Check if the temporary output line matched the previous line.  Duplicate lines are not displayed.     
                                                                                                              
      IF (line_buffer_p^ (size_of_address + 1, *) = previous_line_p^ (size_of_address + 1, *)) AND            
            (units_displayed < total_units) THEN                                                              
        previous_line_p^ := line_buffer_p^;                                                                   
        repeated_lines := repeated_lines + 1;                                                                 
      ELSE                                                                                                    
        IF repeated_lines > 1 THEN                                                                            
          osp$set_status_abnormal (duc$dump_analyzer_id, due$skipped_lines, '', local_status);                
          osp$append_status_integer (osc$status_parameter_delimiter, repeated_lines, 10, FALSE, local_status);
          dup$display_message (local_status, display_control);                                                
        ELSEIF repeated_lines = 1 THEN                                                                        
          clp$put_display (display_control, previous_line_p^, clc$trim, ignore_status);                       
        IFEND;                                                                                                
        repeated_lines := 0;                                                                                  
        clp$put_display (display_control, line_buffer_p^, clc$trim, ignore_status);                           
        previous_line_p^ := line_buffer_p^;                                                                   
      IFEND;                                                                                                  
                                                                                                              
      IF units_displayed >= total_units THEN                                                                  
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      display_address := display_address + units_this_line;                                                   
    WHILEND;                                                                                                  
                                                                                                              
  PROCEND dup$display_data;                                                                                   
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$display_message', EJECT ??                                                                
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure formats a status message and displays it to the user.                                      
                                                                                                              
  PROCEDURE [XDCL] dup$display_message                                                                        
    (    status_message: ost$status;                                                                          
     VAR display_control: clt$display_control);                                                               
                                                                                                              
    VAR                                                                                                       
      line_count_p: ^ost$status_message_line_count,                                                           
      line_counter: ost$status_message_line_count,                                                            
      line_size_p: ^ost$status_message_line_size,                                                             
      local_status: ost$status,                                                                               
      message_level: ost$status_message_level,                                                                
      message_line_p: ^string ( * ),                                                                          
      message_width: ost$max_status_message_line,                                                             
      message_p: ^ost$status_message;                                                                         
                                                                                                              
    osp$get_message_level (message_level, local_status);                                                      
    IF NOT local_status.normal THEN                                                                           
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    PUSH message_p;                                                                                           
    RESET message_p;                                                                                          
    IF message_p = NIL THEN                                                                                   
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    IF display_control.page_width < LOWERVALUE (message_width) THEN                                           
      message_width := LOWERVALUE (message_width);                                                            
    ELSEIF display_control.page_width > UPPERVALUE (message_width) THEN                                       
      message_width := UPPERVALUE (message_width);                                                            
    ELSE                                                                                                      
      message_width := display_control.page_width;                                                            
    IFEND;                                                                                                    
    osp$format_message (status_message, message_level, message_width, message_p^, local_status);              
    IF NOT local_status.normal THEN                                                                           
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    RESET message_p;                                                                                          
    NEXT line_count_p IN message_p;                                                                           
    IF line_count_p = NIL THEN                                                                                
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    FOR line_counter := 1 TO line_count_p^ DO                                                                 
      NEXT line_size_p IN message_p;                                                                          
      IF line_size_p = NIL THEN                                                                               
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      IF line_size_p^ > 0 THEN                                                                                
        NEXT message_line_p: [line_size_p^] IN message_p;                                                     
        IF message_line_p = NIL THEN                                                                          
          RETURN;  {---->                                                                                     
        IFEND;                                                                                                
        clp$put_display (display_control, message_line_p^, clc$no_trim, local_status);                        
        IF NOT local_status.normal THEN                                                                       
          RETURN;  {---->                                                                                     
        IFEND;                                                                                                
      IFEND;                                                                                                  
    FOREND;                                                                                                   
                                                                                                              
  PROCEND dup$display_message;                                                                                
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$display_register_data', EJECT ??                                                          
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure displays register data with a description.                                                 
                                                                                                              
  PROCEDURE [XDCL] dup$display_register_data                                                                  
    (    description: string (*);                                                                             
         register: ARRAY [1 .. duc$de_max_register_length] OF 0 .. 0ff(16);                                   
     VAR display_control: clt$display_control);                                                               
                                                                                                              
    TYPE                                                                                                      
      t$register_line = RECORD                                                                                
        CASE boolean OF                                                                                       
        = TRUE =                                                                                              
          line: string (20),                                                                                  
        = FALSE =                                                                                             
          data: ARRAY [1 .. 4] OF t$register_line_entry,                                                      
        CASEND,                                                                                               
      RECEND,                                                                                                 
                                                                                                              
      t$register_line_entry = RECORD                                                                          
        first_byte: string (2),                                                                               
        second_byte: string (2),                                                                              
        unused: string (1),                                                                                   
      RECEND;                                                                                                 
                                                                                                              
    VAR                                                                                                       
      byte_index: 0 .. 0ff(16),                                                                               
      display_string: string (osc$max_string_size),                                                           
      ignore_status: ost$status,                                                                              
      index: 0 .. 0ff(16),                                                                                    
      register_line: t$register_line,                                                                         
      string_2: string (2),                                                                                   
      string_length: integer;                                                                                 
                                                                                                              
    byte_index := 1;                                                                                          
    register_line.line := ' ';                                                                                
    FOR index := 1 TO 4 DO                                                                                    
      clp$convert_integer_to_rjstring (register [byte_index], 16, FALSE, '0', string_2, ignore_status);       
      register_line.data [index].first_byte := string_2;                                                      
      byte_index := byte_index + 1;                                                                           
      clp$convert_integer_to_rjstring (register [byte_index], 16, FALSE, '0', string_2, ignore_status);       
      register_line.data [index].second_byte := string_2;                                                     
      byte_index := byte_index + 1;                                                                           
    FOREND;                                                                                                   
    STRINGREP (display_string, string_length, '  ', description, ' = ', register_line.line);                  
    clp$put_display (display_control, display_string (1, string_length), clc$trim, ignore_status);            
                                                                                                              
  PROCEND dup$display_register_data;                                                                          
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$evaluate_parameters', EJECT ??                                                            
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure changes the default parameter values on the pdt and calls the evaluate parameters routine. 
                                                                                                              
  PROCEDURE [XDCL] dup$evaluate_parameters                                                                    
    (    parameter_list: clt$parameter_list;                                                                  
         default_list: dut$default_change_list;                                                               
         pdt_p: ^clt$parameter_description_table;                                                             
         pvt_p: ^clt$parameter_value_table;                                                                   
     VAR status: ost$status);                                                                                 
                                                                                                              
    VAR                                                                                                       
      altered_pdt_p: ^clt$parameter_description_table,                                                        
      default_index: 0 .. clc$max_parameters,                                                                 
      defaults_changed: 0 .. clc$max_parameters,                                                              
      parameter_index: clt$parameter_number,                                                                  
      parameter_value: ost$name,                                                                              
      pdt_changes_p: ^clt$pdt_changes;                                                                        
                                                                                                              
    status.normal := TRUE;                                                                                    
                                                                                                              
    { Make a copy of the PDT.                                                                                 
                                                                                                              
    PUSH altered_pdt_p: [[REP #SIZE (pdt_p^) OF cell]];                                                       
    IF altered_pdt_p = NIL THEN                                                                               
      osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);                            
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
    RESET altered_pdt_p;                                                                                      
    altered_pdt_p^ := pdt_p^;                                                                                 
                                                                                                              
    { Determine how many default parameters sent to this procedure actually have defaults set.                
                                                                                                              
    defaults_changed := 0;                                                                                    
    FOR parameter_index := 1 TO UPPERBOUND (default_list) DO                                                  
      IF duv$default_parameters^.value [default_list [parameter_index].default_name].default_set THEN         
        defaults_changed := defaults_changed + 1;                                                             
      IFEND;                                                                                                  
    FOREND;                                                                                                   
                                                                                                              
    { Change the default parameters that have defaults set.                                                   
                                                                                                              
    IF defaults_changed > 0 THEN                                                                              
      PUSH pdt_changes_p: [1 .. defaults_changed];                                                            
      IF pdt_changes_p = NIL THEN                                                                             
        osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);                          
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      default_index := 0;                                                                                     
      FOR parameter_index := 1 TO UPPERBOUND (default_list) DO                                                
        IF duv$default_parameters^.value [default_list [parameter_index].default_name].default_set THEN       
          default_index := default_index + 1;                                                                 
          parameter_value := duv$default_parameters^.value [default_list [parameter_index].default_name].     
                value;                                                                                        
          PUSH pdt_changes_p^ [default_index].default_value: [#SIZE (parameter_value)];                       
          IF pdt_changes_p^ [default_index].default_value = NIL THEN                                          
            osp$set_status_abnormal (duc$dump_analyzer_id, due$nil_pointer, '', status);                      
            RETURN;  {---->                                                                                   
          IFEND;                                                                                              
          pdt_changes_p^ [default_index].number := default_list [parameter_index].number;                     
          pdt_changes_p^ [default_index].kind := clc$pdtc_default_value;                                      
          pdt_changes_p^ [default_index].default_value^ := parameter_value;                                   
        IFEND;                                                                                                
      FOREND;                                                                                                 
      clp$change_pdt (altered_pdt_p, pdt_changes_p^, status);                                                 
    IFEND;                                                                                                    
                                                                                                              
    clp$evaluate_parameters (parameter_list, altered_pdt_p, NIL, pvt_p, status);                              
                                                                                                              
  PROCEND dup$evaluate_parameters;                                                                            
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$find_record_list_entry', EJECT ??                                                         
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure returns the list index of a record from the "other records" list.  A NIL pointer is        
{   returned if the record is not found.                                                                      
                                                                                                              
  PROCEDURE [XDCL] dup$find_record_list_entry                                                                 
    (    data_value: clt$data_value;                                                                          
     VAR entry_p: ^dut$de_other_record_entry);                                                                
                                                                                                              
    VAR                                                                                                       
      cell_p: ^cell,                                                                                          
      list_index: 0 .. duc$de_max_other_records,                                                              
      name_index: 0 .. 3,                                                                                     
      record_name: dut$de_other_record_name,                                                                  
      restart_file_seq_p: ^SEQ ( * ),                                                                         
      search_entry_p: ^dut$de_other_record_entry,                                                             
      search_index: 0 .. duc$de_max_other_records,                                                            
      string_length: integer,                                                                                 
      temp_record_name: dut$de_other_record_name;                                                             
                                                                                                              
    entry_p := NIL;                                                                                           
    IF NOT duv$dump_environment_p^.other_records.available THEN                                               
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    search_index := 0;                                                                                        
    temp_record_name := ' ';                                                                                  
    IF data_value.kind = clc$integer THEN                                                                     
      IF (data_value.integer_value.value > 0) AND                                                             
            (data_value.integer_value.value <= duv$dump_environment_p^.other_records.number_of_records) THEN  
        search_index := data_value.integer_value.value;                                                       
      ELSE                                                                                                    
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
    ELSE                                                                                                      
      IF data_value.kind = clc$name THEN                                                                      
        record_name := data_value.name_value (1, 3);                                                          
      ELSE                                                                                                    
        record_name := data_value.string_value^;                                                              
      IFEND;                                                                                                  
                                                                                                              
      { Convert the record name from lower case to upper case if necessary.                                   
                                                                                                              
      FOR name_index := 1 TO 3 DO                                                                             
        IF ($INTEGER (record_name (name_index)) >= $INTEGER('a')) AND                                         
              ($INTEGER (record_name (name_index)) <= $INTEGER('z')) THEN                                     
          STRINGREP (temp_record_name (name_index), string_length,                                            
                $CHAR (($INTEGER (record_name (name_index)) - $INTEGER('a')) + $INTEGER('A')));               
        ELSE                                                                                                  
          temp_record_name (name_index) := record_name (name_index);                                          
        IFEND;                                                                                                
      FOREND;                                                                                                 
    IFEND;                                                                                                    
                                                                                                              
    { Search the list for the correct record.                                                                 
                                                                                                              
    restart_file_seq_p := duv$execution_environment.data_file_p^.segment_pointer.sequence_pointer;            
    cell_p := #ADDRESS (#RING (restart_file_seq_p), #SEGMENT (restart_file_seq_p),                            
          duv$dump_environment_p^.other_records.first_record);                                                
                                                                                                              
    list_index := 1;                                                                                          
    WHILE list_index <= duv$dump_environment_p^.other_records.number_of_records DO                            
      RESET restart_file_seq_p TO cell_p;                                                                     
      NEXT search_entry_p IN restart_file_seq_p;                                                              
      IF search_entry_p = NIL THEN                                                                            
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      IF (search_entry_p^.index = search_index) OR (search_entry_p^.name = temp_record_name) THEN             
        entry_p := search_entry_p;                                                                            
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      IF (search_entry_p^.name = 'CCM') AND                                                                   
            duv$dump_environment_p^.critical_memory.multiple_ccm_exists THEN                                  
        cell_p := #ADDRESS (#RING (restart_file_seq_p), #SEGMENT (restart_file_seq_p),                        
              duv$dump_environment_p^.critical_memory.last_ccm_other_record);                                 
        RESET restart_file_seq_p TO cell_p;                                                                   
        NEXT search_entry_p IN restart_file_seq_p;                                                            
        IF search_entry_p = NIL THEN                                                                          
          RETURN;  {---->                                                                                     
        IFEND;                                                                                                
        list_index := search_entry_p^.index + 1;                                                              
      ELSE                                                                                                    
        list_index := list_index + 1;                                                                         
      IFEND;                                                                                                  
      cell_p := #ADDRESS (#RING (restart_file_seq_p), #SEGMENT (restart_file_seq_p),                          
            search_entry_p^.next_record);                                                                     
    WHILEND;                                                                                                  
                                                                                                              
  PROCEND dup$find_record_list_entry;                                                                         
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$is_cpu1_installed', EJECT ??                                                              
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure determines if the second cpu is installed and displays a message if it installed but not   
{   available on the dump.                                                                                    
                                                                                                              
  PROCEDURE [XDCL] dup$is_cpu1_installed                                                                      
    (    origin: dut$ee_cpu1_installed_commands;                                                              
         processor: 0 .. duc$de_maximum_processors;                                                           
     VAR display_control: clt$display_control);                                                               
                                                                                                              
    CONST                                                                                                     
      c$text = 'The second processor is installed but the maintenance register data is not on the dump.';     
                                                                                                              
    TYPE                                                                                                      
      t$register_byte_or_bit = PACKED RECORD                                                                  
        CASE boolean OF                                                                                       
        = TRUE =                                                                                              
          byte_part: ARRAY [1 .. duc$de_max_register_length] OF 0 .. 0ff(16),                                 
        = FALSE =                                                                                             
          bit_part: PACKED ARRAY [0 .. 63] OF boolean,                                                        
        CASEND,                                                                                               
      RECEND;                                                                                                 
                                                                                                              
    VAR                                                                                                       
      ignore_status: ost$status,                                                                              
      register: dut$de_maintenance_register,                                                                  
      register_byte_or_bit: t$register_byte_or_bit;                                                           
                                                                                                              
    IF processor <> 1 THEN                                                                                    
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    IF NOT duv$dump_environment_p^.pro_maintenance_registers [0].available OR                                 
          duv$dump_environment_p^.pro_maintenance_registers [1].available THEN                                
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    dup$retrieve_register (duc$de_cpu, 0, 12(16), register);                                                  
    register_byte_or_bit.byte_part := register.value;                                                         
    IF register.available AND register_byte_or_bit.bit_part [59] THEN                                         
      CASE origin OF                                                                                          
      = duc$ee_cic_disd =                                                                                     
        clp$put_partial_display (display_control, '     ', clc$no_trim, amc$continue, ignore_status);         
        clp$put_partial_display (display_control, c$text, clc$no_trim, amc$terminate, ignore_status);         
      = duc$ee_cic_dismr =                                                                                    
        display_control.line_number := display_control.page_length + 1;                                       
        clp$new_display_line (display_control, 1, ignore_status);                                             
        clp$put_partial_display (display_control, '  PROCESSOR 01', clc$no_trim, amc$terminate,               
              ignore_status);                                                                                 
        clp$new_display_line (display_control, 1, ignore_status);                                             
        clp$put_partial_display (display_control, c$text, clc$no_trim, amc$terminate, ignore_status);         
      ELSE                                                                                                    
      CASEND;                                                                                                 
    IFEND;                                                                                                    
                                                                                                              
  PROCEND dup$is_cpu1_installed;                                                                              
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$put_item', EJECT ??                                                                       
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure places an item on the output file.                                                         
                                                                                                              
  PROCEDURE [XDCL] dup$put_item                                                                               
    (    item: string ( * );                                                                                  
         trim_option: clt$trim_display_text_option;                                                           
         term_option: amt$term_option;                                                                        
     VAR display_control: clt$display_control);                                                               
                                                                                                              
    CONST                                                                                                     
      c$alignment = 3;                                                                                        
                                                                                                              
    VAR                                                                                                       
      ignore_status: ost$status,                                                                              
      item_index: ost$string_index,                                                                           
      item_size: ost$string_size;                                                                             
                                                                                                              
    item_size := STRLENGTH (item);                                                                            
                                                                                                              
    { Trim the item that is to be displayed.                                                                  
                                                                                                              
    IF trim_option = clc$trim THEN                                                                            
      WHILE (item_size > 2) AND (item (item_size) = ' ') DO                                                   
        item_size := item_size - 1;                                                                           
      WHILEND;                                                                                                
    IFEND;                                                                                                    
                                                                                                              
    IF item (1, 2) = ', ' THEN                                                                                
      clp$put_partial_display (display_control, ', ', clc$no_trim, amc$continue, ignore_status);              
      item_index := 3;                                                                                        
      item_size := item_size - 2;                                                                             
    ELSE                                                                                                      
      item_index := 1;                                                                                        
    IFEND;                                                                                                    
                                                                                                              
    IF (display_control.column_number <> 1) AND                                                               
          ((display_control.column_number + item_size) > display_control.page_width) THEN                     
      clp$new_display_line (display_control, 0, ignore_status);                                               
      clp$horizontal_tab_display (display_control, c$alignment, ignore_status);                               
    IFEND;                                                                                                    
                                                                                                              
    clp$put_partial_display (display_control, item (item_index, item_size), clc$no_trim, term_option,         
          ignore_status);                                                                                     
                                                                                                              
  PROCEND dup$put_item;                                                                                       
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$retrieve_bc_entry', EJECT ??                                                              
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure retrieves a buffer controlware entry.  A NIL pointer is returned if the entry is not found.
                                                                                                              
  PROCEDURE [XDCL] dup$retrieve_bc_entry                                                                      
    (    channel_number: 0 .. duc$de_maximum_channels;                                                        
     VAR entry_p: ^dut$de_buffer_controlware_entry);                                                          
                                                                                                              
    VAR                                                                                                       
      cell_p: ^cell,                                                                                          
      index: 0 .. 0ff(16),                                                                                    
      restart_file_seq_p: ^SEQ ( * ),                                                                         
      search_entry_p: ^dut$de_buffer_controlware_entry;                                                       
                                                                                                              
    entry_p := NIL;                                                                                           
    IF NOT duv$dump_environment_p^.buffer_controlware.available THEN                                          
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    restart_file_seq_p := duv$execution_environment.data_file_p^.segment_pointer.sequence_pointer;            
    cell_p := #ADDRESS (#RING (restart_file_seq_p), #SEGMENT (restart_file_seq_p),                            
          duv$dump_environment_p^.buffer_controlware.first_bc_entry);                                         
    FOR index := 1 TO duv$dump_environment_p^.buffer_controlware.number_of_entries DO                         
      RESET restart_file_seq_p TO cell_p;                                                                     
      NEXT search_entry_p IN restart_file_seq_p;                                                              
      IF search_entry_p = NIL THEN                                                                            
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      IF search_entry_p^.channel_number = channel_number THEN                                                 
        entry_p := search_entry_p;                                                                            
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      cell_p := #ADDRESS (#RING (restart_file_seq_p), #SEGMENT (restart_file_seq_p),                          
            search_entry_p^.next_bc_entry);                                                                   
    FOREND;                                                                                                   
                                                                                                              
  PROCEND dup$retrieve_bc_entry;                                                                              
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$retrieve_cip_program', EJECT ??                                                           
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure retrieves an address to a CIP program in the EIC record.                                   
                                                                                                              
  PROCEDURE [XDCL] dup$retrieve_cip_program                                                                   
    (    cip_program_name: string (4);                                                                        
     VAR cip_program_available: boolean;                                                                      
     VAR cip_program_cell_p: ^cell);                                                                          
                                                                                                              
    CONST                                                                                                     
      c$number_of_words_before_dscm2 = 32;                                                                    
                                                                                                              
    TYPE                                                                                                      
      t$data = RECORD                                                                                         
        first_half: 0 .. 0ffff(16),                                                                           
        second_half: 0 .. 0ffff(16),                                                                          
        unused: 0 .. 0ffff(16),                                                                               
        size: 0 .. 0ffff(16),                                                                                 
      RECEND,                                                                                                 
                                                                                                              
      t$memory_register =  PACKED RECORD                                                                      
        CASE 0 .. 2 OF                                                                                        
        = 0 =                                                                                                 
          unused_0_a: 0 .. 0ffffffff(16),                                                                     
          unused_0_b: 0 .. 01fff(16),                                                                         
          bounds_bits_45_63: 0 .. 07ffff(16),                                                                 
        = 1 =                                                                                                 
          unused_1: 0 .. 0ffffffff(16),                                                                       
          bounds_bits_32_47: 0 .. 0ffff(16),                                                                  
          bounds_bits_48_63: 0 .. 0ffff(16),                                                                  
        = 2 =                                                                                                 
          value: ARRAY [1 .. duc$de_max_register_length] OF 0 .. 0ff(16),                                     
        CASEND,                                                                                               
      RECEND;                                                                                                 
                                                                                                              
    VAR                                                                                                       
      cell_p: ^cell,                                                                                          
      cip_name: 0 .. 077777777(8),                                                                            
      cpu_index: 0 .. duc$de_maximum_processors,                                                              
      cti_cm_directory_address: integer,                                                                      
      data_p: ^t$data,                                                                                        
      data_value: clt$data_value,                                                                             
      display_code: 0 .. 077777777(8),                                                                        
      entry_p: ^dut$de_other_record_entry,                                                                    
      index: 1 .. 4,                                                                                          
      model_number: 0 .. 0ff(16),                                                                             
      memory_bounds: integer,                                                                                 
      memory_register: t$memory_register,                                                                     
      offset: integer,                                                                                        
      r_pointer_p: ^dst$r_pointer,                                                                            
      record_size: integer,                                                                                   
      register: dut$de_maintenance_register,                                                                  
      restart_file_seq_p: ^SEQ ( * ),                                                                         
      skip_p: ^SEQ ( * ),                                                                                     
      use_bits_45_63: boolean;                                                                                
                                                                                                              
    cip_program_available := FALSE;                                                                           
    cip_program_cell_p := NIL;                                                                                
                                                                                                              
    { Retrieve the Processor model number and determine which way to read the memory bounds register.         
    { 930, 960, 962 and the 2000 use bits 45-63.  Every other machine uses bits 32-47.                        
                                                                                                              
   /search_cpus/                                                                                              
    FOR cpu_index := 0 TO duc$de_maximum_processors DO                                                        
      dup$retrieve_register (duc$de_cpu, cpu_index, 10(16), register);                                        
      IF register.available THEN                                                                              
        model_number := register.value [duc$de_model_byte_number];                                            
        EXIT /search_cpus/;  {---->                                                                           
      IFEND;                                                                                                  
    FOREND /search_cpus/;                                                                                     
    IF NOT register.available THEN                                                                            
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
    use_bits_45_63 :=                                                                                         
          ((model_number >= 50(16)) AND (model_number <= 5f(16))) OR   {  93x mainframe }                     
          ((model_number >= 3a(16)) AND (model_number <= 3d(16))) OR   {  96x mainframe }                     
          ((model_number >= 46(16)) AND (model_number <= 48(16)));     { 2000 mainframe }                     
                                                                                                              
    { Retrieve the address to the CTI Directory from word DSCM+2 in the DSB record.                           
                                                                                                              
    data_value.kind := clc$name;                                                                              
    data_value.name_value := 'DSB';                                                                           
    dup$find_record_list_entry (data_value, entry_p);                                                         
    IF entry_p = NIL THEN                                                                                     
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
    restart_file_seq_p := duv$execution_environment.data_file_p^.segment_pointer.sequence_pointer;            
    cell_p := #ADDRESS (#RING (restart_file_seq_p), #SEGMENT (restart_file_seq_p), entry_p^.first_byte);      
    RESET restart_file_seq_p TO cell_p;                                                                       
    NEXT skip_p: [[REP c$number_of_words_before_dscm2 OF integer]] IN restart_file_seq_p;                     
    IF skip_p = NIL THEN                                                                                      
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
    NEXT r_pointer_p IN restart_file_seq_p;                                                                   
    IF r_pointer_p = NIL THEN                                                                                 
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
    cti_cm_directory_address := (r_pointer_p^.rupper * 10000000(8)) + (r_pointer_p^.rlower * 1000(8)) +       
          (r_pointer_p^.offset * 10(8));                                                                      
                                                                                                              
    { Retrieve the memory bounds from memory register 21(16).                                                 
                                                                                                              
    dup$retrieve_register (duc$de_memory, 0, 21(16), register);                                               
    IF NOT register.available THEN                                                                            
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
    memory_register.value := register.value;                                                                  
    IF use_bits_45_63 THEN                                                                                    
      memory_bounds := memory_register.bounds_bits_45_63 * 4096;                                              
    ELSE                                                                                                      
      memory_bounds := memory_register.bounds_bits_32_47 * 4096;                                              
    IFEND;                                                                                                    
                                                                                                              
    { The difference between the CTI directory address and the memory bounds is the offset into               
    { the EIC record of where the CTI directory begins.                                                       
                                                                                                              
    offset := cti_cm_directory_address - memory_bounds;                                                       
                                                                                                              
    { Convert the cip program name desired to display code.                                                   
                                                                                                              
    display_code := 0;                                                                                        
    FOR index := 1 TO 4 DO                                                                                    
      display_code := display_code * 100(8);                                                                  
      IF (cip_program_name(index) >= '0') AND (cip_program_name(index) <= '9') THEN                           
        display_code := display_code + $INTEGER (cip_program_name(index)) - $INTEGER ('0') + 33(8);           
      ELSEIF (cip_program_name(index) >= 'A') AND (cip_program_name(index) <= 'Z') THEN                       
        display_code := display_code + $INTEGER (cip_program_name(index)) - $INTEGER ('A') + 01(8);           
      IFEND;                                                                                                  
    FOREND;                                                                                                   
                                                                                                              
    { Retrieve the EIC record and skip to the CTI directory.                                                  
                                                                                                              
    data_value.kind := clc$name;                                                                              
    data_value.name_value := 'EIC';                                                                           
    dup$find_record_list_entry (data_value, entry_p);                                                         
    IF entry_p = NIL THEN                                                                                     
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
    restart_file_seq_p := duv$execution_environment.data_file_p^.segment_pointer.sequence_pointer;            
    cell_p := #ADDRESS (#RING (restart_file_seq_p), #SEGMENT (restart_file_seq_p), entry_p^.first_byte);      
    RESET restart_file_seq_p TO cell_p;                                                                       
    record_size := entry_p^.size;                                                                             
    NEXT skip_p: [[REP offset OF cell]] IN restart_file_seq_p;                                                
    IF skip_p = NIL THEN                                                                                      
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
    record_size := record_size - #SIZE (skip_p^);                                                             
                                                                                                              
    { Search for the desired CIP program.                                                                     
                                                                                                              
    WHILE record_size > 0 DO                                                                                  
      NEXT data_p IN restart_file_seq_p;                                                                      
      IF data_p = NIL THEN                                                                                    
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      RESET restart_file_seq_p TO data_p;                                                                     
      cip_name := (data_p^.first_half * 10000(8)) + data_p^.second_half;                                      
      IF cip_name = display_code THEN                                                                         
        NEXT cip_program_cell_p IN restart_file_seq_p;                                                        
        cip_program_available := (cip_program_cell_p <> NIL);                                                 
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      NEXT skip_p: [[REP (data_p^.size * 8) OF cell]] IN restart_file_seq_p;                                  
      IF skip_p = NIL THEN                                                                                    
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
      record_size := record_size - #SIZE (skip_p^);                                                           
    WHILEND;                                                                                                  
                                                                                                              
  PROCEND dup$retrieve_cip_program;                                                                           
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$retrieve_dft_pointers', EJECT ??                                                          
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure sets up the individual buffer pointers to the DFT structure.                               
                                                                                                              
  PROCEDURE [XDCL] dup$retrieve_dft_pointers                                                                  
    (VAR dft_data: dut$dft_data;                                                                              
     VAR data_length_valid: boolean;                                                                          
     VAR data_valid: boolean);                                                                                
                                                                                                              
    VAR                                                                                                       
      cell_p: ^cell,                                                                                          
      data_length: integer,                                                                                   
      data_value: clt$data_value,                                                                             
      dft_cw_p: ^dst$dftb_control_word,                                                                       
      dft_dump_record_size: amt$file_byte_address,                                                            
      dump_information: dut$dump_information,                                                                 
      entry_p: ^dut$de_other_record_entry,                                                                    
      index: dst$dftb_element_size,                                                                           
      mdb_p: ^ARRAY [1 .. *] OF dst$r_pointer,                                                                
      pointer_index: 1 .. duc$dft_max_known_pointer_words,                                                    
      r_pointer_words_p: ^dst$dftb_r_pointer_words,                                                           
      restart_file_seq_p: ^SEQ ( * ),                                                                         
      second_seq_p: ^SEQ ( * ),                                                                               
      seq_p: ^SEQ ( * );                                                                                      
                                                                                                              
    data_length_valid := FALSE;                                                                               
    data_valid := FALSE;                                                                                      
                                                                                                              
    data_value.kind := clc$name;                                                                              
    data_value.name_value := 'DFT';                                                                           
    dup$find_record_list_entry (data_value, entry_p);                                                         
    IF entry_p = NIL THEN                                                                                     
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    restart_file_seq_p := duv$execution_environment.data_file_p^.segment_pointer.sequence_pointer;            
    cell_p := #ADDRESS (#RING (restart_file_seq_p), #SEGMENT (restart_file_seq_p), entry_p^.first_byte);      
    dft_dump_record_size := entry_p^.size;                                                                    
                                                                                                              
    RESET restart_file_seq_p TO cell_p;                                                                       
    NEXT dft_cw_p IN restart_file_seq_p;                                                                      
    IF (dft_cw_p = NIL) OR (dft_cw_p^.revision_level < 4) THEN                                                
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
                                                                                                              
    dft_data.actual_number_of_pointer_words := dft_cw_p^.pointer_words - 1;                                   
    IF dft_data.actual_number_of_pointer_words > duc$dft_max_known_pointer_words THEN                         
      dft_data.number_of_pointer_words := duc$dft_max_known_pointer_words;                                    
    ELSE                                                                                                      
      dft_data.number_of_pointer_words := dft_data.actual_number_of_pointer_words;                            
    IFEND;                                                                                                    
                                                                                                              
    dft_data.revision_level := dft_cw_p^.revision_level;                                                      
    dft_data.mrb_length := dft_cw_p^.mrb_length;                                                              
    dft_data.buffer [duc$dft_cw].cell_p := ^dft_cw_p^;                                                        
    dft_data.buffer [duc$dft_cw].size := #SIZE (dft_cw_p^) DIV 8;                                             
                                                                                                              
    data_length := 0;                                                                                         
    NEXT r_pointer_words_p: [1 .. dft_data.actual_number_of_pointer_words] IN restart_file_seq_p;             
    IF r_pointer_words_p = NIL THEN                                                                           
      RETURN;  {---->                                                                                         
    IFEND;                                                                                                    
    FOR pointer_index := 1 TO dft_data.number_of_pointer_words DO                                             
      IF r_pointer_words_p^ [pointer_index].length > 0 THEN                                                   
        NEXT seq_p: [[REP (r_pointer_words_p^ [pointer_index].length * 8) OF cell]] IN restart_file_seq_p;    
        IF seq_p = NIL THEN                                                                                   
          RETURN;  {---->                                                                                     
        IFEND;                                                                                                
        RESET seq_p;                                                                                          
        dft_data.buffer [pointer_index].cell_p := ^seq_p^;                                                    
        dft_data.buffer [pointer_index].size := r_pointer_words_p^ [pointer_index].length;                    
        data_length := data_length + dft_data.buffer [pointer_index].size;                                    
        IF pointer_index = dsc$dftb_rpw_mdb THEN                                                              
          dup$determine_dump_information (dump_information);                                                  
          IF dump_information.dump_type = duc$di_dt_unknown THEN                                              
            RETURN;  {---->                                                                                   
          IFEND;                                                                                              
          IF dump_information.dump_type = duc$di_dt_edd THEN                                                  
            RESET restart_file_seq_p TO seq_p;                                                                
            NEXT mdb_p: [1 .. r_pointer_words_p^ [pointer_index].length] IN restart_file_seq_p;               
            IF mdb_p = NIL THEN                                                                               
              RETURN;  {---->                                                                                 
            IFEND;                                                                                            
            FOR index := 1 TO r_pointer_words_p^ [pointer_index].length DO                                    
              IF mdb_p^ [index].length > 0 THEN                                                               
                NEXT second_seq_p: [[REP (mdb_p^ [index].length * 8) OF cell]] IN restart_file_seq_p;         
                IF second_seq_p = NIL THEN                                                                    
                  RETURN;  {---->                                                                             
                IFEND;                                                                                        
                RESET second_seq_p;                                                                           
                dft_data.mdb [index].cell_p := ^second_seq_p^;                                                
                dft_data.mdb [index].size := mdb_p^ [index].length;                                           
                data_length := data_length + dft_data.mdb [index].size;                                       
              ELSE                                                                                            
                dft_data.mdb [index].cell_p := NIL;                                                           
                dft_data.mdb [index].size := 0;                                                               
              IFEND;                                                                                          
            FOREND;                                                                                           
          IFEND;                                                                                              
        IFEND;                                                                                                
      ELSE                                                                                                    
        dft_data.buffer [pointer_index].cell_p := NIL;                                                        
        dft_data.buffer [pointer_index].size := 0;                                                            
      IFEND;                                                                                                  
    FOREND;                                                                                                   
                                                                                                              
    data_value.kind := clc$name;                                                                              
    data_value.name_value := 'PS1';                                                                           
    dup$find_record_list_entry (data_value, entry_p);                                                         
    IF entry_p = NIL THEN                                                                                     
      dft_data.buffer [dsc$dftb_rpw_dft_secondary].cell_p := NIL;                                             
    IFEND;                                                                                                    
                                                                                                              
    data_length_valid := ((data_length * 8) <= dft_dump_record_size);                                         
    data_valid := TRUE;                                                                                       
                                                                                                              
  PROCEND dup$retrieve_dft_pointers;                                                                          
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$retrieve_exchange_package', EJECT ??                                                      
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure retrieves the correct exchange package.                                                    
                                                                                                              
  PROCEDURE [XDCL] dup$retrieve_exchange_package                                                              
    (    processor: 0 .. duc$de_maximum_processors;                                                           
         exchange_parameter: clt$data_value;                                                                  
     VAR exchange_package_p: ^dut$exchange_package;                                                           
     VAR status: ost$status);                                                                                 
                                                                                                              
    VAR                                                                                                       
      new_byte_size: ost$segment_length;                                                                      
                                                                                                              
    status.normal := TRUE;                                                                                    
                                                                                                              
    IF exchange_parameter.kind = clc$integer THEN                                                             
      dup$access_real_memory (#SIZE (dut$exchange_package), exchange_parameter.integer_value.value,           
            exchange_package_p, new_byte_size, status);                                                       
      IF NOT status.normal THEN                                                                               
        RETURN;  {---->                                                                                       
      IFEND;                                                                                                  
                                                                                                              
    ELSE { exchange_parameter.kind = clc$keyword }                                                            
      IF exchange_parameter.keyword_value = 'ACTIVE' THEN                                                     
        IF NOT duv$dump_environment_p^.active_exchange [processor].available THEN                             
          osp$set_status_abnormal (duc$dump_analyzer_id, due$data_not_on_dump,                                
                'The active exchange package for processor', status);                                         
          osp$append_status_integer (osc$status_parameter_delimiter, processor, 10, FALSE, status);           
          osp$append_status_parameter (osc$status_parameter_delimiter, 'is', status);                         
          RETURN;  {---->                                                                                     
        IFEND;                                                                                                
        exchange_package_p := ^duv$dump_environment_p^.active_exchange [processor].value;                     
                                                                                                              
      ELSEIF exchange_parameter.keyword_value = 'MONITOR' THEN                                                
        IF NOT duv$execution_environment.processor_registers [processor].available THEN                       
          osp$set_status_abnormal (duc$dump_analyzer_id, due$data_not_on_dump,                                
                'The mps register for processor', status);                                                    
          osp$append_status_integer (osc$status_parameter_delimiter, processor, 10, FALSE, status);           
          osp$append_status_parameter (osc$status_parameter_delimiter, 'is', status);                         
          RETURN;  {---->                                                                                     
        IFEND;                                                                                                
        dup$access_real_memory (#SIZE (dut$exchange_package),                                                 
              duv$execution_environment.processor_registers [processor].monitor_process_state,                
              exchange_package_p, new_byte_size, status);                                                     
        IF NOT status.normal THEN                                                                             
          RETURN;  {---->                                                                                     
        IFEND;                                                                                                
                                                                                                              
      ELSEIF exchange_parameter.keyword_value = 'JOB' THEN                                                    
        IF NOT duv$execution_environment.processor_registers [processor].available THEN                       
          osp$set_status_abnormal (duc$dump_analyzer_id, due$data_not_on_dump,                                
                'The jps register for processor', status);                                                    
          osp$append_status_integer (osc$status_parameter_delimiter, processor, 10, FALSE, status);           
          osp$append_status_parameter (osc$status_parameter_delimiter, 'is', status);                         
          RETURN;  {---->                                                                                     
        IFEND;                                                                                                
        dup$access_real_memory (#SIZE (dut$exchange_package),                                                 
              duv$execution_environment.processor_registers [processor].job_process_state,                    
              exchange_package_p, new_byte_size, status);                                                     
        IF NOT status.normal THEN                                                                             
          RETURN;  {---->                                                                                     
        IFEND;                                                                                                
      IFEND;                                                                                                  
    IFEND;                                                                                                    
                                                                                                              
  PROCEND dup$retrieve_exchange_package;                                                                      
?? OLDTITLE ??                                                                                                
?? NEWTITLE := 'dup$retrieve_register', EJECT ??                                                              
                                                                                                              
{ PURPOSE:                                                                                                    
{   This procedure retrieves a register for a particular element.                                             
                                                                                                              
  PROCEDURE [XDCL] dup$retrieve_register                                                                      
    (    element: dut$de_element;                                                                             
         element_index: 0 .. 0ff(16);                                                                         
         register_number: 0 .. duc$de_max_register_number;                                                    
     VAR register: dut$de_maintenance_register);                                                              
                                                                                                              
    VAR                                                                                                       
      index: 0 .. 0ffff(16);                                                                                  
                                                                                                              
    CASE element OF                                                                                           
    = duc$de_iou =                                                                                            
      IF duv$dump_environment_p^.iou_maintenance_registers [element_index].available THEN                     
        FOR index := 1 TO duc$de_number_of_iou_mrs_dumped DO                                                  
          register := duv$dump_environment_p^.iou_maintenance_registers [element_index].registers [index];    
          IF register.available AND (register.number = register_number) THEN                                  
            RETURN;  {---->                                                                                   
          IFEND;                                                                                              
        FOREND;                                                                                               
      IFEND;                                                                                                  
    = duc$de_cpu =                                                                                            
      IF duv$dump_environment_p^.pro_maintenance_registers [element_index].available THEN                     
        FOR index := 1 TO duc$de_number_of_pro_mrs_dumped DO                                                  
          register := duv$dump_environment_p^.pro_maintenance_registers [element_index].registers [index];    
          IF register.available AND (register.number = register_number) THEN                                  
            RETURN;  {---->                                                                                   
          IFEND;                                                                                              
        FOREND;                                                                                               
      IFEND;                                                                                                  
    = duc$de_memory =                                                                                         
      IF duv$dump_environment_p^.mem_maintenance_registers.available THEN                                     
        FOR index := 1 TO duc$de_number_of_mem_mrs_dumped DO                                                  
          register := duv$dump_environment_p^.mem_maintenance_registers.registers [index];                    
          IF register.available AND (register.number = register_number) THEN                                  
            RETURN;  {---->                                                                                   
          IFEND;                                                                                              
        FOREND;                                                                                               
      IFEND;                                                                                                  
    ELSE                                                                                                      
    CASEND;                                                                                                   
    register.available := FALSE;                                                                              
                                                                                                              
  PROCEND dup$retrieve_register;                                                                              
MODEND dum$common_analyzer_routines;                                                                          
