



		    convert_pdp10_bytes_.pl1        01/09/80  1041.9rew 01/09/80  0915.1      188343



/* ******************************************************
   *                                                    *
   *                                                    *
   * Copyright (c) 1972 by Massachusetts Institute of   *
   * Technology and Honeywell Information Systems, Inc. *
   *                                                    *
   *                                                    *
   ****************************************************** */

convert_pdp10_bytes_:
          procedure ();

/*             "convert_pdp10_bytes_" -- a collection of procedures used in      */
/*        converting from PDP-10 characters (7 bits) to Multics characters (9   */
/*        bits).  The most common subsets of conversions are here so that, if   */
/*        necessary, this module can be converted to assembly language for      */
/*        efficiency.                                                           */
/*             The interfaces to all entries in this module are identical:      */
/*        The info_ptr is ignored (but is here because it makes the calling     */
/*        sequence of these entries similar to others having to do with code    */
/*        conversion (and someday, it just might be useful).                    */
/*        The input_ptr and output_ptr parameters point to an I/O workspace     */
/*        (i.e., word aligned).  The next_XXX argument indicates the next       */
/*        available (from the beginning) byte to be read from/stored into.      */
/*        The last_XXX argument indicates the last available byte.  Notice      */
/*        that the next_XXX argument is thus both an input and an output arg.   */

/*        Originally written by D. M. Wells 30 April, 1974.                     */


          /* * * * * PARAMETER DECLARATIONS  * * * * * * * */

     declare
         (P_first_in fixed binary (24),                     /* first byte in workspace to process             */
          P_num_in fixed binary (24),                       /* num bytes in workspace to process              */
          P_num_in_proc fixed binary (24),                  /* num bytes in workspace processed               */
          P_first_out fixed binary (24),                    /* first available byte in output workspace       */
          P_num_out fixed binary (24),                      /* num bytes available in output workspace        */
          P_num_out_proc fixed binary (24),                 /* num bytes processed to output workspace         */

          P_error_code fixed binary (35),                   /* always returned as zero                         */
          P_info_ptr pointer,                               /* unused, makes arg list similar to other procs  */
          P_input_ptr pointer,                              /* points to input I/O workspace                  */
          P_output_ptr pointer)                             /* points to output I/O workspace                 */
               parameter;

          /* * * * * AUTOMATIC STORAGE DECLARATIONS  * * * */

     declare
         (byte_num_in fixed binary (3) initial (-1),        /* byte offset (within element) of next input     */
          byte_num_out fixed binary (3) initial (-1),       /* byte offset (within element) of next output    */
          next_in fixed binary (24) initial (P_first_in),   /* always indicates next input byte               */
          next_out fixed binary (24) initial (P_first_out), /* always indicates next output byte              */
          last_in fixed binary (24) initial (P_first_in + P_num_in - 1),        /* indicates last input byte  */
          last_out fixed binary (24) initial (P_first_out + P_num_out - 1),     /* indicates last output byte */
          string_offset fixed binary (18),
          current_byte bit (9),
          temp_byte bit (9),                                /* used to remember last byte during lookahead    */
          in_string_ptr pointer,                            /* points to current input element                */
          out_string_ptr pointer,                           /* points to current output element               */
          input_ptr pointer initial (P_input_ptr),         /* automatic copy of P_input_ptr                 */
          output_ptr pointer initial (P_output_ptr))       /* automatic copy of P_output_ptr                */
               automatic;

          /* * * * * BASED & TEMPLATE DECLARATIONS * * * * */

     declare
         (based_bit36_algn bit (36) aligned,
          based_bit36_array (0 : 1) bit (36) aligned)
               based;

          /* * * * * ENTRY & PROCEDURE DECLARATIONS  * * * */

     declare
          (addr, substr)
               builtin;

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

                                        /*      Because PL/1 doesn't have a feature which implements the      */
                                        /* converse of the initial attribute, we cause all returns to go here */
                                        /* so that we can update the arguments to this procedure from the     */
                                        /* automatic copies that we created with an initial attribute (or     */
                                        /* that are constants like the error code).                           */

return_to_caller:
          P_num_out_proc = next_out - P_first_out;
          P_num_in_proc = next_in - P_first_in;

          P_error_code = 0;

          return;

          /* * * * * * * * * * * * * * * * * * * * * * * * */

                                        /*      This entry point does a particular translation of Multics     */
                                        /* ASCII to PDP10 ASCII.  In particular, it only implements the       */
                                        /* CR-LF -> NL, CR-NUL -> CR, and NUL -> /0 conversions.  In general,  */
                                        /* programs will have to do separate translations for conversions     */
                                        /* not performed here.  These other translations can generally be     */
                                        /* performed by a PL/1 translate statement.                           */

ascii_7_to_9:
          entry (P_info_ptr, P_input_ptr, P_first_in, P_num_in, P_num_in_proc,
                    P_output_ptr, P_first_out, P_num_out, P_num_out_proc, P_error_code);

          do next_in = next_in by 1 to last_in;
               call fetch_7_bits ();

               if current_byte >= "000100000"b              /* (SPACE) -- All controls are less than space    */
               then call store_9_bits ();                   /* non-control, just store it                     */
               else if current_byte = "000001101"b
                    then do;                                /* this is a CR, look at next char for info       */
                         if next_in + 1 > last_in
                         then goto return_to_caller;        /* see if we can look at one more character       */

                         next_in = next_in + 1;             /* update to next character                       */
                         call fetch_7_bits ();              /* fetch the next input byte                      */
                         if current_byte = "000001010"b
                         then call store_9_bits ();         /* store this NL character                        */
                         else if current_byte = "000000000"b
                              then do;
                                   current_byte = "000001101"b;       /* this was CR-NUL, store a CR          */
                                   call store_9_bits ();
                                   end;
                              else do;                      /* PROTOCOL VIOLATION -- but attempt to recover   */
                                   current_byte = "000001101"b;       /* pick up a CR again                   */
                                   call store_9_bits ();              /* and store it                         */

                                   next_in = next_in - 1;             /* back down on the input byte num      */
                                   byte_num_in = -1;                  /* and cause recomputation of byte num  */
                                   end;
                         end;
                    else if current_byte ^= "000000000"b              /* pass through all but NULs            */
                         then call store_9_bits ();
               end;

          goto return_to_caller;

          /* * * * * * * * * * * * * * * * * * * * * * * * */

                                        /*      This entry converts from 7 bits to 9 bits (and nothing else). */

direct_7_to_9:
          entry (P_info_ptr, P_input_ptr, P_first_in, P_num_in, P_num_in_proc,
                    P_output_ptr, P_first_out, P_num_out, P_num_out_proc, P_error_code);

          do next_in = next_in by 1 to last_in;
               call fetch_7_bits ();

               call store_9_bits ();
               end;

          goto return_to_caller;

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

fetch_7_bits:
          procedure ();

          /* * * * * * * * * * * * * * * * * * * * * * * * */

          goto fetch_seven (byte_num_in);

                    /* * * * * * * * * * * * * * * * * * * */

fetch_seven (-1):
          string_offset = divide (next_in, 5, 24, 0);       /* which word are we referencing (5 = 36/7)       */
          byte_num_in = next_in - 5 * string_offset;        /* now which 7-bit byte in that element           */
          in_string_ptr = addr (input_ptr -> based_bit36_array (string_offset));          /* addr of element  */

          goto fetch_seven (byte_num_in);


                    /* * * * * * * * * * * * * * * * * * * */

fetch_seven (0):
          current_byte = "00"b || substr (in_string_ptr -> based_bit36_algn, 1, 7);
          byte_num_in = byte_num_in + 1;                    /* will be 1, but use an "aos" instruction        */

          return;

                    /* * * * * * * * * * * * * * * * * * * */

fetch_seven (1):
          current_byte = "00"b || substr (in_string_ptr -> based_bit36_algn, 8, 7);
          byte_num_in = byte_num_in + 1;                    /* will be 2, but use an "aos" instruction        */

          return;

                    /* * * * * * * * * * * * * * * * * * * */

fetch_seven (2):
          current_byte = "00"b || substr (in_string_ptr -> based_bit36_algn, 15, 7);
          byte_num_in = byte_num_in + 1;

          return;

                    /* * * * * * * * * * * * * * * * * * * */

fetch_seven (3):
          current_byte = "00"b || substr (in_string_ptr -> based_bit36_algn, 22, 7);
          byte_num_in = byte_num_in + 1;                    /* will be 4, but use an "aos" instruction        */

          return;

                    /* * * * * * * * * * * * * * * * * * * */

fetch_seven (4):
          current_byte = "00"b || substr (in_string_ptr -> based_bit36_algn, 29, 7);
          byte_num_in = 0;
          in_string_ptr = addr (in_string_ptr -> based_bit36_array (1));        /* move to next element       */

          return;

end;       /* end fetch_7_bits                             */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

store_9_bits:
          procedure ();

          /* * * * * * * * * * * * * * * * * * * * * * * * */

          if next_out > last_out
          then goto return_to_caller;

          next_out = next_out + 1;

          goto store_nine (byte_num_out);

                    /* * * * * * * * * * * * * * * * * * * */

store_nine (-1):
          string_offset = divide ((next_out - 1), 4, 18, 0);          /* which 36-bit element is referenced   */
          byte_num_out = (next_out - 1) - 4 * string_offset;          /* which byte in that 36-bit element    */
          out_string_ptr = addr (output_ptr -> based_bit36_array (string_offset));        /* addr of element  */

          goto store_nine (byte_num_out);

                    /* * * * * * * * * * * * * * * * * * * */

store_nine (0):
          substr (out_string_ptr -> based_bit36_algn, 1, 9) = current_byte;
          byte_num_out = byte_num_out + 1;                    /* will be 1, but use "aos" instruction           */

          return;

                    /* * * * * * * * * * * * * * * * * * * */

store_nine (1):
          substr (out_string_ptr -> based_bit36_algn, 10, 9) = current_byte;
          byte_num_out = byte_num_out + 1;                    /* will be 2, but use "aos" instruction           */

          return;

                    /* * * * * * * * * * * * * * * * * * * */

store_nine (2):
          substr (out_string_ptr -> based_bit36_algn, 19, 9) = current_byte;
          byte_num_out = byte_num_out + 1;                    /* will be 3                                      */

          return;

                    /* * * * * * * * * * * * * * * * * * * */

store_nine (3):
          substr (out_string_ptr -> based_bit36_algn, 28, 9) = current_byte;
          byte_num_out = 0;
          out_string_ptr = addr (out_string_ptr -> based_bit36_array (1));      /* move to next element       */

          return;

end;      /* end store_9_bits                              */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

                                        /*      This entry point translates from 9 bits to 8 bits and in the  */
                                        /* process converts Multics ASCII to Network ASCII.  This includes    */
                                        /* NL -> CR-LF, CR -> CR-NUL, PAD -> /0.                               */

ascii_9_to_7:
          entry (P_info_ptr, P_input_ptr, P_first_in, P_num_in, P_num_in_proc,
                    P_output_ptr, P_first_out, P_num_out, P_num_out_proc, P_error_code);

          do next_in = next_in by 1 to last_in;
               call fetch_9_bits ();

               if current_byte >= "000100000"b
               then do;                                     /* if above SP                                    */
                    if current_byte ^= "001111111"b         
                    then call store_7_bits ();              /* then store, if not a PAD                       */
                    end;
               else do;                                     /* else this is a control character               */
                    if current_byte = "000001010"b
                    then do;                                /* this is a NL character, handle specially       */
                         if next_out + 1 > last_out
                         then goto return_to_caller;        /* we dont have enough room left, give up         */

                         current_byte = "000001101"b;       /* NL gets replaced by CR-LF                      */
                         call store_7_bits ();
                         current_byte = "000001010"b;
                         call store_7_bits ();
                         end;
                    else if current_byte = "000001101"b
                         then do;                           /* this is a CR character, handler specially      */
                              if next_out + 1 > last_out
                              then goto return_to_caller;   /* we dont have enough room left, give up         */

                              call store_7_bits ();         /* store the CR and then follow it by a NUL       */
                              current_byte = "000000000"b;
                              call store_7_bits ();
                              end;
                         else call store_7_bits ();         /* otherwise, just store the random character     */
                    end;

               end;

          goto return_to_caller;

          /* * * * * * * * * ** * * * * * * * * * * * * * */

                                        /*      This entry converts from 9 bits to 7 bits (and nothing else). */

direct_9_to_7:
          entry (P_info_ptr, P_input_ptr, P_first_in, P_num_in, P_num_in_proc,
                    P_output_ptr, P_first_out, P_num_out, P_num_out_proc, P_error_code);

          do next_in = next_in by 1 to last_in;
               call fetch_9_bits ();

               call store_7_bits ();
               end;

          goto return_to_caller;

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

store_7_bits:
          procedure ();

          /* * * * * * * * * * * * * * * * * * * * * * * * */

          if next_out > last_out
          then goto return_to_caller;

          next_out = next_out + 1;

          goto store_seven (byte_num_out);

                    /* * * * * * * * * * * * * * * * * * * */

store_seven (-1):
          string_offset = divide ((next_out - 1), 5, 24, 0);          /* which word is referenced (5 = 36/7)  */
          byte_num_out = (next_out - 1) - 5 * string_offset;          /* which byte in that word              */
          out_string_ptr = addr (output_ptr -> based_bit36_array (string_offset));        /* addr of element  */

          goto store_seven (byte_num_out);

                    /* * * * * * * * * * * * * * * * * * * */

store_seven (0):
          substr (out_string_ptr -> based_bit36_algn, 1, 7) = substr (current_byte, 3, 7);
          byte_num_out = byte_num_out + 1;                  /* will be 1, but use an "aos" instruction        */

          return;

                    /* * * * * * * * * * * * * * * * * * * */

store_seven (1):
          substr (out_string_ptr -> based_bit36_algn, 8, 7) = substr (current_byte, 3, 7);
          byte_num_out = byte_num_out + 1;                  /* wil be 1, but use an "aos" instruction         */

          return;

                    /* * * * * * * * * * * * * * * * * * * */

store_seven (2):
          substr (out_string_ptr -> based_bit36_algn, 15, 7) = substr (current_byte, 3, 7);
          byte_num_out = byte_num_out + 1;

          return;

                    /* * * * * * * * * * * * * * * * * * * */

store_seven (3):
          substr (out_string_ptr -> based_bit36_algn, 22, 7) = substr (current_byte, 3, 7);
          byte_num_out = byte_num_out + 1;                  /* will be 4, but use an "aos" instruction        */

          return;

                    /* * * * * * * * * * * * * * * * * * * */

store_seven (4):
          substr (out_string_ptr -> based_bit36_algn, 29, 7) = substr (current_byte, 3, 7);
          substr (out_string_ptr -> based_bit36_algn, 36, 1) = "0"b;

          byte_num_out = 0;
          out_string_ptr = addr (out_string_ptr -> based_bit36_array (1));      /* move to next element       */

          return;

end;      /* end store_7_bits                              */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

fetch_9_bits:
          procedure ();

          /* * * * * * * * * * * * * * * * * * * * * * * * */

          goto fetch_nine (byte_num_in);

                    /* * * * * * * * * * * * * * * * * * * */

fetch_nine (-1):
          string_offset = divide (next_in, 4, 18, 0);       /* which 36-bit element are we referencing        */
          byte_num_in = next_in - 4 * string_offset;        /* which byte in that 36-bit element              */
          in_string_ptr = addr (input_ptr -> based_bit36_array (string_offset));          /* addr of element  */

          goto fetch_nine (byte_num_in);

                    /* * * * * * * * * * * * * * * * * * * */

fetch_nine (0):
          current_byte = substr (in_string_ptr -> based_bit36_algn, 1, 9);
          byte_num_in = byte_num_in + 1;                    /* will be 1, but use "aos" instruction           */

          return;

                    /* * * * * * * * * * * * * * * * * * * */

fetch_nine (1):
          current_byte = substr (in_string_ptr -> based_bit36_algn, 10, 9);
          byte_num_in = byte_num_in + 1;                    /* will be 2, but use "aos" instruction           */

          return;

                    /* * * * * * * * * * * * * * * * * * * */

fetch_nine (2):
          current_byte = substr (in_string_ptr -> based_bit36_algn, 19, 9);
          byte_num_in = byte_num_in + 1;                    /* will be 3                                      */

          return;

                    /* * * * * * * * * * * * * * * * * * * */

fetch_nine (3):
          current_byte = substr (in_string_ptr -> based_bit36_algn, 28, 9);
          byte_num_in = 0;
          in_string_ptr = addr (in_string_ptr -> based_bit36_array (1));        /* move to next element       */

          return;

end;      /* end fetch_9_bits                              */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

	/* end convert_pdp10_bytes_		         */
end;




		    convert_pdp10_file.pl1          01/09/80  1041.9rew 01/09/80  0918.3      104418



/* ******************************************************
   *                                                    *
   *                                                    *
   * Copyright (c) 1972 by Massachusetts Institute of   *
   * Technology and Honeywell Information Systems, Inc. *
   *                                                    *
   *                                                    *
   ****************************************************** */

convert_pdp10_file:
          procedure ();

          /* * * * * AUTOMATIC STORAGE DECLARATIONS  * * * */

     declare
         (num_args fixed binary (17),
          input_count fixed binary (24),
          err_code fixed binary (35),
          (input_ename, output_ename) character (32),
          (input_dirname, output_dirname) character (168),
          (input_ptr, output_ptr, temp_ptr) pointer)
               automatic;

     declare
          abort_command variable entry options (variable) initial (abort_command_invocation)
               automatic;

     declare
          1 canonicalization_info aligned automatic like canon_comm_template;

          /* * * * * INTERNAL STATIC DECLARATIONS  * * * * */

          /* * * * * TEXT SECTION REFERENCES * * * * * * * */

     declare
         (NL character (1) initial ("
"),
          US character (1) initial (""),
          PROG character (32) initial ("convert_pdp10_file"))
               internal static options (constant);

          /* * * * BASED & TEMPLATE DECLARATIONS * * * * * */

     declare
          based_count_string character (input_count)
               based;

          /* * * * * EXTERNAL STATIC DECLARATIONS  * * * * */

     declare
         (error_table_$badopt,
          error_table_$namedup,
          error_table_$noarg,
          error_table_$segknown,
          error_table_$zero_length_seg)
               fixed binary (35) external static;

          /* * * * * ENTRY & PROCEDURE DECLARATIONS  * * * */

     declare
          com_err_ constant entry options (variable),
          cu_$arg_count constant entry (fixed bin (17)),
          cu_$arg_list_ptr constant entry () returns (ptr),
          cu_$arg_ptr_rel constant entry (fixed bin (17), ptr, fixed bin (24), fixed bin (35), ptr),
          cu_$gen_call constant entry (entry, ptr),
          cv_dec_check_ constant entry (char (*), fixed bin (35)) returns (fixed bin (35)),
          expand_path_ constant entry (ptr, fixed bin (24), ptr, ptr, fixed bin (35)),
          get_pdir_ constant entry () returns (char (168) aligned),
          hcs_$delentry_seg constant entry (ptr, fixed bin (35)),
          hcs_$initiate_count constant entry (char (*), char (*), char (*), fixed bin (24), fixed bin (2),
                    ptr, fixed bin (35)),
          hcs_$make_seg constant entry (char (*), char (*), char (*), fixed bin (5), ptr, fixed bin (35)),
          hcs_$set_bc_seg constant entry (ptr, fixed bin (24), fixed bin (35)),
          hcs_$terminate_noname constant entry (ptr, fixed bin (35)),
          ioa_ constant entry options (variable),
          net_canonicalize_ constant entry (ptr, ptr, fixed bin (24), fixed bin (24), fixed bin (24),
                    ptr, fixed bin (24), fixed bin (24), fixed bin (24), fixed bin (35)),
          net_canonicalize_$initialize_canon_defaults constant entry (ptr, fixed bin (35));

     declare
          (addr, divide, length, null, substr)
               builtin;

          /* * * * * STACK REFERENCES  * * * * * * * * * * */

     declare
          cleanup condition;

          /* * * * * INCLUDE FILES * * * * * * * * * * * * */

          % include net_canon_dcls;

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

          err_code = 0;

          call cu_$arg_count (num_args);

          if num_args = 0
          then do;
               call ioa_ ("Usage is:^/^10x^a inputseg -outputseg-", (PROG));
               return;
               end;

          call process_options (cu_$arg_list_ptr ());

          input_ptr = null ();
          output_ptr = null ();
          temp_ptr = null ();

          on cleanup
               call cleanup_after_command ();

          canonicalization_info.version_number = 3;
          call net_canonicalize_$initialize_canon_defaults (addr (canonicalization_info), err_code);
          if err_code ^= 0
          then call abort_command (err_code, PROG, "Unable to initialize canonicalization defaults.");

          canonicalization_info.tab_increment = 8;

          call hcs_$initiate_count (input_dirname, input_ename, "", input_count, 0b, input_ptr, err_code);
          if (err_code ^= 0) & (err_code ^= error_table_$segknown)
          then call abort_command (err_code, PROG, "^a>^a", input_dirname, input_ename);

          if input_count = 0
          then call abort_command (error_table_$zero_length_seg, PROG, "^a>^a", input_dirname, input_ename);

          input_count = divide (input_count, 9, 24, 0);

          call hcs_$make_seg ("", "", "", 01011b, temp_ptr, err_code);
          if err_code ^= 0
          then call abort_command (err_code, PROG, "Unable to create temporary segment.");

          temp_ptr -> based_count_string = translate (input_ptr -> based_count_string, NL, US);

          call hcs_$make_seg (output_dirname, output_ename, "", 01011b, output_ptr, err_code);
          if (err_code ^= 0) & (err_code ^= error_table_$segknown) & (err_code ^= error_table_$namedup)
          then call abort_command (err_code, PROG, "^a>^a", output_dirname, output_ename);

          call perform_function (temp_ptr, output_ptr, input_count);

          call cleanup_after_command ();

return_to_caller:
          return;

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

perform_function:
          procedure (p_in_ptr, p_out_ptr, p_num_chars);

          /* * * * * PARAMETER DECLARATIONS  * * * * * * * */

     declare
         (p_num_chars fixed binary (24),
          (p_in_ptr, p_out_ptr) pointer)
               parameter;

          /* * * * * AUTOMATIC STORAGE DECLARATIONS  * * * */

     declare
         ((in_chars_proc, temp_chars_proc) fixed binary (24),
          area_ptr pointer)
               automatic;

          /* * * * * * * * * * * * * * * * * * * * * * * * */

          call hcs_$set_bc_seg (p_out_ptr, 0, err_code);
          if err_code ^= 0
          then call abort_command (err_code, PROG, "^a>^a", output_dirname, input_dirname);

          call net_canonicalize_ (addr (canonicalization_info), p_in_ptr, 0, p_num_chars, in_chars_proc,
                    p_out_ptr, 0, 262144 * 4, temp_chars_proc, err_code);
          if err_code ^= 0
          then call abort_command (err_code, PROG, "Invoking canonicalizer.");

          call hcs_$set_bc_seg (p_out_ptr, temp_chars_proc * 9, err_code);
          if err_code ^= 0
          then call abort_command (err_code, PROG, "^a>^a", output_dirname, output_ename);

          return;

end;      /* end perform_function                          */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

process_options:
          procedure (P_arg_list_ptr);

          /* * * * * PARAMETER DECLARATIONS  * * * * * * * */

     declare
          P_arg_list_ptr pointer
               parameter;

          /* * * * * AUTOMATIC STORAGE DECLARATIONS  * * * */

     declare
          (arg_indx fixed binary (17),
          arg_length fixed binary (24),
          arg_ptr pointer)
               automatic;

          /* * * * * BASED & TEMPLATE DECLARATIONS * * * * */

     declare
          based_argument character (arg_length)
               based;

          /* * * * * * * * * * * * * * * * * * * * * * * * */

          input_dirname = "";
          input_ename = "";
          output_dirname = "";
          output_ename = "";

          do arg_indx = 1 repeat (arg_indx + 1) while (got_argument (arg_indx));
               call process_control_argument (arg_ptr -> based_argument);
               end;

          if substr (output_dirname, 1, 1) = " "
          then do;
               output_dirname = input_dirname;
               output_ename = input_ename;
               end;

          return;

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

got_argument:
          procedure (P_arg) returns (bit (1));

          /* * * * * PARAMETER DECLARATIONS  * * * * * * * */

     declare
          P_arg fixed binary (17)                           /* index of the argument which we are to address  */
               parameter;

          /* * * * * * * * * * * * * * * * * * * * * * * * */

          call cu_$arg_ptr_rel (P_arg, arg_ptr, arg_length, err_code, P_arg_list_ptr);
          if err_code = 0
          then return ("1"b);

          if err_code = error_table_$noarg
          then return ("0"b);

          call abort_command (err_code, (PROG), "Attempting to get argument #^d.", P_arg);

end;      /* end got_argument                              */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

process_control_argument:
          procedure (P_control_arg);

          /* * * * * PARAMETER DECLARATIONS  * * * * * * * */

     declare
          P_control_arg character (*)
               parameter;

          /* * * * * AUTOMATIC STORAGE DECLARATIONS  * * * */

     declare
         (ename character (32),
          dirname character (168))
               automatic;

          /* * * * * * * * * * * * * * * * * * * * * * * * */

          if substr (P_control_arg, 1, 1) ^= "-"
          then do;                                          /* first char is not a minus, must be a pathname  */
               call expand_path_ (addr (P_control_arg), length (P_control_arg), addr (dirname), addr (ename), err_code);
               if err_code ^= 0
               then call abort_command (err_code, PROG, P_control_arg);

               if substr (input_dirname, 1, 1) = " "
               then do;
                    input_dirname = dirname;
                    input_ename = ename;
                    end;
               else if substr (output_dirname, 1, 1) = " "
                    then do;
                         output_dirname = dirname;
                         output_ename = ename;
                         end;
                    else call abort_command (err_code, PROG, "Only one conversion per command invocation.");
               return;
               end;

          call abort_command (error_table_$badopt, (PROG), P_control_arg);

end;      /* end process_control_argument                  */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

end;      /* end process_options                           */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

cleanup_after_command:
          procedure ();

          /* * * * * * * * * * * * * * * * * * * * * * * * */

          call hcs_$delentry_seg (temp_ptr, (0));

          do temp_ptr = input_ptr, output_ptr;
               call hcs_$terminate_noname (temp_ptr, (0));
               end;

          return;

end;      /* end cleanup_after_command                     */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

abort_command_invocation:
          procedure ();

          /* * * * * * * * * * * * * * * * * * * * * * * * */

          call cu_$gen_call (com_err_, cu_$arg_list_ptr ());

          call cleanup_after_command ();

          goto return_to_caller;

end;      /* end abort_command_invocation                  */

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

          /* end convert_pdp10_file                        */
end;





		    bull_copyright_notice.txt       08/30/05  1008.4r   08/30/05  1007.3    00020025

                                          -----------------------------------------------------------


Historical Background

This edition of the Multics software materials and documentation is provided and donated
to Massachusetts Institute of Technology by Group Bull including Bull HN Information Systems Inc. 
as a contribution to computer science knowledge.  
This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology,
Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell Bull Inc., Groupe Bull
and Bull HN Information Systems Inc. to the development of this operating system. 
Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970),
renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership
of Professor Fernando Jose Corbato.Users consider that Multics provided the best software architecture for 
managing computer hardware properly and for executing programs. Many subsequent operating systems
incorporated Multics principles.
Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., 
as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. .

                                          -----------------------------------------------------------

Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without
fee is hereby granted,provided that the below copyright notice and historical background appear in all copies
and that both the copyright notice and historical background and this permission notice appear in supporting
documentation, and that the names of MIT, HIS, Bull or Bull HN not be used in advertising or publicity pertaining
to distribution of the programs without specific prior written permission.
    Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc.
    Copyright 2006 by Bull HN Information Systems Inc.
    Copyright 2006 by Bull SAS
    All Rights Reserved
