?? RIGHT := 110 ??
?? NEWTITLE := '                     NOS/VE : OBJECT MODULE CONVERTER' ??
MODULE ocm$object_module_converter;

{  PURPOSE:                               }
{    This module contains the needed      }
{    declarations to convert multiple 170 }
{    to multiple 180 object modules.      }
?? NEWTITLE := ' Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc cyd$debug_symbols
*copyc llt$object_module
*copyc oce$object_converter_exceptions
*copyc oss$job_paged_literal
*copyc pme$program_services_exceptions
?? POP ??
*copyc amp$close
*copyc amp$get_file_attributes
*copyc amp$get_next
*copyc amp$get_segment_pointer
*copyc amp$open
*copyc amp$set_segment_eoi
*copyc clp$get_value
*copyc clp$scan_parameter_list
*copyc i#move
*copyc osp$set_status_abnormal
?? OLDTITLE ??
?? NEWTITLE := '  OCP$GET_RING_BRACKETS', EJECT ??

  PROCEDURE ocp$get_ring_brackets (file_name: amt$local_file_name;
    VAR ring_brackets: amt$ring_attributes;
    VAR status: ost$status);


    VAR
      get_attributes: array [1 .. 1] of amt$get_item,
      local_file: boolean,
      existing_file: boolean,
      contains_data: boolean,
      ring: ost$valid_ring;


    get_attributes [1].key := amc$ring_attributes;

    amp$get_file_attributes (file_name, get_attributes, local_file, existing_file, contains_data, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;


    IF get_attributes [1].source <> amc$undefined_attribute THEN
      ring_brackets.r1 := get_attributes [1].ring_attributes.r1;
      ring_brackets.r2 := get_attributes [1].ring_attributes.r2;
      ring_brackets.r3 := get_attributes [1].ring_attributes.r3;

    ELSE
      ring := #ring (#LOC (get_attributes));
      ring_brackets.r1 := ring;
      ring_brackets.r2 := ring;
      ring_brackets.r3 := ring;

    IFEND;


  PROCEND ocp$get_ring_brackets;
?? OLDTITLE ??
?? NEWTITLE := '                       CITOII CONVERTER' ??

?? EJECT ??

  PROCEDURE [XDCL, #GATE] citoii (parameter_list: clt$parameter_list;
    VAR status: ost$status);



    PROCEDURE eoi_warning (eoi_warning_condition: integer;
      VAR status: ost$status);

      status.normal := FALSE;
      status_state := eoi_warning_status;
      status.condition := eoi_warning_condition;

    PROCEND eoi_warning;



    PROCEDURE error (error_condition: integer;
          error_string: string ( * );
      VAR status: ost$status);


      osp$set_status_abnormal ('OC', error_condition, error_string, status);


    PROCEND error;
?? OLDTITLE ??
?? NEWTITLE := '                         OBTAIN CI FILE' ??
?? EJECT ??

    PROCEDURE obtain_ci_file (ci_file_name: amt$local_file_name;
      VAR ci_file_identifier: amt$file_identifier;
      VAR ci_input_seg: ^SEQ ( * );
      VAR status: ost$status);




      VAR
        ci_segment: amt$segment_pointer,
        local_file: boolean,
        existing_file: boolean,
        contains_data: boolean,

        dummy: array [1 .. 1] of amt$get_item,

?? FMT (FORMAT := OFF) ??
        file_attributes: [STATIC, READ, oss$job_paged_literal] array [1 .. 2] of amt$access_selection := [
          [amc$access_mode, $pft$usage_selections [pfc$read]],
          [amc$open_position, amc$open_at_boi]];


?? FMT (FORMAT:=ON) ??
        dummy [1].key := amc$access_mode;

      amp$get_file_attributes (ci_file_name, dummy, local_file, existing_file, contains_data, status);

      IF status.normal THEN
        IF contains_data THEN
          amp$open (ci_file_name, amc$segment, ^file_attributes, ci_file_identifier, status);
          IF status.normal THEN
            amp$get_segment_pointer (ci_file_identifier, amc$sequence_pointer, ci_segment, status);
            IF status.normal THEN
              ci_input_seg := ci_segment.sequence_pointer;
              RESET ci_input_seg;
            IFEND;
          IFEND;
        ELSE
          error (oce$missing_or_empty_file, ci_file_name, status);
        IFEND;
      IFEND;


    PROCEND obtain_ci_file;
?? OLDTITLE ??
?? NEWTITLE := '                         OBTAIN II SEQ' ??
?? EJECT ??

    PROCEDURE obtain_ii_seg (ii_file_name: amt$local_file_name;
      VAR ii_file_identifier: amt$file_identifier;
      VAR ii_output_seg: amt$segment_pointer;
      VAR status: ost$status);


      VAR
        file_attributes: array [1 .. 3] of amt$access_selection;


      file_attributes [1].key := amc$access_mode;
      file_attributes [1].access_mode := $pft$usage_selections [pfc$append, pfc$shorten, pfc$read];
      file_attributes [2].key := amc$file_structure;
      file_attributes [2].file_structure := amc$data;
      file_attributes [3].key := amc$file_contents;
      file_attributes [3].file_contents := amc$object;

      amp$open (ii_file_name, amc$segment, ^file_attributes, ii_file_identifier, status);
      IF status.normal THEN
        amp$get_segment_pointer (ii_file_identifier, amc$sequence_pointer, ii_output_seg, status);
        IF status.normal THEN
          RESET ii_output_seg.sequence_pointer;
        IFEND;
      IFEND;


    PROCEND obtain_ii_seg;
?? OLDTITLE ??
?? NEWTITLE := '                         CONVERT OBJECT FILE' ??
?? NEWTITLE := '                           Address and misc. Constants and Types  ' ??
?? EJECT ??

    PROCEDURE convert_object_file (VAR output_seq {buffer} : ^SEQ ( * );
      VAR status: ost$status);

{   PURPOSE:                             }
{     To convert multiple 170 IOU or PPU }
{     object modules to multiple 180     }
{     object modules.                    }



      { 170 program_name and string types }


      TYPE
        pmt$ci_program_name = packed array [1 .. 112] of half_byte,

        pmt$ci_string = packed array [ * ] of half_byte,

        llt$ci_decl_matching_value = packed record
          upper: half_byte,
          lower_1: 0 .. 0fffffff(16),
          lower_2: 0 .. 0ffffffff(16),
        recend;





      { 170 constants and general types }


      TYPE

        byte = 0 .. 0ff(16),
        half_byte = 0 .. 0f(16),
        two_bytes = 0 .. 0ffff(16),
        word = string (8),
        half_word = string (4);




?? OLDTITLE ??
?? NEWTITLE := '                           CONVERT STRING' ??
?? EJECT ??

      PROCEDURE convert_string (VAR ci_strng: pmt$ci_string;
            starting_char: 0 .. 256;
        VAR ii_string: string ( * ));

        VAR
          string_length: 0 .. 256,
          ii_char_count: 0 .. 256,
          ii_count: integer,
          ci_count: integer,
          ii_strng: ^packed array [1 .. 512] of half_byte;


        string_length := STRLENGTH (ii_string);
        ii_strng := #LOC (ii_string);
        ii_count := 1;
        ci_count := ((starting_char + 4) DIV 5) + ((starting_char - 1) * 3) + 2;

        FOR ii_char_count := 1 TO string_length DO
          ii_strng^ [ii_count] := ci_strng [ci_count];
          ii_strng^ [ii_count + 1] := ci_strng [ci_count + 1];

          ii_count := ii_count + 2;
          IF (ci_count MOD 16) = 15 THEN
            ci_count := ci_count + 4;
          ELSE
            ci_count := ci_count + 3;
          IFEND;
        FOREND;

      PROCEND convert_string;


?? TITLE := '                           CONVERT SET' ??
?? EJECT ??

      PROCEDURE convert_set (ci_cell: ^cell;
            set_length: 1 .. 8;
            ii_cell: ^cell);

{       PURPOSE:                                                   }
{         To convert a 170 'set' ( left justified in a byte ) to a }
{         normal 180 set.                                          }

        VAR
          shifts: 1 .. 4,
          number_of_shifts: 1 .. 4,
          ci_set: ^packed record
            upper: half_byte,
            lower: half_byte,
          recend,
          ii_set: ^0 .. 255;


        ci_set := ci_cell;
        ii_set := ii_cell;


        { right shift set by an integer divide if shift is needed }

        IF set_length < 4 THEN
          number_of_shifts := 4 - set_length;
          ii_set^ := ci_set^.lower;
          FOR shifts := 1 TO number_of_shifts DO
            ii_set^ := ii_set^ DIV 2;
          FOREND;
        ELSE
          ii_set^ := ci_set^.lower;
        IFEND;

      PROCEND convert_set;
?? TITLE := '                           CONVERT BOOLEAN' ??
?? EJECT ??

      PROCEDURE convert_boolean (ci_cell: ^cell;
        VAR ii_boolean: boolean);

{       PURPOSE:                                               }
{         To convert a 170 'boolean' (5th bit in the byte) to  }
{         a normal 180 boolean.                                }


        CONST
          ci_true = 1000(2),
          ci_false = 0000(2);

        VAR
          ci_boolean: ^packed record
            upper: half_byte,
            lower: half_byte,
          recend;


        ci_boolean := ci_cell;

        ii_boolean := (ci_boolean^.lower >= ci_true);

      PROCEND convert_boolean;
?? TITLE := '                           CONVERT INTEGER' ??
?? EJECT ??

      PROCEDURE convert_integer (ci_cell: ^cell;
            ii_cell: ^cell);

{       PURPOSE:                                              }
{         To convert a 170 'integer' to a normal 180 integer. }


        CONST
          ci_negative = 1000(2),
          ii_negative = 1111(2);

        TYPE
          intger = packed record
            case 0 .. 1 of
            = 0 =
              ii_sign_byte: half_byte,
              ci_sign_byte: half_byte,
              rest_of_word: array [1 .. 7] of byte,
            = 1 =
              int: integer,
            casend,
          recend;

        VAR
          ci_intger: ^intger,
          ii_intger: ^intger;


        ci_intger := ci_cell;
        ii_intger := ii_cell;
        ii_intger^ := ci_intger^;

        { check if cc sign bit is on, if so extend the sign }

        IF ci_intger^.ci_sign_byte >= ci_negative THEN
          ii_intger^.ii_sign_byte := ii_negative;
          ii_intger^.int := ii_intger^.int + 1;
        ELSE
          ii_intger^.ii_sign_byte := 0;
        IFEND;

      PROCEND convert_integer;
?? OLDTITLE ??
?? NEWTITLE := '                           CONVERT VERSION 1.1 TEXT' ??
?? NEWTITLE := '                             CONVERT OBJECT TEXT DESCRIPTOR - 1.1' ??
?? EJECT ??

      PROCEDURE convert_version_11_text (ii_identification: ^llt$identification;
        VAR output_seq: ^SEQ ( * );
        VAR status: ost$status);

{ The following *copy is here on purpose.  If it is moved to the beginning of
{ the module, it will not compile given the current implementation.  The problem is that
{ ordinal types llt$object_record_kind and llt$extended_object_record_kind, which is
{ declared in procedure convert_object_file, use some of the same ordinal names.
{ Declaring llt$object_record_kind here means that the ordinal names override the ones
{ with the same names declared in the outer procedure.

*copy llt$object_record_kind

        VAR
          ii_text_descriptor: ^llt$object_text_descriptor;


        PROCEDURE convert_object_text_desc_11 (VAR object_type: llt$object_record_kind;
          VAR size: integer;
          VAR status: ost$status);





          TYPE
            llt$ci_object_text_descriptor = record
              f00: array [1 .. 7] of byte,
              case kind: llt$object_record_kind of
              = llc$identification, llc$section_definition, llc$entry_definition, llc$binding_template,
                llc$transfer_symbol, llc$bit_string_insertion =
                unused: ost$segment_offset, {always 0}

              = llc$libraries =
                f02: array [1 .. 6] of byte,
                number_of_libraries: 1 .. llc$max_libraries,

              = llc$text, llc$replication =
                f03: array [1 .. 4] of byte,
                number_of_bytes: 1 .. osc$max_segment_length,

              = llc$relocation =
                f05: array [1 .. 6] of byte,
                number_of_rel_items: 1 .. llc$max_rel_items,

              = llc$address_formulation =
                f06: array [1 .. 6] of byte,
                number_of_adr_items: 1 .. llc$max_adr_items,

              = llc$external_linkage =
                f07: array [1 .. 6] of byte,
                number_of_ext_items: 1 .. llc$max_ext_items,

              = llc$formal_parameters, llc$actual_parameters, llc$cybil_symbol_table_fragment =
                f08: array [1 .. 4] of byte,
                sequence_length: ost$segment_length,

              = llc$ppu_absolute =
                f09: array [1 .. 6] of byte,
                number_of_words: llt$ppu_address,
              casend,
            recend;




          VAR
            ci_text_descriptor: ^llt$ci_object_text_descriptor;



          NEXT ci_text_descriptor IN ci_input_seg;

          IF ci_text_descriptor <> NIL THEN
            object_type := ci_text_descriptor^.kind;

            NEXT ii_text_descriptor IN output_seq;

            ii_text_descriptor^.kind := ci_text_descriptor^.kind;

            CASE ci_text_descriptor^.kind OF
            = llc$identification, llc$section_definition, llc$entry_definition, llc$binding_template,
                  llc$bit_string_insertion, llc$transfer_symbol =
              ii_text_descriptor^.unused := ci_text_descriptor^.unused;

            = llc$libraries =
              ii_text_descriptor^.number_of_libraries := ci_text_descriptor^.number_of_libraries;
              size := ci_text_descriptor^.number_of_libraries;

            = llc$text, llc$replication =
              ii_text_descriptor^.number_of_bytes := ci_text_descriptor^.number_of_bytes;
              size := ci_text_descriptor^.number_of_bytes;

            = llc$relocation =
              ii_text_descriptor^.number_of_rel_items := ci_text_descriptor^.number_of_rel_items;
              size := ci_text_descriptor^.number_of_rel_items;

            = llc$address_formulation =
              ii_text_descriptor^.number_of_adr_items := ci_text_descriptor^.number_of_adr_items;
              size := ci_text_descriptor^.number_of_adr_items;

            = llc$external_linkage =
              ii_text_descriptor^.number_of_ext_items := ci_text_descriptor^.number_of_ext_items;
              size := ci_text_descriptor^.number_of_ext_items;

            = llc$formal_parameters, llc$actual_parameters, llc$cybil_symbol_table_fragment =
              size := ci_text_descriptor^.sequence_length;

            = llc$ppu_absolute =
              ii_text_descriptor^.number_of_words := ci_text_descriptor^.number_of_words;
              size := ci_text_descriptor^.number_of_words;

            ELSE
              error (oce$invalid_object_record_kind, 'Object Text Descriptor 1.1', status);

            CASEND;

          ELSE
            eoi_warning (oce$missing_rec_or_descriptor, status);

          IFEND;


        PROCEND convert_object_text_desc_11;
?? OLDTITLE ??

?? NEWTITLE := '                             CONVERT IOU OBJECT MODULE' ??
?? NEWTITLE := '                               CONVERT PPU ABSOLUTE ITEM' ??
?? EJECT ??

        PROCEDURE convert_iou_object_module (VAR status: ost$status);




          PROCEDURE convert_ppu_absolute_item (number_of_words: llt$ppu_address;
            VAR status: ost$status);




            { 170 ppu absolute }


            TYPE
              llt$ci_ppu_absolute = record
                executes_on_any_ppu: boolean,
                f01: array [1 .. 7] of byte,

                f02: array [1 .. 7] of byte,
                ppu_number: 0 .. llc$max_ppu_number,

                f03: array [1 .. 6] of byte,
                load_address: llt$ppu_address,

                f04: array [1 .. 6] of byte,
                entry_address: llt$ppu_address,

                text_array: array [ * ] of ppu_text,

              recend,


              ppu_text = record
                f01: array [1 .. 6] of byte,
                text: 0 .. 0ffff(16),

              recend;






            VAR
              ci_ppu: ^llt$ci_ppu_absolute,
              ii_ppu: ^llt$ppu_absolute,
              w: 0 .. llc$max_ppu_size + 1;



            NEXT ci_ppu: [0 .. number_of_words - 1] IN ci_input_seg;

            IF ci_ppu <> NIL THEN

              NEXT ii_ppu: [0 .. number_of_words - 1] IN output_seq;


              convert_boolean (#LOC (ci_ppu^.executes_on_any_ppu), ii_ppu^.executes_on_any_ppu);

              ii_ppu^.ppu_number := ci_ppu^.ppu_number;
              ii_ppu^.load_address := ci_ppu^.load_address;
              ii_ppu^.entry_address := ci_ppu^.entry_address;

              FOR w := 0 TO (number_of_words - 1) DO
                ii_ppu^.text [w] := ci_ppu^.text_array [w].text;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'PPU Record', status);
            IFEND;


          PROCEND convert_ppu_absolute_item;
?? EJECT ??
?? OLDTITLE ??


          VAR
            type_of_obj_record {control} : llt$object_record_kind,
            size: integer;


          convert_object_text_desc_11 (type_of_obj_record, size, status);

          IF status.normal THEN
            CASE type_of_obj_record OF
            = llc$ppu_absolute =
              convert_ppu_absolute_item (size, status);

            ELSE
              error (oce$invalid_ppu_record_kind, 'IOU Object Module', status);

            CASEND;

          ELSE
            error (oce$missing_rec_or_descriptor, 'PPU Descriptor', status);
          IFEND;


        PROCEND convert_iou_object_module;
?? OLDTITLE ??
?? NEWTITLE := '                             CONVERT CPU OBJECT MODULE' ??
?? NEWTITLE := '                               CONVERT LIBRARY DIRECTIVES' ??
?? EJECT ??

        PROCEDURE convert_cpu_object_module (generator_id: llt$module_generator;
          VAR status: ost$status);

{       NOTE:                                    }
{         The parameter 'generator_id' is used }
{         by 'convert_formal_parameters' to      }
{         identify the type of calling procedure.}



          PROCEDURE convert_library_directives (number_of_libraries: 1 .. llc$max_libraries;
            VAR status: ost$status);


            { 170 library directives }


            TYPE
              llt$ci_libraries = array [ * ] of pmt$ci_program_name;


            VAR
              ci_library: ^llt$ci_libraries,
              ii_library: ^llt$libraries,
              l: 1 .. llc$max_libraries + 1;



            NEXT ci_library: [1 .. number_of_libraries] IN ci_input_seg;

            IF ci_library <> NIL THEN
              NEXT ii_library: [1 .. number_of_libraries] IN output_seq;


              FOR l := 1 TO number_of_libraries DO
                convert_string (ci_library^ [l], 1, ii_library^ [l]);
                IF ii_library^ [l] = 'CYBILIB ' THEN
                  ii_library^ [l] := 'CYF$RUN_TIME_LIBRARY';
                IFEND;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Library Record', status);
            IFEND;


          PROCEND convert_library_directives;
?? TITLE := '                               CONVERT SECTION DEFINITION' ??
?? EJECT ??

          PROCEDURE convert_section_definition_item (VAR status: ost$status);



            { 170 section definitions }


            TYPE
              llt$ci_section_definition = record
                f01: array [1 .. 7] of byte,
                kind: llt$section_kind,

                access_attributes: llt$section_access_attributes,
                f02: array [1 .. 7] of byte,

                f03: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f04: half_word,
                length: ost$segment_length,

                allocation_alignment: ost$segment_offset,

                allocation_offset: ost$segment_offset,

                name: pmt$ci_program_name,

              recend;




?? EJECT ??

            CONST
              num_access_attributes = 4;

            VAR
              ci_section: ^llt$ci_section_definition,
              ii_section: ^llt$section_definition;




            NEXT ci_section IN ci_input_seg;

            IF ci_section <> NIL THEN
              NEXT ii_section IN output_seq;


              ii_section^.kind := ci_section^.kind;

              convert_set (#LOC (ci_section^.access_attributes), num_access_attributes, #LOC (ii_section^.
                    access_attributes));

              ii_section^.section_ordinal := ci_section^.section_ordinal;
              ii_section^.length := ci_section^.length;
              convert_integer (#LOC (ci_section^.allocation_alignment), #LOC (ii_section^.
                    allocation_alignment));
              convert_integer (#LOC (ci_section^.allocation_offset), #LOC (ii_section^.allocation_offset));

              convert_string (ci_section^.name, 1, ii_section^.name);

            ELSE
              error (oce$missing_rec_or_descriptor, 'Section Defn. Record', status);
            IFEND;


          PROCEND convert_section_definition_item;
?? TITLE := '                               CONVERT TEXT ITEM' ??
?? EJECT ??

          PROCEDURE convert_text_item (number_of_bytes: 1 .. osc$max_segment_length;
            VAR status: ost$status);



            { 170 text item }


            TYPE
              llt$ci_text = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                byte_array: array [ * ] of text_component,

              recend,

              text_component = record
                f01: array [1 .. 7] of byte,
                byte: 0 .. 255,

              recend;





            VAR
              ci_text: ^llt$ci_text,
              ii_text: ^llt$text,
              b: 1 .. osc$max_segment_length + 1;

?? EJECT ??
            NEXT ci_text: [1 .. number_of_bytes] IN ci_input_seg;

            IF ci_text <> NIL THEN
              NEXT ii_text: [1 .. number_of_bytes] IN output_seq;


              ii_text^.section_ordinal := ci_text^.section_ordinal;
              ii_text^.offset := ci_text^.offset;

              FOR b := 1 TO number_of_bytes DO
                ii_text^.byte [b] := ci_text^.byte_array [b].byte;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Text Record', status);
            IFEND;


          PROCEND convert_text_item;
?? TITLE := '                               CONVERT REPLICATION ITEM' ??
?? EJECT ??

          PROCEDURE convert_replication_item (number_of_bytes: 1 .. osc$max_segment_length;
            VAR status: ost$status);




            { 170 replication item }


            TYPE
              llt$ci_replication = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                f03: half_word,
                increment: 1 .. osc$max_segment_length,

                f04: half_word,
                count: 1 .. osc$max_segment_length,

                byte_array: array [ * ] of replication_text,

              recend,


              replication_text = record
                f01: array [1 .. 7] of byte,
                byte: 0 .. 255,

              recend;

?? EJECT ??

            VAR
              ci_replication: ^llt$ci_replication,
              ii_replication: ^llt$replication,
              b: 1 .. osc$max_segment_length + 1;



            NEXT ci_replication: [1 .. number_of_bytes] IN ci_input_seg;

            IF ci_replication <> NIL THEN
              NEXT ii_replication: [1 .. number_of_bytes] IN output_seq;


              ii_replication^.section_ordinal := ci_replication^.section_ordinal;
              ii_replication^.offset := ci_replication^.offset;
              ii_replication^.increment := ci_replication^.increment;
              ii_replication^.count := ci_replication^.count;

              FOR b := 1 TO number_of_bytes DO
                ii_replication^.byte [b] := ci_replication^.byte_array [b].byte;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Replication Record', status);
            IFEND;


          PROCEND convert_replication_item;
?? TITLE := '                               CONVERT BIT INSERTION ITEM' ??
?? EJECT ??

          PROCEDURE convert_bit_insertion_item (VAR status: ost$status);




            { 170 bit insertion item }


            TYPE
              llt$ci_bit_string_insertion = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                f03: array [1 .. 7] of byte,
                bit_offset: 0 .. 7,

                f04: array [1 .. 7] of byte,
                bit_length: 1 .. 63,

                bit_string: packed array [1 .. 128] of 0 .. 1,

              recend;


            VAR
              ci_bit_insertion: ^llt$ci_bit_string_insertion,
              ii_bit_insertion: ^llt$bit_string_insertion,
              b: 1 .. 128;

?? EJECT ??



            NEXT ci_bit_insertion IN ci_input_seg;

            IF ci_bit_insertion <> NIL THEN
              NEXT ii_bit_insertion IN output_seq;


              ii_bit_insertion^.section_ordinal := ci_bit_insertion^.section_ordinal;
              ii_bit_insertion^.offset := ci_bit_insertion^.offset;
              ii_bit_insertion^.bit_offset := ci_bit_insertion^.bit_offset;
              ii_bit_insertion^.bit_length := ci_bit_insertion^.bit_length;

              FOR b := 1 TO 60 DO
                ii_bit_insertion^.bit_string [b] := ci_bit_insertion^.bit_string [b + 4];
              FOREND;
              FOR b := 61 TO 63 DO
                ii_bit_insertion^.bit_string [b] := ci_bit_insertion^.bit_string [b + 8];
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Bit Insertion Record', status);
            IFEND;


          PROCEND convert_bit_insertion_item;
?? TITLE := '                               CONVERT ADDRESS FORMULATION ITEM' ??
?? EJECT ??

          PROCEDURE convert_addr_formulation_item (addr_upper_bnd: 1 .. llc$max_adr_items;
            VAR status: ost$status);


            { 170 address formulation item }


            TYPE
              llt$ci_address_formulation = record
                f01: array [1 .. 6] of byte,
                value_section: llt$section_ordinal,

                f02: array [1 .. 6] of byte,
                dest_section: llt$section_ordinal,

                item: array [ * ] of llt$ci_address_formulation_item,

              recend,


              llt$ci_address_formulation_item = record
                f01: array [1 .. 7] of byte,
                kind: llt$internal_address_kind,

                f02: half_word,
                value_offset: llt$section_offset,

                f03: half_word,
                dest_offset: llt$section_offset,

              recend;






            VAR
              ci_address: ^llt$ci_address_formulation,
              ii_address: ^llt$address_formulation,
              a: 1 .. llc$max_adr_items + 1;

?? EJECT ??



            NEXT ci_address: [1 .. addr_upper_bnd] IN ci_input_seg;

            IF ci_address <> NIL THEN
              NEXT ii_address: [1 .. addr_upper_bnd] IN output_seq;


              ii_address^.value_section := ci_address^.value_section;
              ii_address^.dest_section := ci_address^.dest_section;

              FOR a := 1 TO addr_upper_bnd DO
                ii_address^.item [a].kind := ci_address^.item [a].kind;
                ii_address^.item [a].value_offset := ci_address^.item [a].value_offset;
                ii_address^.item [a].dest_offset := ci_address^.item [a].dest_offset;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Address Formulation Record', status);
            IFEND;


          PROCEND convert_addr_formulation_item;
?? TITLE := '                               CONVERT EXTERNAL REFERENCE ITEM' ??
?? EJECT ??

          PROCEDURE convert_external_linkage_item (number_of_ext_items: 1 .. llc$max_ext_items;
            VAR status: ost$status);



            { 170 external reference item }


            TYPE
              llt$ci_external_linkage = record
                name: pmt$ci_program_name,

                f00: array [1 .. 7] of byte,
                language: llt$module_generator,

                declaration_matching_required: boolean,
                f01: array [1 .. 7] of byte,

                declaration_matching_value: llt$ci_decl_matching_value,

                item: array [ * ] of llt$ci_external_linkage_item,
              recend,


              llt$ci_external_linkage_item = record
                f02: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f03: half_word,
                offset: llt$section_offset,
                f01: array [1 .. 7] of byte,
                kind: llt$address_kind,

                offset_operand: - osc$maximum_offset .. osc$maximum_offset,

              recend;


?? EJECT ??

            VAR
              ci_external_linkage: ^llt$ci_external_linkage,
              ii_external_linkage: ^llt$external_linkage,
              e: 1 .. llc$max_ext_items + 1;


            NEXT ci_external_linkage: [1 .. number_of_ext_items] IN ci_input_seg;

            IF ci_external_linkage <> NIL THEN
              NEXT ii_external_linkage: [1 .. number_of_ext_items] IN output_seq;

              convert_string (ci_external_linkage^.name, 1, ii_external_linkage^.name);

              ii_external_linkage^.language := ci_external_linkage^.language;
              IF ci_external_linkage^.language = llc$obsolete_cybil THEN
                convert_boolean (#LOC (ci_external_linkage^.declaration_matching_required),
                      ii_external_linkage^.declaration_matching_required);
                ii_external_linkage^.declaration_matching.language_dependent_value :=
                      ci_external_linkage^.declaration_matching_value.lower_1 * 100000000(16) +
                      ci_external_linkage^.declaration_matching_value.lower_2;
              ELSE
                ii_external_linkage^.declaration_matching_required := FALSE;

                ii_external_linkage^.declaration_matching.object_encryption := 0;
                ii_external_linkage^.declaration_matching.source_encryption := 0;
              IFEND;
              FOR e := 1 TO number_of_ext_items DO
                ii_external_linkage^.item [e].kind := ci_external_linkage^.item [e].kind;

                convert_integer (#LOC (ci_external_linkage^.item [e].offset_operand), #LOC
                      (ii_external_linkage^.item [e].offset_operand));

                ii_external_linkage^.item [e].section_ordinal := ci_external_linkage^.item [e].
                      section_ordinal;
                ii_external_linkage^.item [e].offset := ci_external_linkage^.item [e].offset;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'External Reference Record', status);
            IFEND;


          PROCEND convert_external_linkage_item;
?? TITLE := '                               CONVERT ENTRY POINT DEFINITION' ??
?? EJECT ??

          PROCEDURE convert_entry_point_definition (VAR status: ost$status);




            { 170 entry point definition item }


            TYPE
              llt$ci_entry_definition = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                attributes: llt$entry_point_attributes,
                f03: array [1 .. 7] of byte,

                name: pmt$ci_program_name,

                f04: array [1 .. 7] of byte,
                language: llt$module_generator,

                declaration_matching_required: boolean,
                f05: array [1 .. 7] of byte,

                declaration_matching_value: llt$ci_decl_matching_value,

              recend;


            CONST
              num_entry_point_attr = 2;

?? EJECT ??

            VAR
              ci_entry_point: ^llt$ci_entry_definition,
              ii_entry_point: ^llt$entry_definition;



            NEXT ci_entry_point IN ci_input_seg;

            IF ci_entry_point <> NIL THEN
              NEXT ii_entry_point IN output_seq;


              ii_entry_point^.section_ordinal := ci_entry_point^.section_ordinal;
              ii_entry_point^.offset := ci_entry_point^.offset;

              convert_set (#LOC (ci_entry_point^.attributes), num_entry_point_attr, #LOC (ii_entry_point^.
                    attributes));

              convert_string (ci_entry_point^.name, 1, ii_entry_point^.name);

              ii_entry_point^.language := ci_entry_point^.language;
              IF ci_entry_point^.language = llc$obsolete_cybil THEN
                convert_boolean (#LOC (ci_entry_point^.declaration_matching_required),
                      ii_entry_point^.declaration_matching_required);
                ii_entry_point^.declaration_matching.language_dependent_value :=
                      ci_entry_point^.declaration_matching_value.lower_1 * 100000000(16) +
                      ci_entry_point^.declaration_matching_value.lower_2;
              ELSE

                ii_entry_point^.declaration_matching_required := FALSE;

                ii_entry_point^.declaration_matching.object_encryption := 0;
                ii_entry_point^.declaration_matching.source_encryption := 0;
              IFEND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Entry Point Defn. Record', status);
            IFEND;


          PROCEND convert_entry_point_definition;
?? TITLE := '                               CONVERT RELOCATION ITEM' ??
?? EJECT ??

          PROCEDURE convert_relocation_item (number_of_rel_items: 1 .. llc$max_rel_items;
            VAR status: ost$status);



            { relocation item }

            TYPE
              llt$ci_relocation = array [ * ] of llt$ci_relocation_item,


              llt$ci_relocation_item = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                f03: array [1 .. 6] of byte,
                relocating_section: llt$section_ordinal,

                f04: array [1 .. 7] of byte,
                container: llt$relocation_container,

                f05: array [1 .. 7] of byte,
                address: llt$address_type,

              recend;

?? EJECT ??



            VAR
              ci_relocation: ^llt$ci_relocation,
              ii_relocation: ^llt$relocation,
              r: 1 .. llc$max_rel_items + 1;



            NEXT ci_relocation: [1 .. number_of_rel_items] IN ci_input_seg;

            IF ci_relocation <> NIL THEN
              NEXT ii_relocation: [1 .. number_of_rel_items] IN output_seq;

              FOR r := 1 TO number_of_rel_items DO
                ii_relocation^ [r].section_ordinal := ci_relocation^ [r].section_ordinal;
                ii_relocation^ [r].offset := ci_relocation^ [r].offset;
                ii_relocation^ [r].relocating_section := ci_relocation^ [r].relocating_section;
                ii_relocation^ [r].container := ci_relocation^ [r].container;
                ii_relocation^ [r].address := ci_relocation^ [r].address;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Relocation Record', status);
            IFEND;


          PROCEND convert_relocation_item;
?? TITLE := '                               170 Formal & Actual Parameter Items' ??
?? EJECT ??




          { 170 procedure formal parameter description item }


          TYPE
            llt$ci_formal_parameters = record
              procedure_name: pmt$ci_program_name,

            recend;


          { 170 procedure call actual parameters item }


          TYPE
            llt$ci_actual_parameters = record
              callee_name: pmt$ci_program_name,

              f01: array [1 .. 7] of byte,
              language: llt$module_generator,

              f02: array [1 .. 5] of byte,
              line_number_of_call: llt$source_line_number,


            recend,

            llt$ci_source_line_number = packed array [1 .. 64] of half_byte;





?? TITLE := '                               170 Fortran Argument Descriptor' ??
?? EJECT ??
          { 170 fortran argument description: used to describe a }
          { single actual or formal fortran parameter }


          TYPE
            llt$ci_fortran_argument_desc = record
              f01: array [1 .. 7] of byte,
              argument_type: llt$fortran_argument_type,

              string_length: llt$ci_fortran_string_length,

              f02: array [1 .. 7] of byte,
              argument_kind: llt$fortran_argument_kind,

              array_size: llt$ci_fortran_array_size,

              f03: array [1 .. 6] of byte,
              dummy_argument_ordinal: 1 .. llc$max_fortran_arguments,


              f04: array [1 .. 7] of byte,
              mode: llt$argument_usage,
            recend,


            llt$ci_fortran_string_length = packed record
              f01: half_byte,
              attributes: llt$fortran_string_attributes,
              f02: half_byte,
              f03: array [1 .. 6] of byte,

              f04: array [1 .. 6] of byte,
              number_of_characters: llt$fortran_string_size,
            recend,


            llt$ci_fortran_array_size = packed record
              f01: half_byte,
              attributes: llt$fortran_array_attributes,
              f02: half_byte,
              f03: array [1 .. 6] of byte,

              f04: array [1 .. 7] of byte,
              rank: llt$fortran_array_rank,

              f05: half_word,
              number_of_elements: llt$section_length,
            recend;




?? TITLE := '                               CONVERT FORTRAN PARAMETERS' ??
?? EJECT ??

          PROCEDURE convert_fortran_parameters (sequence_length: ost$segment_length;
            VAR parameters: SEQ ( * );
            VAR status: ost$status);


            VAR
              parameter_sequence: ^SEQ ( * ),
              ci_fortran_parameter: ^array [1 .. * ] of llt$ci_fortran_argument_desc,
              ii_fortran_parameter: ^array [1 .. * ] of llt$fortran_argument_desc,
              num_params: integer,
              np: integer;


            num_params := sequence_length DIV #SIZE (llt$ci_fortran_argument_desc);

            NEXT ci_fortran_parameter: [1 .. num_params] IN ci_input_seg;
            IF ci_fortran_parameter = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Fortran Parameters', status);
              RETURN;
            IFEND;

            parameter_sequence := ^parameters;
            RESET parameter_sequence;
            NEXT ii_fortran_parameter: [1 .. num_params] IN parameter_sequence;

            FOR np := 1 TO num_params DO
              ii_fortran_parameter^ [np].argument_type := ci_fortran_parameter^ [np].argument_type;

              ii_fortran_parameter^ [np].string_length.attributes := ci_fortran_parameter^ [np].string_length.
                    attributes;

              ii_fortran_parameter^ [np].string_length.number_of_characters := ci_fortran_parameter^ [np].
                    string_length.number_of_characters;

              ii_fortran_parameter^ [np].argument_kind := ci_fortran_parameter^ [np].argument_kind;

              ii_fortran_parameter^ [np].array_size.attributes := ci_fortran_parameter^ [np].array_size.
                    attributes;

              ii_fortran_parameter^ [np].array_size.rank := ci_fortran_parameter^ [np].array_size.rank;

              ii_fortran_parameter^ [np].array_size.number_of_elements := ci_fortran_parameter^ [np].
                    array_size.number_of_elements;

              ii_fortran_parameter^ [np].dummy_argument_ordinal := ci_fortran_parameter^ [np].
                    dummy_argument_ordinal;

              ii_fortran_parameter^ [np].mode := ci_fortran_parameter^ [np].mode;
            FOREND;


          PROCEND convert_fortran_parameters;
?? TITLE := '                               CONVERT FORMAL PARAMETERS' ??
?? EJECT ??

          PROCEDURE convert_formal_parameters (sequence_length: ost$segment_length;
                type_of_calling_routine {control} : llt$module_generator;
            VAR status: ost$status);



            VAR
              ci_parameter_item: ^llt$ci_formal_parameters,
              ii_parameter_item: ^llt$formal_parameters;



            NEXT ci_parameter_item IN ci_input_seg;

            IF ci_parameter_item <> NIL THEN
              CASE type_of_calling_routine OF
              = llc$fortran =
                ii_text_descriptor^.sequence_length := sequence_length DIV #SIZE
                      (llt$ci_fortran_argument_desc) * #SIZE (llt$fortran_argument_desc);

                NEXT ii_parameter_item: [[REP ii_text_descriptor^.sequence_length OF cell]] IN output_seq;

                convert_fortran_parameters (sequence_length, ii_parameter_item^.specification, status);
              ELSE
                error (oce$invalid_parameter_kind, 'Formal Parameters', status);
              CASEND;

              convert_string (ci_parameter_item^.procedure_name, 1, ii_parameter_item^.procedure_name);

            ELSE
              error (oce$missing_rec_or_descriptor, 'Formal Parameters', status);
            IFEND;


          PROCEND convert_formal_parameters;
?? TITLE := '                               CONVERT ACTUAL PARAMETERS' ??
?? EJECT ??

          PROCEDURE convert_actual_parameters (sequence_length: ost$segment_length;
            VAR status: ost$status);



            VAR
              ci_parameter_item: ^llt$ci_actual_parameters,
              ii_parameter_item: ^llt$actual_parameters;



            NEXT ci_parameter_item IN ci_input_seg;

            IF ci_parameter_item <> NIL THEN
              CASE ci_parameter_item^.language OF
              = llc$fortran =
                ii_text_descriptor^.sequence_length := sequence_length DIV #SIZE
                      (llt$ci_fortran_argument_desc) * #SIZE (llt$fortran_argument_desc);

                NEXT ii_parameter_item: [[REP ii_text_descriptor^.sequence_length OF cell]] IN output_seq;

                convert_fortran_parameters (sequence_length, ii_parameter_item^.specification, status);
              ELSE
                error (oce$invalid_parameter_kind, 'Actual Parameters', status);
              CASEND;

              convert_string (ci_parameter_item^.callee_name, 1, ii_parameter_item^.callee_name);

              ii_parameter_item^.language := ci_parameter_item^.language;

              ii_parameter_item^.line_number_of_call := ci_parameter_item^.line_number_of_call;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Actual Parameters', status);
            IFEND;


          PROCEND convert_actual_parameters;
?? TITLE := '                               170 Debug Symbol Table Declarations' ??
?? EJECT ??

          TYPE
            cyt$ci_cybil_symbol_table_item = packed record
              symbol_name: packed array [1 .. 100] of half_byte,
              next_symbol: symbol_no,
              symtab_no: symbol_no,
              case symbol_type: entry_kinds of

              = var_kind =
                f01: 0 .. 03ff(16),

                f02: half_byte,
                var_type: symbol_no,
                var_length: ost$segment_length,
                base: base_type,
                f03: 0 .. 1ff(16),

                f04: half_byte,
                var_section_ordinal: llt$section_ordinal,
                var_offset: ost$segment_length,
                indirectly_referenced: boolean,

              = cons_kind =
                f05: 0 .. 03ff(16),

                f06: half_byte,
                cons_type: symbol_no,
                f07: 0 .. 0fffffffffff(16),

                f08: half_byte,
                cons_value: integer_range,

              = label_kind =
                f09: 0 .. 03ff(16),

                f10: half_byte,
                line_no: line_number_range,

              = ordinal_kind =
                f11: 0 .. 03ff(16),

                f12: half_byte,
                last_const: symbol_no,
                upper_bound: 0 .. 4095,

              = subrange_kind =
                f13: 0 .. 03ff(16),

                f14: half_byte,
                subtype: symbol_no,
                low_value_type: len_kinds,
                high_value_type: len_kinds,
                f15: 0 .. 0ffffffffff(16),

                f16: half_byte,
                low_value: integer_range,
                f17: 0 .. 7ff(16),

                f18: half_byte,
                high_value: integer_range,

              = proc_kind =
                main_proc: boolean,
                f19: 0 .. 01ff(16),

                f20: half_byte,
                param_list: symbol_no,
                symbol_list: symbol_no,
                f21: 0 .. 0fffffff(16),

                f22: half_byte,
                proc_section_ordinal: llt$section_offset, {************ change for build M **************}
                f24: 0 .. 01fffffff(16),

                f25: half_byte,
                proc_offset: ost$segment_length,
                f23: 0 .. 0fffffff(16),

                f26: half_byte,
                proc_length: ost$segment_length,
                parent_proc: symbol_no,
                f27: 0 .. 0fff(16),

                f28: half_byte,
                return_type: symbol_no,
                f29: 0 .. 0fffffffffff(16),

              = pointer_kind =
                f30: 0 .. 03ff(16),

                f31: half_byte,
                ptr_type: symbol_no,

              = set_kind =
                f32: 0 .. 03ff(16),

                f33: half_byte,
                set_element_type: symbol_no,
                set_len: 0 .. 7fff(16),

              = string_kind =
                len_type: len_kinds,
                f34: 0 .. 00ff(16),

                f35: half_byte,
                string_len: symbol_no,

              = array_kind =
                array_binding: bindkinds,
                array_packing: packattrs,
                length_is_bits: boolean,
                f36: 0 .. 07(16),

                f37: half_byte,
                index_type: symbol_no,
                array_element_type: symbol_no,
                f38: 0 .. 07ffffff(16),

                f39: half_byte,
                element_length: ost$segment_length,

              = record_kind =
                record_binding: bindkinds,
                record_packing: packattrs,
                variation_flag: boolean,
                f40: 0 .. 07(16),

                f41: half_byte,
                first_field: symbol_no,
                record_length: ost$segment_length,
                f42: 0 .. 7ff(16),

                f43: half_byte,
                selector: symbol_no,

              = field_kind =
                f44: 0 .. 03ff(16),

                f45: half_byte,
                field_offset: machine_addr_in_bits_type,
                f46: 0 .. 3ffffff(16),

                f47: half_byte,
                field_length: machine_addr_in_bits_type,
                unit_addressed: boolean,
                field_type: symbol_no,
                f48: 0 .. 1ff(16),

                f49: half_byte,
                next_field: symbol_no,

              = selector_kind =
                f50: 0 .. 03ff(16),

                f51: half_byte,
                variation: symbol_no,
                next_selector: symbol_no,
                f52: 0 .. 0fffffff(16),

                f53: half_byte,
                low_selector: integer_range,
                f54: 0 .. 7ff(16),

                f55: half_byte,
                high_selector: integer_range,

              = heap_kind =
                ,

              = seq_kind =
                ,


              = parameter_kind =
                param_mode: mode_kinds,
                f56: 0 .. 01f(16),

                f57: half_byte,
                param_type: symbol_no,
                next_param: symbol_no,

              = bound_vrec_kind =
                f58: 0 .. 03ff(16),

                f59: half_byte,
                bound_type: symbol_no,

              casend,
            recend,


            cyt$ci_cybil_symbol_table = record
              original_name: pmt$ci_program_name,

              f01: array [1 .. 7] of byte,
              language: llt$module_generator,

              f02: array [1 .. 6] of byte,
              number_of_symbols: symbol_no,
            recend,


            llt$ci_debug_table_fragment = record
              f01: half_word,
              offset: llt$section_offset,
            recend;

          TYPE
            cyt$ii_cybil_symbol_table = record
              original_name: pmt$program_name,
              language: llt$module_generator,
              number_of_symbols: symbol_no,
            recend;

?? TITLE := '                               CONVERT CYBIL SYMBOL TABLE' ??
?? EJECT ??

          PROCEDURE convert_cybil_symbol_table (sequence_length: ost$segment_length;
            VAR status: ost$status);


          PROCEND convert_cybil_symbol_table;
?? TITLE := '                               CONVERT BINDING TEMPLATE ITEM' ??
?? EJECT ??

          PROCEDURE convert_binding_template (VAR status: ost$status);


            { 170 binding section }

            TYPE
              llt$ci_binding_template = record
                f00: half_word,
                binding_offset: llt$section_offset,

                f01: array [1 .. 7] of byte,
                case kind: llt$binding_template_kind of
                = llc$current_module =
                  f02: array [1 .. 6] of byte,
                  section_ordinal: llt$section_ordinal,

                  f03: 0 .. 0ffffffff(16),
                  offset: llt$section_offset,

                  f04: array [1 .. 7] of byte,
                  internal_address: llt$address_kind,

                  f05: array [1 .. 5] of word,

                = llc$external_reference =
                  name: pmt$ci_program_name,

                  f06: array [1 .. 7] of byte,
                  address: llt$address_kind,
                casend,
              recend;

?? EJECT ??

            VAR
              ci_binding: ^llt$ci_binding_template,
              ii_binding: ^llt$binding_template;


            NEXT ci_binding IN ci_input_seg;

            IF ci_binding <> NIL THEN
              NEXT ii_binding IN output_seq;

              ii_binding^.binding_offset := ci_binding^.binding_offset;

              ii_binding^.kind := ci_binding^.kind;

              CASE ci_binding^.kind OF
              = llc$current_module =
                ii_binding^.section_ordinal := ci_binding^.section_ordinal;
                ii_binding^.offset := ci_binding^.offset;
                ii_binding^.internal_address := ci_binding^.internal_address;

              = llc$external_reference =
                convert_string (ci_binding^.name, 1, ii_binding^.name);
                ii_binding^.address := ci_binding^.address;

              CASEND;
            ELSE
              error (oce$missing_rec_or_descriptor, 'Binding Template Record', status);
            IFEND;


          PROCEND convert_binding_template;
?? TITLE := '                               CONVERT TRANSFER SYMBOL ITEM' ??
?? EJECT ??

          PROCEDURE convert_transfer_symbol_item (VAR status: ost$status);



            { 170 transfer symbol }


            TYPE
              llt$ci_transfer_symbol = record
                name: pmt$ci_program_name,

              recend;


            VAR
              ci_transfer_symbol: ^llt$ci_transfer_symbol,
              ii_transfer_symbol: ^llt$transfer_symbol;

            NEXT ci_transfer_symbol IN ci_input_seg;

            IF ci_transfer_symbol <> NIL THEN
              NEXT ii_transfer_symbol IN output_seq;
              convert_string (ci_transfer_symbol^.name, 1, ii_transfer_symbol^.name);

            ELSE
              error (oce$missing_rec_or_descriptor, 'Transfer Symbol Record', status);
            IFEND;


          PROCEND convert_transfer_symbol_item;
?? OLDTITLE ??
?? EJECT ??

          VAR
            type_of_obj_record {control} : llt$object_record_kind,
            size: integer;


          REPEAT
            convert_object_text_desc_11 (type_of_obj_record, size, status);

            IF status.normal THEN

              CASE type_of_obj_record OF
              = llc$identification =
                error (oce$multiple_ident_records, 'CPU Object Module', status);

              = llc$libraries =
                convert_library_directives (size, status);

              = llc$section_definition =
                convert_section_definition_item (status);

              = llc$text =
                convert_text_item (size, status);

              = llc$replication =
                convert_replication_item (size, status);

              = llc$bit_string_insertion =
                convert_bit_insertion_item (status);

              = llc$address_formulation =
                convert_addr_formulation_item (size, status);

              = llc$external_linkage =
                convert_external_linkage_item (size, status);

              = llc$entry_definition =
                convert_entry_point_definition (status);

              = llc$relocation =
                convert_relocation_item (size, status);

              = llc$actual_parameters =
                convert_actual_parameters (size, status);

              = llc$formal_parameters =
                convert_formal_parameters (size, generator_id, status);

              = llc$cybil_symbol_table_fragment =
                convert_cybil_symbol_table (size, status);

              = llc$binding_template =
                convert_binding_template (status);

              = llc$transfer_symbol =
                convert_transfer_symbol_item (status);

              ELSE
                error (oce$invalid_cpu_record_kind, 'CPU Object Module', status);

              CASEND;

            ELSE
              error (status.condition, 'Object Text Descriptor 1.1', status);
            IFEND;

          UNTIL (type_of_obj_record = llc$transfer_symbol) OR (NOT status.normal);


        PROCEND convert_cpu_object_module;
?? TITLE := '                             CONVERT IDENTIFICATION BODY' ??
?? EJECT ??

        PROCEDURE convert_identification_body (ii_identification: ^llt$identification;
          VAR type_of_object_program: llt$module_kind;
          VAR generator_id: llt$module_generator;
          VAR status: ost$status);


          { 170 identification record }


          TYPE
            llt$ci_identification_body = record
              f00: array [1 .. 7] of byte,
              kind: llt$module_kind,

              time_created: ost$ci_time,

              date_created: ost$ci_date,

              f01: array [1 .. 7] of byte,
              attributes: llt$module_attributes,

              f02: array [1 .. 6] of byte,
              greatest_section_ordinal: llt$section_ordinal,

              f03: array [1 .. 7] of byte,
              generator_id: llt$module_generator,

              generator_name_vers: packed array [1 .. 128] of half_byte,

              commentary: packed array [1 .. 128] of half_byte,

            recend;


          CONST
            num_module_attr = 2;




          { 170 return date }


          TYPE
            ost$ci_date = record
              f01: array [1 .. 7] of byte,
              case date_format: ost$date_formats of
              = osc$month_date =
                month: packed array [1 .. 64] of half_byte,

              = osc$mdy_date =
                mdy: packed array [1 .. 64] of half_byte,

              = osc$iso_date =
                iso: packed array [1 .. 64] of half_byte,

              = osc$ordinal_date =
                ordinal: packed array [1 .. 64] of half_byte,

              casend,

            recend;




          { 170 return time }


          TYPE
            ost$ci_time = record
              f01: array [1 .. 7] of byte,
              case time_format: ost$time_formats of
              = osc$ampm_time =
                ampm: packed array [1 .. 48] of half_byte,

              = osc$hms_time =
                hms: packed array [1 .. 48] of half_byte,

              = osc$millisecond_time =
                millisecond: packed array [1 .. 48] of half_byte,

              casend,

            recend;

?? EJECT ??

          VAR
            ci_identification: ^llt$ci_identification_body;



          NEXT ci_identification IN ci_input_seg;

          IF ci_identification <> NIL THEN

            type_of_object_program := ci_identification^.kind;
            ii_identification^.kind := ci_identification^.kind;

            { convert time request return value }

            ii_identification^.time_created.time_format := ci_identification^.time_created.time_format;

            CASE ci_identification^.time_created.time_format OF
            = osc$ampm_time =
              convert_string (ci_identification^.time_created.ampm, 1, ii_identification^.time_created.ampm);

            = osc$hms_time =
              convert_string (ci_identification^.time_created.hms, 1, ii_identification^.time_created.hms);

            = osc$millisecond_time =
              convert_string (ci_identification^.time_created.millisecond, 1, ii_identification^.time_created.
                    millisecond);
            ELSE
              error (pme$invalid_time_format, 'Identification Record', status);

            CASEND;

            IF status.normal THEN

              { convert date request return value }

              ii_identification^.date_created.date_format := ci_identification^.date_created.date_format;

              CASE ci_identification^.date_created.date_format OF
              = osc$month_date =
                convert_string (ci_identification^.date_created.month, 1, ii_identification^.date_created.
                      month);

              = osc$mdy_date =
                convert_string (ci_identification^.date_created.mdy, 1, ii_identification^.date_created.mdy);

              = osc$iso_date =
                convert_string (ci_identification^.date_created.iso, 1, ii_identification^.date_created.iso);

              = osc$ordinal_date =
                convert_string (ci_identification^.date_created.ordinal, 1, ii_identification^.date_created.
                      ordinal);
              ELSE
                error (pme$invalid_date_format, 'Identification Record', status);

              CASEND;

              IF status.normal THEN

                { finish converting identification record }

                convert_set (#LOC (ci_identification^.attributes), num_module_attr, #LOC (ii_identification^.
                      attributes));

                ii_identification^.greatest_section_ordinal := ci_identification^.greatest_section_ordinal;

                ii_identification^.generator_id := ci_identification^.generator_id;
                generator_id := ci_identification^.generator_id;

                IF generator_id = llc$assembler THEN
                  ii_identification^.attributes := ii_identification^.attributes + $llt$module_attributes
                        [llc$nonbindable];
                IFEND;

                IF generator_id = llc$cybil THEN
                  error (oce$invalid_version, 'V1.1 - CYBIL', status);
                  RETURN;
                IFEND;

                convert_string (ci_identification^.generator_name_vers, 1, ii_identification^.
                      generator_name_vers);

                convert_string (ci_identification^.commentary, 1, ii_identification^.commentary);

              IFEND;
            IFEND;
          ELSE
            error (oce$missing_rec_or_descriptor, 'Identification Record', status);
          IFEND;


        PROCEND convert_identification_body;
?? OLDTITLE ??
?? EJECT ??


        VAR
          kind_of_object_module {control} : llt$module_kind,
          module_generator: llt$module_generator;




        convert_identification_body (ii_identification, kind_of_object_module, module_generator, status);

        IF status.normal THEN
          CASE kind_of_object_module OF
          = llc$iou =
            convert_iou_object_module (status);

          = llc$mi_virtual_state, llc$vector_virtual_state, llc$vector_extended_state =
            convert_cpu_object_module (module_generator, status);

          ELSE
            error (oce$invalid_object_module_kind, 'Version 1.1 Text', status);
          CASEND;

        IFEND;

      PROCEND convert_version_11_text;
?? OLDTITLE ??
?? NEWTITLE := '                           CONVERT VERSION 1.2 TEXT' ??
?? NEWTITLE := '                             CONVERT OBJECT TEXT DESCRIPTOR - 1.2' ??
?? EJECT ??

      PROCEDURE convert_version_12_text (ii_identification: ^llt$identification;
        VAR output_seq: ^SEQ ( * );
        VAR status: ost$status);

{ The following *copy is here on purpose.  If it is moved to the beginning of
{ the module, it will not compile given the current implementation.  The problem is that
{ ordinal types llt$object_record_kind and llt$extended_object_record_kind, which is
{ declared in procedure convert_object_file, use some of the same ordinal names.
{ Declaring llt$object_record_kind here means that the ordinal names override the ones
{ with the same names declared in the outer procedure.

*copy llt$object_record_kind



        VAR
          ii_text_descriptor: ^llt$object_text_descriptor;


        PROCEDURE convert_object_text_desc_12 (VAR object_type: llt$object_record_kind;
          VAR size: integer;
          VAR status: ost$status);





          TYPE
            llt$ci_object_text_descriptor = record
              f00: array [1 .. 7] of byte,
              case kind: llt$object_record_kind of
              = llc$identification, llc$section_definition, llc$entry_definition, llc$binding_template,
                llc$transfer_symbol, llc$bit_string_insertion =
                unused: ost$segment_offset, {always 0}

              = llc$libraries =
                f02: array [1 .. 6] of byte,
                number_of_libraries: 1 .. llc$max_libraries,

              = llc$text, llc$replication =
                f03: array [1 .. 4] of byte,
                number_of_bytes: 1 .. osc$max_segment_length,

              = llc$relocation =
                f05: array [1 .. 6] of byte,
                number_of_rel_items: 1 .. llc$max_rel_items,

              = llc$address_formulation =
                f06: array [1 .. 6] of byte,
                number_of_adr_items: 1 .. llc$max_adr_items,

              = llc$external_linkage =
                f07: array [1 .. 6] of byte,
                number_of_ext_items: 1 .. llc$max_ext_items,

              = llc$formal_parameters, llc$actual_parameters, llc$cybil_symbol_table_fragment =
                f08: array [1 .. 4] of byte,
                sequence_length: ost$segment_length,

              = llc$ppu_absolute =
                f09: array [1 .. 6] of byte,
                number_of_words: llt$ppu_address,
              casend,
            recend;




          VAR
            ci_text_descriptor: ^llt$ci_object_text_descriptor;



          NEXT ci_text_descriptor IN ci_input_seg;

          IF ci_text_descriptor <> NIL THEN
            object_type := ci_text_descriptor^.kind;

            NEXT ii_text_descriptor IN output_seq;

            ii_text_descriptor^.kind := ci_text_descriptor^.kind;

            CASE ci_text_descriptor^.kind OF
            = llc$identification, llc$section_definition, llc$entry_definition, llc$binding_template,
                  llc$bit_string_insertion, llc$transfer_symbol =
              ii_text_descriptor^.unused := ci_text_descriptor^.unused;

            = llc$libraries =
              ii_text_descriptor^.number_of_libraries := ci_text_descriptor^.number_of_libraries;
              size := ci_text_descriptor^.number_of_libraries;

            = llc$text, llc$replication =
              ii_text_descriptor^.number_of_bytes := ci_text_descriptor^.number_of_bytes;
              size := ci_text_descriptor^.number_of_bytes;

            = llc$relocation =
              ii_text_descriptor^.number_of_rel_items := ci_text_descriptor^.number_of_rel_items;
              size := ci_text_descriptor^.number_of_rel_items;

            = llc$address_formulation =
              ii_text_descriptor^.number_of_adr_items := ci_text_descriptor^.number_of_adr_items;
              size := ci_text_descriptor^.number_of_adr_items;

            = llc$external_linkage =
              ii_text_descriptor^.number_of_ext_items := ci_text_descriptor^.number_of_ext_items;
              size := ci_text_descriptor^.number_of_ext_items;

            = llc$formal_parameters, llc$actual_parameters =
              size := ci_text_descriptor^.sequence_length;

            = llc$cybil_symbol_table_fragment =
              size := ci_text_descriptor^.sequence_length;
              RESET output_seq TO ii_text_descriptor;

            = llc$ppu_absolute =
              ii_text_descriptor^.number_of_words := ci_text_descriptor^.number_of_words;
              size := ci_text_descriptor^.number_of_words;

            ELSE
              error (oce$invalid_object_record_kind, 'Object Text Descriptor 1.2', status);

            CASEND;

          ELSE
            eoi_warning (oce$missing_rec_or_descriptor, status);

          IFEND;


        PROCEND convert_object_text_desc_12;
?? OLDTITLE ??

?? NEWTITLE := '                             CONVERT IOU OBJECT MODULE' ??
?? NEWTITLE := '                               CONVERT PPU ABSOLUTE ITEM' ??
?? EJECT ??

        PROCEDURE convert_iou_object_module (VAR status: ost$status);




          PROCEDURE convert_ppu_absolute_item (number_of_words: llt$ppu_address;
            VAR status: ost$status);




            { 170 ppu absolute }


            TYPE
              llt$ci_ppu_absolute = record
                executes_on_any_ppu: boolean,
                f01: array [1 .. 7] of byte,

                f02: array [1 .. 7] of byte,
                ppu_number: 0 .. llc$max_ppu_number,

                f03: array [1 .. 6] of byte,
                load_address: llt$ppu_address,

                f04: array [1 .. 6] of byte,
                entry_address: llt$ppu_address,

                text_array: array [ * ] of ppu_text,

              recend,


              ppu_text = record
                f01: array [1 .. 6] of byte,
                text: 0 .. 0ffff(16),

              recend;






            VAR
              ci_ppu: ^llt$ci_ppu_absolute,
              ii_ppu: ^llt$ppu_absolute,
              w: 0 .. llc$max_ppu_size + 1;



            NEXT ci_ppu: [0 .. number_of_words - 1] IN ci_input_seg;

            IF ci_ppu <> NIL THEN

              NEXT ii_ppu: [0 .. number_of_words - 1] IN output_seq;


              convert_boolean (#LOC (ci_ppu^.executes_on_any_ppu), ii_ppu^.executes_on_any_ppu);

              ii_ppu^.ppu_number := ci_ppu^.ppu_number;
              ii_ppu^.load_address := ci_ppu^.load_address;
              ii_ppu^.entry_address := ci_ppu^.entry_address;

              FOR w := 0 TO (number_of_words - 1) DO
                ii_ppu^.text [w] := ci_ppu^.text_array [w].text;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'PPU Record', status);
            IFEND;


          PROCEND convert_ppu_absolute_item;
?? EJECT ??
?? OLDTITLE ??


          VAR
            type_of_obj_record {control} : llt$object_record_kind,
            size: integer;


          convert_object_text_desc_12 (type_of_obj_record, size, status);

          IF status.normal THEN
            CASE type_of_obj_record OF
            = llc$ppu_absolute =
              convert_ppu_absolute_item (size, status);

            ELSE
              error (oce$invalid_ppu_record_kind, 'IOU Object Module', status);

            CASEND;

          ELSE
            error (oce$missing_rec_or_descriptor, 'PPU Descriptor', status);
          IFEND;


        PROCEND convert_iou_object_module;
?? OLDTITLE ??
?? NEWTITLE := '                             CONVERT CPU OBJECT MODULE' ??
?? NEWTITLE := '                               CONVERT LIBRARY DIRECTIVES' ??
?? EJECT ??

        PROCEDURE convert_cpu_object_module (generator_id: llt$module_generator;
          VAR status: ost$status);

{       NOTE:                                    }
{         The parameter 'generator_id' is used }
{         by 'convert_formal_parameters' to      }
{         identify the type of calling procedure.}



          PROCEDURE convert_library_directives (number_of_libraries: 1 .. llc$max_libraries;
            VAR status: ost$status);


            { 170 library directives }


            TYPE
              llt$ci_libraries = array [ * ] of pmt$ci_program_name;


            VAR
              ci_library: ^llt$ci_libraries,
              ii_library: ^llt$libraries,
              l: 1 .. llc$max_libraries + 1;



            NEXT ci_library: [1 .. number_of_libraries] IN ci_input_seg;

            IF ci_library <> NIL THEN
              NEXT ii_library: [1 .. number_of_libraries] IN output_seq;


              FOR l := 1 TO number_of_libraries DO
                convert_string (ci_library^ [l], 1, ii_library^ [l]);
                IF ii_library^ [l] = 'CYBILIB ' THEN
                  ii_library^ [l] := 'CYF$RUN_TIME_LIBRARY';
                IFEND;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Library Record', status);
            IFEND;


          PROCEND convert_library_directives;
?? TITLE := '                               CONVERT SECTION DEFINITION' ??
?? EJECT ??

          PROCEDURE convert_section_definition_item (VAR status: ost$status);



            { 170 section definitions }


            TYPE
              llt$ci_section_definition = record
                f01: array [1 .. 7] of byte,
                kind: llt$section_kind,

                access_attributes: llt$section_access_attributes,
                f02: array [1 .. 7] of byte,

                f03: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f04: half_word,
                length: ost$segment_length,

                allocation_alignment: ost$segment_offset,

                allocation_offset: ost$segment_offset,

                name: pmt$ci_program_name,

              recend;




?? EJECT ??

            CONST
              num_access_attributes = 4;

            VAR
              ci_section: ^llt$ci_section_definition,
              ii_section: ^llt$section_definition;




            NEXT ci_section IN ci_input_seg;

            IF ci_section <> NIL THEN
              NEXT ii_section IN output_seq;


              ii_section^.kind := ci_section^.kind;

              convert_set (#LOC (ci_section^.access_attributes), num_access_attributes, #LOC (ii_section^.
                    access_attributes));

              ii_section^.section_ordinal := ci_section^.section_ordinal;
              ii_section^.length := ci_section^.length;
              convert_integer (#LOC (ci_section^.allocation_alignment), #LOC (ii_section^.
                    allocation_alignment));
              convert_integer (#LOC (ci_section^.allocation_offset), #LOC (ii_section^.allocation_offset));

              convert_string (ci_section^.name, 1, ii_section^.name);

            ELSE
              error (oce$missing_rec_or_descriptor, 'Section Defn. Record', status);
            IFEND;


          PROCEND convert_section_definition_item;
?? TITLE := '                               CONVERT TEXT ITEM' ??
?? EJECT ??

          PROCEDURE convert_text_item (number_of_bytes: 1 .. osc$max_segment_length;
            VAR status: ost$status);



            { 170 text item }


            TYPE
              llt$ci_text = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                byte_array: array [ * ] of text_component,

              recend,

              text_component = record
                f01: array [1 .. 7] of byte,
                byte: 0 .. 255,

              recend;





            VAR
              ci_text: ^llt$ci_text,
              ii_text: ^llt$text,
              b: 1 .. osc$max_segment_length + 1;

?? EJECT ??
            NEXT ci_text: [1 .. number_of_bytes] IN ci_input_seg;

            IF ci_text <> NIL THEN
              NEXT ii_text: [1 .. number_of_bytes] IN output_seq;


              ii_text^.section_ordinal := ci_text^.section_ordinal;
              ii_text^.offset := ci_text^.offset;

              FOR b := 1 TO number_of_bytes DO
                ii_text^.byte [b] := ci_text^.byte_array [b].byte;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Text Record', status);
            IFEND;


          PROCEND convert_text_item;
?? TITLE := '                               CONVERT REPLICATION ITEM' ??
?? EJECT ??

          PROCEDURE convert_replication_item (number_of_bytes: 1 .. osc$max_segment_length;
            VAR status: ost$status);




            { 170 replication item }


            TYPE
              llt$ci_replication = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                f03: half_word,
                increment: 1 .. osc$max_segment_length,

                f04: half_word,
                count: 1 .. osc$max_segment_length,

                byte_array: array [ * ] of replication_text,

              recend,


              replication_text = record
                f01: array [1 .. 7] of byte,
                byte: 0 .. 255,

              recend;

?? EJECT ??

            VAR
              ci_replication: ^llt$ci_replication,
              ii_replication: ^llt$replication,
              b: 1 .. osc$max_segment_length + 1;



            NEXT ci_replication: [1 .. number_of_bytes] IN ci_input_seg;

            IF ci_replication <> NIL THEN
              NEXT ii_replication: [1 .. number_of_bytes] IN output_seq;


              ii_replication^.section_ordinal := ci_replication^.section_ordinal;
              ii_replication^.offset := ci_replication^.offset;
              ii_replication^.increment := ci_replication^.increment;
              ii_replication^.count := ci_replication^.count;

              FOR b := 1 TO number_of_bytes DO
                ii_replication^.byte [b] := ci_replication^.byte_array [b].byte;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Replication Record', status);
            IFEND;


          PROCEND convert_replication_item;
?? TITLE := '                               CONVERT BIT INSERTION ITEM' ??
?? EJECT ??

          PROCEDURE convert_bit_insertion_item (VAR status: ost$status);




            { 170 bit insertion item }


            TYPE
              llt$ci_bit_string_insertion = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                f03: array [1 .. 7] of byte,
                bit_offset: 0 .. 7,

                f04: array [1 .. 7] of byte,
                bit_length: 1 .. 63,

                bit_string: packed array [1 .. 128] of 0 .. 1,

              recend;


            VAR
              ci_bit_insertion: ^llt$ci_bit_string_insertion,
              ii_bit_insertion: ^llt$bit_string_insertion,
              b: 1 .. 128;

?? EJECT ??



            NEXT ci_bit_insertion IN ci_input_seg;

            IF ci_bit_insertion <> NIL THEN
              NEXT ii_bit_insertion IN output_seq;


              ii_bit_insertion^.section_ordinal := ci_bit_insertion^.section_ordinal;
              ii_bit_insertion^.offset := ci_bit_insertion^.offset;
              ii_bit_insertion^.bit_offset := ci_bit_insertion^.bit_offset;
              ii_bit_insertion^.bit_length := ci_bit_insertion^.bit_length;

              FOR b := 1 TO 60 DO
                ii_bit_insertion^.bit_string [b] := ci_bit_insertion^.bit_string [b + 4];
              FOREND;
              FOR b := 61 TO 63 DO
                ii_bit_insertion^.bit_string [b] := ci_bit_insertion^.bit_string [b + 8];
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Bit Insertion Record', status);
            IFEND;


          PROCEND convert_bit_insertion_item;
?? TITLE := '                               CONVERT ADDRESS FORMULATION ITEM' ??
?? EJECT ??

          PROCEDURE convert_addr_formulation_item (addr_upper_bnd: 1 .. llc$max_adr_items;
            VAR status: ost$status);


            { 170 address formulation item }


            TYPE
              llt$ci_address_formulation = record
                f01: array [1 .. 6] of byte,
                value_section: llt$section_ordinal,

                f02: array [1 .. 6] of byte,
                dest_section: llt$section_ordinal,

                item: array [ * ] of llt$ci_address_formulation_item,

              recend,


              llt$ci_address_formulation_item = record
                f01: array [1 .. 7] of byte,
                kind: llt$internal_address_kind,

                value_offset: ost$segment_offset,

                f03: half_word,
                dest_offset: llt$section_offset,

              recend;






            VAR
              ci_address: ^llt$ci_address_formulation,
              ii_address: ^llt$address_formulation,
              a: 1 .. llc$max_adr_items + 1;

?? EJECT ??



            NEXT ci_address: [1 .. addr_upper_bnd] IN ci_input_seg;

            IF ci_address <> NIL THEN
              NEXT ii_address: [1 .. addr_upper_bnd] IN output_seq;


              ii_address^.value_section := ci_address^.value_section;
              ii_address^.dest_section := ci_address^.dest_section;

              FOR a := 1 TO addr_upper_bnd DO
                ii_address^.item [a].kind := ci_address^.item [a].kind;
                convert_integer (#LOC (ci_address^.item [a].value_offset), #LOC (ii_address^.item [a].
                      value_offset));
                ii_address^.item [a].dest_offset := ci_address^.item [a].dest_offset;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Address Formulation Record', status);
            IFEND;


          PROCEND convert_addr_formulation_item;
?? TITLE := '                               CONVERT EXTERNAL REFERENCE ITEM' ??
?? EJECT ??

          PROCEDURE convert_external_linkage_item (number_of_ext_items: 1 .. llc$max_ext_items;
            VAR status: ost$status);



            { 170 external reference item }


            TYPE
              llt$ci_external_linkage = record
                name: pmt$ci_program_name,

                f00: array [1 .. 7] of byte,
                language: llt$module_generator,

                declaration_matching_required: boolean,
                f01: array [1 .. 7] of byte,

                declaration_matching_value: llt$ci_decl_matching_value,

                item: array [ * ] of llt$ci_external_linkage_item,
              recend,


              llt$ci_external_linkage_item = record
                f02: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f03: half_word,
                offset: llt$section_offset,
                f01: array [1 .. 7] of byte,
                kind: llt$address_kind,

                offset_operand: - osc$maximum_offset .. osc$maximum_offset,

              recend;


?? EJECT ??

            VAR
              ci_external_linkage: ^llt$ci_external_linkage,
              ii_external_linkage: ^llt$external_linkage,
              e: 1 .. llc$max_ext_items + 1;


            NEXT ci_external_linkage: [1 .. number_of_ext_items] IN ci_input_seg;

            IF ci_external_linkage <> NIL THEN
              NEXT ii_external_linkage: [1 .. number_of_ext_items] IN output_seq;

              convert_string (ci_external_linkage^.name, 1, ii_external_linkage^.name);

              ii_external_linkage^.language := ci_external_linkage^.language;
              IF ci_external_linkage^.language = llc$obsolete_cybil THEN
                convert_boolean (#LOC (ci_external_linkage^.declaration_matching_required),
                      ii_external_linkage^.declaration_matching_required);
                ii_external_linkage^.declaration_matching.language_dependent_value :=
                      ci_external_linkage^.declaration_matching_value.lower_1 * 100000000(16) +
                      ci_external_linkage^.declaration_matching_value.lower_2;
              ELSE

                ii_external_linkage^.declaration_matching_required := FALSE;

                ii_external_linkage^.declaration_matching.object_encryption := 0;
                ii_external_linkage^.declaration_matching.source_encryption := 0;
              IFEND;
              FOR e := 1 TO number_of_ext_items DO
                ii_external_linkage^.item [e].kind := ci_external_linkage^.item [e].kind;

                convert_integer (#LOC (ci_external_linkage^.item [e].offset_operand), #LOC
                      (ii_external_linkage^.item [e].offset_operand));

                ii_external_linkage^.item [e].section_ordinal := ci_external_linkage^.item [e].
                      section_ordinal;
                ii_external_linkage^.item [e].offset := ci_external_linkage^.item [e].offset;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'External Reference Record', status);
            IFEND;


          PROCEND convert_external_linkage_item;
?? TITLE := '                               CONVERT ENTRY POINT DEFINITION' ??
?? EJECT ??

          PROCEDURE convert_entry_point_definition (VAR status: ost$status);




            { 170 entry point definition item }


            TYPE
              llt$ci_entry_definition = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                attributes: llt$entry_point_attributes,
                f03: array [1 .. 7] of byte,

                name: pmt$ci_program_name,

                f04: array [1 .. 7] of byte,
                language: llt$module_generator,

                declaration_matching_required: boolean,
                f05: array [1 .. 7] of byte,

                declaration_matching_value: llt$ci_decl_matching_value,

              recend;


            CONST
              num_entry_point_attr = 2;

?? EJECT ??

            VAR
              ci_entry_point: ^llt$ci_entry_definition,
              ii_entry_point: ^llt$entry_definition;



            NEXT ci_entry_point IN ci_input_seg;

            IF ci_entry_point <> NIL THEN
              NEXT ii_entry_point IN output_seq;


              ii_entry_point^.section_ordinal := ci_entry_point^.section_ordinal;
              ii_entry_point^.offset := ci_entry_point^.offset;

              convert_set (#LOC (ci_entry_point^.attributes), num_entry_point_attr, #LOC (ii_entry_point^.
                    attributes));

              convert_string (ci_entry_point^.name, 1, ii_entry_point^.name);

              ii_entry_point^.language := ci_entry_point^.language;
              IF ci_entry_point^.language = llc$obsolete_cybil THEN
                convert_boolean (#LOC (ci_entry_point^.declaration_matching_required),
                      ii_entry_point^.declaration_matching_required);
                ii_entry_point^.declaration_matching.language_dependent_value :=
                      ci_entry_point^.declaration_matching_value.lower_1 * 100000000(16) +
                      ci_entry_point^.declaration_matching_value.lower_2;
              ELSE

                ii_entry_point^.declaration_matching_required := FALSE;

                ii_entry_point^.declaration_matching.object_encryption := 0;
                ii_entry_point^.declaration_matching.source_encryption := 0;
              IFEND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Entry Point Defn. Record', status);
            IFEND;


          PROCEND convert_entry_point_definition;
?? TITLE := '                               CONVERT RELOCATION ITEM' ??
?? EJECT ??

          PROCEDURE convert_relocation_item (number_of_rel_items: 1 .. llc$max_rel_items;
            VAR status: ost$status);



            { relocation item }

            TYPE
              llt$ci_relocation = array [ * ] of llt$ci_relocation_item,


              llt$ci_relocation_item = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                f03: array [1 .. 6] of byte,
                relocating_section: llt$section_ordinal,

                f04: array [1 .. 7] of byte,
                container: llt$relocation_container,

                f05: array [1 .. 7] of byte,
                address: llt$address_type,

              recend;

?? EJECT ??



            VAR
              ci_relocation: ^llt$ci_relocation,
              ii_relocation: ^llt$relocation,
              r: 1 .. llc$max_rel_items + 1;



            NEXT ci_relocation: [1 .. number_of_rel_items] IN ci_input_seg;

            IF ci_relocation <> NIL THEN
              NEXT ii_relocation: [1 .. number_of_rel_items] IN output_seq;

              FOR r := 1 TO number_of_rel_items DO
                ii_relocation^ [r].section_ordinal := ci_relocation^ [r].section_ordinal;
                ii_relocation^ [r].offset := ci_relocation^ [r].offset;
                ii_relocation^ [r].relocating_section := ci_relocation^ [r].relocating_section;
                ii_relocation^ [r].container := ci_relocation^ [r].container;
                ii_relocation^ [r].address := ci_relocation^ [r].address;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Relocation Record', status);
            IFEND;


          PROCEND convert_relocation_item;
?? TITLE := '                               170 Formal & Actual Parameter Items' ??
?? EJECT ??




          { 170 procedure formal parameter description item }


          TYPE
            llt$ci_formal_parameters = record
              procedure_name: pmt$ci_program_name,

            recend;


          { 170 procedure call actual parameters item }


          TYPE
            llt$ci_actual_parameters = record
              callee_name: pmt$ci_program_name,

              f01: array [1 .. 7] of byte,
              language: llt$module_generator,

              f02: array [1 .. 5] of byte,
              line_number_of_call: llt$source_line_number,


            recend,

            llt$ci_source_line_number = packed array [1 .. 32] of half_byte;





?? TITLE := '                               170 Fortran Argument Descriptor' ??
?? EJECT ??
          { 170 fortran argument description: used to describe a }
          { single actual or formal fortran parameter }


          TYPE
            llt$ci_fortran_argument_desc = record
              f01: array [1 .. 7] of byte,
              argument_type: llt$fortran_argument_type,

              string_length: llt$ci_fortran_string_length,

              f02: array [1 .. 7] of byte,
              argument_kind: llt$fortran_argument_kind,

              array_size: llt$ci_fortran_array_size,

              f03: array [1 .. 6] of byte,
              dummy_argument_ordinal: 1 .. llc$max_fortran_arguments,


              f04: array [1 .. 7] of byte,
              mode: llt$argument_usage,
            recend,


            llt$ci_fortran_string_length = packed record
              f01: half_byte,
              attributes: llt$fortran_string_attributes,
              f02: half_byte,
              f03: array [1 .. 6] of byte,

              f04: array [1 .. 6] of byte,
              number_of_characters: llt$fortran_string_size,
            recend,


            llt$ci_fortran_array_size = packed record
              f01: half_byte,
              attributes: llt$fortran_array_attributes,
              f02: half_byte,
              f03: array [1 .. 6] of byte,

              f04: array [1 .. 7] of byte,
              rank: llt$fortran_array_rank,

              f05: half_word,
              number_of_elements: llt$section_length,
            recend;




?? TITLE := '                               CONVERT FORTRAN PARAMETERS' ??
?? EJECT ??

          PROCEDURE convert_fortran_parameters (sequence_length: ost$segment_length;
            VAR parameters: SEQ ( * );
            VAR status: ost$status);


            VAR
              parameter_sequence: ^SEQ ( * ),
              ci_fortran_parameter: ^array [1 .. * ] of llt$ci_fortran_argument_desc,
              ii_fortran_parameter: ^array [1 .. * ] of llt$fortran_argument_desc,
              num_params: integer,
              np: integer;


            num_params := sequence_length DIV #SIZE (llt$ci_fortran_argument_desc);

            NEXT ci_fortran_parameter: [1 .. num_params] IN ci_input_seg;
            IF ci_fortran_parameter = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Fortran Parameters', status);
              RETURN;
            IFEND;

            parameter_sequence := ^parameters;
            RESET parameter_sequence;
            NEXT ii_fortran_parameter: [1 .. num_params] IN parameter_sequence;

            FOR np := 1 TO num_params DO
              ii_fortran_parameter^ [np].argument_type := ci_fortran_parameter^ [np].argument_type;

              ii_fortran_parameter^ [np].string_length.attributes := ci_fortran_parameter^ [np].string_length.
                    attributes;

              ii_fortran_parameter^ [np].string_length.number_of_characters := ci_fortran_parameter^ [np].
                    string_length.number_of_characters;

              ii_fortran_parameter^ [np].argument_kind := ci_fortran_parameter^ [np].argument_kind;

              ii_fortran_parameter^ [np].array_size.attributes := ci_fortran_parameter^ [np].array_size.
                    attributes;

              ii_fortran_parameter^ [np].array_size.rank := ci_fortran_parameter^ [np].array_size.rank;

              ii_fortran_parameter^ [np].array_size.number_of_elements := ci_fortran_parameter^ [np].
                    array_size.number_of_elements;

              ii_fortran_parameter^ [np].dummy_argument_ordinal := ci_fortran_parameter^ [np].
                    dummy_argument_ordinal;

              ii_fortran_parameter^ [np].mode := ci_fortran_parameter^ [np].mode;
            FOREND;


          PROCEND convert_fortran_parameters;
?? TITLE := '                               CONVERT FORMAL PARAMETERS' ??
?? EJECT ??

          PROCEDURE convert_formal_parameters (sequence_length: ost$segment_length;
                type_of_calling_routine {control} : llt$module_generator;
            VAR status: ost$status);



            VAR
              ci_parameter_item: ^llt$ci_formal_parameters,
              ii_parameter_item: ^llt$formal_parameters;



            NEXT ci_parameter_item IN ci_input_seg;

            IF ci_parameter_item <> NIL THEN
              CASE type_of_calling_routine OF
              = llc$fortran =
                ii_text_descriptor^.sequence_length := sequence_length DIV #SIZE
                      (llt$ci_fortran_argument_desc) * #SIZE (llt$fortran_argument_desc);

                NEXT ii_parameter_item: [[REP ii_text_descriptor^.sequence_length OF cell]] IN output_seq;

                convert_fortran_parameters (sequence_length, ii_parameter_item^.specification, status);
              ELSE
                error (oce$invalid_parameter_kind, 'Formal Parameters', status);
              CASEND;

              convert_string (ci_parameter_item^.procedure_name, 1, ii_parameter_item^.procedure_name);

            ELSE
              error (oce$missing_rec_or_descriptor, 'Formal Parameters', status);
            IFEND;


          PROCEND convert_formal_parameters;
?? TITLE := '                               CONVERT ACTUAL PARAMETERS' ??
?? EJECT ??

          PROCEDURE convert_actual_parameters (sequence_length: ost$segment_length;
            VAR status: ost$status);



            VAR
              ci_parameter_item: ^llt$ci_actual_parameters,
              ii_parameter_item: ^llt$actual_parameters;



            NEXT ci_parameter_item IN ci_input_seg;

            IF ci_parameter_item <> NIL THEN
              CASE ci_parameter_item^.language OF
              = llc$fortran =
                ii_text_descriptor^.sequence_length := sequence_length DIV #SIZE
                      (llt$ci_fortran_argument_desc) * #SIZE (llt$fortran_argument_desc);

                NEXT ii_parameter_item: [[REP ii_text_descriptor^.sequence_length OF cell]] IN output_seq;

                convert_fortran_parameters (sequence_length, ii_parameter_item^.specification, status);
              ELSE
                error (oce$invalid_parameter_kind, 'Actual Parameters', status);
              CASEND;

              convert_string (ci_parameter_item^.callee_name, 1, ii_parameter_item^.callee_name);

              ii_parameter_item^.language := ci_parameter_item^.language;

              ii_parameter_item^.line_number_of_call := ci_parameter_item^.line_number_of_call;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Actual Parameters', status);
            IFEND;


          PROCEND convert_actual_parameters;
?? TITLE := '                               170 Debug Symbol Table Declarations' ??
?? EJECT ??

          TYPE
            llt$ci_debug_table_fragment = record
              f01: half_word,
              offset: llt$section_offset,

              sequence: array [1 .. * ] of integer,
            recend;


?? TITLE := '                               CONVERT CYBIL SYMBOL TABLE' ??
?? EJECT ??

          PROCEDURE convert_cybil_symbol_table (sequence_length: ost$segment_length;
            VAR status: ost$status);


            VAR
              ci_debug_table_fragment: ^llt$ci_debug_table_fragment;


            NEXT ci_debug_table_fragment: [1 .. sequence_length] IN ci_input_seg;


          PROCEND convert_cybil_symbol_table;
?? TITLE := '                               CONVERT BINDING TEMPLATE ITEM' ??
?? EJECT ??

          PROCEDURE convert_binding_template (VAR status: ost$status);


            { 170 binding section }

            TYPE
              llt$ci_binding_template = record
                f00: half_word,
                binding_offset: llt$section_offset,

                f01: array [1 .. 7] of byte,
                case kind: llt$binding_template_kind of
                = llc$current_module =
                  f02: array [1 .. 6] of byte,
                  section_ordinal: llt$section_ordinal,

                  offset: ost$segment_offset,

                  f04: array [1 .. 7] of byte,
                  internal_address: llt$address_kind,

                  f05: array [1 .. 5] of word,

                = llc$external_reference =
                  name: pmt$ci_program_name,

                  f06: array [1 .. 7] of byte,
                  address: llt$address_kind,
                casend,
              recend;

?? EJECT ??

            VAR
              ci_binding: ^llt$ci_binding_template,
              ii_binding: ^llt$binding_template;


            NEXT ci_binding IN ci_input_seg;

            IF ci_binding <> NIL THEN
              NEXT ii_binding IN output_seq;

              ii_binding^.binding_offset := ci_binding^.binding_offset;

              ii_binding^.kind := ci_binding^.kind;

              CASE ci_binding^.kind OF
              = llc$current_module =
                ii_binding^.section_ordinal := ci_binding^.section_ordinal;
                convert_integer (#LOC (ci_binding^.offset), #LOC (ii_binding^.offset));
                ii_binding^.internal_address := ci_binding^.internal_address;

              = llc$external_reference =
                convert_string (ci_binding^.name, 1, ii_binding^.name);
                ii_binding^.address := ci_binding^.address;

              CASEND;
            ELSE
              error (oce$missing_rec_or_descriptor, 'Binding Template Record', status);
            IFEND;


          PROCEND convert_binding_template;
?? TITLE := '                               CONVERT TRANSFER SYMBOL ITEM' ??
?? EJECT ??

          PROCEDURE convert_transfer_symbol_item (VAR status: ost$status);



            { 170 transfer symbol }


            TYPE
              llt$ci_transfer_symbol = record
                name: pmt$ci_program_name,

              recend;


            VAR
              ci_transfer_symbol: ^llt$ci_transfer_symbol,
              ii_transfer_symbol: ^llt$transfer_symbol;

            NEXT ci_transfer_symbol IN ci_input_seg;

            IF ci_transfer_symbol <> NIL THEN
              NEXT ii_transfer_symbol IN output_seq;
              convert_string (ci_transfer_symbol^.name, 1, ii_transfer_symbol^.name);

            ELSE
              error (oce$missing_rec_or_descriptor, 'Transfer Symbol Record', status);
            IFEND;


          PROCEND convert_transfer_symbol_item;
?? OLDTITLE ??
?? EJECT ??

          VAR
            type_of_obj_record {control} : llt$object_record_kind,
            size: integer;


          REPEAT
            convert_object_text_desc_12 (type_of_obj_record, size, status);

            IF status.normal THEN

              CASE type_of_obj_record OF
              = llc$identification =
                error (oce$multiple_ident_records, 'CPU Object Module', status);

              = llc$libraries =
                convert_library_directives (size, status);

              = llc$section_definition =
                convert_section_definition_item (status);

              = llc$text =
                convert_text_item (size, status);

              = llc$replication =
                convert_replication_item (size, status);

              = llc$bit_string_insertion =
                convert_bit_insertion_item (status);

              = llc$address_formulation =
                convert_addr_formulation_item (size, status);

              = llc$external_linkage =
                convert_external_linkage_item (size, status);

              = llc$entry_definition =
                convert_entry_point_definition (status);

              = llc$relocation =
                convert_relocation_item (size, status);

              = llc$actual_parameters =
                convert_actual_parameters (size, status);

              = llc$formal_parameters =
                convert_formal_parameters (size, generator_id, status);

              = llc$cybil_symbol_table_fragment =
                convert_cybil_symbol_table (size, status);

              = llc$binding_template =
                convert_binding_template (status);

              = llc$transfer_symbol =
                convert_transfer_symbol_item (status);

              ELSE
                error (oce$invalid_cpu_record_kind, 'CPU Object Module', status);

              CASEND;

            ELSE
              error (status.condition, 'Object Text Descriptor 1.2', status);
            IFEND;

          UNTIL (type_of_obj_record = llc$transfer_symbol) OR (NOT status.normal);


        PROCEND convert_cpu_object_module;
?? TITLE := '                             CONVERT IDENTIFICATION BODY' ??
?? EJECT ??

        PROCEDURE convert_identification_body (ii_identification: ^llt$identification;
          VAR type_of_object_program: llt$module_kind;
          VAR generator_id: llt$module_generator;
          VAR status: ost$status);


          { 170 identification record }


          TYPE
            llt$ci_identification_body = record
              f00: array [1 .. 7] of byte,
              kind: llt$module_kind,

              time_created: ost$ci_time,

              date_created: ost$ci_date,

              attributes: llt$module_attributes,
              f01: array [1 .. 7] of byte,

              f02: array [1 .. 6] of byte,
              greatest_section_ordinal: llt$section_ordinal,

              f03: array [1 .. 7] of byte,
              generator_id: llt$module_generator,

              generator_name_vers: packed array [1 .. 128] of half_byte,

              commentary: packed array [1 .. 128] of half_byte,

            recend;


          CONST
            num_module_attr = 2;




          { 170 return date }


          TYPE
            ost$ci_date = record
              f01: array [1 .. 7] of byte,
              case date_format: ost$date_formats of
              = osc$month_date =
                month: packed array [1 .. 64] of half_byte,

              = osc$mdy_date =
                mdy: packed array [1 .. 64] of half_byte,

              = osc$iso_date =
                iso: packed array [1 .. 64] of half_byte,

              = osc$ordinal_date =
                ordinal: packed array [1 .. 64] of half_byte,

              casend,

            recend;




          { 170 return time }


          TYPE
            ost$ci_time = record
              f01: array [1 .. 7] of byte,
              case time_format: ost$time_formats of
              = osc$ampm_time =
                ampm: packed array [1 .. 48] of half_byte,

              = osc$hms_time =
                hms: packed array [1 .. 48] of half_byte,

              = osc$millisecond_time =
                millisecond: packed array [1 .. 48] of half_byte,

              casend,

            recend;

?? EJECT ??

          VAR
            ci_identification: ^llt$ci_identification_body;



          NEXT ci_identification IN ci_input_seg;

          IF ci_identification <> NIL THEN

            type_of_object_program := ci_identification^.kind;
            ii_identification^.kind := ci_identification^.kind;

            { convert time request return value }

            ii_identification^.time_created.time_format := ci_identification^.time_created.time_format;

            CASE ci_identification^.time_created.time_format OF
            = osc$ampm_time =
              convert_string (ci_identification^.time_created.ampm, 1, ii_identification^.time_created.ampm);

            = osc$hms_time =
              convert_string (ci_identification^.time_created.hms, 1, ii_identification^.time_created.hms);

            = osc$millisecond_time =
              convert_string (ci_identification^.time_created.millisecond, 1, ii_identification^.time_created.
                    millisecond);
            ELSE
              error (pme$invalid_time_format, 'Identification Record', status);

            CASEND;

            IF status.normal THEN

              { convert date request return value }

              ii_identification^.date_created.date_format := ci_identification^.date_created.date_format;

              CASE ci_identification^.date_created.date_format OF
              = osc$month_date =
                convert_string (ci_identification^.date_created.month, 1, ii_identification^.date_created.
                      month);

              = osc$mdy_date =
                convert_string (ci_identification^.date_created.mdy, 1, ii_identification^.date_created.mdy);

              = osc$iso_date =
                convert_string (ci_identification^.date_created.iso, 1, ii_identification^.date_created.iso);

              = osc$ordinal_date =
                convert_string (ci_identification^.date_created.ordinal, 1, ii_identification^.date_created.
                      ordinal);
              ELSE
                error (pme$invalid_date_format, 'Identification Record', status);

              CASEND;

              IF status.normal THEN

                { finish converting identification record }

                convert_set (#LOC (ci_identification^.attributes), num_module_attr, #LOC (ii_identification^.
                      attributes));

                ii_identification^.greatest_section_ordinal := ci_identification^.greatest_section_ordinal;

                ii_identification^.generator_id := ci_identification^.generator_id;
                generator_id := ci_identification^.generator_id;

                IF generator_id = llc$cybil THEN
                  error (oce$invalid_version, 'V1.2 - CYBIL', status);
                  RETURN;
                IFEND;

                convert_string (ci_identification^.generator_name_vers, 1, ii_identification^.
                      generator_name_vers);

                convert_string (ci_identification^.commentary, 1, ii_identification^.commentary);

              IFEND;
            IFEND;
          ELSE
            error (oce$missing_rec_or_descriptor, 'Identification Record', status);
          IFEND;


        PROCEND convert_identification_body;
?? OLDTITLE ??
?? EJECT ??


        VAR
          kind_of_object_module {control} : llt$module_kind,
          module_generator: llt$module_generator;




        convert_identification_body (ii_identification, kind_of_object_module, module_generator, status);

        IF status.normal THEN
          CASE kind_of_object_module OF
          = llc$iou =
            convert_iou_object_module (status);

          = llc$mi_virtual_state, llc$vector_virtual_state, llc$vector_extended_state =
            convert_cpu_object_module (module_generator, status);

          ELSE
            error (oce$invalid_object_module_kind, 'Version 1.2 Text', status);
          CASEND;

        IFEND;

      PROCEND convert_version_12_text;
?? OLDTITLE ??
?? NEWTITLE := '                           CONVERT VERSION 1.3 TEXT' ??
?? NEWTITLE := '                             CONVERT OBJECT TEXT DESCRIPTOR - 1.3' ??
?? EJECT ??

      PROCEDURE convert_version_13_text (ii_identification: ^llt$identification;
        VAR output_seq: ^SEQ ( * );
        VAR status: ost$status);

{ The following *copy is here on purpose.  If it is moved to the beginning of
{ the module, it will not compile given the current implementation.  The problem is that
{ ordinal types llt$object_record_kind and llt$extended_object_record_kind, which is
{ declared in procedure convert_object_file, use some of the same ordinal names.
{ Declaring llt$object_record_kind here means that the ordinal names override the ones
{ with the same names declared in the outer procedure.

*copy llt$object_record_kind


        VAR
          ii_text_descriptor: ^llt$object_text_descriptor;


        PROCEDURE convert_object_text_desc_13 (VAR object_type: llt$object_record_kind;
          VAR size: integer;
          VAR status: ost$status);





          TYPE
            llt$ci_object_text_descriptor = record
              f00: array [1 .. 7] of byte,
              case kind: llt$object_record_kind of
              = llc$identification, llc$section_definition, llc$entry_definition, llc$binding_template,
                llc$transfer_symbol, llc$bit_string_insertion =
                unused: ost$segment_offset, {always 0}

              = llc$libraries =
                f02: array [1 .. 6] of byte,
                number_of_libraries: 1 .. llc$max_libraries,

              = llc$text, llc$replication =
                f03: array [1 .. 4] of byte,
                number_of_bytes: 1 .. osc$max_segment_length,

              = llc$relocation =
                f05: array [1 .. 6] of byte,
                number_of_rel_items: 1 .. llc$max_rel_items,

              = llc$address_formulation =
                f06: array [1 .. 6] of byte,
                number_of_adr_items: 1 .. llc$max_adr_items,

              = llc$external_linkage =
                f07: array [1 .. 6] of byte,
                number_of_ext_items: 1 .. llc$max_ext_items,

              = llc$formal_parameters, llc$actual_parameters, llc$cybil_symbol_table_fragment =
                f08: array [1 .. 4] of byte,
                sequence_length: ost$segment_length,

              = llc$ppu_absolute =
                f09: array [1 .. 6] of byte,
                number_of_words: llt$ppu_address,
              casend,
            recend;




          VAR
            ci_text_descriptor: ^llt$ci_object_text_descriptor;



          NEXT ci_text_descriptor IN ci_input_seg;

          IF ci_text_descriptor <> NIL THEN
            object_type := ci_text_descriptor^.kind;

            NEXT ii_text_descriptor IN output_seq;

            ii_text_descriptor^.kind := ci_text_descriptor^.kind;

            CASE ci_text_descriptor^.kind OF
            = llc$identification, llc$section_definition, llc$entry_definition, llc$binding_template,
                  llc$bit_string_insertion, llc$transfer_symbol =
              ii_text_descriptor^.unused := ci_text_descriptor^.unused;

            = llc$libraries =
              ii_text_descriptor^.number_of_libraries := ci_text_descriptor^.number_of_libraries;
              size := ci_text_descriptor^.number_of_libraries;

            = llc$text, llc$replication =
              ii_text_descriptor^.number_of_bytes := ci_text_descriptor^.number_of_bytes;
              size := ci_text_descriptor^.number_of_bytes;

            = llc$relocation =
              ii_text_descriptor^.number_of_rel_items := ci_text_descriptor^.number_of_rel_items;
              size := ci_text_descriptor^.number_of_rel_items;

            = llc$address_formulation =
              ii_text_descriptor^.number_of_adr_items := ci_text_descriptor^.number_of_adr_items;
              size := ci_text_descriptor^.number_of_adr_items;

            = llc$external_linkage =
              ii_text_descriptor^.number_of_ext_items := ci_text_descriptor^.number_of_ext_items;
              size := ci_text_descriptor^.number_of_ext_items;

            = llc$formal_parameters, llc$actual_parameters =
              size := ci_text_descriptor^.sequence_length;

            = llc$cybil_symbol_table_fragment =
              size := ci_text_descriptor^.sequence_length;

            = llc$ppu_absolute =
              ii_text_descriptor^.number_of_words := ci_text_descriptor^.number_of_words;
              size := ci_text_descriptor^.number_of_words;

            ELSE
              error (oce$invalid_object_record_kind, 'Object Text Descriptor 1.3', status);

            CASEND;

          ELSE
            eoi_warning (oce$missing_rec_or_descriptor, status);

          IFEND;


        PROCEND convert_object_text_desc_13;
?? OLDTITLE ??

?? NEWTITLE := '                             CONVERT IOU OBJECT MODULE' ??
?? NEWTITLE := '                               CONVERT PPU ABSOLUTE ITEM' ??
?? EJECT ??

        PROCEDURE convert_iou_object_module (VAR status: ost$status);




          PROCEDURE convert_ppu_absolute_item (number_of_words: llt$ppu_address;
            VAR status: ost$status);




            { 170 ppu absolute }


            TYPE
              llt$ci_ppu_absolute = record
                executes_on_any_ppu: boolean,
                f01: array [1 .. 7] of byte,

                f02: array [1 .. 7] of byte,
                ppu_number: 0 .. llc$max_ppu_number,

                f03: array [1 .. 6] of byte,
                load_address: llt$ppu_address,

                f04: array [1 .. 6] of byte,
                entry_address: llt$ppu_address,

                text_array: array [ * ] of ppu_text,

              recend,


              ppu_text = record
                f01: array [1 .. 6] of byte,
                text: 0 .. 0ffff(16),

              recend;






            VAR
              ci_ppu: ^llt$ci_ppu_absolute,
              ii_ppu: ^llt$ppu_absolute,
              w: 0 .. llc$max_ppu_size + 1;



            NEXT ci_ppu: [0 .. number_of_words - 1] IN ci_input_seg;

            IF ci_ppu <> NIL THEN

              NEXT ii_ppu: [0 .. number_of_words - 1] IN output_seq;


              convert_boolean (#LOC (ci_ppu^.executes_on_any_ppu), ii_ppu^.executes_on_any_ppu);

              ii_ppu^.ppu_number := ci_ppu^.ppu_number;
              ii_ppu^.load_address := ci_ppu^.load_address;
              ii_ppu^.entry_address := ci_ppu^.entry_address;

              FOR w := 0 TO (number_of_words - 1) DO
                ii_ppu^.text [w] := ci_ppu^.text_array [w].text;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'PPU Record', status);
            IFEND;


          PROCEND convert_ppu_absolute_item;
?? EJECT ??
?? OLDTITLE ??


          VAR
            type_of_obj_record {control} : llt$object_record_kind,
            size: integer;


          convert_object_text_desc_13 (type_of_obj_record, size, status);

          IF status.normal THEN
            CASE type_of_obj_record OF
            = llc$ppu_absolute =
              convert_ppu_absolute_item (size, status);

            ELSE
              error (oce$invalid_ppu_record_kind, 'IOU Object Module', status);

            CASEND;

          ELSE
            error (oce$missing_rec_or_descriptor, 'PPU Descriptor', status);
          IFEND;


        PROCEND convert_iou_object_module;
?? OLDTITLE ??
?? NEWTITLE := '                             CONVERT CPU OBJECT MODULE' ??
?? NEWTITLE := '                               CONVERT LIBRARY DIRECTIVES' ??
?? EJECT ??

        PROCEDURE convert_cpu_object_module (generator_id: llt$module_generator;
          VAR status: ost$status);

{       NOTE:                                    }
{         The parameter 'generator_id' is used }
{         by 'convert_formal_parameters' to      }
{         identify the type of calling procedure.}



          PROCEDURE convert_library_directives (number_of_libraries: 1 .. llc$max_libraries;
            VAR status: ost$status);


            { 170 library directives }


            TYPE
              llt$ci_libraries = array [ * ] of pmt$ci_program_name;


            VAR
              ci_library: ^llt$ci_libraries,
              ii_library: ^llt$libraries,
              l: 1 .. llc$max_libraries + 1;



            NEXT ci_library: [1 .. number_of_libraries] IN ci_input_seg;

            IF ci_library <> NIL THEN
              NEXT ii_library: [1 .. number_of_libraries] IN output_seq;


              FOR l := 1 TO number_of_libraries DO
                convert_string (ci_library^ [l], 1, ii_library^ [l]);
                IF ii_library^ [l] = 'CYBILIB ' THEN
                  ii_library^ [l] := 'CYF$RUN_TIME_LIBRARY';
                IFEND;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Library Record', status);
            IFEND;


          PROCEND convert_library_directives;
?? TITLE := '                               CONVERT SECTION DEFINITION' ??
?? EJECT ??

          PROCEDURE convert_section_definition_item (VAR status: ost$status);



            { 170 section definitions }


            TYPE
              llt$ci_section_definition = record
                f01: array [1 .. 7] of byte,
                kind: llt$section_kind,

                access_attributes: llt$section_access_attributes,
                f02: array [1 .. 7] of byte,

                f03: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f04: half_word,
                length: ost$segment_length,

                allocation_alignment: ost$segment_offset,

                allocation_offset: ost$segment_offset,

                name: pmt$ci_program_name,

              recend;




?? EJECT ??

            CONST
              num_access_attributes = 4;

            VAR
              ci_section: ^llt$ci_section_definition,
              ii_section: ^llt$section_definition;




            NEXT ci_section IN ci_input_seg;

            IF ci_section <> NIL THEN
              NEXT ii_section IN output_seq;


              ii_section^.kind := ci_section^.kind;

              convert_set (#LOC (ci_section^.access_attributes), num_access_attributes, #LOC (ii_section^.
                    access_attributes));

              ii_section^.section_ordinal := ci_section^.section_ordinal;
              ii_section^.length := ci_section^.length;
              convert_integer (#LOC (ci_section^.allocation_alignment), #LOC (ii_section^.
                    allocation_alignment));
              convert_integer (#LOC (ci_section^.allocation_offset), #LOC (ii_section^.allocation_offset));

              convert_string (ci_section^.name, 1, ii_section^.name);

            ELSE
              error (oce$missing_rec_or_descriptor, 'Section Defn. Record', status);
            IFEND;


          PROCEND convert_section_definition_item;
?? TITLE := '                               CONVERT TEXT ITEM' ??
?? EJECT ??

          PROCEDURE convert_text_item (number_of_bytes: 1 .. osc$max_segment_length;
            VAR status: ost$status);



            { 170 text item }


            TYPE
              llt$ci_text = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                byte_array: array [ * ] of text_component,

              recend,

              text_component = record
                f01: array [1 .. 7] of byte,
                byte: 0 .. 255,

              recend;





            VAR
              ci_text: ^llt$ci_text,
              ii_text: ^llt$text,
              b: 1 .. osc$max_segment_length + 1;

?? EJECT ??
            NEXT ci_text: [1 .. number_of_bytes] IN ci_input_seg;

            IF ci_text <> NIL THEN
              NEXT ii_text: [1 .. number_of_bytes] IN output_seq;


              ii_text^.section_ordinal := ci_text^.section_ordinal;
              ii_text^.offset := ci_text^.offset;

              FOR b := 1 TO number_of_bytes DO
                ii_text^.byte [b] := ci_text^.byte_array [b].byte;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Text Record', status);
            IFEND;


          PROCEND convert_text_item;
?? TITLE := '                               CONVERT REPLICATION ITEM' ??
?? EJECT ??

          PROCEDURE convert_replication_item (number_of_bytes: 1 .. osc$max_segment_length;
            VAR status: ost$status);




            { 170 replication item }


            TYPE
              llt$ci_replication = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                f03: half_word,
                increment: 1 .. osc$max_segment_length,

                f04: half_word,
                count: 1 .. osc$max_segment_length,

                byte_array: array [ * ] of replication_text,

              recend,


              replication_text = record
                f01: array [1 .. 7] of byte,
                byte: 0 .. 255,

              recend;

?? EJECT ??

            VAR
              ci_replication: ^llt$ci_replication,
              ii_replication: ^llt$replication,
              b: 1 .. osc$max_segment_length + 1;



            NEXT ci_replication: [1 .. number_of_bytes] IN ci_input_seg;

            IF ci_replication <> NIL THEN
              NEXT ii_replication: [1 .. number_of_bytes] IN output_seq;


              ii_replication^.section_ordinal := ci_replication^.section_ordinal;
              ii_replication^.offset := ci_replication^.offset;
              ii_replication^.increment := ci_replication^.increment;
              ii_replication^.count := ci_replication^.count;

              FOR b := 1 TO number_of_bytes DO
                ii_replication^.byte [b] := ci_replication^.byte_array [b].byte;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Replication Record', status);
            IFEND;


          PROCEND convert_replication_item;
?? TITLE := '                               CONVERT BIT INSERTION ITEM' ??
?? EJECT ??

          PROCEDURE convert_bit_insertion_item (VAR status: ost$status);




            { 170 bit insertion item }


            TYPE
              llt$ci_bit_string_insertion = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                f03: array [1 .. 7] of byte,
                bit_offset: 0 .. 7,

                f04: array [1 .. 7] of byte,
                bit_length: 1 .. 63,

                bit_string: packed array [1 .. 128] of 0 .. 1,

              recend;


            VAR
              ci_bit_insertion: ^llt$ci_bit_string_insertion,
              ii_bit_insertion: ^llt$bit_string_insertion,
              b: 1 .. 128;

?? EJECT ??



            NEXT ci_bit_insertion IN ci_input_seg;

            IF ci_bit_insertion <> NIL THEN
              NEXT ii_bit_insertion IN output_seq;


              ii_bit_insertion^.section_ordinal := ci_bit_insertion^.section_ordinal;
              ii_bit_insertion^.offset := ci_bit_insertion^.offset;
              ii_bit_insertion^.bit_offset := ci_bit_insertion^.bit_offset;
              ii_bit_insertion^.bit_length := ci_bit_insertion^.bit_length;

              FOR b := 1 TO 60 DO
                ii_bit_insertion^.bit_string [b] := ci_bit_insertion^.bit_string [b + 4];
              FOREND;
              FOR b := 61 TO 63 DO
                ii_bit_insertion^.bit_string [b] := ci_bit_insertion^.bit_string [b + 8];
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Bit Insertion Record', status);
            IFEND;


          PROCEND convert_bit_insertion_item;
?? TITLE := '                               CONVERT ADDRESS FORMULATION ITEM' ??
?? EJECT ??

          PROCEDURE convert_addr_formulation_item (addr_upper_bnd: 1 .. llc$max_adr_items;
            VAR status: ost$status);


            { 170 address formulation item }


            TYPE
              llt$ci_address_formulation = record
                f01: array [1 .. 6] of byte,
                value_section: llt$section_ordinal,

                f02: array [1 .. 6] of byte,
                dest_section: llt$section_ordinal,

                item: array [ * ] of llt$ci_address_formulation_item,

              recend,


              llt$ci_address_formulation_item = record
                f01: array [1 .. 7] of byte,
                kind: llt$internal_address_kind,

                value_offset: ost$segment_offset,

                f03: half_word,
                dest_offset: llt$section_offset,

              recend;






            VAR
              ci_address: ^llt$ci_address_formulation,
              ii_address: ^llt$address_formulation,
              a: 1 .. llc$max_adr_items + 1;

?? EJECT ??



            NEXT ci_address: [1 .. addr_upper_bnd] IN ci_input_seg;

            IF ci_address <> NIL THEN
              NEXT ii_address: [1 .. addr_upper_bnd] IN output_seq;


              ii_address^.value_section := ci_address^.value_section;
              ii_address^.dest_section := ci_address^.dest_section;

              FOR a := 1 TO addr_upper_bnd DO
                ii_address^.item [a].kind := ci_address^.item [a].kind;
                convert_integer (#LOC (ci_address^.item [a].value_offset), #LOC (ii_address^.item [a].
                      value_offset));
                ii_address^.item [a].dest_offset := ci_address^.item [a].dest_offset;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Address Formulation Record', status);
            IFEND;


          PROCEND convert_addr_formulation_item;
?? TITLE := '                               CONVERT EXTERNAL REFERENCE ITEM' ??
?? EJECT ??

          PROCEDURE convert_external_linkage_item (number_of_ext_items: 1 .. llc$max_ext_items;
            VAR status: ost$status);



            { 170 external reference item }


            TYPE
              llt$ci_external_linkage = record
                name: pmt$ci_program_name,

                f00: array [1 .. 7] of byte,
                language: llt$module_generator,

                declaration_matching_required: boolean,
                f01: array [1 .. 7] of byte,

                declaration_matching_value: llt$ci_decl_matching_value,

                item: array [ * ] of llt$ci_external_linkage_item,
              recend,


              llt$ci_external_linkage_item = record
                f02: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f03: half_word,
                offset: llt$section_offset,
                f01: array [1 .. 7] of byte,
                kind: llt$address_kind,

                offset_operand: - osc$maximum_offset .. osc$maximum_offset,

              recend;


?? EJECT ??

            VAR
              ci_external_linkage: ^llt$ci_external_linkage,
              ii_external_linkage: ^llt$external_linkage,
              e: 1 .. llc$max_ext_items + 1;


            NEXT ci_external_linkage: [1 .. number_of_ext_items] IN ci_input_seg;

            IF ci_external_linkage <> NIL THEN
              NEXT ii_external_linkage: [1 .. number_of_ext_items] IN output_seq;

              convert_string (ci_external_linkage^.name, 1, ii_external_linkage^.name);

              ii_external_linkage^.language := ci_external_linkage^.language;
              IF ci_external_linkage^.language = llc$obsolete_cybil THEN
                convert_boolean (#LOC (ci_external_linkage^.declaration_matching_required),
                      ii_external_linkage^.declaration_matching_required);
                ii_external_linkage^.declaration_matching.language_dependent_value :=
                      ci_external_linkage^.declaration_matching_value.lower_1 * 100000000(16) +
                      ci_external_linkage^.declaration_matching_value.lower_2;
              ELSE

                ii_external_linkage^.declaration_matching_required := FALSE;

                ii_external_linkage^.declaration_matching.object_encryption := 0;
                ii_external_linkage^.declaration_matching.source_encryption := 0;
              IFEND;
              FOR e := 1 TO number_of_ext_items DO
                ii_external_linkage^.item [e].kind := ci_external_linkage^.item [e].kind;

                convert_integer (#LOC (ci_external_linkage^.item [e].offset_operand), #LOC
                      (ii_external_linkage^.item [e].offset_operand));

                ii_external_linkage^.item [e].section_ordinal := ci_external_linkage^.item [e].
                      section_ordinal;
                ii_external_linkage^.item [e].offset := ci_external_linkage^.item [e].offset;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'External Reference Record', status);
            IFEND;


          PROCEND convert_external_linkage_item;
?? TITLE := '                               CONVERT ENTRY POINT DEFINITION' ??
?? EJECT ??

          PROCEDURE convert_entry_point_definition (VAR status: ost$status);




            { 170 entry point definition item }


            TYPE
              llt$ci_entry_definition = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                attributes: llt$entry_point_attributes,
                f03: array [1 .. 7] of byte,

                name: pmt$ci_program_name,

                f04: array [1 .. 7] of byte,
                language: llt$module_generator,

                declaration_matching_required: boolean,
                f05: array [1 .. 7] of byte,

                declaration_matching_value: llt$ci_decl_matching_value,

              recend;


            CONST
              num_entry_point_attr = 2;

?? EJECT ??

            VAR
              ci_entry_point: ^llt$ci_entry_definition,
              ii_entry_point: ^llt$entry_definition;



            NEXT ci_entry_point IN ci_input_seg;

            IF ci_entry_point <> NIL THEN
              NEXT ii_entry_point IN output_seq;


              ii_entry_point^.section_ordinal := ci_entry_point^.section_ordinal;
              ii_entry_point^.offset := ci_entry_point^.offset;

              convert_set (#LOC (ci_entry_point^.attributes), num_entry_point_attr, #LOC (ii_entry_point^.
                    attributes));

              convert_string (ci_entry_point^.name, 1, ii_entry_point^.name);

              ii_entry_point^.language := ci_entry_point^.language;

              IF ci_entry_point^.language = llc$obsolete_cybil THEN
                convert_boolean (#LOC (ci_entry_point^.declaration_matching_required),
                      ii_entry_point^.declaration_matching_required);
                ii_entry_point^.declaration_matching.language_dependent_value :=
                      ci_entry_point^.declaration_matching_value.lower_1 * 100000000(16) +
                      ci_entry_point^.declaration_matching_value.lower_2;
              ELSE

                ii_entry_point^.declaration_matching_required := FALSE;

                ii_entry_point^.declaration_matching.object_encryption := 0;
                ii_entry_point^.declaration_matching.source_encryption := 0;
              IFEND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Entry Point Defn. Record', status);
            IFEND;


          PROCEND convert_entry_point_definition;
?? TITLE := '                               CONVERT RELOCATION ITEM' ??
?? EJECT ??

          PROCEDURE convert_relocation_item (number_of_rel_items: 1 .. llc$max_rel_items;
            VAR status: ost$status);



            { relocation item }

            TYPE
              llt$ci_relocation = array [ * ] of llt$ci_relocation_item,


              llt$ci_relocation_item = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                f03: array [1 .. 6] of byte,
                relocating_section: llt$section_ordinal,

                f04: array [1 .. 7] of byte,
                container: llt$relocation_container,

                f05: array [1 .. 7] of byte,
                address: llt$address_type,

              recend;

?? EJECT ??



            VAR
              ci_relocation: ^llt$ci_relocation,
              ii_relocation: ^llt$relocation,
              r: 1 .. llc$max_rel_items + 1;



            NEXT ci_relocation: [1 .. number_of_rel_items] IN ci_input_seg;

            IF ci_relocation <> NIL THEN
              NEXT ii_relocation: [1 .. number_of_rel_items] IN output_seq;

              FOR r := 1 TO number_of_rel_items DO
                ii_relocation^ [r].section_ordinal := ci_relocation^ [r].section_ordinal;
                ii_relocation^ [r].offset := ci_relocation^ [r].offset;
                ii_relocation^ [r].relocating_section := ci_relocation^ [r].relocating_section;
                ii_relocation^ [r].container := ci_relocation^ [r].container;
                ii_relocation^ [r].address := ci_relocation^ [r].address;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Relocation Record', status);
            IFEND;


          PROCEND convert_relocation_item;
?? TITLE := '                               170 Formal & Actual Parameter Items' ??
?? EJECT ??




          { 170 procedure formal parameter description item }


          TYPE
            llt$ci_formal_parameters = record
              procedure_name: pmt$ci_program_name,

            recend;


          { 170 procedure call actual parameters item }


          TYPE
            llt$ci_actual_parameters = record
              callee_name: pmt$ci_program_name,

              f01: array [1 .. 7] of byte,
              language: llt$module_generator,

              f02: array [1 .. 5] of byte,
              line_number_of_call: llt$source_line_number,


            recend,

            llt$ci_source_line_number = packed array [1 .. 32] of half_byte;





?? TITLE := '                               170 Fortran Argument Descriptor' ??
?? EJECT ??
          { 170 fortran argument description: used to describe a }
          { single actual or formal fortran parameter }


          TYPE
            llt$ci_fortran_argument_desc = record
              f01: array [1 .. 7] of byte,
              argument_type: llt$fortran_argument_type,

              string_length: llt$ci_fortran_string_length,

              f02: array [1 .. 7] of byte,
              argument_kind: llt$fortran_argument_kind,

              array_size: llt$ci_fortran_array_size,

              f03: array [1 .. 6] of byte,
              dummy_argument_ordinal: 1 .. llc$max_fortran_arguments,


              f04: array [1 .. 7] of byte,
              mode: llt$argument_usage,
            recend,


            llt$ci_fortran_string_length = packed record
              f01: half_byte,
              attributes: llt$fortran_string_attributes,
              f02: half_byte,
              f03: array [1 .. 6] of byte,

              f04: array [1 .. 6] of byte,
              number_of_characters: llt$fortran_string_size,
            recend,


            llt$ci_fortran_array_size = packed record
              f01: half_byte,
              attributes: llt$fortran_array_attributes,
              f02: half_byte,
              f03: array [1 .. 6] of byte,

              f04: array [1 .. 7] of byte,
              rank: llt$fortran_array_rank,

              f05: half_word,
              number_of_elements: llt$section_length,
            recend;




?? TITLE := '                               CONVERT FORTRAN PARAMETERS' ??
?? EJECT ??

          PROCEDURE convert_fortran_parameters (sequence_length: ost$segment_length;
            VAR parameters: SEQ ( * );
            VAR status: ost$status);


            VAR
              parameter_sequence: ^SEQ ( * ),
              ci_fortran_parameter: ^array [1 .. * ] of llt$ci_fortran_argument_desc,
              ii_fortran_parameter: ^array [1 .. * ] of llt$fortran_argument_desc,
              num_params: integer,
              np: integer;


            num_params := sequence_length DIV #SIZE (llt$ci_fortran_argument_desc);

            NEXT ci_fortran_parameter: [1 .. num_params] IN ci_input_seg;
            IF ci_fortran_parameter = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Fortran Parameters', status);
              RETURN;
            IFEND;

            parameter_sequence := ^parameters;
            RESET parameter_sequence;
            NEXT ii_fortran_parameter: [1 .. num_params] IN parameter_sequence;

            FOR np := 1 TO num_params DO
              ii_fortran_parameter^ [np].argument_type := ci_fortran_parameter^ [np].argument_type;

              ii_fortran_parameter^ [np].string_length.attributes := ci_fortran_parameter^ [np].string_length.
                    attributes;

              ii_fortran_parameter^ [np].string_length.number_of_characters := ci_fortran_parameter^ [np].
                    string_length.number_of_characters;

              ii_fortran_parameter^ [np].argument_kind := ci_fortran_parameter^ [np].argument_kind;

              ii_fortran_parameter^ [np].array_size.attributes := ci_fortran_parameter^ [np].array_size.
                    attributes;

              ii_fortran_parameter^ [np].array_size.rank := ci_fortran_parameter^ [np].array_size.rank;

              ii_fortran_parameter^ [np].array_size.number_of_elements := ci_fortran_parameter^ [np].
                    array_size.number_of_elements;

              ii_fortran_parameter^ [np].dummy_argument_ordinal := ci_fortran_parameter^ [np].
                    dummy_argument_ordinal;

              ii_fortran_parameter^ [np].mode := ci_fortran_parameter^ [np].mode;
            FOREND;


          PROCEND convert_fortran_parameters;
?? TITLE := '                               CONVERT FORMAL PARAMETERS' ??
?? EJECT ??

          PROCEDURE convert_formal_parameters (sequence_length: ost$segment_length;
                type_of_calling_routine {control} : llt$module_generator;
            VAR status: ost$status);



            VAR
              ci_parameter_item: ^llt$ci_formal_parameters,
              ii_parameter_item: ^llt$formal_parameters;



            NEXT ci_parameter_item IN ci_input_seg;

            IF ci_parameter_item <> NIL THEN
              CASE type_of_calling_routine OF
              = llc$fortran =
                ii_text_descriptor^.sequence_length := sequence_length DIV #SIZE
                      (llt$ci_fortran_argument_desc) * #SIZE (llt$fortran_argument_desc);

                NEXT ii_parameter_item: [[REP ii_text_descriptor^.sequence_length OF cell]] IN output_seq;

                convert_fortran_parameters (sequence_length, ii_parameter_item^.specification, status);
              ELSE
                error (oce$invalid_parameter_kind, 'Formal Parameters', status);
              CASEND;

              convert_string (ci_parameter_item^.procedure_name, 1, ii_parameter_item^.procedure_name);

            ELSE
              error (oce$missing_rec_or_descriptor, 'Formal Parameters', status);
            IFEND;


          PROCEND convert_formal_parameters;
?? TITLE := '                               CONVERT ACTUAL PARAMETERS' ??
?? EJECT ??

          PROCEDURE convert_actual_parameters (sequence_length: ost$segment_length;
            VAR status: ost$status);



            VAR
              ci_parameter_item: ^llt$ci_actual_parameters,
              ii_parameter_item: ^llt$actual_parameters;



            NEXT ci_parameter_item IN ci_input_seg;

            IF ci_parameter_item <> NIL THEN
              CASE ci_parameter_item^.language OF
              = llc$fortran =
                ii_text_descriptor^.sequence_length := sequence_length DIV #SIZE
                      (llt$ci_fortran_argument_desc) * #SIZE (llt$fortran_argument_desc);

                NEXT ii_parameter_item: [[REP ii_text_descriptor^.sequence_length OF cell]] IN output_seq;

                convert_fortran_parameters (sequence_length, ii_parameter_item^.specification, status);
              ELSE
                error (oce$invalid_parameter_kind, 'Actual Parameters', status);
              CASEND;

              convert_string (ci_parameter_item^.callee_name, 1, ii_parameter_item^.callee_name);

              ii_parameter_item^.language := ci_parameter_item^.language;

              ii_parameter_item^.line_number_of_call := ci_parameter_item^.line_number_of_call;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Actual Parameters', status);
            IFEND;


          PROCEND convert_actual_parameters;
?? TITLE := '                               170 Debug Symbol Table Declarations' ??
?? EJECT ??

          TYPE
            cyt$ci_cybil_symbol_table = record
              original_name: pmt$ci_program_name,

              f01: array [1 .. 7] of byte,
              language: llt$module_generator,

              f02: array [1 .. 7] of byte,
              optimization_level: 0 .. 255,

              version: packed array [1 .. 16] of half_byte,

              f03: array [1 .. 6] of byte,
              module_symbol_list: symbol_no,

              f04: array [1 .. 6] of byte,
              number_of_symbols: symbol_no,
            recend,

            cyt$ci_cybil_symbol_table_item = record
              symbol_name: pmt$ci_program_name,

              end_of_chain: boolean,
              f01: array [1 .. 7] of byte,

              f02: array [1 .. 6] of byte,
              symtab_no: symbol_no,

              f03: array [1 .. 7] of byte,
              case symbol_type: entry_kinds of

              = int_kind, bool_kind, char_kind, real_kind, longreal_kind, cell_kind =
                ,

              = var_kind =
                f04: array [1 .. 6] of byte,
                var_type: symbol_no,

                f05: half_word,
                var_length: ost$segment_length,

                f06: array [1 .. 7] of byte,
                base: base_type,

                f07: array [1 .. 6] of byte,
                var_section_ordinal: llt$section_ordinal,

                f08: half_word,
                var_offset: ost$segment_length,

                indirectly_referenced: boolean,
                f09: array [1 .. 7] of byte,

                var_is_parameter: boolean,
                f10: array [1 .. 7] of byte,

              = cons_kind =
                f11: array [1 .. 6] of byte,
                cons_type: symbol_no,

                f12: array [1 .. 7] of byte,
                cons_length_type: (short_constant_type, long_constant_type),

                cons_value: integer_range,

              = label_kind =
                f13: array [1 .. 6] of byte,
                line_no: line_number_range,

              = ordinal_kind =
                f14: array [1 .. 6] of byte,
                last_const: symbol_no,

                f15: array [1 .. 6] of byte,
                upper_bound: 0 .. 4095,

              = subrange_kind =
                f16: array [1 .. 6] of byte,
                subtype: symbol_no,

                f17: array [1 .. 7] of byte,
                low_value_type: len_kinds,

                f18: array [1 .. 7] of byte,
                high_value_type: len_kinds,

                low_value: integer_range,

                high_value: integer_range,


              = proc_kind =
                f19: array [1 .. 7] of byte,
                lexical_level: 0 .. 255,

                f20: array [1 .. 6] of byte,
                symbol_list: symbol_no,

                f21: array [1 .. 6] of byte,
                proc_section_ordinal: llt$section_ordinal,

                f22: half_word,
                proc_offset: ost$segment_length,

                f23: half_word,
                proc_length: ost$segment_length,

                f24: array [1 .. 6] of byte,
                parent_proc: symbol_no,

                f25: array [1 .. 6] of byte,
                return_type: symbol_no,

              = pointer_kind =
                f26: array [1 .. 6] of byte,
                ptr_type: symbol_no,

                f100: half_word,
                ptr_object_length: ost$segment_length,

              = set_kind =
                f27: array [1 .. 6] of byte,
                set_element_type: symbol_no,

                f28: array [1 .. 6] of byte,
                set_len: 0 .. 7fff(16),

              = string_kind =
                f29: array [1 .. 7] of byte,
                len_type: len_kinds,

                f30: array [1 .. 6] of byte,
                string_len: symbol_no,

              = array_kind =
                array_binding: bindkinds,
                f31: array [1 .. 7] of byte,

                f32: array [1 .. 7] of byte,
                array_packing: packattrs,

                length_is_bits: boolean,
                f33: array [1 .. 7] of byte,

                f34: array [1 .. 6] of byte,
                index_type: symbol_no,

                f35: array [1 .. 6] of byte,
                array_element_type: symbol_no,

                f36: half_word,
                element_length: ost$segment_length,

              = record_kind =
                record_binding: bindkinds,
                f37: array [1 .. 7] of byte,

                f38: array [1 .. 7] of byte,
                record_packing: packattrs,

                variation_flag: boolean,
                f39: array [1 .. 7] of byte,

                f40: array [1 .. 6] of byte,
                first_field: symbol_no,

                f41: half_word,
                record_length: ost$segment_length,

                f42: array [1 .. 6] of byte,
                selector: symbol_no,

              = field_kind =
                f43: array [1 .. 3] of byte,
                field_offset: machine_addr_in_bits_type,

                f44: array [1 .. 3] of byte,
                field_length: machine_addr_in_bits_type,

                unit_addressed: boolean,
                f45: array [1 .. 7] of byte,

                f46: array [1 .. 6] of byte,
                field_type: symbol_no,

                f47: array [1 .. 6] of byte,
                next_field: symbol_no,


              = selector_kind =
                f48: array [1 .. 6] of byte,
                variation: symbol_no,

                f50: array [1 .. 6] of byte,
                next_selector: symbol_no,

                low_selector: integer_range,

                high_selector: integer_range,


              = heap_kind =
                ,


              = seq_kind =
                ,


              = bound_vrec_kind =
                f52: array [1 .. 6] of byte,
                bound_type: symbol_no,


              = rel_ptr_kind =
                f53: array [1 .. 6] of byte,
                parent_type: symbol_no,

                f54: array [1 .. 6] of byte,
                object_type: symbol_no,

                f55: half_word,
                rel_ptr_object_length: ost$segment_length,

              casend,
            recend;

          TYPE

            llt$ci_debug_table_fragment = record
              f01: half_word,
              offset: llt$section_offset,
            recend;

          TYPE
            cyt$ii_cybil_symbol_table = record
              original_name: pmt$program_name,
              language: llt$module_generator,
              optimization_level: 0 .. 255,
              version: string (4),
              module_symbol_list: symbol_no,
              number_of_symbols: symbol_no,
            recend;

?? TITLE := '                               CONVERT CYBIL SYMBOL TABLE' ??
?? EJECT ??

          PROCEDURE convert_cybil_symbol_table (sequence_length: ost$segment_length;
            VAR status: ost$status);


            VAR
              symbol_table_text: ^SEQ ( * ),

              number_of_items: integer,
              item: integer,

              header_present: boolean,
              number_of_bytes: integer,

              ci_debug_table_fragment: ^llt$ci_debug_table_fragment,
              ii_debug_table_fragment: ^llt$debug_table_fragment,

              ci_cybil_symbol_table: ^cyt$ci_cybil_symbol_table,
              ii_cybil_symbol_table: ^cyt$ii_cybil_symbol_table,

              ci_item: ^array [1 .. * ] of cyt$ci_cybil_symbol_table_item,
              ii_item: ^array [1 .. * ] of cyt$debug_symbol_table_item,

              ci_dummy_name: packed array [1 .. 100] of half_byte,
              ii_dummy_name: pmt$program_name;


            number_of_bytes := sequence_length * 8;

            header_present := number_of_bytes MOD #SIZE (cyt$ci_cybil_symbol_table_item) <> 0;

            IF header_present THEN
              number_of_items := (number_of_bytes - #SIZE (cyt$ci_cybil_symbol_table)) DIV #SIZE
                    (cyt$ci_cybil_symbol_table_item);
              ii_text_descriptor^.sequence_length := number_of_items * #SIZE (cyt$debug_symbol_table_item) +
                    #SIZE (cyt$ii_cybil_symbol_table);
            ELSE
              number_of_items := number_of_bytes DIV #SIZE (cyt$ci_cybil_symbol_table_item);
              ii_text_descriptor^.sequence_length := number_of_items * #SIZE (cyt$debug_symbol_table_item);
            IFEND;

            NEXT ci_debug_table_fragment IN ci_input_seg;
            IF ci_debug_table_fragment = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Debug Symbol Table', status);
              RETURN;
            IFEND;

            NEXT ii_debug_table_fragment: [[REP ii_text_descriptor^.sequence_length OF cell]] IN output_seq;

            ii_debug_table_fragment^.offset := ci_debug_table_fragment^.offset;

            symbol_table_text := ^ii_debug_table_fragment^.text;
            RESET symbol_table_text;
            IF header_present THEN
              NEXT ci_cybil_symbol_table IN ci_input_seg;
              IF ci_cybil_symbol_table = NIL THEN
                error (oce$missing_rec_or_descriptor, 'Debug Symbol Table', status);
                RETURN;
              IFEND;

              NEXT ii_cybil_symbol_table IN symbol_table_text;

              convert_string (ci_cybil_symbol_table^.original_name, 1, ii_cybil_symbol_table^.original_name);
              ii_cybil_symbol_table^.language := ci_cybil_symbol_table^.language;
              ii_cybil_symbol_table^.optimization_level := ci_cybil_symbol_table^.optimization_level;
              convert_string (ci_cybil_symbol_table^.version, 1, ii_cybil_symbol_table^.version);
              ii_cybil_symbol_table^.module_symbol_list := ci_cybil_symbol_table^.module_symbol_list;
              ii_cybil_symbol_table^.number_of_symbols := ci_cybil_symbol_table^.number_of_symbols;
            IFEND;

            NEXT ci_item: [1 .. number_of_items] IN ci_input_seg;

            IF ci_item = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Debug Symbol Table', status);
              RETURN;
            IFEND;

            NEXT ii_item: [1 .. number_of_items] IN symbol_table_text;

            FOR item := 1 TO number_of_items DO
              convert_string (ci_item^ [item].symbol_name, 1, ii_item^ [item].symbol_name);
              convert_boolean (#LOC (ci_item^ [item].end_of_chain), ii_item^ [item].end_of_chain);
              ii_item^ [item].symtab_no := ci_item^ [item].symtab_no;
              ii_item^ [item].symbol_type := ci_item^ [item].symbol_type;

              CASE ii_item^ [item].symbol_type OF
              = int_kind, bool_kind, char_kind, real_kind, longreal_kind, cell_kind =

              = var_kind =
                ii_item^ [item].var_type := ci_item^ [item].var_type;
                ii_item^ [item].var_length := ci_item^ [item].var_length;
                ii_item^ [item].base := ci_item^ [item].base;
                ii_item^ [item].var_section_ordinal := ci_item^ [item].var_section_ordinal;
                ii_item^ [item].var_offset := ci_item^ [item].var_offset;
                convert_boolean (#LOC (ci_item^ [item].indirectly_referenced), ii_item^ [item].
                      indirectly_referenced);
                convert_boolean (#LOC (ci_item^ [item].var_is_parameter), ii_item^ [item].var_is_parameter);

              = cons_kind =
                ii_item^ [item].cons_type := ci_item^ [item].cons_type;
                ii_item^ [item].cons_length_type := ci_item^ [item].cons_length_type;
                convert_integer (#LOC (ci_item^ [item].cons_value), #LOC (ii_item^ [item].cons_value));

              = label_kind =
                ii_item^ [item].line_no := ci_item^ [item].line_no;

              = ordinal_kind =
                ii_item^ [item].last_const := ci_item^ [item].last_const;
                ii_item^ [item].upper_bound := ci_item^ [item].upper_bound;

              = subrange_kind =
                ii_item^ [item].subtype := ci_item^ [item].subtype;
                ii_item^ [item].low_value_type := ci_item^ [item].low_value_type;
                ii_item^ [item].high_value_type := ci_item^ [item].high_value_type;
                convert_integer (#LOC (ci_item^ [item].low_value), #LOC (ii_item^ [item].low_value));
                convert_integer (#LOC (ci_item^ [item].high_value), #LOC (ii_item^ [item].high_value));

              = proc_kind =
                ii_item^ [item].lexical_level := ci_item^ [item].lexical_level;
                ii_item^ [item].symbol_list := ci_item^ [item].symbol_list;
                ii_item^ [item].proc_section_ordinal := ci_item^ [item].proc_section_ordinal;
                ii_item^ [item].proc_offset := ci_item^ [item].proc_offset;
                ii_item^ [item].proc_length := ci_item^ [item].proc_length;
                ii_item^ [item].parent_proc := ci_item^ [item].parent_proc;
                ii_item^ [item].return_type := ci_item^ [item].return_type;

              = pointer_kind =
                ii_item^ [item].ptr_type := ci_item^ [item].ptr_type;
                ii_item^ [item].ptr_object_length := ci_item^ [item].ptr_object_length;

              = set_kind =
                ii_item^ [item].set_element_type := ci_item^ [item].set_element_type;
                ii_item^ [item].set_len := ci_item^ [item].set_len;

              = string_kind =
                ii_item^ [item].len_type := ci_item^ [item].len_type;
                ii_item^ [item].string_len := ci_item^ [item].string_len;

              = array_kind =
                convert_set (#LOC (ci_item^ [item].array_binding), 4, #LOC (ii_item^ [item].array_binding));
                ii_item^ [item].array_packing := ci_item^ [item].array_packing;
                convert_boolean (#LOC (ci_item^ [item].length_is_bits), ii_item^ [item].length_is_bits);
                ii_item^ [item].index_type := ci_item^ [item].index_type;
                ii_item^ [item].array_element_type := ci_item^ [item].array_element_type;
                ii_item^ [item].element_length := ci_item^ [item].element_length;

              = record_kind =
                convert_set (#LOC (ci_item^ [item].record_binding), 4, #LOC (ii_item^ [item].record_binding));
                ii_item^ [item].record_packing := ci_item^ [item].record_packing;
                convert_boolean (#LOC (ci_item^ [item].variation_flag), ii_item^ [item].variation_flag);
                ii_item^ [item].first_field := ci_item^ [item].first_field;
                ii_item^ [item].record_length := ci_item^ [item].record_length;
                ii_item^ [item].selector := ci_item^ [item].selector;

              = field_kind =
                ii_item^ [item].field_offset := ci_item^ [item].field_offset;
                ii_item^ [item].field_length := ci_item^ [item].field_length;
                convert_boolean (#LOC (ci_item^ [item].unit_addressed), ii_item^ [item].unit_addressed);
                ii_item^ [item].field_type := ci_item^ [item].field_type;
                ii_item^ [item].next_field := ci_item^ [item].next_field;

              = selector_kind =
                ii_item^ [item].variation := ci_item^ [item].variation;
                ii_item^ [item].next_selector := ci_item^ [item].next_selector;
                convert_integer (#LOC (ci_item^ [item].low_selector), #LOC (ii_item^ [item].low_selector));
                convert_integer (#LOC (ci_item^ [item].high_selector), #LOC (ii_item^ [item].high_selector));

              = heap_kind =

              = seq_kind =

              = bound_vrec_kind =
                ii_item^ [item].bound_type := ci_item^ [item].bound_type;

              = rel_ptr_kind =
                ii_item^ [item].parent_type := ci_item^ [item].parent_type;
                ii_item^ [item].object_type := ci_item^ [item].object_type;
                ii_item^ [item].rel_ptr_object_length := ci_item^ [item].rel_ptr_object_length;

              ELSE
              CASEND;
            FOREND;


          PROCEND convert_cybil_symbol_table;
?? TITLE := '                               CONVERT BINDING TEMPLATE ITEM' ??
?? EJECT ??

          PROCEDURE convert_binding_template (VAR status: ost$status);


            { 170 binding section }

            TYPE
              llt$ci_binding_template = record
                f00: half_word,
                binding_offset: llt$section_offset,

                f01: array [1 .. 7] of byte,
                case kind: llt$binding_template_kind of
                = llc$current_module =
                  f02: array [1 .. 6] of byte,
                  section_ordinal: llt$section_ordinal,

                  offset: ost$segment_offset,

                  f04: array [1 .. 7] of byte,
                  internal_address: llt$address_kind,

                  f05: array [1 .. 5] of word,

                = llc$external_reference =
                  name: pmt$ci_program_name,

                  f06: array [1 .. 7] of byte,
                  address: llt$address_kind,
                casend,
              recend;

?? EJECT ??

            VAR
              ci_binding: ^llt$ci_binding_template,
              ii_binding: ^llt$binding_template;


            NEXT ci_binding IN ci_input_seg;

            IF ci_binding <> NIL THEN
              NEXT ii_binding IN output_seq;

              ii_binding^.binding_offset := ci_binding^.binding_offset;

              ii_binding^.kind := ci_binding^.kind;

              CASE ci_binding^.kind OF
              = llc$current_module =
                ii_binding^.section_ordinal := ci_binding^.section_ordinal;
                convert_integer (#LOC (ci_binding^.offset), #LOC (ii_binding^.offset));
                ii_binding^.internal_address := ci_binding^.internal_address;

              = llc$external_reference =
                convert_string (ci_binding^.name, 1, ii_binding^.name);
                ii_binding^.address := ci_binding^.address;

              CASEND;
            ELSE
              error (oce$missing_rec_or_descriptor, 'Binding Template Record', status);
            IFEND;


          PROCEND convert_binding_template;
?? TITLE := '                               CONVERT TRANSFER SYMBOL ITEM' ??
?? EJECT ??

          PROCEDURE convert_transfer_symbol_item (VAR status: ost$status);



            { 170 transfer symbol }


            TYPE
              llt$ci_transfer_symbol = record
                name: pmt$ci_program_name,

              recend;


            VAR
              ci_transfer_symbol: ^llt$ci_transfer_symbol,
              ii_transfer_symbol: ^llt$transfer_symbol;

            NEXT ci_transfer_symbol IN ci_input_seg;

            IF ci_transfer_symbol <> NIL THEN
              NEXT ii_transfer_symbol IN output_seq;
              convert_string (ci_transfer_symbol^.name, 1, ii_transfer_symbol^.name);

            ELSE
              error (oce$missing_rec_or_descriptor, 'Transfer Symbol Record', status);
            IFEND;


          PROCEND convert_transfer_symbol_item;
?? OLDTITLE ??
?? EJECT ??

          VAR
            type_of_obj_record {control} : llt$object_record_kind,
            size: integer;


          REPEAT
            convert_object_text_desc_13 (type_of_obj_record, size, status);

            IF status.normal THEN

              CASE type_of_obj_record OF
              = llc$identification =
                error (oce$multiple_ident_records, 'CPU Object Module', status);

              = llc$libraries =
                convert_library_directives (size, status);

              = llc$section_definition =
                convert_section_definition_item (status);

              = llc$text =
                convert_text_item (size, status);

              = llc$replication =
                convert_replication_item (size, status);

              = llc$bit_string_insertion =
                convert_bit_insertion_item (status);

              = llc$address_formulation =
                convert_addr_formulation_item (size, status);

              = llc$external_linkage =
                convert_external_linkage_item (size, status);

              = llc$entry_definition =
                convert_entry_point_definition (status);

              = llc$relocation =
                convert_relocation_item (size, status);

              = llc$actual_parameters =
                convert_actual_parameters (size, status);

              = llc$formal_parameters =
                convert_formal_parameters (size, generator_id, status);

              = llc$cybil_symbol_table_fragment =
                convert_cybil_symbol_table (size, status);

              = llc$binding_template =
                convert_binding_template (status);

              = llc$transfer_symbol =
                convert_transfer_symbol_item (status);

              ELSE
                error (oce$invalid_cpu_record_kind, 'CPU Object Module', status);

              CASEND;

            ELSE
              error (status.condition, 'Object Text Descriptor 1.3', status);
            IFEND;

          UNTIL (type_of_obj_record = llc$transfer_symbol) OR (NOT status.normal);


        PROCEND convert_cpu_object_module;
?? TITLE := '                             CONVERT IDENTIFICATION BODY' ??
?? EJECT ??

        PROCEDURE convert_identification_body (ii_identification: ^llt$identification;
          VAR type_of_object_program: llt$module_kind;
          VAR generator_id: llt$module_generator;
          VAR status: ost$status);


          { 170 identification record }


          TYPE
            llt$ci_identification_body = record
              f00: array [1 .. 7] of byte,
              kind: llt$module_kind,

              time_created: ost$ci_time,

              date_created: ost$ci_date,

              attributes: llt$module_attributes,
              f01: array [1 .. 7] of byte,

              f02: array [1 .. 6] of byte,
              greatest_section_ordinal: llt$section_ordinal,

              f03: array [1 .. 7] of byte,
              generator_id: llt$module_generator,

              generator_name_vers: packed array [1 .. 128] of half_byte,

              commentary: packed array [1 .. 128] of half_byte,

            recend;


          CONST
            num_module_attr = 2;




          { 170 return date }


          TYPE
            ost$ci_date = record
              f01: array [1 .. 7] of byte,
              case date_format: ost$date_formats of
              = osc$month_date =
                month: packed array [1 .. 64] of half_byte,

              = osc$mdy_date =
                mdy: packed array [1 .. 64] of half_byte,

              = osc$iso_date =
                iso: packed array [1 .. 64] of half_byte,

              = osc$ordinal_date =
                ordinal: packed array [1 .. 64] of half_byte,

              casend,

            recend;




          { 170 return time }


          TYPE
            ost$ci_time = record
              f01: array [1 .. 7] of byte,
              case time_format: ost$time_formats of
              = osc$ampm_time =
                ampm: packed array [1 .. 48] of half_byte,

              = osc$hms_time =
                hms: packed array [1 .. 48] of half_byte,

              = osc$millisecond_time =
                millisecond: packed array [1 .. 48] of half_byte,

              casend,

            recend;

?? EJECT ??

          VAR
            ci_identification: ^llt$ci_identification_body;



          NEXT ci_identification IN ci_input_seg;

          IF ci_identification <> NIL THEN

            type_of_object_program := ci_identification^.kind;
            ii_identification^.kind := ci_identification^.kind;

            { convert time request return value }

            ii_identification^.time_created.time_format := ci_identification^.time_created.time_format;

            CASE ci_identification^.time_created.time_format OF
            = osc$ampm_time =
              convert_string (ci_identification^.time_created.ampm, 1, ii_identification^.time_created.ampm);

            = osc$hms_time =
              convert_string (ci_identification^.time_created.hms, 1, ii_identification^.time_created.hms);

            = osc$millisecond_time =
              convert_string (ci_identification^.time_created.millisecond, 1, ii_identification^.time_created.
                    millisecond);
            ELSE
              error (pme$invalid_time_format, 'Identification Record', status);

            CASEND;

            IF status.normal THEN

              { convert date request return value }

              ii_identification^.date_created.date_format := ci_identification^.date_created.date_format;

              CASE ci_identification^.date_created.date_format OF
              = osc$month_date =
                convert_string (ci_identification^.date_created.month, 1, ii_identification^.date_created.
                      month);

              = osc$mdy_date =
                convert_string (ci_identification^.date_created.mdy, 1, ii_identification^.date_created.mdy);

              = osc$iso_date =
                convert_string (ci_identification^.date_created.iso, 1, ii_identification^.date_created.iso);

              = osc$ordinal_date =
                convert_string (ci_identification^.date_created.ordinal, 1, ii_identification^.date_created.
                      ordinal);
              ELSE
                error (pme$invalid_date_format, 'Identification Record', status);

              CASEND;

              IF status.normal THEN

                { finish converting identification record }

                convert_set (#LOC (ci_identification^.attributes), num_module_attr, #LOC (ii_identification^.
                      attributes));

                ii_identification^.greatest_section_ordinal := ci_identification^.greatest_section_ordinal;

                ii_identification^.generator_id := ci_identification^.generator_id;
                generator_id := ci_identification^.generator_id;

                IF generator_id = llc$cybil THEN
                  error (oce$invalid_version, 'V1.3 - CYBIL', status);
                  RETURN;
                IFEND;

                convert_string (ci_identification^.generator_name_vers, 1, ii_identification^.
                      generator_name_vers);

                convert_string (ci_identification^.commentary, 1, ii_identification^.commentary);

              IFEND;
            IFEND;
          ELSE
            error (oce$missing_rec_or_descriptor, 'Identification Record', status);
          IFEND;


        PROCEND convert_identification_body;
?? OLDTITLE ??
?? EJECT ??


        VAR
          kind_of_object_module {control} : llt$module_kind,
          module_generator: llt$module_generator;




        convert_identification_body (ii_identification, kind_of_object_module, module_generator, status);

        IF status.normal THEN
          CASE kind_of_object_module OF
          = llc$iou =
            convert_iou_object_module (status);

          = llc$mi_virtual_state, llc$vector_virtual_state, llc$vector_extended_state =
            convert_cpu_object_module (module_generator, status);

          ELSE
            error (oce$invalid_object_module_kind, 'Version 1.3 Text', status);
          CASEND;

        IFEND;

      PROCEND convert_version_13_text;
?? OLDTITLE ??
?? NEWTITLE := '                           CONVERT VERSION 1.4 TEXT' ??
?? NEWTITLE := '                             CONVERT OBJECT TEXT DESCRIPTOR - 1.4' ??
?? EJECT ??

      PROCEDURE convert_version_14_text (ii_identification: ^llt$identification;
        VAR output_seq: ^SEQ ( * );
        VAR status: ost$status);

{ The following *copy is here on purpose.  If it is moved to the beginning of
{ the module, it will not compile given the current implementation.  The problem is that
{ ordinal types llt$object_record_kind and llt$extended_object_record_kind, which is
{ declared in procedure convert_object_file, use some of the same ordinal names.
{ Declaring llt$object_record_kind here means that the ordinal names override the ones
{ with the same names declared in the outer procedure.

*copy llt$object_record_kind


        VAR
          ii_text_descriptor: ^llt$object_text_descriptor;


        PROCEDURE convert_object_text_desc_14 (VAR object_type: llt$object_record_kind;
          VAR size: integer;
          VAR status: ost$status);





          TYPE
            llt$ci_object_text_descriptor = record
              f00: array [1 .. 7] of byte,
              case kind: llt$object_record_kind of
              = llc$identification, llc$section_definition, llc$entry_definition, llc$binding_template,
                llc$transfer_symbol, llc$bit_string_insertion =
                unused: ost$segment_offset, {always 0}

              = llc$libraries =
                f02: array [1 .. 6] of byte,
                number_of_libraries: 1 .. llc$max_libraries,

              = llc$text, llc$replication =
                f03: array [1 .. 4] of byte,
                number_of_bytes: 1 .. osc$max_segment_length,

              = llc$relocation =
                f05: array [1 .. 6] of byte,
                number_of_rel_items: 1 .. llc$max_rel_items,

              = llc$address_formulation =
                f06: array [1 .. 6] of byte,
                number_of_adr_items: 1 .. llc$max_adr_items,

              = llc$external_linkage =
                f07: array [1 .. 6] of byte,
                number_of_ext_items: 1 .. llc$max_ext_items,

              = llc$formal_parameters, llc$actual_parameters, llc$cybil_symbol_table_fragment,
                llc$symbol_table_fragment, llc$line_table_fragment =
                f08: array [1 .. 4] of byte,
                sequence_length: ost$segment_length,

              = llc$ppu_absolute =
                f09: array [1 .. 6] of byte,
                number_of_words: llt$ppu_address,

              = llc$68000_absolute =
                f10: half_word,
                number_of_68000_bytes: 1 .. llc$maximum_68000_address,
              casend,
            recend;




          VAR
            ci_text_descriptor: ^llt$ci_object_text_descriptor;



          NEXT ci_text_descriptor IN ci_input_seg;

          IF ci_text_descriptor <> NIL THEN
            object_type := ci_text_descriptor^.kind;

            NEXT ii_text_descriptor IN output_seq;

            ii_text_descriptor^.kind := ci_text_descriptor^.kind;

            CASE ci_text_descriptor^.kind OF
            = llc$identification, llc$section_definition, llc$entry_definition, llc$binding_template,
                  llc$bit_string_insertion, llc$transfer_symbol =
              ii_text_descriptor^.unused := ci_text_descriptor^.unused;

            = llc$libraries =
              ii_text_descriptor^.number_of_libraries := ci_text_descriptor^.number_of_libraries;
              size := ci_text_descriptor^.number_of_libraries;

            = llc$text, llc$replication =
              ii_text_descriptor^.number_of_bytes := ci_text_descriptor^.number_of_bytes;
              size := ci_text_descriptor^.number_of_bytes;

            = llc$relocation =
              ii_text_descriptor^.number_of_rel_items := ci_text_descriptor^.number_of_rel_items;
              size := ci_text_descriptor^.number_of_rel_items;

            = llc$address_formulation =
              ii_text_descriptor^.number_of_adr_items := ci_text_descriptor^.number_of_adr_items;
              size := ci_text_descriptor^.number_of_adr_items;

            = llc$external_linkage =
              ii_text_descriptor^.number_of_ext_items := ci_text_descriptor^.number_of_ext_items;
              size := ci_text_descriptor^.number_of_ext_items;

            = llc$formal_parameters, llc$actual_parameters =
              size := ci_text_descriptor^.sequence_length;

            = llc$cybil_symbol_table_fragment =
              size := ci_text_descriptor^.sequence_length;

            = llc$68000_absolute =
              ii_text_descriptor^.number_of_68000_bytes := ci_text_descriptor^.number_of_68000_bytes;
              size := ci_text_descriptor^.sequence_length;

            = llc$symbol_table_fragment, llc$line_table_fragment =
              size := ci_text_descriptor^.sequence_length;
              RESET output_seq TO ii_text_descriptor;

            = llc$ppu_absolute =
              ii_text_descriptor^.number_of_words := ci_text_descriptor^.number_of_words;
              size := ci_text_descriptor^.number_of_words;

            ELSE
              error (oce$invalid_object_record_kind, 'Object Text Descriptor 1.4', status);

            CASEND;

          ELSE
            eoi_warning (oce$missing_rec_or_descriptor, status);

          IFEND;


        PROCEND convert_object_text_desc_14;
?? OLDTITLE ??

?? NEWTITLE := '                             CONVERT IOU OBJECT MODULE' ??
?? NEWTITLE := '                               CONVERT PPU ABSOLUTE ITEM' ??
?? EJECT ??

        PROCEDURE convert_iou_object_module (VAR status: ost$status);




          PROCEDURE convert_ppu_absolute_item (number_of_words: llt$ppu_address;
            VAR status: ost$status);




            { 170 ppu absolute }


            TYPE
              llt$ci_ppu_absolute = record
                executes_on_any_ppu: boolean,
                f01: array [1 .. 7] of byte,

                f02: array [1 .. 7] of byte,
                ppu_number: 0 .. llc$max_ppu_number,

                f03: array [1 .. 6] of byte,
                load_address: llt$ppu_address,

                f04: array [1 .. 6] of byte,
                entry_address: llt$ppu_address,

                text_array: array [ * ] of ppu_text,

              recend,


              ppu_text = record
                f01: array [1 .. 6] of byte,
                text: 0 .. 0ffff(16),

              recend;






            VAR
              ci_ppu: ^llt$ci_ppu_absolute,
              ii_ppu: ^llt$ppu_absolute,
              w: 0 .. llc$max_ppu_size + 1;



            NEXT ci_ppu: [0 .. number_of_words - 1] IN ci_input_seg;

            IF ci_ppu <> NIL THEN

              NEXT ii_ppu: [0 .. number_of_words - 1] IN output_seq;


              convert_boolean (#LOC (ci_ppu^.executes_on_any_ppu), ii_ppu^.executes_on_any_ppu);

              ii_ppu^.ppu_number := ci_ppu^.ppu_number;
              ii_ppu^.load_address := ci_ppu^.load_address;
              ii_ppu^.entry_address := ci_ppu^.entry_address;

              FOR w := 0 TO (number_of_words - 1) DO
                ii_ppu^.text [w] := ci_ppu^.text_array [w].text;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'PPU Record', status);
            IFEND;


          PROCEND convert_ppu_absolute_item;
?? EJECT ??
?? OLDTITLE ??


          VAR
            type_of_obj_record {control} : llt$object_record_kind,
            size: integer;


          convert_object_text_desc_14 (type_of_obj_record, size, status);

          IF status.normal THEN
            CASE type_of_obj_record OF
            = llc$ppu_absolute =
              convert_ppu_absolute_item (size, status);

            ELSE
              error (oce$invalid_ppu_record_kind, 'IOU Object Module', status);

            CASEND;

          ELSE
            error (oce$missing_rec_or_descriptor, 'PPU Descriptor', status);
          IFEND;


        PROCEND convert_iou_object_module;
?? OLDTITLE ??
?? NEWTITLE := '                             CONVERT CPU OBJECT MODULE' ??
?? NEWTITLE := '                               CONVERT LIBRARY DIRECTIVES' ??
?? EJECT ??

        PROCEDURE convert_cpu_object_module (generator_id: llt$module_generator;
          VAR status: ost$status);

{       NOTE:                                    }
{         The parameter 'generator_id' is used }
{         by 'convert_formal_parameters' to      }
{         identify the type of calling procedure.}



          PROCEDURE convert_library_directives (number_of_libraries: 1 .. llc$max_libraries;
            VAR status: ost$status);


            { 170 library directives }


            TYPE
              llt$ci_libraries = array [ * ] of pmt$ci_program_name;


            VAR
              ci_library: ^llt$ci_libraries,
              ii_library: ^llt$libraries,
              l: 1 .. llc$max_libraries + 1;



            NEXT ci_library: [1 .. number_of_libraries] IN ci_input_seg;

            IF ci_library <> NIL THEN
              NEXT ii_library: [1 .. number_of_libraries] IN output_seq;


              FOR l := 1 TO number_of_libraries DO
                convert_string (ci_library^ [l], 1, ii_library^ [l]);
                IF ii_library^ [l] = 'CYBILIB ' THEN
                  ii_library^ [l] := 'CYF$RUN_TIME_LIBRARY';
                ELSEIF ii_library^ [l] = 'CYBMLIB' THEN
                  ii_library^ [l] := 'CYF$DIOS_RUN_TIME_LIBRARY';
                IFEND;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Library Record', status);
            IFEND;


          PROCEND convert_library_directives;
?? TITLE := '                               CONVERT SECTION DEFINITION' ??
?? EJECT ??

          PROCEDURE convert_section_definition_item (VAR status: ost$status);



            { 170 section definitions }


            TYPE
              llt$ci_section_definition = record
                f01: array [1 .. 7] of byte,
                kind: llt$section_kind,

                access_attributes: llt$section_access_attributes,
                f02: array [1 .. 7] of byte,

                f03: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f04: half_word,
                length: ost$segment_length,

                allocation_alignment: ost$segment_offset,

                allocation_offset: ost$segment_offset,

                name: pmt$ci_program_name,

              recend;




?? EJECT ??

            CONST
              num_access_attributes = 4;

            VAR
              ci_section: ^llt$ci_section_definition,
              ii_section: ^llt$section_definition;




            NEXT ci_section IN ci_input_seg;

            IF ci_section <> NIL THEN
              NEXT ii_section IN output_seq;


              ii_section^.kind := ci_section^.kind;

              convert_set (#LOC (ci_section^.access_attributes), num_access_attributes, #LOC (ii_section^.
                    access_attributes));

              ii_section^.section_ordinal := ci_section^.section_ordinal;
              ii_section^.length := ci_section^.length;
              convert_integer (#LOC (ci_section^.allocation_alignment), #LOC (ii_section^.
                    allocation_alignment));
              convert_integer (#LOC (ci_section^.allocation_offset), #LOC (ii_section^.allocation_offset));

              convert_string (ci_section^.name, 1, ii_section^.name);

            ELSE
              error (oce$missing_rec_or_descriptor, 'Section Defn. Record', status);
            IFEND;


          PROCEND convert_section_definition_item;
?? TITLE := '                               CONVERT TEXT ITEM' ??
?? EJECT ??

          PROCEDURE convert_text_item (number_of_bytes: 1 .. osc$max_segment_length;
            VAR status: ost$status);



            { 170 text item }


            TYPE
              llt$ci_text = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                byte_array: array [ * ] of text_component,

              recend,

              text_component = record
                f01: array [1 .. 7] of byte,
                byte: 0 .. 255,

              recend;





            VAR
              ci_text: ^llt$ci_text,
              ii_text: ^llt$text,
              b: 1 .. osc$max_segment_length + 1;

?? EJECT ??
            NEXT ci_text: [1 .. number_of_bytes] IN ci_input_seg;

            IF ci_text <> NIL THEN
              NEXT ii_text: [1 .. number_of_bytes] IN output_seq;


              ii_text^.section_ordinal := ci_text^.section_ordinal;
              ii_text^.offset := ci_text^.offset;

              FOR b := 1 TO number_of_bytes DO
                ii_text^.byte [b] := ci_text^.byte_array [b].byte;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Text Record', status);
            IFEND;


          PROCEND convert_text_item;
?? TITLE := '                               CONVERT REPLICATION ITEM' ??
?? EJECT ??

          PROCEDURE convert_replication_item (number_of_bytes: 1 .. osc$max_segment_length;
            VAR status: ost$status);




            { 170 replication item }


            TYPE
              llt$ci_replication = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                f03: half_word,
                increment: 1 .. osc$max_segment_length,

                f04: half_word,
                count: 1 .. osc$max_segment_length,

                byte_array: array [ * ] of replication_text,

              recend,


              replication_text = record
                f01: array [1 .. 7] of byte,
                byte: 0 .. 255,

              recend;

?? EJECT ??

            VAR
              ci_replication: ^llt$ci_replication,
              ii_replication: ^llt$replication,
              b: 1 .. osc$max_segment_length + 1;



            NEXT ci_replication: [1 .. number_of_bytes] IN ci_input_seg;

            IF ci_replication <> NIL THEN
              NEXT ii_replication: [1 .. number_of_bytes] IN output_seq;


              ii_replication^.section_ordinal := ci_replication^.section_ordinal;
              ii_replication^.offset := ci_replication^.offset;
              ii_replication^.increment := ci_replication^.increment;
              ii_replication^.count := ci_replication^.count;

              FOR b := 1 TO number_of_bytes DO
                ii_replication^.byte [b] := ci_replication^.byte_array [b].byte;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Replication Record', status);
            IFEND;


          PROCEND convert_replication_item;
?? TITLE := '                               CONVERT BIT INSERTION ITEM' ??
?? EJECT ??

          PROCEDURE convert_bit_insertion_item (VAR status: ost$status);




            { 170 bit insertion item }


            TYPE
              llt$ci_bit_string_insertion = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                f03: array [1 .. 7] of byte,
                bit_offset: 0 .. 7,

                f04: array [1 .. 7] of byte,
                bit_length: 1 .. 63,

                bit_string: packed array [1 .. 128] of 0 .. 1,

              recend;


            VAR
              ci_bit_insertion: ^llt$ci_bit_string_insertion,
              ii_bit_insertion: ^llt$bit_string_insertion,
              b: 1 .. 128;

?? EJECT ??



            NEXT ci_bit_insertion IN ci_input_seg;

            IF ci_bit_insertion <> NIL THEN
              NEXT ii_bit_insertion IN output_seq;


              ii_bit_insertion^.section_ordinal := ci_bit_insertion^.section_ordinal;
              ii_bit_insertion^.offset := ci_bit_insertion^.offset;
              ii_bit_insertion^.bit_offset := ci_bit_insertion^.bit_offset;
              ii_bit_insertion^.bit_length := ci_bit_insertion^.bit_length;

              FOR b := 1 TO 60 DO
                ii_bit_insertion^.bit_string [b] := ci_bit_insertion^.bit_string [b + 4];
              FOREND;
              FOR b := 61 TO 63 DO
                ii_bit_insertion^.bit_string [b] := ci_bit_insertion^.bit_string [b + 8];
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Bit Insertion Record', status);
            IFEND;


          PROCEND convert_bit_insertion_item;
?? TITLE := '                               CONVERT ADDRESS FORMULATION ITEM' ??
?? EJECT ??

          PROCEDURE convert_addr_formulation_item (addr_upper_bnd: 1 .. llc$max_adr_items;
            VAR status: ost$status);


            { 170 address formulation item }


            TYPE
              llt$ci_address_formulation = record
                f01: array [1 .. 6] of byte,
                value_section: llt$section_ordinal,

                f02: array [1 .. 6] of byte,
                dest_section: llt$section_ordinal,

                item: array [ * ] of llt$ci_address_formulation_item,

              recend,


              llt$ci_address_formulation_item = record
                f01: array [1 .. 7] of byte,
                kind: llt$internal_address_kind,

                value_offset: ost$segment_offset,

                f03: half_word,
                dest_offset: llt$section_offset,

              recend;






            VAR
              ci_address: ^llt$ci_address_formulation,
              ii_address: ^llt$address_formulation,
              a: 1 .. llc$max_adr_items + 1;

?? EJECT ??



            NEXT ci_address: [1 .. addr_upper_bnd] IN ci_input_seg;

            IF ci_address <> NIL THEN
              NEXT ii_address: [1 .. addr_upper_bnd] IN output_seq;


              ii_address^.value_section := ci_address^.value_section;
              ii_address^.dest_section := ci_address^.dest_section;

              FOR a := 1 TO addr_upper_bnd DO
                ii_address^.item [a].kind := ci_address^.item [a].kind;
                convert_integer (#LOC (ci_address^.item [a].value_offset), #LOC (ii_address^.item [a].
                      value_offset));
                ii_address^.item [a].dest_offset := ci_address^.item [a].dest_offset;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Address Formulation Record', status);
            IFEND;


          PROCEND convert_addr_formulation_item;
?? TITLE := '                               CONVERT EXTERNAL REFERENCE ITEM' ??
?? EJECT ??

          PROCEDURE convert_external_linkage_item (number_of_ext_items: 1 .. llc$max_ext_items;
            VAR status: ost$status);



            { 170 external reference item }


            TYPE
              llt$ci_external_linkage = record
                name: pmt$ci_program_name,

                f00: array [1 .. 7] of byte,
                language: llt$module_generator,

                declaration_matching_required: boolean,
                f01: array [1 .. 7] of byte,

                declaration_matching_value: llt$ci_decl_matching_value,

                item: array [ * ] of llt$ci_external_linkage_item,
              recend,


              llt$ci_external_linkage_item = record
                f02: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f03: half_word,
                offset: llt$section_offset,
                f01: array [1 .. 7] of byte,
                kind: llt$address_kind,

                offset_operand: - osc$maximum_offset .. osc$maximum_offset,

              recend;


?? EJECT ??

            VAR
              ci_external_linkage: ^llt$ci_external_linkage,
              ii_external_linkage: ^llt$external_linkage,
              e: 1 .. llc$max_ext_items + 1;


            NEXT ci_external_linkage: [1 .. number_of_ext_items] IN ci_input_seg;

            IF ci_external_linkage <> NIL THEN
              NEXT ii_external_linkage: [1 .. number_of_ext_items] IN output_seq;

              convert_string (ci_external_linkage^.name, 1, ii_external_linkage^.name);

              ii_external_linkage^.language := ci_external_linkage^.language;
              IF ci_external_linkage^.language = llc$obsolete_cybil THEN
                convert_boolean (#LOC (ci_external_linkage^.declaration_matching_required),
                      ii_external_linkage^.declaration_matching_required);
                ii_external_linkage^.declaration_matching.language_dependent_value :=
                      ci_external_linkage^.declaration_matching_value.lower_1 * 100000000(16) +
                      ci_external_linkage^.declaration_matching_value.lower_2;
              ELSE

                ii_external_linkage^.declaration_matching_required := FALSE;

                ii_external_linkage^.declaration_matching.object_encryption := 0;
                ii_external_linkage^.declaration_matching.source_encryption := 0;
              IFEND;
              FOR e := 1 TO number_of_ext_items DO
                ii_external_linkage^.item [e].kind := ci_external_linkage^.item [e].kind;

                convert_integer (#LOC (ci_external_linkage^.item [e].offset_operand), #LOC
                      (ii_external_linkage^.item [e].offset_operand));

                ii_external_linkage^.item [e].section_ordinal := ci_external_linkage^.item [e].
                      section_ordinal;
                ii_external_linkage^.item [e].offset := ci_external_linkage^.item [e].offset;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'External Reference Record', status);
            IFEND;


          PROCEND convert_external_linkage_item;
?? TITLE := '                               CONVERT ENTRY POINT DEFINITION' ??
?? EJECT ??

          PROCEDURE convert_entry_point_definition (VAR status: ost$status);




            { 170 entry point definition item }


            TYPE
              llt$ci_entry_definition = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                attributes: llt$entry_point_attributes,
                f03: array [1 .. 7] of byte,

                name: pmt$ci_program_name,

                f04: array [1 .. 7] of byte,
                language: llt$module_generator,

                declaration_matching_required: boolean,
                f05: array [1 .. 7] of byte,

                declaration_matching_value: llt$ci_decl_matching_value,

              recend;


            CONST
              num_entry_point_attr = 2;

?? EJECT ??

            VAR
              ci_entry_point: ^llt$ci_entry_definition,
              ii_entry_point: ^llt$entry_definition;



            NEXT ci_entry_point IN ci_input_seg;

            IF ci_entry_point <> NIL THEN
              NEXT ii_entry_point IN output_seq;


              ii_entry_point^.section_ordinal := ci_entry_point^.section_ordinal;
              ii_entry_point^.offset := ci_entry_point^.offset;

              convert_set (#LOC (ci_entry_point^.attributes), num_entry_point_attr, #LOC (ii_entry_point^.
                    attributes));

              convert_string (ci_entry_point^.name, 1, ii_entry_point^.name);

              ii_entry_point^.language := ci_entry_point^.language;
              IF ci_entry_point^.language = llc$obsolete_cybil THEN
                convert_boolean (#LOC (ci_entry_point^.declaration_matching_required),
                      ii_entry_point^.declaration_matching_required);
                ii_entry_point^.declaration_matching.language_dependent_value :=
                      ci_entry_point^.declaration_matching_value.lower_1 * 100000000(16) +
                      ci_entry_point^.declaration_matching_value.lower_2;
              ELSE

                ii_entry_point^.declaration_matching_required := FALSE;

                ii_entry_point^.declaration_matching.object_encryption := 0;
                ii_entry_point^.declaration_matching.source_encryption := 0;
              IFEND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Entry Point Defn. Record', status);
            IFEND;


          PROCEND convert_entry_point_definition;
?? TITLE := '                               CONVERT RELOCATION ITEM' ??
?? EJECT ??

          PROCEDURE convert_relocation_item (number_of_rel_items: 1 .. llc$max_rel_items;
            VAR status: ost$status);



            { relocation item }

            TYPE
              llt$ci_relocation = array [ * ] of llt$ci_relocation_item,


              llt$ci_relocation_item = record
                f01: array [1 .. 6] of byte,
                section_ordinal: llt$section_ordinal,

                f02: half_word,
                offset: llt$section_offset,

                f03: array [1 .. 6] of byte,
                relocating_section: llt$section_ordinal,

                f04: array [1 .. 7] of byte,
                container: llt$relocation_container,

                f05: array [1 .. 7] of byte,
                address: llt$address_type,

              recend;

?? EJECT ??



            VAR
              ci_relocation: ^llt$ci_relocation,
              ii_relocation: ^llt$relocation,
              r: 1 .. llc$max_rel_items + 1;



            NEXT ci_relocation: [1 .. number_of_rel_items] IN ci_input_seg;

            IF ci_relocation <> NIL THEN
              NEXT ii_relocation: [1 .. number_of_rel_items] IN output_seq;

              FOR r := 1 TO number_of_rel_items DO
                ii_relocation^ [r].section_ordinal := ci_relocation^ [r].section_ordinal;
                ii_relocation^ [r].offset := ci_relocation^ [r].offset;
                ii_relocation^ [r].relocating_section := ci_relocation^ [r].relocating_section;
                ii_relocation^ [r].container := ci_relocation^ [r].container;
                ii_relocation^ [r].address := ci_relocation^ [r].address;
              FOREND;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Relocation Record', status);
            IFEND;


          PROCEND convert_relocation_item;
?? TITLE := '                               170 Formal & Actual Parameter Items' ??
?? EJECT ??




          { 170 procedure formal parameter description item }


          TYPE
            llt$ci_formal_parameters = record
              procedure_name: pmt$ci_program_name,

            recend;


          { 170 procedure call actual parameters item }


          TYPE
            llt$ci_actual_parameters = record
              callee_name: pmt$ci_program_name,

              f01: array [1 .. 7] of byte,
              language: llt$module_generator,

              f02: array [1 .. 5] of byte,
              line_number_of_call: llt$source_line_number,


            recend,

            llt$ci_source_line_number = packed array [1 .. 32] of half_byte;





?? TITLE := '                               170 Fortran Argument Descriptor' ??
?? EJECT ??
          { 170 fortran argument description: used to describe a }
          { single actual or formal fortran parameter }


          TYPE
            llt$ci_fortran_argument_desc = record
              f01: array [1 .. 7] of byte,
              argument_type: llt$fortran_argument_type,

              string_length: llt$ci_fortran_string_length,

              f02: array [1 .. 7] of byte,
              argument_kind: llt$fortran_argument_kind,

              array_size: llt$ci_fortran_array_size,

              f03: array [1 .. 6] of byte,
              dummy_argument_ordinal: 1 .. llc$max_fortran_arguments,


              f04: array [1 .. 7] of byte,
              mode: llt$argument_usage,
            recend,


            llt$ci_fortran_string_length = packed record
              f01: half_byte,
              attributes: llt$fortran_string_attributes,
              f02: half_byte,
              f03: array [1 .. 6] of byte,

              f04: array [1 .. 6] of byte,
              number_of_characters: llt$fortran_string_size,
            recend,


            llt$ci_fortran_array_size = packed record
              f01: half_byte,
              attributes: llt$fortran_array_attributes,
              f02: half_byte,
              f03: array [1 .. 6] of byte,

              f04: array [1 .. 7] of byte,
              rank: llt$fortran_array_rank,

              f05: half_word,
              number_of_elements: llt$section_length,
            recend;




?? TITLE := '                               CONVERT FORTRAN PARAMETERS' ??
?? EJECT ??

          PROCEDURE convert_fortran_parameters (sequence_length: ost$segment_length;
            VAR parameters: SEQ ( * );
            VAR status: ost$status);


            VAR
              parameter_sequence: ^SEQ ( * ),
              ci_fortran_parameter: ^array [1 .. * ] of llt$ci_fortran_argument_desc,
              ii_fortran_parameter: ^array [1 .. * ] of llt$fortran_argument_desc,
              num_params: integer,
              np: integer;


            num_params := sequence_length DIV #SIZE (llt$ci_fortran_argument_desc);

            NEXT ci_fortran_parameter: [1 .. num_params] IN ci_input_seg;
            IF ci_fortran_parameter = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Fortran Parameters', status);
              RETURN;
            IFEND;

            parameter_sequence := ^parameters;
            RESET parameter_sequence;
            NEXT ii_fortran_parameter: [1 .. num_params] IN parameter_sequence;

            FOR np := 1 TO num_params DO
              ii_fortran_parameter^ [np].argument_type := ci_fortran_parameter^ [np].argument_type;

              ii_fortran_parameter^ [np].string_length.attributes := ci_fortran_parameter^ [np].string_length.
                    attributes;

              ii_fortran_parameter^ [np].string_length.number_of_characters := ci_fortran_parameter^ [np].
                    string_length.number_of_characters;

              ii_fortran_parameter^ [np].argument_kind := ci_fortran_parameter^ [np].argument_kind;

              ii_fortran_parameter^ [np].array_size.attributes := ci_fortran_parameter^ [np].array_size.
                    attributes;

              ii_fortran_parameter^ [np].array_size.rank := ci_fortran_parameter^ [np].array_size.rank;

              ii_fortran_parameter^ [np].array_size.number_of_elements := ci_fortran_parameter^ [np].
                    array_size.number_of_elements;

              ii_fortran_parameter^ [np].dummy_argument_ordinal := ci_fortran_parameter^ [np].
                    dummy_argument_ordinal;

              ii_fortran_parameter^ [np].mode := ci_fortran_parameter^ [np].mode;
            FOREND;


          PROCEND convert_fortran_parameters;
?? TITLE := '                               CONVERT FORMAL PARAMETERS' ??
?? EJECT ??

          PROCEDURE convert_formal_parameters (sequence_length: ost$segment_length;
                type_of_calling_routine {control} : llt$module_generator;
            VAR status: ost$status);



            VAR
              ci_parameter_item: ^llt$ci_formal_parameters,
              ii_parameter_item: ^llt$formal_parameters;



            NEXT ci_parameter_item IN ci_input_seg;

            IF ci_parameter_item <> NIL THEN
              CASE type_of_calling_routine OF
              = llc$fortran =
                ii_text_descriptor^.sequence_length := sequence_length DIV #SIZE
                      (llt$ci_fortran_argument_desc) * #SIZE (llt$fortran_argument_desc);

                NEXT ii_parameter_item: [[REP ii_text_descriptor^.sequence_length OF cell]] IN output_seq;

                convert_fortran_parameters (sequence_length, ii_parameter_item^.specification, status);
              ELSE
                error (oce$invalid_parameter_kind, 'Formal Parameters', status);
              CASEND;

              convert_string (ci_parameter_item^.procedure_name, 1, ii_parameter_item^.procedure_name);

            ELSE
              error (oce$missing_rec_or_descriptor, 'Formal Parameters', status);
            IFEND;


          PROCEND convert_formal_parameters;
?? TITLE := '                               CONVERT ACTUAL PARAMETERS' ??
?? EJECT ??

          PROCEDURE convert_actual_parameters (sequence_length: ost$segment_length;
            VAR status: ost$status);



            VAR
              ci_parameter_item: ^llt$ci_actual_parameters,
              ii_parameter_item: ^llt$actual_parameters;



            NEXT ci_parameter_item IN ci_input_seg;

            IF ci_parameter_item <> NIL THEN
              CASE ci_parameter_item^.language OF
              = llc$fortran =
                ii_text_descriptor^.sequence_length := sequence_length DIV #SIZE
                      (llt$ci_fortran_argument_desc) * #SIZE (llt$fortran_argument_desc);

                NEXT ii_parameter_item: [[REP ii_text_descriptor^.sequence_length OF cell]] IN output_seq;

                convert_fortran_parameters (sequence_length, ii_parameter_item^.specification, status);
              ELSE
                error (oce$invalid_parameter_kind, 'Actual Parameters', status);
              CASEND;

              convert_string (ci_parameter_item^.callee_name, 1, ii_parameter_item^.callee_name);

              ii_parameter_item^.language := ci_parameter_item^.language;

              ii_parameter_item^.line_number_of_call := ci_parameter_item^.line_number_of_call;

            ELSE
              error (oce$missing_rec_or_descriptor, 'Actual Parameters', status);
            IFEND;


          PROCEND convert_actual_parameters;
?? TITLE := '                               170 Debug Symbol Table Declarations' ??
?? EJECT ??

          TYPE
            cyt$ci_cybil_symbol_table = record
              original_name: pmt$ci_program_name,

              f01: array [1 .. 7] of byte,
              language: llt$module_generator,

              f02: array [1 .. 7] of byte,
              optimization_level: 0 .. 255,

              version: packed array [1 .. 16] of half_byte,

              f03: array [1 .. 6] of byte,
              module_symbol_list: symbol_no,

              f04: array [1 .. 6] of byte,
              number_of_symbols: symbol_no,
            recend,

            cyt$ci_cybil_symbol_table_item = record
              symbol_name: pmt$ci_program_name,

              end_of_chain: boolean,
              f01: array [1 .. 7] of byte,

              f02: array [1 .. 6] of byte,
              symtab_no: symbol_no,

              f03: array [1 .. 7] of byte,
              case symbol_type: entry_kinds of

              = int_kind, bool_kind, char_kind, real_kind, longreal_kind, cell_kind =
                ,

              = var_kind =
                f04: array [1 .. 6] of byte,
                var_type: symbol_no,

                f05: half_word,
                var_length: ost$segment_length,

                f06: array [1 .. 7] of byte,
                base: base_type,

                f07: array [1 .. 6] of byte,
                var_section_ordinal: llt$section_ordinal,

                f08: half_word,
                var_offset: ost$segment_length,

                indirectly_referenced: boolean,
                f09: array [1 .. 7] of byte,

                var_is_parameter: boolean,
                f10: array [1 .. 7] of byte,

              = cons_kind =
                f11: array [1 .. 6] of byte,
                cons_type: symbol_no,

                f12: array [1 .. 7] of byte,
                cons_length_type: (short_constant_type, long_constant_type),

                cons_value: integer_range,

              = label_kind =
                f13: array [1 .. 6] of byte,
                line_no: line_number_range,

              = ordinal_kind =
                f14: array [1 .. 6] of byte,
                last_const: symbol_no,

                f15: array [1 .. 6] of byte,
                upper_bound: 0 .. 4095,

              = subrange_kind =
                f16: array [1 .. 6] of byte,
                subtype: symbol_no,

                f17: array [1 .. 7] of byte,
                low_value_type: len_kinds,

                f18: array [1 .. 7] of byte,
                high_value_type: len_kinds,

                low_value: integer_range,

                high_value: integer_range,


              = proc_kind =
                f19: array [1 .. 7] of byte,
                lexical_level: 0 .. 255,

                f20: array [1 .. 6] of byte,
                symbol_list: symbol_no,

                f21: array [1 .. 6] of byte,
                proc_section_ordinal: llt$section_ordinal,

                f22: half_word,
                proc_offset: ost$segment_length,

                f23: half_word,
                proc_length: ost$segment_length,

                f24: array [1 .. 6] of byte,
                parent_proc: symbol_no,

                f25: array [1 .. 6] of byte,
                return_type: symbol_no,

              = pointer_kind =
                f26: array [1 .. 6] of byte,
                ptr_type: symbol_no,

                f100: half_word,
                ptr_object_length: ost$segment_length,

              = set_kind =
                f27: array [1 .. 6] of byte,
                set_element_type: symbol_no,

                f28: array [1 .. 6] of byte,
                set_len: 0 .. 7fff(16),

              = string_kind =
                f29: array [1 .. 7] of byte,
                len_type: len_kinds,

                f30: array [1 .. 6] of byte,
                string_len: symbol_no,

              = array_kind =
                array_binding: bindkinds,
                f31: array [1 .. 7] of byte,

                f32: array [1 .. 7] of byte,
                array_packing: packattrs,

                length_is_bits: boolean,
                f33: array [1 .. 7] of byte,

                f34: array [1 .. 6] of byte,
                index_type: symbol_no,

                f35: array [1 .. 6] of byte,
                array_element_type: symbol_no,

                f36: half_word,
                element_length: ost$segment_length,

              = record_kind =
                record_binding: bindkinds,
                f37: array [1 .. 7] of byte,

                f38: array [1 .. 7] of byte,
                record_packing: packattrs,

                variation_flag: boolean,
                f39: array [1 .. 7] of byte,

                f40: array [1 .. 6] of byte,
                first_field: symbol_no,

                f41: half_word,
                record_length: ost$segment_length,

                f42: array [1 .. 6] of byte,
                selector: symbol_no,

              = field_kind =
                f43: array [1 .. 3] of byte,
                field_offset: machine_addr_in_bits_type,

                f44: array [1 .. 3] of byte,
                field_length: machine_addr_in_bits_type,

                unit_addressed: boolean,
                f45: array [1 .. 7] of byte,

                f46: array [1 .. 6] of byte,
                field_type: symbol_no,

                f47: array [1 .. 6] of byte,
                next_field: symbol_no,


              = selector_kind =
                f48: array [1 .. 6] of byte,
                variation: symbol_no,

                f50: array [1 .. 6] of byte,
                next_selector: symbol_no,

                low_selector: integer_range,

                high_selector: integer_range,


              = heap_kind =
                ,


              = seq_kind =
                ,


              = bound_vrec_kind =
                f52: array [1 .. 6] of byte,
                bound_type: symbol_no,


              = rel_ptr_kind =
                f53: array [1 .. 6] of byte,
                parent_type: symbol_no,

                f54: array [1 .. 6] of byte,
                object_type: symbol_no,

                f55: half_word,
                rel_ptr_object_length: ost$segment_length,

              casend,
            recend;

          TYPE

            llt$ci_debug_table_fragment = record
              f01: half_word,
              offset: llt$section_offset,
            recend;

          TYPE
            cyt$ii_cybil_symbol_table = record
              original_name: pmt$program_name,
              language: llt$module_generator,
              optimization_level: 0 .. 255,
              version: string (4),
              module_symbol_list: symbol_no,
              number_of_symbols: symbol_no,
            recend;

?? TITLE := '                               CONVERT CYBIL SYMBOL TABLE' ??
?? EJECT ??

          PROCEDURE convert_cybil_symbol_table (sequence_length: ost$segment_length;
            VAR status: ost$status);


            VAR
              symbol_table_text: ^SEQ ( * ),

              number_of_items: integer,
              item: integer,

              header_present: boolean,
              number_of_bytes: integer,

              ci_debug_table_fragment: ^llt$ci_debug_table_fragment,
              ii_debug_table_fragment: ^llt$debug_table_fragment,

              ci_cybil_symbol_table: ^cyt$ci_cybil_symbol_table,
              ii_cybil_symbol_table: ^cyt$ii_cybil_symbol_table,

              ci_item: ^array [1 .. * ] of cyt$ci_cybil_symbol_table_item,
              ii_item: ^array [1 .. * ] of cyt$debug_symbol_table_item,

              ci_dummy_name: packed array [1 .. 100] of half_byte,
              ii_dummy_name: pmt$program_name;


            number_of_bytes := sequence_length * 8;

            header_present := number_of_bytes MOD #SIZE (cyt$ci_cybil_symbol_table_item) <> 0;

            IF header_present THEN
              number_of_items := (number_of_bytes - #SIZE (cyt$ci_cybil_symbol_table)) DIV #SIZE
                    (cyt$ci_cybil_symbol_table_item);
              ii_text_descriptor^.sequence_length := number_of_items * #SIZE (cyt$debug_symbol_table_item) +
                    #SIZE (cyt$ii_cybil_symbol_table);
            ELSE
              number_of_items := number_of_bytes DIV #SIZE (cyt$ci_cybil_symbol_table_item);
              ii_text_descriptor^.sequence_length := number_of_items * #SIZE (cyt$debug_symbol_table_item);
            IFEND;

            NEXT ci_debug_table_fragment IN ci_input_seg;
            IF ci_debug_table_fragment = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Debug Symbol Table', status);
              RETURN;
            IFEND;

            NEXT ii_debug_table_fragment: [[REP ii_text_descriptor^.sequence_length OF cell]] IN output_seq;

            ii_debug_table_fragment^.offset := ci_debug_table_fragment^.offset;

            symbol_table_text := ^ii_debug_table_fragment^.text;
            RESET symbol_table_text;
            IF header_present THEN
              NEXT ci_cybil_symbol_table IN ci_input_seg;
              IF ci_cybil_symbol_table = NIL THEN
                error (oce$missing_rec_or_descriptor, 'Debug Symbol Table', status);
                RETURN;
              IFEND;

              NEXT ii_cybil_symbol_table IN symbol_table_text;

              convert_string (ci_cybil_symbol_table^.original_name, 1, ii_cybil_symbol_table^.original_name);
              ii_cybil_symbol_table^.language := ci_cybil_symbol_table^.language;
              ii_cybil_symbol_table^.optimization_level := ci_cybil_symbol_table^.optimization_level;
              convert_string (ci_cybil_symbol_table^.version, 1, ii_cybil_symbol_table^.version);
              ii_cybil_symbol_table^.module_symbol_list := ci_cybil_symbol_table^.module_symbol_list;
              ii_cybil_symbol_table^.number_of_symbols := ci_cybil_symbol_table^.number_of_symbols;
            IFEND;

            NEXT ci_item: [1 .. number_of_items] IN ci_input_seg;

            IF ci_item = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Debug Symbol Table', status);
              RETURN;
            IFEND;

            NEXT ii_item: [1 .. number_of_items] IN symbol_table_text;

            FOR item := 1 TO number_of_items DO
              convert_string (ci_item^ [item].symbol_name, 1, ii_item^ [item].symbol_name);
              convert_boolean (#LOC (ci_item^ [item].end_of_chain), ii_item^ [item].end_of_chain);
              ii_item^ [item].symtab_no := ci_item^ [item].symtab_no;
              ii_item^ [item].symbol_type := ci_item^ [item].symbol_type;

              CASE ii_item^ [item].symbol_type OF
              = int_kind, bool_kind, char_kind, real_kind, longreal_kind, cell_kind =

              = var_kind =
                ii_item^ [item].var_type := ci_item^ [item].var_type;
                ii_item^ [item].var_length := ci_item^ [item].var_length;
                ii_item^ [item].base := ci_item^ [item].base;
                ii_item^ [item].var_section_ordinal := ci_item^ [item].var_section_ordinal;
                ii_item^ [item].var_offset := ci_item^ [item].var_offset;
                convert_boolean (#LOC (ci_item^ [item].indirectly_referenced), ii_item^ [item].
                      indirectly_referenced);
                convert_boolean (#LOC (ci_item^ [item].var_is_parameter), ii_item^ [item].var_is_parameter);

              = cons_kind =
                ii_item^ [item].cons_type := ci_item^ [item].cons_type;
                ii_item^ [item].cons_length_type := ci_item^ [item].cons_length_type;
                convert_integer (#LOC (ci_item^ [item].cons_value), #LOC (ii_item^ [item].cons_value));

              = label_kind =
                ii_item^ [item].line_no := ci_item^ [item].line_no;

              = ordinal_kind =
                ii_item^ [item].last_const := ci_item^ [item].last_const;
                ii_item^ [item].upper_bound := ci_item^ [item].upper_bound;

              = subrange_kind =
                ii_item^ [item].subtype := ci_item^ [item].subtype;
                ii_item^ [item].low_value_type := ci_item^ [item].low_value_type;
                ii_item^ [item].high_value_type := ci_item^ [item].high_value_type;
                convert_integer (#LOC (ci_item^ [item].low_value), #LOC (ii_item^ [item].low_value));
                convert_integer (#LOC (ci_item^ [item].high_value), #LOC (ii_item^ [item].high_value));

              = proc_kind =
                ii_item^ [item].lexical_level := ci_item^ [item].lexical_level;
                ii_item^ [item].symbol_list := ci_item^ [item].symbol_list;
                ii_item^ [item].proc_section_ordinal := ci_item^ [item].proc_section_ordinal;
                ii_item^ [item].proc_offset := ci_item^ [item].proc_offset;
                ii_item^ [item].proc_length := ci_item^ [item].proc_length;
                ii_item^ [item].parent_proc := ci_item^ [item].parent_proc;
                ii_item^ [item].return_type := ci_item^ [item].return_type;

              = pointer_kind =
                ii_item^ [item].ptr_type := ci_item^ [item].ptr_type;
                ii_item^ [item].ptr_object_length := ci_item^ [item].ptr_object_length;

              = set_kind =
                ii_item^ [item].set_element_type := ci_item^ [item].set_element_type;
                ii_item^ [item].set_len := ci_item^ [item].set_len;

              = string_kind =
                ii_item^ [item].len_type := ci_item^ [item].len_type;
                ii_item^ [item].string_len := ci_item^ [item].string_len;

              = array_kind =
                convert_set (#LOC (ci_item^ [item].array_binding), 4, #LOC (ii_item^ [item].array_binding));
                ii_item^ [item].array_packing := ci_item^ [item].array_packing;
                convert_boolean (#LOC (ci_item^ [item].length_is_bits), ii_item^ [item].length_is_bits);
                ii_item^ [item].index_type := ci_item^ [item].index_type;
                ii_item^ [item].array_element_type := ci_item^ [item].array_element_type;
                ii_item^ [item].element_length := ci_item^ [item].element_length;

              = record_kind =
                convert_set (#LOC (ci_item^ [item].record_binding), 4, #LOC (ii_item^ [item].record_binding));
                ii_item^ [item].record_packing := ci_item^ [item].record_packing;
                convert_boolean (#LOC (ci_item^ [item].variation_flag), ii_item^ [item].variation_flag);
                ii_item^ [item].first_field := ci_item^ [item].first_field;
                ii_item^ [item].record_length := ci_item^ [item].record_length;
                ii_item^ [item].selector := ci_item^ [item].selector;

              = field_kind =
                ii_item^ [item].field_offset := ci_item^ [item].field_offset;
                ii_item^ [item].field_length := ci_item^ [item].field_length;
                convert_boolean (#LOC (ci_item^ [item].unit_addressed), ii_item^ [item].unit_addressed);
                ii_item^ [item].field_type := ci_item^ [item].field_type;
                ii_item^ [item].next_field := ci_item^ [item].next_field;

              = selector_kind =
                ii_item^ [item].variation := ci_item^ [item].variation;
                ii_item^ [item].next_selector := ci_item^ [item].next_selector;
                convert_integer (#LOC (ci_item^ [item].low_selector), #LOC (ii_item^ [item].low_selector));
                convert_integer (#LOC (ci_item^ [item].high_selector), #LOC (ii_item^ [item].high_selector));

              = heap_kind =

              = seq_kind =

              = bound_vrec_kind =
                ii_item^ [item].bound_type := ci_item^ [item].bound_type;

              = rel_ptr_kind =
                ii_item^ [item].parent_type := ci_item^ [item].parent_type;
                ii_item^ [item].object_type := ci_item^ [item].object_type;
                ii_item^ [item].rel_ptr_object_length := ci_item^ [item].rel_ptr_object_length;

              ELSE
              CASEND;
            FOREND;


          PROCEND convert_cybil_symbol_table;
?? TITLE := '                               CONVERT SYMBOL TABLE FRAGMENT', EJECT ??

          PROCEDURE convert_symbol_table_fragment (sequence_length: ost$segment_length;
            VAR status: ost$status);


            VAR
              number_of_bytes: ost$segment_length,
              ci_symbol_table_fragment: ^llt$ci_debug_table_fragment,
              text: ^SEQ ( * );


            number_of_bytes := sequence_length * 8;

            NEXT ci_symbol_table_fragment IN ci_input_seg;
            IF ci_symbol_table_fragment = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Symbol table fragment', status);
              RETURN;
            IFEND;

            NEXT text: [[REP number_of_bytes OF cell]] IN ci_input_seg;
            IF text = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Symbol table fragment text', status);
              RETURN;
            IFEND;


          PROCEND convert_symbol_table_fragment;
?? TITLE := '                               CONVERT LINE TABLE FRAGMENT', EJECT ??

          PROCEDURE convert_line_table_fragment (sequence_length: ost$segment_length;
            VAR status: ost$status);


            VAR
              number_of_bytes: ost$segment_length,
              ci_line_table_fragment: ^llt$ci_debug_table_fragment,
              text: ^SEQ ( * );


            number_of_bytes := sequence_length * 8;

            NEXT ci_line_table_fragment IN ci_input_seg;
            IF ci_line_table_fragment = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Line table fragment', status);
              RETURN;
            IFEND;

            NEXT text: [[REP number_of_bytes OF cell]] IN ci_input_seg;
            IF text = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Line table fragment text', status);
              RETURN;
            IFEND;


          PROCEND convert_line_table_fragment;
?? TITLE := '                               CONVERT BINDING TEMPLATE ITEM' ??
?? EJECT ??

          PROCEDURE convert_binding_template (VAR status: ost$status);


            { 170 binding section }

            TYPE
              llt$ci_binding_template = record
                f00: half_word,
                binding_offset: llt$section_offset,

                f01: array [1 .. 7] of byte,
                case kind: llt$binding_template_kind of
                = llc$current_module =
                  f02: array [1 .. 6] of byte,
                  section_ordinal: llt$section_ordinal,

                  offset: ost$segment_offset,

                  f04: array [1 .. 7] of byte,
                  internal_address: llt$address_kind,

                  f05: array [1 .. 5] of word,

                = llc$external_reference =
                  name: pmt$ci_program_name,

                  f06: array [1 .. 7] of byte,
                  address: llt$address_kind,
                casend,
              recend;

?? EJECT ??

            VAR
              ci_binding: ^llt$ci_binding_template,
              ii_binding: ^llt$binding_template;


            NEXT ci_binding IN ci_input_seg;

            IF ci_binding <> NIL THEN
              NEXT ii_binding IN output_seq;

              ii_binding^.binding_offset := ci_binding^.binding_offset;

              ii_binding^.kind := ci_binding^.kind;

              CASE ci_binding^.kind OF
              = llc$current_module =
                ii_binding^.section_ordinal := ci_binding^.section_ordinal;
                convert_integer (#LOC (ci_binding^.offset), #LOC (ii_binding^.offset));
                ii_binding^.internal_address := ci_binding^.internal_address;

              = llc$external_reference =
                convert_string (ci_binding^.name, 1, ii_binding^.name);
                ii_binding^.address := ci_binding^.address;

              CASEND;
            ELSE
              error (oce$missing_rec_or_descriptor, 'Binding Template Record', status);
            IFEND;


          PROCEND convert_binding_template;
?? TITLE := '                               CONVERT 68000 ABSOLUTE' ??
?? EJECT ??

          PROCEDURE convert_68000_absolute (number_of_bytes: 1 .. llc$maximum_68000_address;
            VAR status: ost$status);



            { 170 68000 absolute }


            TYPE
              llt$ci_68000_absolute = record
                f01: half_word,
                load_address: llt$68000_address,

                f02: half_word,
                transfer_address: llt$68000_address,
              recend;


            VAR
              ci_68000_absolute: ^llt$ci_68000_absolute,
              ii_68000_absolute: ^llt$68000_absolute,
              seq_pointer: ^SEQ ( * ),
              array_170: ^packed array [0 .. 15] of half_byte,
              array_180: ^packed array [1 .. * ] of half_byte,
              i: integer,
              c: 0 .. 15;


            NEXT ci_68000_absolute IN ci_input_seg;
            IF ci_68000_absolute = NIL THEN
              error (oce$missing_rec_or_descriptor, '68000 Absolute', status);
              RETURN;
            IFEND;

            NEXT ii_68000_absolute: [[REP number_of_bytes OF cell]] IN output_seq;

            ii_68000_absolute^.load_address := ci_68000_absolute^.load_address;
            ii_68000_absolute^.transfer_address := ci_68000_absolute^.transfer_address;


            seq_pointer := ^ii_68000_absolute^.text;
            RESET seq_pointer;
            NEXT array_180: [1 .. (2 * number_of_bytes)] IN seq_pointer;

            i := 0;
            WHILE (i + 15) <= (2 * number_of_bytes) DO
              NEXT array_170 IN ci_input_seg;
              IF array_170 = NIL THEN
                error (oce$missing_rec_or_descriptor, '68000 Absolute text', status);
                RETURN;
              IFEND;

              FOR c := 1 TO 15 DO
                i := i + 1;
                array_180^ [i] := array_170^ [c];
              FOREND;
            WHILEND;

            IF i < (2 * number_of_bytes) THEN
              NEXT array_170 IN ci_input_seg;
              IF array_170 = NIL THEN
                error (oce$missing_rec_or_descriptor, '68000 Absolute text - last bytes', status);
                RETURN;
              IFEND;

              c := 0;
              FOR i := (i + 1) TO (2 * number_of_bytes) DO
                c := c + 1;
                array_180^ [i] := array_170^ [c];
              FOREND;
            IFEND;


          PROCEND convert_68000_absolute;
?? TITLE := '                               CONVERT TRANSFER SYMBOL ITEM' ??
?? EJECT ??

          PROCEDURE convert_transfer_symbol_item (VAR status: ost$status);



            { 170 transfer symbol }


            TYPE
              llt$ci_transfer_symbol = record
                name: pmt$ci_program_name,

              recend;


            VAR
              ci_transfer_symbol: ^llt$ci_transfer_symbol,
              ii_transfer_symbol: ^llt$transfer_symbol;

            NEXT ci_transfer_symbol IN ci_input_seg;

            IF ci_transfer_symbol <> NIL THEN
              NEXT ii_transfer_symbol IN output_seq;
              convert_string (ci_transfer_symbol^.name, 1, ii_transfer_symbol^.name);

            ELSE
              error (oce$missing_rec_or_descriptor, 'Transfer Symbol Record', status);
            IFEND;


          PROCEND convert_transfer_symbol_item;
?? OLDTITLE ??
?? EJECT ??

          VAR
            type_of_obj_record {control} : llt$object_record_kind,
            size: integer;


          REPEAT
            convert_object_text_desc_14 (type_of_obj_record, size, status);

            IF status.normal THEN

              CASE type_of_obj_record OF
              = llc$identification =
                error (oce$multiple_ident_records, 'CPU Object Module', status);

              = llc$libraries =
                convert_library_directives (size, status);

              = llc$section_definition =
                convert_section_definition_item (status);

              = llc$text =
                convert_text_item (size, status);

              = llc$replication =
                convert_replication_item (size, status);

              = llc$bit_string_insertion =
                convert_bit_insertion_item (status);

              = llc$address_formulation =
                convert_addr_formulation_item (size, status);

              = llc$external_linkage =
                convert_external_linkage_item (size, status);

              = llc$entry_definition =
                convert_entry_point_definition (status);

              = llc$relocation =
                convert_relocation_item (size, status);

              = llc$actual_parameters =
                convert_actual_parameters (size, status);

              = llc$formal_parameters =
                convert_formal_parameters (size, generator_id, status);

              = llc$cybil_symbol_table_fragment =
                convert_cybil_symbol_table (size, status);

              = llc$symbol_table_fragment =
                convert_symbol_table_fragment (size, status);

              = llc$line_table_fragment =
                convert_line_table_fragment (size, status);

              = llc$binding_template =
                convert_binding_template (status);

              = llc$68000_absolute =
                convert_68000_absolute (size, status);

              = llc$transfer_symbol =
                convert_transfer_symbol_item (status);

              ELSE
                error (oce$invalid_cpu_record_kind, 'CPU Object Module', status);

              CASEND;

            ELSE
              error (status.condition, 'Object Text Descriptor 1.4', status);
            IFEND;

          UNTIL (type_of_obj_record = llc$transfer_symbol) OR (NOT status.normal);


        PROCEND convert_cpu_object_module;
?? TITLE := '                             CONVERT IDENTIFICATION BODY' ??
?? EJECT ??

        PROCEDURE convert_identification_body (ii_identification: ^llt$identification;
          VAR type_of_object_program: llt$module_kind;
          VAR generator_id: llt$module_generator;
          VAR status: ost$status);


          { 170 identification record }


          TYPE
            llt$ci_identification_body = record
              f00: array [1 .. 7] of byte,
              kind: llt$module_kind,

              time_created: ost$ci_time,

              date_created: ost$ci_date,

              attributes: llt$module_attributes,
              f01: array [1 .. 7] of byte,

              f02: array [1 .. 6] of byte,
              greatest_section_ordinal: llt$section_ordinal,

              f03: array [1 .. 7] of byte,
              generator_id: llt$module_generator,

              generator_name_vers: packed array [1 .. 128] of half_byte,

              commentary: packed array [1 .. 128] of half_byte,

            recend;


          CONST
            num_module_attr = 2;




          { 170 return date }


          TYPE
            ost$ci_date = record
              f01: array [1 .. 7] of byte,
              case date_format: ost$date_formats of
              = osc$month_date =
                month: packed array [1 .. 64] of half_byte,

              = osc$mdy_date =
                mdy: packed array [1 .. 64] of half_byte,

              = osc$iso_date =
                iso: packed array [1 .. 64] of half_byte,

              = osc$ordinal_date =
                ordinal: packed array [1 .. 64] of half_byte,

              casend,

            recend;




          { 170 return time }


          TYPE
            ost$ci_time = record
              f01: array [1 .. 7] of byte,
              case time_format: ost$time_formats of
              = osc$ampm_time =
                ampm: packed array [1 .. 48] of half_byte,

              = osc$hms_time =
                hms: packed array [1 .. 48] of half_byte,

              = osc$millisecond_time =
                millisecond: packed array [1 .. 48] of half_byte,

              casend,

            recend;

?? EJECT ??

          VAR
            ci_identification: ^llt$ci_identification_body;



          NEXT ci_identification IN ci_input_seg;

          IF ci_identification <> NIL THEN

            type_of_object_program := ci_identification^.kind;
            ii_identification^.kind := ci_identification^.kind;

            { convert time request return value }

            ii_identification^.time_created.time_format := ci_identification^.time_created.time_format;

            CASE ci_identification^.time_created.time_format OF
            = osc$ampm_time =
              convert_string (ci_identification^.time_created.ampm, 1, ii_identification^.time_created.ampm);

            = osc$hms_time =
              convert_string (ci_identification^.time_created.hms, 1, ii_identification^.time_created.hms);

            = osc$millisecond_time =
              convert_string (ci_identification^.time_created.millisecond, 1, ii_identification^.time_created.
                    millisecond);
            ELSE
              error (pme$invalid_time_format, 'Identification Record', status);

            CASEND;

            IF status.normal THEN

              { convert date request return value }

              ii_identification^.date_created.date_format := ci_identification^.date_created.date_format;

              CASE ci_identification^.date_created.date_format OF
              = osc$month_date =
                convert_string (ci_identification^.date_created.month, 1, ii_identification^.date_created.
                      month);

              = osc$mdy_date =
                convert_string (ci_identification^.date_created.mdy, 1, ii_identification^.date_created.mdy);

              = osc$iso_date =
                convert_string (ci_identification^.date_created.iso, 1, ii_identification^.date_created.iso);

              = osc$ordinal_date =
                convert_string (ci_identification^.date_created.ordinal, 1, ii_identification^.date_created.
                      ordinal);
              ELSE
                error (pme$invalid_date_format, 'Identification Record', status);

              CASEND;

              IF status.normal THEN

                { finish converting identification record }

                IF ii_identification^.kind <> llc$motorola_68000_absolute THEN
                  convert_set (#LOC (ci_identification^.attributes), num_module_attr, #LOC
                        (ii_identification^.attributes));
                ELSE
                  ii_identification^.attributes := $llt$module_attributes [llc$nonbindable];
                IFEND;

                ii_identification^.greatest_section_ordinal := ci_identification^.greatest_section_ordinal;

                ii_identification^.generator_id := ci_identification^.generator_id;
                generator_id := ci_identification^.generator_id;

                convert_string (ci_identification^.generator_name_vers, 1, ii_identification^.
                      generator_name_vers);

                convert_string (ci_identification^.commentary, 1, ii_identification^.commentary);

              IFEND;
            IFEND;
          ELSE
            error (oce$missing_rec_or_descriptor, 'Identification Record', status);
          IFEND;


        PROCEND convert_identification_body;
?? OLDTITLE ??
?? EJECT ??


        VAR
          kind_of_object_module {control} : llt$module_kind,
          module_generator: llt$module_generator;




        convert_identification_body (ii_identification, kind_of_object_module, module_generator, status);

        IF status.normal THEN
          CASE kind_of_object_module OF
          = llc$iou =
            convert_iou_object_module (status);

          = llc$mi_virtual_state, llc$vector_virtual_state, llc$motorola_68000, llc$motorola_68000_absolute,
              llc$vector_extended_state =
            convert_cpu_object_module (module_generator, status);

          ELSE
            error (oce$invalid_object_module_kind, 'Version 1.4 Text', status);
          CASEND;

        IFEND;

      PROCEND convert_version_14_text;
?? OLDTITLE ??
?? NEWTITLE := '                           CONVERT OBJECT TEXT DESCRIPTOR' ??
?? EJECT ??

      PROCEDURE convert_object_text_descriptor (VAR object_type: llt$extended_object_record_kind;
        VAR size: integer;
        VAR status: ost$status);





        TYPE
          llt$ci_object_text_descriptor = record
            f00: array [1 .. 7] of byte,
            case kind: llt$extended_object_record_kind of
            = llc$identification, llc$section_definition, llc$entry_definition, llc$binding_template,
              llc$transfer_symbol, llc$bit_string_insertion, llc$obsolte_line_table,
                llc$cybil_symbol_table_fragment, llc$reserved_4, occ$library_header, occ$module_directory,
                occ$entry_point_directory =
              unused: ost$segment_offset, {always 0}

            = llc$libraries =
              f02: array [1 .. 6] of byte,
              number_of_libraries: 1 .. llc$max_libraries,

            = llc$text, llc$replication =
              f03: array [1 .. 4] of byte,
              number_of_bytes: 1 .. osc$max_segment_length,

            = llc$relocation =
              f05: array [1 .. 6] of byte,
              number_of_rel_items: 1 .. llc$max_rel_items,

            = llc$address_formulation =
              f06: array [1 .. 6] of byte,
              number_of_adr_items: 1 .. llc$max_adr_items,

            = llc$external_linkage =
              f07: array [1 .. 6] of byte,
              number_of_ext_items: 1 .. llc$max_ext_items,

            = llc$formal_parameters, llc$actual_parameters =
              f08: array [1 .. 4] of byte,
              sequence_length: ost$segment_length,

            = llc$ppu_absolute =
              f09: array [1 .. 6] of byte,
              number_of_words: llt$ppu_address,
            casend,
          recend;




        VAR
          ci_text_descriptor: ^llt$ci_object_text_descriptor,
          ii_text_descriptor: ^llt$extended_object_text_desc;



        NEXT ci_text_descriptor IN ci_input_seg;

        IF ci_text_descriptor <> NIL THEN
          object_type := ci_text_descriptor^.kind;

          CASE ci_text_descriptor^.kind OF
          = llc$identification =
            NEXT ii_text_descriptor IN output_seq;
            ii_text_descriptor^.kind := ci_text_descriptor^.kind;

            ii_text_descriptor^.unused := ci_text_descriptor^.unused;

          ELSE
            RETURN;

          CASEND;

        ELSE
          eoi_warning (oce$missing_rec_or_descriptor, status);

        IFEND;


      PROCEND convert_object_text_descriptor;
?? OLDTITLE ??
?? EJECT ??

      TYPE
        llt$extended_object_text_desc = record
          case kind: llt$extended_object_record_kind of

          = llc$identification, llc$section_definition, llc$bit_string_insertion, llc$entry_definition,
            llc$binding_template, llc$transfer_symbol, llc$obsolte_line_table,
              llc$cybil_symbol_table_fragment, llc$reserved_4, occ$library_header, occ$module_directory,
              occ$entry_point_directory =
            unused: ost$segment_length, {must be zero}
          = llc$libraries =
            number_of_libraries: 1 .. llc$max_libraries,
          = llc$text, llc$replication =
            number_of_bytes: 1 .. osc$max_segment_length,
          = llc$relocation =
            number_of_rel_items: 1 .. llc$max_rel_items,
          = llc$address_formulation =
            number_of_adr_items: 1 .. llc$max_adr_items,
          = llc$external_linkage =
            number_of_ext_items: 1 .. llc$max_ext_items,
          = llc$formal_parameters, llc$actual_parameters =
            sequence_length: ost$segment_length, {REP sequence_length OF CELL}
          = llc$ppu_absolute =
            number_of_words: llt$ppu_address,
          = llc$allotted_section_definition =
            allotted_section: ost$relative_pointer,
          casend,
        recend;




      TYPE
        llt$extended_object_record_kind = (llc$identification, llc$libraries, llc$section_definition,
          llc$text, llc$replication, llc$bit_string_insertion, llc$entry_definition, llc$relocation,
          llc$address_formulation, llc$external_linkage, llc$formal_parameters, llc$actual_parameters,
          llc$binding_template, llc$ppu_absolute, llc$obsolte_line_table, llc$cybil_symbol_table_fragment,
          llc$allotted_section_definition, llc$reserved_4, llc$transfer_symbol, occ$library_header,
          occ$module_directory, occ$entry_point_directory);





      TYPE
        llt$ci_identification_header = record
          name: pmt$ci_program_name,

          object_text_version: packed array [1 .. 16] of half_byte,
        recend;




      TYPE
        llt$library_record = record
          name: pmt$ci_program_name,
          time_created: array [1 .. 4] of word,
          date_created: array [1 .. 5] of word,
          module_directory_index: integer,
          entry_point_directory_index: integer,
        recend;


      VAR
        ci_library_header: ^llt$library_record,
        ci_identification_header: ^llt$ci_identification_header,
        ii_identification: ^llt$identification,

        version: string (4),
        size: integer,
        type_of_object_record: llt$extended_object_record_kind;


      version := '%%%%';

      REPEAT
        convert_object_text_descriptor (type_of_object_record, size, status);

        IF status.normal THEN
          CASE type_of_object_record OF
          = llc$identification =
            NEXT ci_identification_header IN ci_input_seg;
            IF ci_identification_header <> NIL THEN
              NEXT ii_identification IN output_seq;

              convert_string (ci_identification_header^.name, 1, ii_identification^.name);
              convert_string (ci_identification_header^.object_text_version, 1, version);
              ii_identification^.object_text_version := 'V1.4';

              IF (version (1, 4) = '1.0 ') OR (version (1, 4) = 'V1.1') THEN
                convert_version_11_text (ii_identification, output_seq, status);

              ELSEIF version (1, 4) = 'V1.2' THEN
                convert_version_12_text (ii_identification, output_seq, status);
              ELSEIF version (1, 4) = 'V1.3' THEN
                convert_version_13_text (ii_identification, output_seq, status);

              ELSEIF version (1, 4) = 'V1.4' THEN
                convert_version_14_text (ii_identification, output_seq, status);
              ELSE
                error (oce$invalid_version, version, status);
              IFEND;
            ELSE
              error (oce$missing_rec_or_descriptor, 'Convert Object File', status);
            IFEND;

          = occ$library_header, llc$cybil_symbol_table_fragment =
            NEXT ci_library_header IN ci_input_seg;
            IF ci_library_header = NIL THEN
              error (oce$missing_rec_or_descriptor, 'Convert Object File', status);
            IFEND;

          = occ$module_directory, occ$entry_point_directory =
            RETURN;

          ELSE
            error (oce$ident_or_lib_desc_expected, 'Convert Object File', status);

          CASEND;
        IFEND;
      UNTIL NOT status.normal;

      IF (status_state = eoi_warning_status) THEN
        status.normal := TRUE;
      IFEND;


    PROCEND convert_object_file;
?? OLDTITLE ??
?? NEWTITLE := '                         Parameter Descriptors' ??
?? EJECT ??
{ pdt citoii_pdt (
{   ci : file = $required
{   ii : file = $required
{   status, st)

?? PUSH (LISTEXT := ON) ??

    VAR
      citoii_pdt: [STATIC, READ, cls$pdt] clt$parameter_descriptor_table := [^citoii_pdt_names,
        ^citoii_pdt_params];

    VAR
      citoii_pdt_names: [STATIC, READ, cls$pdt_names_and_defaults] array [1 .. 4] of
        clt$parameter_name_descriptor := [['CI', 1], ['II', 2], ['STATUS', 3], ['ST', 3]];

    VAR
      citoii_pdt_params: [STATIC, READ, cls$pdt_parameters] array [1 .. 3] of clt$parameter_descriptor := [

{ CI }
      [[clc$required], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$file_value]],

{ II }
      [[clc$required], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$file_value]],

{ STATUS ST }
      [[clc$optional], 1, 1, 1, 1, clc$value_range_not_allowed, [NIL, clc$variable_reference,
        clc$array_not_allowed, clc$status_value]]];

?? POP ??


    CONST
      ci = 1,
      ii = 2;

?? OLDTITLE ??
?? EJECT ??

    VAR
      status_state: (eoi_warning_status, error_status),
      file: clt$value,
      ci_file_identifier: amt$file_identifier,
      ii_file_identifier: amt$file_identifier,

      ci_input_seg: ^SEQ ( * ),
      ii_output_seg: amt$segment_pointer;


    status.normal := TRUE;
    status_state := error_status;

    clp$scan_parameter_list (parameter_list, citoii_pdt, status);
    IF status.normal THEN
      clp$get_value ('CI', 1, 1, clc$low, file, status);
      IF status.normal THEN
        obtain_ci_file (file.file.local_file_name, ci_file_identifier, ci_input_seg, status);
        IF status.normal THEN
          clp$get_value ('II', 1, 1, clc$low, file, status);
          IF status.normal THEN
            obtain_ii_seg (file.file.local_file_name, ii_file_identifier, ii_output_seg, status);
            IF status.normal THEN
              IF ii_output_seg.sequence_pointer <> NIL THEN  {$NULL}
                convert_object_file (ii_output_seg.sequence_pointer, status);
                IF status.normal THEN
                  amp$close (ci_file_identifier, status);
                  IF status.normal THEN
                    amp$set_segment_eoi (ii_file_identifier, ii_output_seg, status);
                    IF status.normal THEN
                      amp$close (ii_file_identifier, status);
                    IFEND;
                  IFEND;
                IFEND;
              IFEND;
            IFEND;
          IFEND;
        IFEND;
      IFEND;
    IFEND;

  PROCEND citoii;




MODEND ocm$object_module_converter;
