home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / analyze.zip / ANALYZE.DOC next >
Text File  |  1989-04-07  |  24KB  |  727 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.                                           
  8.                                           
  9.                                           
  10.                                           
  11.                                           
  12.                                           
  13.                                       ANALYZE
  14.                                           
  15.                                     Version 1.1
  16.                                           
  17.                                           
  18.             Copyright (c) 1989 by Gary R. Pannone   All rights reserved.
  19.                                           
  20.                  You may freely distribute this version of ANALYZE.
  21.                                           
  22.                                           
  23.                                           
  24.                                           
  25.             If you  find this program useful, please send a contribution
  26.             ($20 suggested) to the address below.  For a contribution of
  27.             $25 you will receive an enhanced version of this program and
  28.             notification of planned future versions.
  29.             
  30.                                   Gary R. Pannone
  31.                                   35 Park View Rd.
  32.                                   Hamden, CT 06514
  33.                                           
  34.                                           
  35.                                           
  36.                                           
  37.                                           
  38.                                           
  39.                                           
  40.                                           
  41.                                           
  42.             If you  have problems  with this program, please send a note
  43.             to the address above.
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.                                  TABLE OF CONTENTS
  74.                                  -----------------
  75.             
  76.             
  77.             1.  Introduction.................................... 1
  78.             
  79.             2.  Starting ANALYZE................................ 1
  80.             
  81.             3.  The Configuration Screen........................ 2
  82.             3.1 The Configuration File.......................... 2
  83.             3.2 The Configuration Screen Keys................... 2
  84.             3.3 The Configuration Data Items.................... 3
  85.             3.4 The Configuration Function Keys................. 5
  86.             
  87.             4.  Displaying Data................................. 6
  88.             4.1 The Data Screen................................. 6
  89.             4.2 The Data Screen Keys............................ 7
  90.             4.3 Displaying a File "Dump"........................ 7
  91.             
  92.             5.  Record Types.................................... 8
  93.             5.1 Text Records.................................... 8
  94.             5.2 Fixed Length Records............................ 8
  95.             5.3 Variable Length Records with a Byte Header...... 9
  96.             5.4 Variable Length Records with a Word Header...... 9
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                                        Page 1                        
  137.  
  138.  
  139.             1.  Introduction
  140.             ----------------
  141.             
  142.             ANALYZE is a powerful tool for programmers, or anyone that
  143.             needs to verify or determine the exact contents, or format,
  144.             of a file.  ANALYZE is an interactive program that displays
  145.             the data contained in files.
  146.             
  147.             ANALYZE can be used to:
  148.             
  149.                  1. Display the character data contained in a file.
  150.                  2. Display the ASCII values of character data.
  151.                  3. Display the byte values of binary data (dump).
  152.                  4. Analyze a file to determine its record length,
  153.                     record type, or internal (field) format.
  154.             
  155.             ANALYZE's special features include:
  156.             
  157.                  1. Fully configurable - you select the number
  158.                     base, numbering system (starts at 0 or 1),
  159.                     display format, display options, etc.
  160.                  2. Supports several record types (see chap. 5).
  161.                  3. Scrolls up and down through data records,
  162.                     scrolls horizontally within records.
  163.                  4. Allows quick access to specific records by
  164.                     record number.
  165.             
  166.             
  167.             
  168.             
  169.             2.  Starting ANALYZE
  170.             --------------------
  171.             
  172.             To start ANALYZE, type -
  173.             
  174.                  ANALYZE <ENTER>
  175.             
  176.             You can specify the name of the data file that you would
  177.             like to display at startup time by typing -
  178.             
  179.                  ANALYZE filename <ENTER>
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                                                        Page 2                        
  203.  
  204.  
  205.             
  206.             
  207.             
  208.             
  209.             3.  The Configuration Screen
  210.             ----------------------------
  211.             
  212.             The Configuration Screen lets you:
  213.             
  214.                  . Specify the name of the data file.
  215.                  . Select the data file's record type.
  216.                  . Select the first record to be displayed.
  217.                  . Select how the data should be displayed.
  218.                  . Select whether numbering starts at 0 or 1.
  219.                  . Select the number base.
  220.                  . Select the screen colors.
  221.             
  222.             The Configuration  Screen is  displayed whenever  you  start
  223.             ANALYZE or  press the  ESC key  while  the  Data  Screen  is
  224.             displayed.   There are  two  types  of  data  items  on  the
  225.             Configuration Screen.   Data  entry items,  such as the File
  226.             Name item, require you to type in data.  Menu items, such as
  227.             the Include  Header item,  require  you  to  choose  one  of
  228.             several choices.
  229.             
  230.             
  231.             3.1 The Configuration File
  232.             --------------------------
  233.             
  234.             ANALYZE lets  you save  the configuration  items in  a  file
  235.             called ANALYZE.CNF.   When  you start  ANALYZE, the  program
  236.             reads the configuration file from the current directory.  If
  237.             the file does not exist in the current directory and you are
  238.             running DOS  version 3.0  (or higher),  the program looks in
  239.             the directory  from which  the program  was read.    If  the
  240.             configuration file  is  not  found  there,  ANALYZE  uses  a
  241.             default configuration.
  242.             
  243.             See section  3.3 for details on saving the program configur-
  244.             ation.
  245.             
  246.             
  247.             3.2 The Configuration Screen Keys
  248.             ---------------------------------
  249.             
  250.             You select  the  data  item  that  you  want  to  change  by
  251.             highlighting the  item name.   Use  the ENTER  or DOWN ARROW
  252.             keys to  highlight the  next Configuration Screen data item.
  253.             Use the UP ARROW to highlight the previous data item.
  254.             
  255.                  Note:   Some data  items may be disabled.  You can
  256.                  not change the value of a disabled data item.  For
  257.                  example, if  you select  the  record  type  called
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                                                        Page 3                        
  269.  
  270.  
  271.                  Text, the  Record Length item is disabled, and the
  272.                  highlight can  not be  moved to  the Record Length
  273.                  item.
  274.             
  275.             When you highlight a data entry item, you can edit the value
  276.             using the standard editing keys:
  277.             
  278.                  Key            Description
  279.                  -----------    ----------------
  280.                  RIGHT ARROW    Move the cursor to the right
  281.                  LEFT ARROW     Move the cursor to the left
  282.                  BACKSPACE      Delete the previous character
  283.                  DEL            Delete the current character
  284.                  INS            Toggle insert mode on/off
  285.                  HOME           Move the cursor to the beginning
  286.                  END            Move the cursor to end
  287.                  CTRL END       Delete to end of field
  288.             
  289.             When you  highlight a  menu item,  you can select a value by
  290.             pressing the SPACE BAR, LEFT ARROW key, or RIGHT ARROW key.
  291.             
  292.             
  293.             3.3 The Configuration Data Items
  294.             --------------------------------
  295.             
  296.             The following items are configurable:
  297.             
  298.             FILE NAME - Enter the name of the data file to be displayed.
  299.             You can  enter a  full file  specification including a drive
  300.             letter and a directory specifier.
  301.             
  302.             RECORD TYPE  -  Choose  the  appropriate  Record  Type  (see
  303.             chapter 5 for a description of the record types):
  304.             
  305.                  Type           Description
  306.                  ----------     -------------------------
  307.                  TEXT           Records terminated by CR and LF
  308.                  FIXEDLENGTH    Fixed length records
  309.                  BYTEHEADER     Variable length with byte header
  310.                  WORDHEADER     Variable length with word header
  311.             
  312.             START AT RECORD - Enter the number of the first record to be
  313.             displayed.   This number can not be less than the configured
  314.             1ST RECORD NUMBER or greater than 65535.
  315.             
  316.                  Note:   This value MUST be entered in the selected
  317.                  NUMBER BASE.
  318.             
  319.             DISPLAY TERM  - Choose  NO  to  display  only  actual  data.
  320.             Choose YES  to also display record terminators (the carriage
  321.             return and  line feed  at the  end of  text records, and the
  322.             byte or  word header at the beginning of byte header or word
  323.             header variable length records).
  324.             
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                                                        Page 4                        
  335.  
  336.  
  337.             RECORD LENGTH  - Enter the length of the data records in the
  338.             fixed length  data file.   This  item is  ignored for  other
  339.             types of  records.   The minimum  value is 1 and the maximum
  340.             value is 32767.
  341.             
  342.                  Note:   This value MUST be entered in the selected
  343.                  NUMBER BASE.
  344.             
  345.             INCLUDE HEADER  - Choose  NO if the value of the byte header
  346.             or word  header does  NOT include  the length  of the header
  347.             itself.   Choose YES if the value does include the length of
  348.             the header.   See  chapter 5  for details.    This  item  is
  349.             ignored for text and fixed length records.
  350.             
  351.             DISPLAY FORMAT  -  Choose  CHARACTER  to  display  only  the
  352.             characters that  correspond to  each byte  of data.   Choose
  353.             DUMP to  display the  byte values  above each  character  of
  354.             data.
  355.             
  356.             1ST DISPLAY  POS -  Enter the  number of the first character
  357.             position of  each record to be displayed.  The minimum value
  358.             is the  configured 1ST  CHARACTER POSITION  and the  maximum
  359.             value is 32767.
  360.             
  361.                  Note:   This value MUST be entered in the selected
  362.                  NUMBER BASE.
  363.             
  364.             1ST CHARACTER  POSITION -  Choose ZERO if you want to number
  365.             the  character   positions  of  each  record  starting  with
  366.             position 0  (zero).   Choose ONE  if you  want to number the
  367.             character positions  of each record starting with position 1
  368.             (one).
  369.             
  370.             1ST RECORD  NUMBER -  Choose ZERO  if you want to number the
  371.             records in  the file  starting with record 0 (zero).  Choose
  372.             ONE if you want to number the records starting with record 1
  373.             (one).
  374.             
  375.             NUMBER BASE  - Choose OCTAL to display all numbers in octal.
  376.             Choose DECIMAL  to display  all numbers  in decimal.  Choose
  377.             HEX to display all numbers in hexidecimal.
  378.             
  379.                  Note:   If you  change the NUMBER BASE, be sure to
  380.                  convert the  START AT  RECORD, RECORD  LENGTH, and
  381.                  1ST DISPLAY POS values to the new number base.
  382.             
  383.             DISPLAY  OPT   -  Choose   NONE  to   display  no   optional
  384.             information.   Choose NUM/LEN  to display  the record number
  385.             and record  length of each record.  Choose OFFSET to display
  386.             the byte  offset to  the beginning of the record, as well as
  387.             the number and record length of each record.
  388.             
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.                                                        Page 5                        
  401.  
  402.  
  403.             DATA - Choose the color in which you want the character data
  404.             to be highlighted.
  405.             
  406.             TEXT - Choose the color in which you want the screen text to
  407.             be displayed.
  408.             
  409.             HIGHLIGHT  -   Choose  the  color  in  which  you  want  the
  410.             highlighted text to be displayed.
  411.             
  412.             BACKGROUND -  Choose the  color in which you want the screen
  413.             background to be displayed.
  414.             
  415.                  Note:  The background color can not be the same as
  416.                  one of the other colors that you have chosen.
  417.             
  418.             
  419.             3.4 The Configuration Function Keys
  420.             -----------------------------------
  421.             
  422.             The following  function keys are active in the Configuration
  423.             Screen:
  424.             
  425.             F1 (DISPLAY  DATA)  -  Displays  the  specified  data  file,
  426.             starting at the specified record, in the specified format.
  427.             
  428.             F2 (SAVE  CONFIG) - Displays the message "Save Configuration
  429.             ? (Y/N)".   If  you press  Y, the  current configuration  is
  430.             written to  the CURRENT  directory.   If you  press  N,  the
  431.             configuration is not saved.
  432.             
  433.                  Note:  You can save the configuration with no file
  434.                  name.   This allows  you to save a generic config-
  435.                  uration, which  can  be  used  with  several  data
  436.                  files.
  437.             
  438.             F3  (RESTORE   CONFIG)  -   Displays  the  message  "Restore
  439.             Configuration ?  (Y/N)".   If you press Y, the configuration
  440.             information  is   read  from   the  configuration  file  and
  441.             displayed.   If  you  press  N,  the  configuration  is  not
  442.             changed.
  443.             
  444.             F4 (SET  START) -  Sets the  starting record  number to  the
  445.             number of  the first  data record  that was displayed on the
  446.             last Data Screen.
  447.             
  448.             ESC (EXIT) - Stops the ANALYZE program.
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.                                                        Page 6                        
  467.  
  468.  
  469.             
  470.             
  471.             
  472.             
  473.             4.  Displaying Data
  474.             -------------------
  475.             
  476.             When  you   press  the   F1  key  (Display  Data)  when  the
  477.             Configuration Screen  is displayed,  ANALYZE looks  for  the
  478.             specified data  file.   If the  file is  found, the  program
  479.             displays the specified starting record.
  480.             
  481.                  Note:   If the record type is not FIXEDLENGTH, the
  482.                  program displays  the message  "Reading ..." while
  483.                  it searches for the starting record.
  484.             
  485.             
  486.             4.1 The Data Screen
  487.             ---------------------------
  488.             
  489.             The top of the Data Screen displays the:
  490.             
  491.                  1. Data file name
  492.                  2. Number base
  493.                  3. Record type
  494.                  4. The first record number
  495.                  5. The first character position
  496.                  6. Whether headers are included in record lengths
  497.             
  498.             The main window displays:
  499.             
  500.                  1. The byte offset (if configured)
  501.                  2. The record number (if configured)
  502.                  3. The  record   length  (if   configured).     If
  503.                     configured  not  to  display  terminators,  the
  504.                     record length  will be  the length  of only the
  505.                     actual data,  and a  plus sign  (+) will follow
  506.                     the record length.
  507.                  4. One or more data records
  508.             
  509.             A ruler  is displayed just above the main window.  The ruler
  510.             is numbered in the number base that was configured.  The 1st
  511.             display position is displayed just above the left end of the
  512.             ruler.   For example,  if you specified that the 1st display
  513.             position is 15, the first digit on the ruler will be a 5 and
  514.             the number 15 is displayed just above the 5.
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.                                                        Page 7                        
  533.  
  534.  
  535.             
  536.             
  537.             4.2 The Data Screen Keys
  538.             ------------------------
  539.             
  540.             The following keys are active in the Data Screen:
  541.             
  542.             CTRL LEFT  ARROW -  Scroll the  data one window-width to the
  543.             right, if possible.
  544.             
  545.             CTRL RIGHT  ARROW -  Scroll the data one window-width to the
  546.             left.
  547.             
  548.             DOWN ARROW - Displays the next data record, if any.
  549.             
  550.             HOME - Displays the beginning of the data record.
  551.             
  552.             LEFT ARROW  - Scroll the data one character to the right, if
  553.             possible.
  554.             
  555.             PGDN - Displays the next screen of data records, if any.
  556.             
  557.             PGUP - Displays the previous screen of data records, if any.
  558.             
  559.             RIGHT ARROW - Scroll the data one character to the left.
  560.             
  561.             UP ARROW - Displays the previous data record, if any.
  562.             
  563.             ESC (EXIT) Redisplays the Configuration Screen.
  564.             
  565.             
  566.             4.3 Displaying a File "Dump"
  567.             ----------------------------
  568.             
  569.             It is  often useful to display a data file in "dump" format,
  570.             that is,  display  every  byte  of  the  file  in  both  its
  571.             character, and byte value, forms. To do this using ANALYZE:
  572.             
  573.             1. Choose  FIXEDLENGTH Record  Type (even is it doesn't have
  574.             fixed length records)
  575.             2. Choose DUMP Display Format
  576.             3. Specify  a Record  Length less  than or equal to the data
  577.             window width (for example, 50).
  578.             
  579.             This method  provides a  way of displaying the data in fixed
  580.             length chunks, the way a typical dump program displays it.
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.                                                        Page 8                        
  599.  
  600.  
  601.             
  602.             
  603.             
  604.             
  605.             5.  Record Types
  606.             ----------------
  607.             
  608.             This  chapter   describes  the  record  types  supported  by
  609.             ANALYZE.
  610.             
  611.             In the  examples in  the following sections, square brackets
  612.             enclose  individual  bytes.    Numbers  enclosed  in  square
  613.             brackets are decimal.  For example:
  614.             
  615.                  BYTE SPEC      DECIMAL VALUE
  616.                  ---------      -------------
  617.                  [19]           19
  618.                  [CR]           13 (ASCII carriage return)
  619.                  [LF]           10 (ASCII line feed)
  620.             
  621.             
  622.             5.1 Text Records
  623.             ----------------
  624.             
  625.             Text records are fixed or variable length records terminated
  626.             by carriage return and line feed characters.  For example:
  627.             
  628.                  Record 1 text[CR][LF]
  629.                  Record 2 text[CR][LF]
  630.                  Record 3 text here[CR][LF]
  631.             
  632.             
  633.             5.2 Fixed Length Records
  634.             ------------------------
  635.             
  636.             Fixed length  records are  assumed to  have  no  terminating
  637.             characters  or   header  characters;   all  data  bytes  are
  638.             displayed and assumed to be data.  For example:
  639.             
  640.                  Record 1 data
  641.                  Record 2 data
  642.                  Record 3 data
  643.             
  644.             It is  often useful to display a data file as a fixed length
  645.             record file,  even is  it doesn't have fixed length records.
  646.             This method  provides a  way of displaying the data in fixed
  647.             length chunks,  the way  a typical dump program displays it.
  648.             This also  provides a  way of displaying entire data records
  649.             that are longer than the data screen window width.
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.                                                        Page 9                        
  665.  
  666.  
  667.             
  668.             
  669.             5.3 Variable Length Records with a Byte Header
  670.             ----------------------------------------------
  671.             
  672.             Byte Header  records have  a one  byte prefix that specifies
  673.             the actual length of the record.
  674.             
  675.             Here is data in a  file with record lengths that include the
  676.             header byte:
  677.             
  678.                  [14]Record 1 data
  679.                  [14]Record 2 data
  680.                  [19]Record 3 data here
  681.             
  682.             Note that the record length of the first record, 14, equals
  683.             the length of the actual data (Record 1 data) plus the
  684.             length of the header itself (which is 1 byte).
  685.             
  686.             Here is the same data in a  file with record lengths that do
  687.             not include the header byte:
  688.             
  689.                  [13]Record 1 data
  690.                  [13]Record 2 data
  691.                  [18]Record 3 data here
  692.             
  693.             
  694.             5.4 Variable Length Records with a Word Header
  695.             ----------------------------------------------
  696.             
  697.             Word Header  records have  a one  word prefix that specifies
  698.             the actual length of the record.
  699.             
  700.             Here is data in a  file with record lengths that include the
  701.             header bytes:
  702.             
  703.                  [15][0]Record 1 data
  704.                  [15][0]Record 2 data
  705.                  [20][0]Record 3 data here
  706.             
  707.             Note that the record length of the first record, 15, equals
  708.             the length of the actual data (Record 1 data) plus the
  709.             length of the header itself (which is 2 bytes).
  710.             
  711.             Here is the same data in a  file with record lengths that do
  712.             not include the header bytes:
  713.             
  714.                  [13][0]Record 1 data
  715.                  [13][0]Record 2 data
  716.                  [18][0]Record 3 data here
  717.             
  718.             
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.