PROCEDURE dum$display_logical_pp_table, display_logical_pp_table, dislppt, dislpt (
  ordinal, ord: any of
      range of integer
      key
        all
      keyend
    anyend = all
  new_table, nt: boolean = FALSE
  output, o: file = $output
  status)

  VAR
    c$active_check_start_address: (READ) integer = 8d(16)
    c$controller_info_start_address: (READ) integer = 5b(16)
    c$flags_size: (READ) integer = 13
    c$flags_starting_address: (READ) integer = 0
    c$handlers_starting_address: (READ) integer = 74(16)
    c$pp_info_starting_address: (READ) integer = 0d(16)
    c$task_info_starting_address: (READ) integer = 5e(16)
  VAREND

  VAR
    ignore_status: status
    index: integer
    last_lppt_ordinal: integer
    logical_pp_table: integer
    logical_pp_table_p: integer
    logical_pp_table_entry: integer
    logical_pp_table_entry_size: integer
    lppt_ordinal: integer
    number_of_entries: integer
    output_file: file
    start_lppt_ordinal: integer
    string_1: string
    string_2: string
    string_3: string
  VAREND

  IF $file(output open_position) = '$BOI' THEN
    delete_file f=output status=ignore_status
  IFEND
  output_file = output.$eoi

  IF new_table THEN
    logical_pp_table_p = $symbol_address(cmv$new_logical_pp_table_p)
  ELSE
    logical_pp_table_p = $symbol_address(cmv$logical_pp_table_p)
  IFEND
  logical_pp_table = $memory(logical_pp_table_p 6 monitor)
  logical_pp_table_entry_size = $memory((logical_pp_table_p + 14) 4 monitor)
  number_of_entries = $memory((logical_pp_table_p + 6) 4 monitor) / logical_pp_table_entry_size
  start_lppt_ordinal = $memory((logical_pp_table_p + 10) 4 monitor)
  last_lppt_ordinal = start_lppt_ordinal + number_of_entries - 1

  put_line l=' LOGICAL PP TABLE' o=output_file

  put_line l='   (entry size = '//$strrep(logical_pp_table_entry_size 10)//' bytes)' o=output_file
  put_line l='   (number of entries = '//$strrep(number_of_entries 10)//')' o=output_file
  put_line l='   (first ordinal = '//$strrep(start_lppt_ordinal 10)//')' o=output_file
  put_line l='   (last ordinal = '//$strrep(last_lppt_ordinal 10)//')' o=output_file

  IF $generic_type(ordinal) = RANGE THEN
    start_lppt_ordinal = ordinal.low
    IF start_lppt_ordinal > last_lppt_ordinal THEN
      put_line l=' ERROR -- Ordinal is beyond the end of the Logical PP Table.' o=output_file
      EXIT PROCEDURE
    IFEND
    IF start_lppt_ordinal < 0 THEN
      put_line l=' ERROR -- Ordinal is less then the starting ordinal of the Logical PP Table. ' o=output_file
      EXIT PROCEDURE
    IFEND
    last_lppt_ordinal = ordinal.high
  IFEND

  FOR lppt_ordinal = start_lppt_ordinal TO last_lppt_ordinal DO
    logical_pp_table_entry = logical_pp_table + ((lppt_ordinal - 1) * logical_pp_table_entry_size)

    put_line l=' ' o=output_file
    put_line l=' -----------------------------------------------------------------' o=output_file
    put_line l='   Logical PP Table Index = '//$strrep(lppt_ordinal) o=output_file
    put_line l='     Flags:' o=output_file

    FOR index = c$flags_starting_address TO (c$flags_size - 1) DO
      IF $memory((logical_pp_table_entry + index) 1 monitor) = 1 THEN
        string_1 = 'TRUE'
      ELSE
        string_1 = 'FALSE'
      IFEND
      IF index = 0 THEN
        put_line l='       configured = '//string_1 o=output_file
      ELSEIF index = 1 THEN
        put_line l='       resources_acquired = '//string_1 o=output_file
      ELSEIF index = 2 THEN
        put_line l='       pp_loaded = '//string_1 o=output_file
      ELSEIF index = 3 THEN
        put_line l='       disabled = '//string_1 o=output_file
      ELSEIF index = 4 THEN
        put_line l='       entry_in_use = '//string_1 o=output_file
      ELSEIF index = 5 THEN
        put_line l='       entry_reserved_by_nosve = '//string_1 o=output_file
      ELSEIF index = 6 THEN
        put_line l='       entry_reserved_by_other = '//string_1 o=output_file
      ELSEIF index = 7 THEN
        put_line l='       entry_reserved_by_system_job = '//string_1 o=output_file
      ELSEIF index = 8 THEN
        put_line l='       reservd_by_other_has_ch_present = '//string_1 o=output_file
      ELSEIF index = 9 THEN
        put_line l='       pp_hung = '//string_1 o=output_file
      ELSEIF index = 10 THEN
        put_line l='       pp_idle_resume_supported = '//string_1 o=output_file
      ELSEIF index = 11 THEN
        put_line l='       pp_handshaking_supported = '//string_1 o=output_file
      ELSEIF index = 12 THEN
        put_line l='       pp_reload_supported = '//string_1 o=output_file
      IFEND
    FOREND

    put_line l='     Pp_info:' o=output_file

    index = 0
    string_1 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor))
    index = index + 1
    IF $memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) = 0 THEN
      string_2 = ', PP'
    ELSE
      string_2 = ', CPP'
    IFEND
    index = index + 1
    string_3 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) 8)
    index = index + 1
    put_line l='       physical_pp = IOU'//string_1//string_2//string_3//'(8)' o=output_file

    string_1 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + index) 2 monitor))
    index = index + 2
    put_line l='       logical_partner_pp_index = '//string_1 o=output_file

    IF $memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) = 0 THEN
      string_1 = 'cmc$lpt_null_pp_type'
    ELSEIF $memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) = 1 THEN
      string_1 = 'cmc$lpt_other_pp_type'
    ELSEIF $memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) = 2 THEN
      string_1 = 'cmc$lpt_disk_pp_type'
    ELSEIF $memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) = 3 THEN
      string_1 = 'cmc$lpt_tape_pp_type'
    ELSEIF $memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) = 4 THEN
      string_1 = 'cmc$lpt_network_pp_type'
    ELSEIF $memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) = 5 THEN
      string_1 = 'cmc$lpt_nad_pp_type'
    ELSE
      string_1 = ' '
    IFEND
    index = index + 1
    put_line l='       pp_type = '//string_1 o=output_file

    string_1 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + index) 4 monitor) 16)
    index = index + 4
    put_line l='       pp_interface_table_rma = '//string_1//'(16)' o=output_file

    string_1 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + index) 6 monitor) 16)
    index = index + 18
    put_line l='       pp_interface_table_p = '//string_1//'(16)' o=output_file

    string_1 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + index) 6 monitor) 16)
    index = index + 6
    put_line l='       pp_communication_buffer_p = '//string_1//'(16)' o=output_file

    string_1 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor))
    index = index + 1
    IF $memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) = 0 THEN
      string_2 = ', CH'
    ELSE
      string_2 = ', CCH'
    IFEND
    index = index + 1
    string_3 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) 8)
    index = index + 1
    put_line l='       channel = IOU'//string_1//string_2//string_3//'(8)' o=output_file

    IF $memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) = 0 THEN
      string_1 = 'cmc$unspecified_port'
    ELSEIF $memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) = 1 THEN
      string_1 = 'cmc$port_a'
    ELSEIF $memory((logical_pp_table_entry + c$pp_info_starting_address + index) 1 monitor) = 2 THEN
      string_1 = 'cmc$port_b'
    ELSE
      string_1 = ' '
    IFEND
    index = index + 1
    put_line l='       channel_port = '//string_1 o=output_file

    string_1 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + index) 6 monitor) 16)
    index = index + 6
    put_line l='       channel_interlock_p = '//string_1//'(16)' o=output_file

    string_1 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + index) 6 monitor) 16)
    index = index + 14
    put_line l='       driver_code_p = '//string_1//'(16)' o=output_file

    string_1 = $memory_string((logical_pp_table_entry + c$pp_info_starting_address + index) 7 monitor)
    index = index + 7
    put_line l='       driver_name = '//string_1 o=output_file

    string_1 = $memory_string((logical_pp_table_entry + c$pp_info_starting_address + index) 7 monitor)
    index = index + 7
    put_line l='       cip_driver_name = '//string_1 o=output_file

    string_1 = $strrep($memory((logical_pp_table_entry + c$pp_info_starting_address + index) 6 monitor) 16)
    index = index + 6
    put_line l='       saved_io_request_p = '//string_1//'(16)' o=output_file

    put_line l='     Controller_info:' o=output_file

    index = 0
    IF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 1 THEN
      string_1 = 'TRUE'
    ELSE
      string_1 = 'FALSE'
    IFEND
    index = index + 1
    put_line l='       controlware_loaded = '//string_1 o=output_file

    IF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 1 THEN
      string_1 = 'TRUE'
    ELSE
      string_1 = 'FALSE'
    IFEND
    index = index + 1
    put_line l='       control_module_loaded = '//string_1 o=output_file

    IF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 0 THEN
      string_1 = 'cmc$ms7154_x'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 1 THEN
      string_1 = 'cmc$ms7155_1'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 2 THEN
      string_1 = 'cmc$ms7155_1x'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 3 THEN
      string_1 = 'cmc$ms7165_2x'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 4 THEN
      string_1 = 'cmc$mscm3_ct'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 5 THEN
      string_1 = 'cmc$mshydra_ct'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 6 THEN
      string_1 = 'cmc$ms5831_x'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 7 THEN
      string_1 = 'cmc$mt7021_3x'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 8 THEN
      string_1 = 'cmc$mt7021_4x'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 9 THEN
      string_1 = 'cmc$ms7255_1_1'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 10 THEN
      string_1 = 'cmc$ms7255_1_2'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 11 THEN
      string_1 = 'cmc$mt7221_2_s0'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 12 THEN
      string_1 = 'cmc$mt5680_xx'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 13 THEN
      string_1 = 'cmc$mt7221_1'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 14 THEN
      string_1 = 'cmc$mt698_xx'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 15 THEN
      string_1 = 'cmc$mt5698_xx'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 16 THEN
      string_1 = 'cmc$mp65354_11'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 17 THEN
      string_1 = 'cmc$ca2629_2'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 18 THEN
      string_1 = 'cmc$lcn380_170'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 19 THEN
      string_1 = 'cmc$mti2620_21x'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 20 THEN
      string_1 = 'cmc$mdi2621_21x'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 21 THEN
      string_1 = 'cmc$fs740_200'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 22 THEN
      string_1 = 'cmc$expresslink'
    ELSEIF $memory((logical_pp_table_entry + c$controller_info_start_address + index) 1 monitor) = 23 THEN
      string_1 = 'cmc$null_controller'
    ELSE
      string_1 = ' '
    IFEND
    index = index + 1
    put_line l='       controller_type = '//string_1 o=output_file

    put_line l='     Task_info:' o=output_file

    index = 0
    string_1 = $strrep($memory((logical_pp_table_entry + c$task_info_starting_address + index) 3 monitor) 16)
    index = index + 3
    put_line l='       gtid = '//string_1//'(16)' o=output_file

    string_1 = $memory_string((logical_pp_table_entry + c$task_info_starting_address + index) 19 monitor)
    index = index + 19
    put_line l='       reserved_job_name = '//string_1 o=output_file

    put_line l='     Handlers:' o=output_file

    index = 0
    string_1 = $strrep($memory((logical_pp_table_entry + c$handlers_starting_address + index) 6 monitor) 16)
    index = index + 12
    put_line l='       response_handler_p = '//string_1//'(16)' o=output_file

    IF $memory((logical_pp_table_entry + c$handlers_starting_address + index) 1 monitor) = 1 THEN
      string_1 = 'TRUE'
    ELSE
      string_1 = 'FALSE'
    IFEND
    index = index + 1
    put_line l='       one_word_response_allowed = '//string_1 o=output_file

    string_1 = $strrep($memory((logical_pp_table_entry + c$handlers_starting_address + index) 6 monitor) 16)
    index = index + 12
    put_line l='       one_word_response_handler_p = '//string_1//'(16)' o=output_file

    put_line l='     Active_check:' o=output_file

    index = 0
    string_1 = $strrep($memory((logical_pp_table_entry + c$active_check_start_address + index) 8 monitor) 16)
    index = index + 8
    put_line l='       timestamp = '//string_1//'(16)' o=output_file

    string_1 = $strrep($memory((logical_pp_table_entry + c$active_check_start_address + index) 8 monitor) 16)
    index = index + 8
    put_line l='       timeout = '//string_1//'(16)' o=output_file

  FOREND

PROCEND dum$display_logical_pp_table
