PROCEDURE dum$display_binary_unique_name, display_binary_unique_name, disbun (
  pva: integer = $optional
  output, o: file = $output
  concat_string, cs: string = ' '
  address_mode, am: key pva, sva, keyend = pva
  exchange_package, ep: key m, j, keyend = j
  help, h: file = $null
  status)

  WHEN any_fault DO
    putl ' entered disbun handler - enter commands or exit_proc'
    disv osv$status
    include_file command
  WHENEND

  IF $specified(help) THEN
COLLECT_TEXT o=$value(help) until='HELPEND'
DISPLAY_BINARY_UNIQUE_NAME or DISBUN

  This procedure will decode and display 11 memory bytes pointed to
by the pva parameter as a unique binary name.  This procedure assumes
the user has previously selected the correct exchange package by
available analyze_dump commands.

PARAMETERS:

PVA: integer
  This parameter selects the address of the first bye of the eleven byte
binary unique name.  This parameter is required.

OUTPUT, O: file
  This parameter selects the file name to receive the data.  This para-
meter is defaulted to $output.  If a file name other than $output is
entered the data will be sent to the file  "$asis".

CONCAT_STRING, CS: string
  This parameter specifies a string to be added to the beginning of
the decoded binary unique name before it is output.  This parameter
is used by other procedures to append their individual labels in front
of the decoded name.  This parameter defaults to one space.

STATUS

WARNINGS/KNOWN DEFICIENCIES:

ERROR HANDLER
  When any fatal error is encountered a condition handler is invoked and
the following message will appear:
 "entered disbun condition handler - enter commands or exit_proc to abort".
This will be followed by the error status.  To exit the handler enter:
 "exit_proc".

HELPEND
    EXIT_PROC
  IFEND

  IF NOT $specified(pva) THEN
    EXIT_PROC WITH $status(false, 'US', 1, 'Parameter PVA is required')
  IFEND

  create_variable name=seq_base_number kind=integer value=$mem(($value(pva)+7), 4(16),,, $value(am))
  create_variable name=date_base_number kind=integer value=$mem(($value(pva)+3), 3(16),,, $value(am))/10(16)
  create_variable name=time_base_number kind=integer value=$mem(($value(pva)+5), 3(16),,, $value(am))/8
  create_variable name=base_operand kind=integer
  create_variable name=work_operand kind=integer
  create_variable name=string_length kind=integer
  create_variable name=sub_string kind=string
  create_variable name=result_string kind=string
  create_variable name=filler_string kind=string value='0000000'

  base_operand = ((seq_base_number)-(seq_base_number/1000000(16)/8*8*1000000(16)))/8
  work_operand = $mem(($value(pva)+2), 1(16),,, $value(am))
  sub_string = $strrep(base_operand)
  string_length = $strlen(sub_string)
  result_string = '$'//$substr(filler_string, 1, (7-string_length))
  result_string = result_string//sub_string
  result_string = result_string//$strrep(work_operand (16))//'s' "add model number"
  sub_string = $strrep($mem(($value(pva)), 2(16),,, $value(am)) (16))
  string_length = $strlen(sub_string)
  result_string = result_string//$substr(filler_string, 1, (4-string_length))
  result_string = result_string//..
$substr(sub_string, 1, string_length)//'d'//$strrep(date_base_number/100(16)/2)
  base_operand = ((date_base_number)-(date_base_number/1000(16)*1000(16)))/10(16)
  base_operand = (base_operand/2)-(base_operand/2/10(16)*10(16))
  base_operand = base_operand-(base_operand/10(16)*10(16))
  sub_string = $strrep(base_operand)
  string_length = $strlen(sub_string)
  result_string = result_string//$substr(filler_string, 1, (2-string_length))//sub_string "month"
  base_operand = date_base_number-(date_base_number/100(16)*100(16))
  base_operand = base_operand-(base_operand/10(16)/2*10(16)*2)
  sub_string = $strrep(base_operand)
  string_length = $strlen(sub_string)
  result_string = result_string//$substr(filler_string, 1, (2-string_length))//(sub_string)//'t' "add day"
  base_operand = (time_base_number-(time_base_number/10000(16)/2*10000(16))*2)
  sub_string = $strrep(base_operand/1000(16))
  string_length = $strlen(sub_string)
  result_string = result_string//$substr(filler_string, 1, (2-string_length))//sub_string "hour"
  base_operand = base_operand-(base_operand/1000(16)*1000(16))
  sub_string = $strrep(base_operand/10(16)/4)
  string_length = $strlen(sub_string)
  result_string = result_string//$substr(filler_string, 1, (2-string_length))//sub_string "min"
  base_operand = base_operand-((base_operand/10(16)/4)*10(16)*4)
  sub_string = $strrep(base_operand)
  string_length = $strlen(sub_string)
  result_string = result_string//$substr(filler_string, 1, (2-string_length))//sub_string "sec"

  IF $file($value(output) open_position) = '$BOI' THEN
    char = $strlen($string($value(output)))
    IF $substr($string($value(output)), char-4, 5) = '$ASIS' THEN
      output_file = $string($value(output))
    ELSEIF $substr($string($value(output)), char-3, 4) = '$EOI' THEN
      output_file = $string($value(output))
    ELSE
      output_file = $string($value(output))//'.$asis'
    IFEND
  ELSE
    output_file = $string($value(output))
  IFEND
  put_line line=$value(concat_string)//result_string o=$fname(output_file)

PROCEND dum$display_binary_unique_name
