Home » Archimedes archive » Acorn Computing » 1994 02 subscription disc.adf » 9402s » PD/ArmSi/!ArmSI/h/dhry

PD/ArmSi/!ArmSI/h/dhry

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn Computing » 1994 02 subscription disc.adf » 9402s
Filename: PD/ArmSi/!ArmSI/h/dhry
Read OK:
File size: 4876 bytes
Load address: 0000
Exec address: 0000
File contents
/*
 ****************************************************************************
 *
 *                   "DHRYSTONE" Benchmark Program
 *                   -----------------------------
 *                                                                            
 *  Version:    C, Version 2.1
 *                                                                            
 *  File:       dhry.h (part 1 of 3)
 *
 *  Date:       May 25, 1988
 *
 *  Author:     Reinhold P. Weicker
 *                      Siemens AG, E STE 35
 *                      Postfach 3240
 *                      8520 Erlangen
 *                      Germany (West)
 *                              Phone:  [xxx-49]-9131-7-20330
 *                                      (8-17 Central European Time)
 *                              Usenet: ..!mcvax!unido!estevax!weicker
 *
 *              Original Version (in Ada) published in
 *              "Communications of the ACM" vol. 27., no. 10 (Oct. 1984),
 *              pp. 1013 - 1030, together with the statistics
 *              on which the distribution of statements etc. is based.
 *
 *              In this C version, the following C library functions are used:
 *              - strcpy, strcmp (inside the measurement loop)
 *              - printf, scanf (outside the measurement loop)
 *              In addition, Berkeley UNIX system calls "times ()" or "time ()"
 *              are used for execution time measurement. For measurements
 *              on other systems, these calls have to be changed.
 *
 *  Collection of Results:
 *              Reinhold Weicker (address see above) and
 *              
 *              Rick Richardson
 *              PC Research. Inc.
 *              94 Apple Orchard Drive
 *              Tinton Falls, NJ 07724
 *                      Phone:  (201) 389-8963 (9-17 EST)               
 *                      Usenet: ...!uunet!pcrat!rick
 *
 *      Please send results to Rick Richardson and/or Reinhold Weicker.
 *      Complete information should be given on hardware and software used.
 *      Hardware information includes: Machine type, CPU, type and size
 *      of caches; for microprocessors: clock frequency, memory speed
 *      (number of wait states).
 *      Software information includes: Compiler (and runtime library)
 *      manufacturer and version, compilation switches, OS version.
 *      The Operating System version may give an indication about the
 *      compiler; Dhrystone itself performs no OS calls in the measurement loop.
 *
 *      The complete output generated by the program should be mailed
 *      such that at least some checks for correctness can be made.
 *
 ***************************************************************************
 *
 *  History:    This version C/2.1 has been made for two reasons:
 *
 *              1) There is an obvious need for a common C version of
 *              Dhrystone, since C is at present the most popular system
 *              programming language for the class of processors
 *              (microcomputers, minicomputers) where Dhrystone is used most.
 *              There should be, as far as possible, only one C version of
 *              Dhrystone such that results can be compared without
 *              restrictions. In the past, the C versions distributed
 *              by Rick Richardson (Version 1.1) and by Reinhold Weicker
 *              had small (though not significant) differences.
 *
 *              2) As far as it is possible without changes to the Dhrystone
 *              statistics, optimizing compilers should be prevented from
 *              removing significant statements.
 *
 *              This C version has been developed in cooperation with
 *              Rick Richardson (Tinton Falls, NJ), it incorporates many
 *              ideas from the "Version 1.1" distributed previously by
 *              him over the UNIX network Usenet.
 *              I also thank Chaim Benedelac (National Semiconductor),
 *              David Ditzel (SUN), Earl Killian and John Mashey (MIPS),
 *              Alan Smith and Rafael Saavedra-Barrera (UC at Berkeley)
 *              for their help with comments on earlier versions of the
 *              benchmark.
 *
 *  Changes:    In the initialization part, this version follows mostly
 *              Rick Richardson's version distributed via Usenet, not the
 *              version distributed earlier via floppy disk by Reinhold Weicker.
 *              As a concession to older compilers, names have been made
 *              unique within the first 8 characters.
 *              Inside the measurement loop, this version follows the
 *              version previously distributed by Reinhold Weicker.
 *
 *              At several places in the benchmark, code has been added,
 *              but within the measurement loop only in branches that 
 *              are not executed. The intention is that optimizing compilers
 *              should be prevented from moving code out of the measurement
 *              loop, or from removing code altogether. Since the statements
 *              that are executed within the measurement loop have NOT been
 *              changed, the numbers defining the "Dhrystone distribution"
 *              (distribution of statements, operand types and locality)
 *              still hold. Except for sophisticated optimizing compilers,
 *              execution times for this version should be the same as
 *              for previous versions.
 *              
 *              Since it has proven difficult to subtract the time for the
 *              measurement loop overhead in a correct way, the loop check
 *              has been made a part of the benchmark. This does have
 *              an impact - though a very minor one - on the distribution
 *              statistics which have been updated for this version.
 *
 *              All changes within the measurement loop are described
 *              and discussed in the companion paper "Rationale for
 *              Dhrystone version 2".
 *
 *              Because of the self-imposed limitation that the order and
 *              distribution of the executed statements should not be
 *              changed, there are still cases where optimizing compilers
 *              may not generate code for some statements. To a certain
 *              degree, this is unavoidable for small synthetic benchmarks.
 *              Users of the benchmark are advised to check code listings
 *              whether code is generated for all statements of Dhrystone.
 *
 *              Version 2.1 is identical to version 2.0 distributed via
 *              the UNIX network Usenet in March 1988 except that it corrects
 *              some minor deficiencies that were found by users of version 2.0.
 *              The only change within the measurement loop is that a
 *              non-executed "else" part was added to the "if" statement in
 *              Func_3, and a non-executed "else" part removed from Proc_3.
 *
 ***************************************************************************
 *
 * Defines:     The following "Defines" are possible:
 *              -DREG=register          (default: Not defined)
 *                      As an approximation to what an average C programmer
 *                      might do, the "register" storage class is applied
 *                      (if enabled by -DREG=register)
 *                      - for local variables, if they are used (dynamically)
 *                        five or more times
 *                      - for parameters if they are used (dynamically)
 *                        six or more times
 *                      Note that an optimal "register" strategy is
 *                      compiler-dependent, and that "register" declarations
 *                      do not necessarily lead to faster execution.
 *              -DNOSTRUCTASSIGN        (default: Not defined)
 *                      Define if the C compiler does not support
 *                      assignment of structures.
 *              -DNOENUMS               (default: Not defined)
 *                      Define if the C compiler does not support
 *                      enumeration types.
 *              -DTIMES                 (default)
 *              -DTIME
 *                      The "times" function of UNIX (returning process times)
 *                      or the "time" function (returning wallclock time)
 *                      is used for measurement. 
 *                      For single user machines, "time ()" is adequate. For
 *                      multi-user machines where you cannot get single-user
 *                      access, use the "times ()" function. If you have
 *                      neither, use a stopwatch in the dead of night.
 *                      "printf"s are provided marking the points "Start Timer"
 *                      and "Stop Timer". DO NOT use the UNIX "time(1)"
 *                      command, as this will measure the total time to
 *                      run this program, which will (erroneously) include
 *                      the time to allocate storage (malloc) and to perform
 *                      the initialization.
 *              -DHZ=nnn
 *                      In Berkeley UNIX, the function "times" returns process
 *                      time in 1/HZ seconds, with HZ = 60 for most systems.
 *                      CHECK YOUR SYSTEM DESCRIPTION BEFORE YOU JUST APPLY
 *                      A VALUE.
 *
 ***************************************************************************
 *
 *  Compilation model and measurement (IMPORTANT):
 *
 *  This C version of Dhrystone consists of three files:
 *  - dhry.h (this file, containing global definitions and comments)
 *  - dhry_1.c (containing the code corresponding to Ada package Pack_1)
 *  - dhry_2.c (containing the code corresponding to Ada package Pack_2)
 *
 *  The following "ground rules" apply for measurements:
 *  - Separate compilation
 *  - No procedure merging
 *  - Otherwise, compiler optimizations are allowed but should be indicated
 *  - Default results are those without register declarations
 *  See the companion paper "Rationale for Dhrystone Version 2" for a more
 *  detailed discussion of these ground rules.
 *
 *  For 16-Bit processors (e.g. 80186, 80286), times for all compilation
 *  models ("small", "medium", "large" etc.) should be given if possible,
 *  together with a definition of these models for the compiler system used.
 *
 **************************************************************************
 *
 *  Dhrystone (C version) statistics:
 *
 *  [Comment from the first distribution, updated for version 2.
 *   Note that because of language differences, the numbers are slightly
 *   different from the Ada version.]
 *
 *  The following program contains statements of a high level programming
 *  language (here: C) in a distribution considered representative:           
 *
 *    assignments                  52 (51.0 %)
 *    control statements           33 (32.4 %)
 *    procedure, function calls    17 (16.7 %)
 *
 *  103 statements are dynamically executed. The program is balanced with
 *  respect to the three aspects:                                             
 *
 *    - statement type
 *    - operand type
 *    - operand locality
 *         operand global, local, parameter, or constant.                     
 *
 *  The combination of these three aspects is balanced only approximately.    
 *
 *  1. Statement Type:                                                        
 *  -----------------             number
 *
 *     V1 = V2                     9
 *       (incl. V1 = F(..)
 *     V = Constant               12
 *     Assignment,                 7
 *       with array element
 *     Assignment,                 6
 *       with record component
 *                                --
 *                                34       34
 *
 *     X = Y +|-|"&&"|"|" Z        5
 *     X = Y +|-|"==" Constant     6
 *     X = X +|- 1                 3
 *     X = Y *|/ Z                 2
 *     X = Expression,             1
 *           two operators
 *     X = Expression,             1
 *           three operators
 *                                --
 *                                18       18
 *
 *     if ....                    14
 *       with "else"      7
 *       without "else"   7
 *           executed        3
 *           not executed    4
 *     for ...                     7  |  counted every time
 *     while ...                   4  |  the loop condition
 *     do ... while                1  |  is evaluated
 *     switch ...                  1
 *     break                       1
 *     declaration with            1
 *       initialization
 *                                --
 *                                34       34
 *
 *     P (...)  procedure call    11
 *       user procedure      10
 *       library procedure    1
 *     X = F (...)
 *             function  call      6
 *       user function        5                                         
 *       library function     1                                               
 *                                --                                          
 *                                17       17
 *                                        ---
 *                                        103
 *
 *    The average number of parameters in procedure or function calls
 *    is 1.82 (not counting the function values aX *
 *
 *  2. Operators
 *  ------------
 *                          number    approximate
 *                                    percentage
 *
 *    Arithmetic             32          50.8                                 
 *
 *       +                     21          33.3                              
 *       -                      7          11.1                              
 *       *                      3           4.8
 *       / (int div)            1           1.6
 *
 *    Comparison             27           42.8
 *
 *       ==                     9           14.3
 *       /=                     4            6.3
 *       >                      1            1.6
 *       <                      3            4.8
 *       >=                     1            1.6
 *       <=                     9           14.3
 *
 *    Logic                   4            6.3
 *
 *       && (AND-THEN)          1            1.6
 *       |  (OR)                1            1.6
 *       !  (NOT)               2            3.2
 * 
 *                           --          -----
 *                           63          100.1
 *
 *
 *  3. Operand Type (counted once per operand reference):
 *  ---------------
 *                          number    approximate
 *                                    percentage
 *
 *     Integer               175        72.3 %
 *     Character              45        18.6 %
 *     Pointer                12         5.0 %
 *     String30                6         2.5 %
 *     Array                   2         0.8 %
 *     Record                  2         0.8 %
 *                           ---       -------
 *                           242       100.0 %
 *
 *  When there is an access path leading to the final operand (e.g. a record
 *  component), only the final data type on the access path is counted.       
 *
 *
 *  4. Operand Locality:                                                      
 *  -------------------
 *                                number    approximate
 *                                          percentage
 *
 *     local variable              114        47.1 %
 *     global variable              22         9.1 %
 *     parameter                    45        18.6 %
 *        value                        23         9.5 %
 *        reference                    22         9.1 %
 *     function result               6         2.5 %
 *     constant                     55        22.7 %
 *                                 ---       -------
 *                                 242       100.0 %
 *
 *
 *  The program does not compute anything meaningful, but it is syntactically
 *  and semantically correct. All variables have a value assigned to them
 *  before they are used as a source operand.
 *
 *  There has been no explicit effort to account for the effects of a
 *  cache, or to balance the use of long or short displacements for code or
 *  data.
 *
 ***************************************************************************
 */

/* Compiler and system dependent definitions: */

#ifndef TIME
#undef TIMES
#define TIMES
#endif
                /* Use times(2) time function unless    */
                /* explicitly defined otherwise         */

#ifdef MSC_CLOCK
#undef HZ
#undef TIMES
#include <time.h>
#define HZ     CLK_TCK
#endif
               /* Use Microsoft C hi-res clock */

#ifdef TIMES
#include <sys/types.h>
#include <sys/times.h>
                /* for "times" */
#endif

#define Mic_secs_Per_Second     1000000.0
                /* Berkeley UNIX C returns process times in seconds/HZ */

#ifdef  NOSTRUCTASSIGN
#define structassign(d, s)      memcpy(&(d), &(s), sizeof(d))
#else
#define structassign(d, s)      d = s
#endif

#ifdef  NOENUM
#define Ident_1 0
#define Ident_2 1
#define Ident_3 2
#define Ident_4 3
#define Ident_5 4
  typedef int   Enumeration;
#else
  typedef       enum    {Ident_1, Ident_2, Ident_3, Ident_4, Ident_5}
                Enumeration;
#endif
        /* for boolean and enumeration types in Ada, Pascal */

/* General definitions: */

#include <stdio.h>
                /* for strcpy, strcmp */

#define Null 0 
                /* Value of a Null pointer */
#define true  1
#define false 0

typedef int     One_Thirty;
typedef int     One_Fifty;
typedef char    Capital_Letter;
typedef int     Boolean;
typedef char    Str_30 [31];
typedef int     Arr_1_Dim [50];
typedef int     Arr_2_Dim [50] [50];

typedef struct record 
    {
    struct record *Ptr_Comp;
    Enumeration    Discr;
    union {
          struct {
                  Enumeration Enum_Comp;
                  int         Int_Comp;
                  char        Str_Comp [31];
                  } var_1;
          struct {
                  Enumeration E_Comp_2;
                  char        Str_2_Comp [31];
                  } var_2;
          struct {
                  char        Ch_1_Comp;
                  char        Ch_2_Comp;
                  } var_3;
          } variant;
      } Rec_Type, *Rec_Pointer;


00000000  2f 2a 0a 20 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |/*. ************|
00000010  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000050  0a 20 2a 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |. *. *          |
00000060  20 20 20 20 20 20 20 20  20 22 44 48 52 59 53 54  |         "DHRYST|
00000070  4f 4e 45 22 20 42 65 6e  63 68 6d 61 72 6b 20 50  |ONE" Benchmark P|
00000080  72 6f 67 72 61 6d 0a 20  2a 20 20 20 20 20 20 20  |rogram. *       |
00000090  20 20 20 20 20 20 20 20  20 20 20 20 2d 2d 2d 2d  |            ----|
000000a0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000000b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 0a 20 2a 20 20 20 20  |---------. *    |
000000c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000100  20 20 20 20 20 20 20 20  0a 20 2a 20 20 56 65 72  |        . *  Ver|
00000110  73 69 6f 6e 3a 20 20 20  20 43 2c 20 56 65 72 73  |sion:    C, Vers|
00000120  69 6f 6e 20 32 2e 31 0a  20 2a 20 20 20 20 20 20  |ion 2.1. *      |
00000130  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000170  20 20 20 20 20 20 0a 20  2a 20 20 46 69 6c 65 3a  |      . *  File:|
00000180  20 20 20 20 20 20 20 64  68 72 79 2e 68 20 28 70  |       dhry.h (p|
00000190  61 72 74 20 31 20 6f 66  20 33 29 0a 20 2a 0a 20  |art 1 of 3). *. |
000001a0  2a 20 20 44 61 74 65 3a  20 20 20 20 20 20 20 4d  |*  Date:       M|
000001b0  61 79 20 32 35 2c 20 31  39 38 38 0a 20 2a 0a 20  |ay 25, 1988. *. |
000001c0  2a 20 20 41 75 74 68 6f  72 3a 20 20 20 20 20 52  |*  Author:     R|
000001d0  65 69 6e 68 6f 6c 64 20  50 2e 20 57 65 69 63 6b  |einhold P. Weick|
000001e0  65 72 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |er. *           |
000001f0  20 20 20 20 20 20 20 20  20 20 20 53 69 65 6d 65  |           Sieme|
00000200  6e 73 20 41 47 2c 20 45  20 53 54 45 20 33 35 0a  |ns AG, E STE 35.|
00000210  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
00000220  20 20 20 20 20 20 20 20  50 6f 73 74 66 61 63 68  |        Postfach|
00000230  20 33 32 34 30 0a 20 2a  20 20 20 20 20 20 20 20  | 3240. *        |
00000240  20 20 20 20 20 20 20 20  20 20 20 20 20 20 38 35  |              85|
00000250  32 30 20 45 72 6c 61 6e  67 65 6e 0a 20 2a 20 20  |20 Erlangen. *  |
00000260  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000270  20 20 20 20 47 65 72 6d  61 6e 79 20 28 57 65 73  |    Germany (Wes|
00000280  74 29 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |t). *           |
00000290  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000002a0  20 20 20 50 68 6f 6e 65  3a 20 20 5b 78 78 78 2d  |   Phone:  [xxx-|
000002b0  34 39 5d 2d 39 31 33 31  2d 37 2d 32 30 33 33 30  |49]-9131-7-20330|
000002c0  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |. *             |
000002d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000002e0  20 20 20 20 20 20 20 20  20 28 38 2d 31 37 20 43  |         (8-17 C|
000002f0  65 6e 74 72 61 6c 20 45  75 72 6f 70 65 61 6e 20  |entral European |
00000300  54 69 6d 65 29 0a 20 2a  20 20 20 20 20 20 20 20  |Time). *        |
00000310  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000320  20 20 20 20 20 20 55 73  65 6e 65 74 3a 20 2e 2e  |      Usenet: ..|
00000330  21 6d 63 76 61 78 21 75  6e 69 64 6f 21 65 73 74  |!mcvax!unido!est|
00000340  65 76 61 78 21 77 65 69  63 6b 65 72 0a 20 2a 0a  |evax!weicker. *.|
00000350  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
00000360  4f 72 69 67 69 6e 61 6c  20 56 65 72 73 69 6f 6e  |Original Version|
00000370  20 28 69 6e 20 41 64 61  29 20 70 75 62 6c 69 73  | (in Ada) publis|
00000380  68 65 64 20 69 6e 0a 20  2a 20 20 20 20 20 20 20  |hed in. *       |
00000390  20 20 20 20 20 20 20 22  43 6f 6d 6d 75 6e 69 63  |       "Communic|
000003a0  61 74 69 6f 6e 73 20 6f  66 20 74 68 65 20 41 43  |ations of the AC|
000003b0  4d 22 20 76 6f 6c 2e 20  32 37 2e 2c 20 6e 6f 2e  |M" vol. 27., no.|
000003c0  20 31 30 20 28 4f 63 74  2e 20 31 39 38 34 29 2c  | 10 (Oct. 1984),|
000003d0  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |. *             |
000003e0  20 70 70 2e 20 31 30 31  33 20 2d 20 31 30 33 30  | pp. 1013 - 1030|
000003f0  2c 20 74 6f 67 65 74 68  65 72 20 77 69 74 68 20  |, together with |
00000400  74 68 65 20 73 74 61 74  69 73 74 69 63 73 0a 20  |the statistics. |
00000410  2a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 6f  |*              o|
00000420  6e 20 77 68 69 63 68 20  74 68 65 20 64 69 73 74  |n which the dist|
00000430  72 69 62 75 74 69 6f 6e  20 6f 66 20 73 74 61 74  |ribution of stat|
00000440  65 6d 65 6e 74 73 20 65  74 63 2e 20 69 73 20 62  |ements etc. is b|
00000450  61 73 65 64 2e 0a 20 2a  0a 20 2a 20 20 20 20 20  |ased.. *. *     |
00000460  20 20 20 20 20 20 20 20  20 49 6e 20 74 68 69 73  |         In this|
00000470  20 43 20 76 65 72 73 69  6f 6e 2c 20 74 68 65 20  | C version, the |
00000480  66 6f 6c 6c 6f 77 69 6e  67 20 43 20 6c 69 62 72  |following C libr|
00000490  61 72 79 20 66 75 6e 63  74 69 6f 6e 73 20 61 72  |ary functions ar|
000004a0  65 20 75 73 65 64 3a 0a  20 2a 20 20 20 20 20 20  |e used:. *      |
000004b0  20 20 20 20 20 20 20 20  2d 20 73 74 72 63 70 79  |        - strcpy|
000004c0  2c 20 73 74 72 63 6d 70  20 28 69 6e 73 69 64 65  |, strcmp (inside|
000004d0  20 74 68 65 20 6d 65 61  73 75 72 65 6d 65 6e 74  | the measurement|
000004e0  20 6c 6f 6f 70 29 0a 20  2a 20 20 20 20 20 20 20  | loop). *       |
000004f0  20 20 20 20 20 20 20 2d  20 70 72 69 6e 74 66 2c  |       - printf,|
00000500  20 73 63 61 6e 66 20 28  6f 75 74 73 69 64 65 20  | scanf (outside |
00000510  74 68 65 20 6d 65 61 73  75 72 65 6d 65 6e 74 20  |the measurement |
00000520  6c 6f 6f 70 29 0a 20 2a  20 20 20 20 20 20 20 20  |loop). *        |
00000530  20 20 20 20 20 20 49 6e  20 61 64 64 69 74 69 6f  |      In additio|
00000540  6e 2c 20 42 65 72 6b 65  6c 65 79 20 55 4e 49 58  |n, Berkeley UNIX|
00000550  20 73 79 73 74 65 6d 20  63 61 6c 6c 73 20 22 74  | system calls "t|
00000560  69 6d 65 73 20 28 29 22  20 6f 72 20 22 74 69 6d  |imes ()" or "tim|
00000570  65 20 28 29 22 0a 20 2a  20 20 20 20 20 20 20 20  |e ()". *        |
00000580  20 20 20 20 20 20 61 72  65 20 75 73 65 64 20 66  |      are used f|
00000590  6f 72 20 65 78 65 63 75  74 69 6f 6e 20 74 69 6d  |or execution tim|
000005a0  65 20 6d 65 61 73 75 72  65 6d 65 6e 74 2e 20 46  |e measurement. F|
000005b0  6f 72 20 6d 65 61 73 75  72 65 6d 65 6e 74 73 0a  |or measurements.|
000005c0  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
000005d0  6f 6e 20 6f 74 68 65 72  20 73 79 73 74 65 6d 73  |on other systems|
000005e0  2c 20 74 68 65 73 65 20  63 61 6c 6c 73 20 68 61  |, these calls ha|
000005f0  76 65 20 74 6f 20 62 65  20 63 68 61 6e 67 65 64  |ve to be changed|
00000600  2e 0a 20 2a 0a 20 2a 20  20 43 6f 6c 6c 65 63 74  |.. *. *  Collect|
00000610  69 6f 6e 20 6f 66 20 52  65 73 75 6c 74 73 3a 0a  |ion of Results:.|
00000620  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
00000630  52 65 69 6e 68 6f 6c 64  20 57 65 69 63 6b 65 72  |Reinhold Weicker|
00000640  20 28 61 64 64 72 65 73  73 20 73 65 65 20 61 62  | (address see ab|
00000650  6f 76 65 29 20 61 6e 64  0a 20 2a 20 20 20 20 20  |ove) and. *     |
00000660  20 20 20 20 20 20 20 20  20 0a 20 2a 20 20 20 20  |         . *    |
00000670  20 20 20 20 20 20 20 20  20 20 52 69 63 6b 20 52  |          Rick R|
00000680  69 63 68 61 72 64 73 6f  6e 0a 20 2a 20 20 20 20  |ichardson. *    |
00000690  20 20 20 20 20 20 20 20  20 20 50 43 20 52 65 73  |          PC Res|
000006a0  65 61 72 63 68 2e 20 49  6e 63 2e 0a 20 2a 20 20  |earch. Inc.. *  |
000006b0  20 20 20 20 20 20 20 20  20 20 20 20 39 34 20 41  |            94 A|
000006c0  70 70 6c 65 20 4f 72 63  68 61 72 64 20 44 72 69  |pple Orchard Dri|
000006d0  76 65 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |ve. *           |
000006e0  20 20 20 54 69 6e 74 6f  6e 20 46 61 6c 6c 73 2c  |   Tinton Falls,|
000006f0  20 4e 4a 20 30 37 37 32  34 0a 20 2a 20 20 20 20  | NJ 07724. *    |
00000700  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000710  20 20 50 68 6f 6e 65 3a  20 20 28 32 30 31 29 20  |  Phone:  (201) |
00000720  33 38 39 2d 38 39 36 33  20 28 39 2d 31 37 20 45  |389-8963 (9-17 E|
00000730  53 54 29 20 20 20 20 20  20 20 20 20 20 20 20 20  |ST)             |
00000740  20 20 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |  . *           |
00000750  20 20 20 20 20 20 20 20  20 20 20 55 73 65 6e 65  |           Usene|
00000760  74 3a 20 2e 2e 2e 21 75  75 6e 65 74 21 70 63 72  |t: ...!uunet!pcr|
00000770  61 74 21 72 69 63 6b 0a  20 2a 0a 20 2a 20 20 20  |at!rick. *. *   |
00000780  20 20 20 50 6c 65 61 73  65 20 73 65 6e 64 20 72  |   Please send r|
00000790  65 73 75 6c 74 73 20 74  6f 20 52 69 63 6b 20 52  |esults to Rick R|
000007a0  69 63 68 61 72 64 73 6f  6e 20 61 6e 64 2f 6f 72  |ichardson and/or|
000007b0  20 52 65 69 6e 68 6f 6c  64 20 57 65 69 63 6b 65  | Reinhold Weicke|
000007c0  72 2e 0a 20 2a 20 20 20  20 20 20 43 6f 6d 70 6c  |r.. *      Compl|
000007d0  65 74 65 20 69 6e 66 6f  72 6d 61 74 69 6f 6e 20  |ete information |
000007e0  73 68 6f 75 6c 64 20 62  65 20 67 69 76 65 6e 20  |should be given |
000007f0  6f 6e 20 68 61 72 64 77  61 72 65 20 61 6e 64 20  |on hardware and |
00000800  73 6f 66 74 77 61 72 65  20 75 73 65 64 2e 0a 20  |software used.. |
00000810  2a 20 20 20 20 20 20 48  61 72 64 77 61 72 65 20  |*      Hardware |
00000820  69 6e 66 6f 72 6d 61 74  69 6f 6e 20 69 6e 63 6c  |information incl|
00000830  75 64 65 73 3a 20 4d 61  63 68 69 6e 65 20 74 79  |udes: Machine ty|
00000840  70 65 2c 20 43 50 55 2c  20 74 79 70 65 20 61 6e  |pe, CPU, type an|
00000850  64 20 73 69 7a 65 0a 20  2a 20 20 20 20 20 20 6f  |d size. *      o|
00000860  66 20 63 61 63 68 65 73  3b 20 66 6f 72 20 6d 69  |f caches; for mi|
00000870  63 72 6f 70 72 6f 63 65  73 73 6f 72 73 3a 20 63  |croprocessors: c|
00000880  6c 6f 63 6b 20 66 72 65  71 75 65 6e 63 79 2c 20  |lock frequency, |
00000890  6d 65 6d 6f 72 79 20 73  70 65 65 64 0a 20 2a 20  |memory speed. * |
000008a0  20 20 20 20 20 28 6e 75  6d 62 65 72 20 6f 66 20  |     (number of |
000008b0  77 61 69 74 20 73 74 61  74 65 73 29 2e 0a 20 2a  |wait states).. *|
000008c0  20 20 20 20 20 20 53 6f  66 74 77 61 72 65 20 69  |      Software i|
000008d0  6e 66 6f 72 6d 61 74 69  6f 6e 20 69 6e 63 6c 75  |nformation inclu|
000008e0  64 65 73 3a 20 43 6f 6d  70 69 6c 65 72 20 28 61  |des: Compiler (a|
000008f0  6e 64 20 72 75 6e 74 69  6d 65 20 6c 69 62 72 61  |nd runtime libra|
00000900  72 79 29 0a 20 2a 20 20  20 20 20 20 6d 61 6e 75  |ry). *      manu|
00000910  66 61 63 74 75 72 65 72  20 61 6e 64 20 76 65 72  |facturer and ver|
00000920  73 69 6f 6e 2c 20 63 6f  6d 70 69 6c 61 74 69 6f  |sion, compilatio|
00000930  6e 20 73 77 69 74 63 68  65 73 2c 20 4f 53 20 76  |n switches, OS v|
00000940  65 72 73 69 6f 6e 2e 0a  20 2a 20 20 20 20 20 20  |ersion.. *      |
00000950  54 68 65 20 4f 70 65 72  61 74 69 6e 67 20 53 79  |The Operating Sy|
00000960  73 74 65 6d 20 76 65 72  73 69 6f 6e 20 6d 61 79  |stem version may|
00000970  20 67 69 76 65 20 61 6e  20 69 6e 64 69 63 61 74  | give an indicat|
00000980  69 6f 6e 20 61 62 6f 75  74 20 74 68 65 0a 20 2a  |ion about the. *|
00000990  20 20 20 20 20 20 63 6f  6d 70 69 6c 65 72 3b 20  |      compiler; |
000009a0  44 68 72 79 73 74 6f 6e  65 20 69 74 73 65 6c 66  |Dhrystone itself|
000009b0  20 70 65 72 66 6f 72 6d  73 20 6e 6f 20 4f 53 20  | performs no OS |
000009c0  63 61 6c 6c 73 20 69 6e  20 74 68 65 20 6d 65 61  |calls in the mea|
000009d0  73 75 72 65 6d 65 6e 74  20 6c 6f 6f 70 2e 0a 20  |surement loop.. |
000009e0  2a 0a 20 2a 20 20 20 20  20 20 54 68 65 20 63 6f  |*. *      The co|
000009f0  6d 70 6c 65 74 65 20 6f  75 74 70 75 74 20 67 65  |mplete output ge|
00000a00  6e 65 72 61 74 65 64 20  62 79 20 74 68 65 20 70  |nerated by the p|
00000a10  72 6f 67 72 61 6d 20 73  68 6f 75 6c 64 20 62 65  |rogram should be|
00000a20  20 6d 61 69 6c 65 64 0a  20 2a 20 20 20 20 20 20  | mailed. *      |
00000a30  73 75 63 68 20 74 68 61  74 20 61 74 20 6c 65 61  |such that at lea|
00000a40  73 74 20 73 6f 6d 65 20  63 68 65 63 6b 73 20 66  |st some checks f|
00000a50  6f 72 20 63 6f 72 72 65  63 74 6e 65 73 73 20 63  |or correctness c|
00000a60  61 6e 20 62 65 20 6d 61  64 65 2e 0a 20 2a 0a 20  |an be made.. *. |
00000a70  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00000ab0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0a 20 2a 0a 20  |***********. *. |
00000ac0  2a 20 20 48 69 73 74 6f  72 79 3a 20 20 20 20 54  |*  History:    T|
00000ad0  68 69 73 20 76 65 72 73  69 6f 6e 20 43 2f 32 2e  |his version C/2.|
00000ae0  31 20 68 61 73 20 62 65  65 6e 20 6d 61 64 65 20  |1 has been made |
00000af0  66 6f 72 20 74 77 6f 20  72 65 61 73 6f 6e 73 3a  |for two reasons:|
00000b00  0a 20 2a 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |. *. *          |
00000b10  20 20 20 20 31 29 20 54  68 65 72 65 20 69 73 20  |    1) There is |
00000b20  61 6e 20 6f 62 76 69 6f  75 73 20 6e 65 65 64 20  |an obvious need |
00000b30  66 6f 72 20 61 20 63 6f  6d 6d 6f 6e 20 43 20 76  |for a common C v|
00000b40  65 72 73 69 6f 6e 20 6f  66 0a 20 2a 20 20 20 20  |ersion of. *    |
00000b50  20 20 20 20 20 20 20 20  20 20 44 68 72 79 73 74  |          Dhryst|
00000b60  6f 6e 65 2c 20 73 69 6e  63 65 20 43 20 69 73 20  |one, since C is |
00000b70  61 74 20 70 72 65 73 65  6e 74 20 74 68 65 20 6d  |at present the m|
00000b80  6f 73 74 20 70 6f 70 75  6c 61 72 20 73 79 73 74  |ost popular syst|
00000b90  65 6d 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |em. *           |
00000ba0  20 20 20 70 72 6f 67 72  61 6d 6d 69 6e 67 20 6c  |   programming l|
00000bb0  61 6e 67 75 61 67 65 20  66 6f 72 20 74 68 65 20  |anguage for the |
00000bc0  63 6c 61 73 73 20 6f 66  20 70 72 6f 63 65 73 73  |class of process|
00000bd0  6f 72 73 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |ors. *          |
00000be0  20 20 20 20 28 6d 69 63  72 6f 63 6f 6d 70 75 74  |    (microcomput|
00000bf0  65 72 73 2c 20 6d 69 6e  69 63 6f 6d 70 75 74 65  |ers, minicompute|
00000c00  72 73 29 20 77 68 65 72  65 20 44 68 72 79 73 74  |rs) where Dhryst|
00000c10  6f 6e 65 20 69 73 20 75  73 65 64 20 6d 6f 73 74  |one is used most|
00000c20  2e 0a 20 2a 20 20 20 20  20 20 20 20 20 20 20 20  |.. *            |
00000c30  20 20 54 68 65 72 65 20  73 68 6f 75 6c 64 20 62  |  There should b|
00000c40  65 2c 20 61 73 20 66 61  72 20 61 73 20 70 6f 73  |e, as far as pos|
00000c50  73 69 62 6c 65 2c 20 6f  6e 6c 79 20 6f 6e 65 20  |sible, only one |
00000c60  43 20 76 65 72 73 69 6f  6e 20 6f 66 0a 20 2a 20  |C version of. * |
00000c70  20 20 20 20 20 20 20 20  20 20 20 20 20 44 68 72  |             Dhr|
00000c80  79 73 74 6f 6e 65 20 73  75 63 68 20 74 68 61 74  |ystone such that|
00000c90  20 72 65 73 75 6c 74 73  20 63 61 6e 20 62 65 20  | results can be |
00000ca0  63 6f 6d 70 61 72 65 64  20 77 69 74 68 6f 75 74  |compared without|
00000cb0  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |. *             |
00000cc0  20 72 65 73 74 72 69 63  74 69 6f 6e 73 2e 20 49  | restrictions. I|
00000cd0  6e 20 74 68 65 20 70 61  73 74 2c 20 74 68 65 20  |n the past, the |
00000ce0  43 20 76 65 72 73 69 6f  6e 73 20 64 69 73 74 72  |C versions distr|
00000cf0  69 62 75 74 65 64 0a 20  2a 20 20 20 20 20 20 20  |ibuted. *       |
00000d00  20 20 20 20 20 20 20 62  79 20 52 69 63 6b 20 52  |       by Rick R|
00000d10  69 63 68 61 72 64 73 6f  6e 20 28 56 65 72 73 69  |ichardson (Versi|
00000d20  6f 6e 20 31 2e 31 29 20  61 6e 64 20 62 79 20 52  |on 1.1) and by R|
00000d30  65 69 6e 68 6f 6c 64 20  57 65 69 63 6b 65 72 0a  |einhold Weicker.|
00000d40  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
00000d50  68 61 64 20 73 6d 61 6c  6c 20 28 74 68 6f 75 67  |had small (thoug|
00000d60  68 20 6e 6f 74 20 73 69  67 6e 69 66 69 63 61 6e  |h not significan|
00000d70  74 29 20 64 69 66 66 65  72 65 6e 63 65 73 2e 0a  |t) differences..|
00000d80  20 2a 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  | *. *           |
00000d90  20 20 20 32 29 20 41 73  20 66 61 72 20 61 73 20  |   2) As far as |
00000da0  69 74 20 69 73 20 70 6f  73 73 69 62 6c 65 20 77  |it is possible w|
00000db0  69 74 68 6f 75 74 20 63  68 61 6e 67 65 73 20 74  |ithout changes t|
00000dc0  6f 20 74 68 65 20 44 68  72 79 73 74 6f 6e 65 0a  |o the Dhrystone.|
00000dd0  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
00000de0  73 74 61 74 69 73 74 69  63 73 2c 20 6f 70 74 69  |statistics, opti|
00000df0  6d 69 7a 69 6e 67 20 63  6f 6d 70 69 6c 65 72 73  |mizing compilers|
00000e00  20 73 68 6f 75 6c 64 20  62 65 20 70 72 65 76 65  | should be preve|
00000e10  6e 74 65 64 20 66 72 6f  6d 0a 20 2a 20 20 20 20  |nted from. *    |
00000e20  20 20 20 20 20 20 20 20  20 20 72 65 6d 6f 76 69  |          removi|
00000e30  6e 67 20 73 69 67 6e 69  66 69 63 61 6e 74 20 73  |ng significant s|
00000e40  74 61 74 65 6d 65 6e 74  73 2e 0a 20 2a 0a 20 2a  |tatements.. *. *|
00000e50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 54 68  |              Th|
00000e60  69 73 20 43 20 76 65 72  73 69 6f 6e 20 68 61 73  |is C version has|
00000e70  20 62 65 65 6e 20 64 65  76 65 6c 6f 70 65 64 20  | been developed |
00000e80  69 6e 20 63 6f 6f 70 65  72 61 74 69 6f 6e 20 77  |in cooperation w|
00000e90  69 74 68 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |ith. *          |
00000ea0  20 20 20 20 52 69 63 6b  20 52 69 63 68 61 72 64  |    Rick Richard|
00000eb0  73 6f 6e 20 28 54 69 6e  74 6f 6e 20 46 61 6c 6c  |son (Tinton Fall|
00000ec0  73 2c 20 4e 4a 29 2c 20  69 74 20 69 6e 63 6f 72  |s, NJ), it incor|
00000ed0  70 6f 72 61 74 65 73 20  6d 61 6e 79 0a 20 2a 20  |porates many. * |
00000ee0  20 20 20 20 20 20 20 20  20 20 20 20 20 69 64 65  |             ide|
00000ef0  61 73 20 66 72 6f 6d 20  74 68 65 20 22 56 65 72  |as from the "Ver|
00000f00  73 69 6f 6e 20 31 2e 31  22 20 64 69 73 74 72 69  |sion 1.1" distri|
00000f10  62 75 74 65 64 20 70 72  65 76 69 6f 75 73 6c 79  |buted previously|
00000f20  20 62 79 0a 20 2a 20 20  20 20 20 20 20 20 20 20  | by. *          |
00000f30  20 20 20 20 68 69 6d 20  6f 76 65 72 20 74 68 65  |    him over the|
00000f40  20 55 4e 49 58 20 6e 65  74 77 6f 72 6b 20 55 73  | UNIX network Us|
00000f50  65 6e 65 74 2e 0a 20 2a  20 20 20 20 20 20 20 20  |enet.. *        |
00000f60  20 20 20 20 20 20 49 20  61 6c 73 6f 20 74 68 61  |      I also tha|
00000f70  6e 6b 20 43 68 61 69 6d  20 42 65 6e 65 64 65 6c  |nk Chaim Benedel|
00000f80  61 63 20 28 4e 61 74 69  6f 6e 61 6c 20 53 65 6d  |ac (National Sem|
00000f90  69 63 6f 6e 64 75 63 74  6f 72 29 2c 0a 20 2a 20  |iconductor),. * |
00000fa0  20 20 20 20 20 20 20 20  20 20 20 20 20 44 61 76  |             Dav|
00000fb0  69 64 20 44 69 74 7a 65  6c 20 28 53 55 4e 29 2c  |id Ditzel (SUN),|
00000fc0  20 45 61 72 6c 20 4b 69  6c 6c 69 61 6e 20 61 6e  | Earl Killian an|
00000fd0  64 20 4a 6f 68 6e 20 4d  61 73 68 65 79 20 28 4d  |d John Mashey (M|
00000fe0  49 50 53 29 2c 0a 20 2a  20 20 20 20 20 20 20 20  |IPS),. *        |
00000ff0  20 20 20 20 20 20 41 6c  61 6e 20 53 6d 69 74 68  |      Alan Smith|
00001000  20 61 6e 64 20 52 61 66  61 65 6c 20 53 61 61 76  | and Rafael Saav|
00001010  65 64 72 61 2d 42 61 72  72 65 72 61 20 28 55 43  |edra-Barrera (UC|
00001020  20 61 74 20 42 65 72 6b  65 6c 65 79 29 0a 20 2a  | at Berkeley). *|
00001030  20 20 20 20 20 20 20 20  20 20 20 20 20 20 66 6f  |              fo|
00001040  72 20 74 68 65 69 72 20  68 65 6c 70 20 77 69 74  |r their help wit|
00001050  68 20 63 6f 6d 6d 65 6e  74 73 20 6f 6e 20 65 61  |h comments on ea|
00001060  72 6c 69 65 72 20 76 65  72 73 69 6f 6e 73 20 6f  |rlier versions o|
00001070  66 20 74 68 65 0a 20 2a  20 20 20 20 20 20 20 20  |f the. *        |
00001080  20 20 20 20 20 20 62 65  6e 63 68 6d 61 72 6b 2e  |      benchmark.|
00001090  0a 20 2a 0a 20 2a 20 20  43 68 61 6e 67 65 73 3a  |. *. *  Changes:|
000010a0  20 20 20 20 49 6e 20 74  68 65 20 69 6e 69 74 69  |    In the initi|
000010b0  61 6c 69 7a 61 74 69 6f  6e 20 70 61 72 74 2c 20  |alization part, |
000010c0  74 68 69 73 20 76 65 72  73 69 6f 6e 20 66 6f 6c  |this version fol|
000010d0  6c 6f 77 73 20 6d 6f 73  74 6c 79 0a 20 2a 20 20  |lows mostly. *  |
000010e0  20 20 20 20 20 20 20 20  20 20 20 20 52 69 63 6b  |            Rick|
000010f0  20 52 69 63 68 61 72 64  73 6f 6e 27 73 20 76 65  | Richardson's ve|
00001100  72 73 69 6f 6e 20 64 69  73 74 72 69 62 75 74 65  |rsion distribute|
00001110  64 20 76 69 61 20 55 73  65 6e 65 74 2c 20 6e 6f  |d via Usenet, no|
00001120  74 20 74 68 65 0a 20 2a  20 20 20 20 20 20 20 20  |t the. *        |
00001130  20 20 20 20 20 20 76 65  72 73 69 6f 6e 20 64 69  |      version di|
00001140  73 74 72 69 62 75 74 65  64 20 65 61 72 6c 69 65  |stributed earlie|
00001150  72 20 76 69 61 20 66 6c  6f 70 70 79 20 64 69 73  |r via floppy dis|
00001160  6b 20 62 79 20 52 65 69  6e 68 6f 6c 64 20 57 65  |k by Reinhold We|
00001170  69 63 6b 65 72 2e 0a 20  2a 20 20 20 20 20 20 20  |icker.. *       |
00001180  20 20 20 20 20 20 20 41  73 20 61 20 63 6f 6e 63  |       As a conc|
00001190  65 73 73 69 6f 6e 20 74  6f 20 6f 6c 64 65 72 20  |ession to older |
000011a0  63 6f 6d 70 69 6c 65 72  73 2c 20 6e 61 6d 65 73  |compilers, names|
000011b0  20 68 61 76 65 20 62 65  65 6e 20 6d 61 64 65 0a  | have been made.|
000011c0  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
000011d0  75 6e 69 71 75 65 20 77  69 74 68 69 6e 20 74 68  |unique within th|
000011e0  65 20 66 69 72 73 74 20  38 20 63 68 61 72 61 63  |e first 8 charac|
000011f0  74 65 72 73 2e 0a 20 2a  20 20 20 20 20 20 20 20  |ters.. *        |
00001200  20 20 20 20 20 20 49 6e  73 69 64 65 20 74 68 65  |      Inside the|
00001210  20 6d 65 61 73 75 72 65  6d 65 6e 74 20 6c 6f 6f  | measurement loo|
00001220  70 2c 20 74 68 69 73 20  76 65 72 73 69 6f 6e 20  |p, this version |
00001230  66 6f 6c 6c 6f 77 73 20  74 68 65 0a 20 2a 20 20  |follows the. *  |
00001240  20 20 20 20 20 20 20 20  20 20 20 20 76 65 72 73  |            vers|
00001250  69 6f 6e 20 70 72 65 76  69 6f 75 73 6c 79 20 64  |ion previously d|
00001260  69 73 74 72 69 62 75 74  65 64 20 62 79 20 52 65  |istributed by Re|
00001270  69 6e 68 6f 6c 64 20 57  65 69 63 6b 65 72 2e 0a  |inhold Weicker..|
00001280  20 2a 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  | *. *           |
00001290  20 20 20 41 74 20 73 65  76 65 72 61 6c 20 70 6c  |   At several pl|
000012a0  61 63 65 73 20 69 6e 20  74 68 65 20 62 65 6e 63  |aces in the benc|
000012b0  68 6d 61 72 6b 2c 20 63  6f 64 65 20 68 61 73 20  |hmark, code has |
000012c0  62 65 65 6e 20 61 64 64  65 64 2c 0a 20 2a 20 20  |been added,. *  |
000012d0  20 20 20 20 20 20 20 20  20 20 20 20 62 75 74 20  |            but |
000012e0  77 69 74 68 69 6e 20 74  68 65 20 6d 65 61 73 75  |within the measu|
000012f0  72 65 6d 65 6e 74 20 6c  6f 6f 70 20 6f 6e 6c 79  |rement loop only|
00001300  20 69 6e 20 62 72 61 6e  63 68 65 73 20 74 68 61  | in branches tha|
00001310  74 20 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |t . *           |
00001320  20 20 20 61 72 65 20 6e  6f 74 20 65 78 65 63 75  |   are not execu|
00001330  74 65 64 2e 20 54 68 65  20 69 6e 74 65 6e 74 69  |ted. The intenti|
00001340  6f 6e 20 69 73 20 74 68  61 74 20 6f 70 74 69 6d  |on is that optim|
00001350  69 7a 69 6e 67 20 63 6f  6d 70 69 6c 65 72 73 0a  |izing compilers.|
00001360  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
00001370  73 68 6f 75 6c 64 20 62  65 20 70 72 65 76 65 6e  |should be preven|
00001380  74 65 64 20 66 72 6f 6d  20 6d 6f 76 69 6e 67 20  |ted from moving |
00001390  63 6f 64 65 20 6f 75 74  20 6f 66 20 74 68 65 20  |code out of the |
000013a0  6d 65 61 73 75 72 65 6d  65 6e 74 0a 20 2a 20 20  |measurement. *  |
000013b0  20 20 20 20 20 20 20 20  20 20 20 20 6c 6f 6f 70  |            loop|
000013c0  2c 20 6f 72 20 66 72 6f  6d 20 72 65 6d 6f 76 69  |, or from removi|
000013d0  6e 67 20 63 6f 64 65 20  61 6c 74 6f 67 65 74 68  |ng code altogeth|
000013e0  65 72 2e 20 53 69 6e 63  65 20 74 68 65 20 73 74  |er. Since the st|
000013f0  61 74 65 6d 65 6e 74 73  0a 20 2a 20 20 20 20 20  |atements. *     |
00001400  20 20 20 20 20 20 20 20  20 74 68 61 74 20 61 72  |         that ar|
00001410  65 20 65 78 65 63 75 74  65 64 20 77 69 74 68 69  |e executed withi|
00001420  6e 20 74 68 65 20 6d 65  61 73 75 72 65 6d 65 6e  |n the measuremen|
00001430  74 20 6c 6f 6f 70 20 68  61 76 65 20 4e 4f 54 20  |t loop have NOT |
00001440  62 65 65 6e 0a 20 2a 20  20 20 20 20 20 20 20 20  |been. *         |
00001450  20 20 20 20 20 63 68 61  6e 67 65 64 2c 20 74 68  |     changed, th|
00001460  65 20 6e 75 6d 62 65 72  73 20 64 65 66 69 6e 69  |e numbers defini|
00001470  6e 67 20 74 68 65 20 22  44 68 72 79 73 74 6f 6e  |ng the "Dhryston|
00001480  65 20 64 69 73 74 72 69  62 75 74 69 6f 6e 22 0a  |e distribution".|
00001490  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
000014a0  28 64 69 73 74 72 69 62  75 74 69 6f 6e 20 6f 66  |(distribution of|
000014b0  20 73 74 61 74 65 6d 65  6e 74 73 2c 20 6f 70 65  | statements, ope|
000014c0  72 61 6e 64 20 74 79 70  65 73 20 61 6e 64 20 6c  |rand types and l|
000014d0  6f 63 61 6c 69 74 79 29  0a 20 2a 20 20 20 20 20  |ocality). *     |
000014e0  20 20 20 20 20 20 20 20  20 73 74 69 6c 6c 20 68  |         still h|
000014f0  6f 6c 64 2e 20 45 78 63  65 70 74 20 66 6f 72 20  |old. Except for |
00001500  73 6f 70 68 69 73 74 69  63 61 74 65 64 20 6f 70  |sophisticated op|
00001510  74 69 6d 69 7a 69 6e 67  20 63 6f 6d 70 69 6c 65  |timizing compile|
00001520  72 73 2c 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |rs,. *          |
00001530  20 20 20 20 65 78 65 63  75 74 69 6f 6e 20 74 69  |    execution ti|
00001540  6d 65 73 20 66 6f 72 20  74 68 69 73 20 76 65 72  |mes for this ver|
00001550  73 69 6f 6e 20 73 68 6f  75 6c 64 20 62 65 20 74  |sion should be t|
00001560  68 65 20 73 61 6d 65 20  61 73 0a 20 2a 20 20 20  |he same as. *   |
00001570  20 20 20 20 20 20 20 20  20 20 20 66 6f 72 20 70  |           for p|
00001580  72 65 76 69 6f 75 73 20  76 65 72 73 69 6f 6e 73  |revious versions|
00001590  2e 0a 20 2a 20 20 20 20  20 20 20 20 20 20 20 20  |.. *            |
000015a0  20 20 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |  . *           |
000015b0  20 20 20 53 69 6e 63 65  20 69 74 20 68 61 73 20  |   Since it has |
000015c0  70 72 6f 76 65 6e 20 64  69 66 66 69 63 75 6c 74  |proven difficult|
000015d0  20 74 6f 20 73 75 62 74  72 61 63 74 20 74 68 65  | to subtract the|
000015e0  20 74 69 6d 65 20 66 6f  72 20 74 68 65 0a 20 2a  | time for the. *|
000015f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 6d 65  |              me|
00001600  61 73 75 72 65 6d 65 6e  74 20 6c 6f 6f 70 20 6f  |asurement loop o|
00001610  76 65 72 68 65 61 64 20  69 6e 20 61 20 63 6f 72  |verhead in a cor|
00001620  72 65 63 74 20 77 61 79  2c 20 74 68 65 20 6c 6f  |rect way, the lo|
00001630  6f 70 20 63 68 65 63 6b  0a 20 2a 20 20 20 20 20  |op check. *     |
00001640  20 20 20 20 20 20 20 20  20 68 61 73 20 62 65 65  |         has bee|
00001650  6e 20 6d 61 64 65 20 61  20 70 61 72 74 20 6f 66  |n made a part of|
00001660  20 74 68 65 20 62 65 6e  63 68 6d 61 72 6b 2e 20  | the benchmark. |
00001670  54 68 69 73 20 64 6f 65  73 20 68 61 76 65 0a 20  |This does have. |
00001680  2a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 61  |*              a|
00001690  6e 20 69 6d 70 61 63 74  20 2d 20 74 68 6f 75 67  |n impact - thoug|
000016a0  68 20 61 20 76 65 72 79  20 6d 69 6e 6f 72 20 6f  |h a very minor o|
000016b0  6e 65 20 2d 20 6f 6e 20  74 68 65 20 64 69 73 74  |ne - on the dist|
000016c0  72 69 62 75 74 69 6f 6e  0a 20 2a 20 20 20 20 20  |ribution. *     |
000016d0  20 20 20 20 20 20 20 20  20 73 74 61 74 69 73 74  |         statist|
000016e0  69 63 73 20 77 68 69 63  68 20 68 61 76 65 20 62  |ics which have b|
000016f0  65 65 6e 20 75 70 64 61  74 65 64 20 66 6f 72 20  |een updated for |
00001700  74 68 69 73 20 76 65 72  73 69 6f 6e 2e 0a 20 2a  |this version.. *|
00001710  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |. *             |
00001720  20 41 6c 6c 20 63 68 61  6e 67 65 73 20 77 69 74  | All changes wit|
00001730  68 69 6e 20 74 68 65 20  6d 65 61 73 75 72 65 6d  |hin the measurem|
00001740  65 6e 74 20 6c 6f 6f 70  20 61 72 65 20 64 65 73  |ent loop are des|
00001750  63 72 69 62 65 64 0a 20  2a 20 20 20 20 20 20 20  |cribed. *       |
00001760  20 20 20 20 20 20 20 61  6e 64 20 64 69 73 63 75  |       and discu|
00001770  73 73 65 64 20 69 6e 20  74 68 65 20 63 6f 6d 70  |ssed in the comp|
00001780  61 6e 69 6f 6e 20 70 61  70 65 72 20 22 52 61 74  |anion paper "Rat|
00001790  69 6f 6e 61 6c 65 20 66  6f 72 0a 20 2a 20 20 20  |ionale for. *   |
000017a0  20 20 20 20 20 20 20 20  20 20 20 44 68 72 79 73  |           Dhrys|
000017b0  74 6f 6e 65 20 76 65 72  73 69 6f 6e 20 32 22 2e  |tone version 2".|
000017c0  0a 20 2a 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |. *. *          |
000017d0  20 20 20 20 42 65 63 61  75 73 65 20 6f 66 20 74  |    Because of t|
000017e0  68 65 20 73 65 6c 66 2d  69 6d 70 6f 73 65 64 20  |he self-imposed |
000017f0  6c 69 6d 69 74 61 74 69  6f 6e 20 74 68 61 74 20  |limitation that |
00001800  74 68 65 20 6f 72 64 65  72 20 61 6e 64 0a 20 2a  |the order and. *|
00001810  20 20 20 20 20 20 20 20  20 20 20 20 20 20 64 69  |              di|
00001820  73 74 72 69 62 75 74 69  6f 6e 20 6f 66 20 74 68  |stribution of th|
00001830  65 20 65 78 65 63 75 74  65 64 20 73 74 61 74 65  |e executed state|
00001840  6d 65 6e 74 73 20 73 68  6f 75 6c 64 20 6e 6f 74  |ments should not|
00001850  20 62 65 0a 20 2a 20 20  20 20 20 20 20 20 20 20  | be. *          |
00001860  20 20 20 20 63 68 61 6e  67 65 64 2c 20 74 68 65  |    changed, the|
00001870  72 65 20 61 72 65 20 73  74 69 6c 6c 20 63 61 73  |re are still cas|
00001880  65 73 20 77 68 65 72 65  20 6f 70 74 69 6d 69 7a  |es where optimiz|
00001890  69 6e 67 20 63 6f 6d 70  69 6c 65 72 73 0a 20 2a  |ing compilers. *|
000018a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 6d 61  |              ma|
000018b0  79 20 6e 6f 74 20 67 65  6e 65 72 61 74 65 20 63  |y not generate c|
000018c0  6f 64 65 20 66 6f 72 20  73 6f 6d 65 20 73 74 61  |ode for some sta|
000018d0  74 65 6d 65 6e 74 73 2e  20 54 6f 20 61 20 63 65  |tements. To a ce|
000018e0  72 74 61 69 6e 0a 20 2a  20 20 20 20 20 20 20 20  |rtain. *        |
000018f0  20 20 20 20 20 20 64 65  67 72 65 65 2c 20 74 68  |      degree, th|
00001900  69 73 20 69 73 20 75 6e  61 76 6f 69 64 61 62 6c  |is is unavoidabl|
00001910  65 20 66 6f 72 20 73 6d  61 6c 6c 20 73 79 6e 74  |e for small synt|
00001920  68 65 74 69 63 20 62 65  6e 63 68 6d 61 72 6b 73  |hetic benchmarks|
00001930  2e 0a 20 2a 20 20 20 20  20 20 20 20 20 20 20 20  |.. *            |
00001940  20 20 55 73 65 72 73 20  6f 66 20 74 68 65 20 62  |  Users of the b|
00001950  65 6e 63 68 6d 61 72 6b  20 61 72 65 20 61 64 76  |enchmark are adv|
00001960  69 73 65 64 20 74 6f 20  63 68 65 63 6b 20 63 6f  |ised to check co|
00001970  64 65 20 6c 69 73 74 69  6e 67 73 0a 20 2a 20 20  |de listings. *  |
00001980  20 20 20 20 20 20 20 20  20 20 20 20 77 68 65 74  |            whet|
00001990  68 65 72 20 63 6f 64 65  20 69 73 20 67 65 6e 65  |her code is gene|
000019a0  72 61 74 65 64 20 66 6f  72 20 61 6c 6c 20 73 74  |rated for all st|
000019b0  61 74 65 6d 65 6e 74 73  20 6f 66 20 44 68 72 79  |atements of Dhry|
000019c0  73 74 6f 6e 65 2e 0a 20  2a 0a 20 2a 20 20 20 20  |stone.. *. *    |
000019d0  20 20 20 20 20 20 20 20  20 20 56 65 72 73 69 6f  |          Versio|
000019e0  6e 20 32 2e 31 20 69 73  20 69 64 65 6e 74 69 63  |n 2.1 is identic|
000019f0  61 6c 20 74 6f 20 76 65  72 73 69 6f 6e 20 32 2e  |al to version 2.|
00001a00  30 20 64 69 73 74 72 69  62 75 74 65 64 20 76 69  |0 distributed vi|
00001a10  61 0a 20 2a 20 20 20 20  20 20 20 20 20 20 20 20  |a. *            |
00001a20  20 20 74 68 65 20 55 4e  49 58 20 6e 65 74 77 6f  |  the UNIX netwo|
00001a30  72 6b 20 55 73 65 6e 65  74 20 69 6e 20 4d 61 72  |rk Usenet in Mar|
00001a40  63 68 20 31 39 38 38 20  65 78 63 65 70 74 20 74  |ch 1988 except t|
00001a50  68 61 74 20 69 74 20 63  6f 72 72 65 63 74 73 0a  |hat it corrects.|
00001a60  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
00001a70  73 6f 6d 65 20 6d 69 6e  6f 72 20 64 65 66 69 63  |some minor defic|
00001a80  69 65 6e 63 69 65 73 20  74 68 61 74 20 77 65 72  |iencies that wer|
00001a90  65 20 66 6f 75 6e 64 20  62 79 20 75 73 65 72 73  |e found by users|
00001aa0  20 6f 66 20 76 65 72 73  69 6f 6e 20 32 2e 30 2e  | of version 2.0.|
00001ab0  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |. *             |
00001ac0  20 54 68 65 20 6f 6e 6c  79 20 63 68 61 6e 67 65  | The only change|
00001ad0  20 77 69 74 68 69 6e 20  74 68 65 20 6d 65 61 73  | within the meas|
00001ae0  75 72 65 6d 65 6e 74 20  6c 6f 6f 70 20 69 73 20  |urement loop is |
00001af0  74 68 61 74 20 61 0a 20  2a 20 20 20 20 20 20 20  |that a. *       |
00001b00  20 20 20 20 20 20 20 6e  6f 6e 2d 65 78 65 63 75  |       non-execu|
00001b10  74 65 64 20 22 65 6c 73  65 22 20 70 61 72 74 20  |ted "else" part |
00001b20  77 61 73 20 61 64 64 65  64 20 74 6f 20 74 68 65  |was added to the|
00001b30  20 22 69 66 22 20 73 74  61 74 65 6d 65 6e 74 20  | "if" statement |
00001b40  69 6e 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |in. *           |
00001b50  20 20 20 46 75 6e 63 5f  33 2c 20 61 6e 64 20 61  |   Func_3, and a|
00001b60  20 6e 6f 6e 2d 65 78 65  63 75 74 65 64 20 22 65  | non-executed "e|
00001b70  6c 73 65 22 20 70 61 72  74 20 72 65 6d 6f 76 65  |lse" part remove|
00001b80  64 20 66 72 6f 6d 20 50  72 6f 63 5f 33 2e 0a 20  |d from Proc_3.. |
00001b90  2a 0a 20 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |*. *************|
00001ba0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00001bd0  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 0a 20  |**************. |
00001be0  2a 0a 20 2a 20 44 65 66  69 6e 65 73 3a 20 20 20  |*. * Defines:   |
00001bf0  20 20 54 68 65 20 66 6f  6c 6c 6f 77 69 6e 67 20  |  The following |
00001c00  22 44 65 66 69 6e 65 73  22 20 61 72 65 20 70 6f  |"Defines" are po|
00001c10  73 73 69 62 6c 65 3a 0a  20 2a 20 20 20 20 20 20  |ssible:. *      |
00001c20  20 20 20 20 20 20 20 20  2d 44 52 45 47 3d 72 65  |        -DREG=re|
00001c30  67 69 73 74 65 72 20 20  20 20 20 20 20 20 20 20  |gister          |
00001c40  28 64 65 66 61 75 6c 74  3a 20 4e 6f 74 20 64 65  |(default: Not de|
00001c50  66 69 6e 65 64 29 0a 20  2a 20 20 20 20 20 20 20  |fined). *       |
00001c60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 41  |               A|
00001c70  73 20 61 6e 20 61 70 70  72 6f 78 69 6d 61 74 69  |s an approximati|
00001c80  6f 6e 20 74 6f 20 77 68  61 74 20 61 6e 20 61 76  |on to what an av|
00001c90  65 72 61 67 65 20 43 20  70 72 6f 67 72 61 6d 6d  |erage C programm|
00001ca0  65 72 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |er. *           |
00001cb0  20 20 20 20 20 20 20 20  20 20 20 6d 69 67 68 74  |           might|
00001cc0  20 64 6f 2c 20 74 68 65  20 22 72 65 67 69 73 74  | do, the "regist|
00001cd0  65 72 22 20 73 74 6f 72  61 67 65 20 63 6c 61 73  |er" storage clas|
00001ce0  73 20 69 73 20 61 70 70  6c 69 65 64 0a 20 2a 20  |s is applied. * |
00001cf0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001d00  20 20 20 20 20 28 69 66  20 65 6e 61 62 6c 65 64  |     (if enabled|
00001d10  20 62 79 20 2d 44 52 45  47 3d 72 65 67 69 73 74  | by -DREG=regist|
00001d20  65 72 29 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |er). *          |
00001d30  20 20 20 20 20 20 20 20  20 20 20 20 2d 20 66 6f  |            - fo|
00001d40  72 20 6c 6f 63 61 6c 20  76 61 72 69 61 62 6c 65  |r local variable|
00001d50  73 2c 20 69 66 20 74 68  65 79 20 61 72 65 20 75  |s, if they are u|
00001d60  73 65 64 20 28 64 79 6e  61 6d 69 63 61 6c 6c 79  |sed (dynamically|
00001d70  29 0a 20 2a 20 20 20 20  20 20 20 20 20 20 20 20  |). *            |
00001d80  20 20 20 20 20 20 20 20  20 20 20 20 66 69 76 65  |            five|
00001d90  20 6f 72 20 6d 6f 72 65  20 74 69 6d 65 73 0a 20  | or more times. |
00001da0  2a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |*               |
00001db0  20 20 20 20 20 20 20 2d  20 66 6f 72 20 70 61 72  |       - for par|
00001dc0  61 6d 65 74 65 72 73 20  69 66 20 74 68 65 79 20  |ameters if they |
00001dd0  61 72 65 20 75 73 65 64  20 28 64 79 6e 61 6d 69  |are used (dynami|
00001de0  63 61 6c 6c 79 29 0a 20  2a 20 20 20 20 20 20 20  |cally). *       |
00001df0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001e00  20 73 69 78 20 6f 72 20  6d 6f 72 65 20 74 69 6d  | six or more tim|
00001e10  65 73 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |es. *           |
00001e20  20 20 20 20 20 20 20 20  20 20 20 4e 6f 74 65 20  |           Note |
00001e30  74 68 61 74 20 61 6e 20  6f 70 74 69 6d 61 6c 20  |that an optimal |
00001e40  22 72 65 67 69 73 74 65  72 22 20 73 74 72 61 74  |"register" strat|
00001e50  65 67 79 20 69 73 0a 20  2a 20 20 20 20 20 20 20  |egy is. *       |
00001e60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 63  |               c|
00001e70  6f 6d 70 69 6c 65 72 2d  64 65 70 65 6e 64 65 6e  |ompiler-dependen|
00001e80  74 2c 20 61 6e 64 20 74  68 61 74 20 22 72 65 67  |t, and that "reg|
00001e90  69 73 74 65 72 22 20 64  65 63 6c 61 72 61 74 69  |ister" declarati|
00001ea0  6f 6e 73 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |ons. *          |
00001eb0  20 20 20 20 20 20 20 20  20 20 20 20 64 6f 20 6e  |            do n|
00001ec0  6f 74 20 6e 65 63 65 73  73 61 72 69 6c 79 20 6c  |ot necessarily l|
00001ed0  65 61 64 20 74 6f 20 66  61 73 74 65 72 20 65 78  |ead to faster ex|
00001ee0  65 63 75 74 69 6f 6e 2e  0a 20 2a 20 20 20 20 20  |ecution.. *     |
00001ef0  20 20 20 20 20 20 20 20  20 2d 44 4e 4f 53 54 52  |         -DNOSTR|
00001f00  55 43 54 41 53 53 49 47  4e 20 20 20 20 20 20 20  |UCTASSIGN       |
00001f10  20 28 64 65 66 61 75 6c  74 3a 20 4e 6f 74 20 64  | (default: Not d|
00001f20  65 66 69 6e 65 64 29 0a  20 2a 20 20 20 20 20 20  |efined). *      |
00001f30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001f40  44 65 66 69 6e 65 20 69  66 20 74 68 65 20 43 20  |Define if the C |
00001f50  63 6f 6d 70 69 6c 65 72  20 64 6f 65 73 20 6e 6f  |compiler does no|
00001f60  74 20 73 75 70 70 6f 72  74 0a 20 2a 20 20 20 20  |t support. *    |
00001f70  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001f80  20 20 61 73 73 69 67 6e  6d 65 6e 74 20 6f 66 20  |  assignment of |
00001f90  73 74 72 75 63 74 75 72  65 73 2e 0a 20 2a 20 20  |structures.. *  |
00001fa0  20 20 20 20 20 20 20 20  20 20 20 20 2d 44 4e 4f  |            -DNO|
00001fb0  45 4e 55 4d 53 20 20 20  20 20 20 20 20 20 20 20  |ENUMS           |
00001fc0  20 20 20 20 28 64 65 66  61 75 6c 74 3a 20 4e 6f  |    (default: No|
00001fd0  74 20 64 65 66 69 6e 65  64 29 0a 20 2a 20 20 20  |t defined). *   |
00001fe0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00001ff0  20 20 20 44 65 66 69 6e  65 20 69 66 20 74 68 65  |   Define if the|
00002000  20 43 20 63 6f 6d 70 69  6c 65 72 20 64 6f 65 73  | C compiler does|
00002010  20 6e 6f 74 20 73 75 70  70 6f 72 74 0a 20 2a 20  | not support. * |
00002020  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002030  20 20 20 20 20 65 6e 75  6d 65 72 61 74 69 6f 6e  |     enumeration|
00002040  20 74 79 70 65 73 2e 0a  20 2a 20 20 20 20 20 20  | types.. *      |
00002050  20 20 20 20 20 20 20 20  2d 44 54 49 4d 45 53 20  |        -DTIMES |
00002060  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002070  28 64 65 66 61 75 6c 74  29 0a 20 2a 20 20 20 20  |(default). *    |
00002080  20 20 20 20 20 20 20 20  20 20 2d 44 54 49 4d 45  |          -DTIME|
00002090  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |. *             |
000020a0  20 20 20 20 20 20 20 20  20 54 68 65 20 22 74 69  |         The "ti|
000020b0  6d 65 73 22 20 66 75 6e  63 74 69 6f 6e 20 6f 66  |mes" function of|
000020c0  20 55 4e 49 58 20 28 72  65 74 75 72 6e 69 6e 67  | UNIX (returning|
000020d0  20 70 72 6f 63 65 73 73  20 74 69 6d 65 73 29 0a  | process times).|
000020e0  20 2a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  | *              |
000020f0  20 20 20 20 20 20 20 20  6f 72 20 74 68 65 20 22  |        or the "|
00002100  74 69 6d 65 22 20 66 75  6e 63 74 69 6f 6e 20 28  |time" function (|
00002110  72 65 74 75 72 6e 69 6e  67 20 77 61 6c 6c 63 6c  |returning wallcl|
00002120  6f 63 6b 20 74 69 6d 65  29 0a 20 2a 20 20 20 20  |ock time). *    |
00002130  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002140  20 20 69 73 20 75 73 65  64 20 66 6f 72 20 6d 65  |  is used for me|
00002150  61 73 75 72 65 6d 65 6e  74 2e 20 0a 20 2a 20 20  |asurement. . *  |
00002160  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002170  20 20 20 20 46 6f 72 20  73 69 6e 67 6c 65 20 75  |    For single u|
00002180  73 65 72 20 6d 61 63 68  69 6e 65 73 2c 20 22 74  |ser machines, "t|
00002190  69 6d 65 20 28 29 22 20  69 73 20 61 64 65 71 75  |ime ()" is adequ|
000021a0  61 74 65 2e 20 46 6f 72  0a 20 2a 20 20 20 20 20  |ate. For. *     |
000021b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000021c0  20 6d 75 6c 74 69 2d 75  73 65 72 20 6d 61 63 68  | multi-user mach|
000021d0  69 6e 65 73 20 77 68 65  72 65 20 79 6f 75 20 63  |ines where you c|
000021e0  61 6e 6e 6f 74 20 67 65  74 20 73 69 6e 67 6c 65  |annot get single|
000021f0  2d 75 73 65 72 0a 20 2a  20 20 20 20 20 20 20 20  |-user. *        |
00002200  20 20 20 20 20 20 20 20  20 20 20 20 20 20 61 63  |              ac|
00002210  63 65 73 73 2c 20 75 73  65 20 74 68 65 20 22 74  |cess, use the "t|
00002220  69 6d 65 73 20 28 29 22  20 66 75 6e 63 74 69 6f  |imes ()" functio|
00002230  6e 2e 20 49 66 20 79 6f  75 20 68 61 76 65 0a 20  |n. If you have. |
00002240  2a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |*               |
00002250  20 20 20 20 20 20 20 6e  65 69 74 68 65 72 2c 20  |       neither, |
00002260  75 73 65 20 61 20 73 74  6f 70 77 61 74 63 68 20  |use a stopwatch |
00002270  69 6e 20 74 68 65 20 64  65 61 64 20 6f 66 20 6e  |in the dead of n|
00002280  69 67 68 74 2e 0a 20 2a  20 20 20 20 20 20 20 20  |ight.. *        |
00002290  20 20 20 20 20 20 20 20  20 20 20 20 20 20 22 70  |              "p|
000022a0  72 69 6e 74 66 22 73 20  61 72 65 20 70 72 6f 76  |rintf"s are prov|
000022b0  69 64 65 64 20 6d 61 72  6b 69 6e 67 20 74 68 65  |ided marking the|
000022c0  20 70 6f 69 6e 74 73 20  22 53 74 61 72 74 20 54  | points "Start T|
000022d0  69 6d 65 72 22 0a 20 2a  20 20 20 20 20 20 20 20  |imer". *        |
000022e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 61 6e  |              an|
000022f0  64 20 22 53 74 6f 70 20  54 69 6d 65 72 22 2e 20  |d "Stop Timer". |
00002300  44 4f 20 4e 4f 54 20 75  73 65 20 74 68 65 20 55  |DO NOT use the U|
00002310  4e 49 58 20 22 74 69 6d  65 28 31 29 22 0a 20 2a  |NIX "time(1)". *|
00002320  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002330  20 20 20 20 20 20 63 6f  6d 6d 61 6e 64 2c 20 61  |      command, a|
00002340  73 20 74 68 69 73 20 77  69 6c 6c 20 6d 65 61 73  |s this will meas|
00002350  75 72 65 20 74 68 65 20  74 6f 74 61 6c 20 74 69  |ure the total ti|
00002360  6d 65 20 74 6f 0a 20 2a  20 20 20 20 20 20 20 20  |me to. *        |
00002370  20 20 20 20 20 20 20 20  20 20 20 20 20 20 72 75  |              ru|
00002380  6e 20 74 68 69 73 20 70  72 6f 67 72 61 6d 2c 20  |n this program, |
00002390  77 68 69 63 68 20 77 69  6c 6c 20 28 65 72 72 6f  |which will (erro|
000023a0  6e 65 6f 75 73 6c 79 29  20 69 6e 63 6c 75 64 65  |neously) include|
000023b0  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 20 20  |. *             |
000023c0  20 20 20 20 20 20 20 20  20 74 68 65 20 74 69 6d  |         the tim|
000023d0  65 20 74 6f 20 61 6c 6c  6f 63 61 74 65 20 73 74  |e to allocate st|
000023e0  6f 72 61 67 65 20 28 6d  61 6c 6c 6f 63 29 20 61  |orage (malloc) a|
000023f0  6e 64 20 74 6f 20 70 65  72 66 6f 72 6d 0a 20 2a  |nd to perform. *|
00002400  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002410  20 20 20 20 20 20 74 68  65 20 69 6e 69 74 69 61  |      the initia|
00002420  6c 69 7a 61 74 69 6f 6e  2e 0a 20 2a 20 20 20 20  |lization.. *    |
00002430  20 20 20 20 20 20 20 20  20 20 2d 44 48 5a 3d 6e  |          -DHZ=n|
00002440  6e 6e 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |nn. *           |
00002450  20 20 20 20 20 20 20 20  20 20 20 49 6e 20 42 65  |           In Be|
00002460  72 6b 65 6c 65 79 20 55  4e 49 58 2c 20 74 68 65  |rkeley UNIX, the|
00002470  20 66 75 6e 63 74 69 6f  6e 20 22 74 69 6d 65 73  | function "times|
00002480  22 20 72 65 74 75 72 6e  73 20 70 72 6f 63 65 73  |" returns proces|
00002490  73 0a 20 2a 20 20 20 20  20 20 20 20 20 20 20 20  |s. *            |
000024a0  20 20 20 20 20 20 20 20  20 20 74 69 6d 65 20 69  |          time i|
000024b0  6e 20 31 2f 48 5a 20 73  65 63 6f 6e 64 73 2c 20  |n 1/HZ seconds, |
000024c0  77 69 74 68 20 48 5a 20  3d 20 36 30 20 66 6f 72  |with HZ = 60 for|
000024d0  20 6d 6f 73 74 20 73 79  73 74 65 6d 73 2e 0a 20  | most systems.. |
000024e0  2a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |*               |
000024f0  20 20 20 20 20 20 20 43  48 45 43 4b 20 59 4f 55  |       CHECK YOU|
00002500  52 20 53 59 53 54 45 4d  20 44 45 53 43 52 49 50  |R SYSTEM DESCRIP|
00002510  54 49 4f 4e 20 42 45 46  4f 52 45 20 59 4f 55 20  |TION BEFORE YOU |
00002520  4a 55 53 54 20 41 50 50  4c 59 0a 20 2a 20 20 20  |JUST APPLY. *   |
00002530  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002540  20 20 20 41 20 56 41 4c  55 45 2e 0a 20 2a 0a 20  |   A VALUE.. *. |
00002550  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00002590  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0a 20 2a 0a 20  |***********. *. |
000025a0  2a 20 20 43 6f 6d 70 69  6c 61 74 69 6f 6e 20 6d  |*  Compilation m|
000025b0  6f 64 65 6c 20 61 6e 64  20 6d 65 61 73 75 72 65  |odel and measure|
000025c0  6d 65 6e 74 20 28 49 4d  50 4f 52 54 41 4e 54 29  |ment (IMPORTANT)|
000025d0  3a 0a 20 2a 0a 20 2a 20  20 54 68 69 73 20 43 20  |:. *. *  This C |
000025e0  76 65 72 73 69 6f 6e 20  6f 66 20 44 68 72 79 73  |version of Dhrys|
000025f0  74 6f 6e 65 20 63 6f 6e  73 69 73 74 73 20 6f 66  |tone consists of|
00002600  20 74 68 72 65 65 20 66  69 6c 65 73 3a 0a 20 2a  | three files:. *|
00002610  20 20 2d 20 64 68 72 79  2e 68 20 28 74 68 69 73  |  - dhry.h (this|
00002620  20 66 69 6c 65 2c 20 63  6f 6e 74 61 69 6e 69 6e  | file, containin|
00002630  67 20 67 6c 6f 62 61 6c  20 64 65 66 69 6e 69 74  |g global definit|
00002640  69 6f 6e 73 20 61 6e 64  20 63 6f 6d 6d 65 6e 74  |ions and comment|
00002650  73 29 0a 20 2a 20 20 2d  20 64 68 72 79 5f 31 2e  |s). *  - dhry_1.|
00002660  63 20 28 63 6f 6e 74 61  69 6e 69 6e 67 20 74 68  |c (containing th|
00002670  65 20 63 6f 64 65 20 63  6f 72 72 65 73 70 6f 6e  |e code correspon|
00002680  64 69 6e 67 20 74 6f 20  41 64 61 20 70 61 63 6b  |ding to Ada pack|
00002690  61 67 65 20 50 61 63 6b  5f 31 29 0a 20 2a 20 20  |age Pack_1). *  |
000026a0  2d 20 64 68 72 79 5f 32  2e 63 20 28 63 6f 6e 74  |- dhry_2.c (cont|
000026b0  61 69 6e 69 6e 67 20 74  68 65 20 63 6f 64 65 20  |aining the code |
000026c0  63 6f 72 72 65 73 70 6f  6e 64 69 6e 67 20 74 6f  |corresponding to|
000026d0  20 41 64 61 20 70 61 63  6b 61 67 65 20 50 61 63  | Ada package Pac|
000026e0  6b 5f 32 29 0a 20 2a 0a  20 2a 20 20 54 68 65 20  |k_2). *. *  The |
000026f0  66 6f 6c 6c 6f 77 69 6e  67 20 22 67 72 6f 75 6e  |following "groun|
00002700  64 20 72 75 6c 65 73 22  20 61 70 70 6c 79 20 66  |d rules" apply f|
00002710  6f 72 20 6d 65 61 73 75  72 65 6d 65 6e 74 73 3a  |or measurements:|
00002720  0a 20 2a 20 20 2d 20 53  65 70 61 72 61 74 65 20  |. *  - Separate |
00002730  63 6f 6d 70 69 6c 61 74  69 6f 6e 0a 20 2a 20 20  |compilation. *  |
00002740  2d 20 4e 6f 20 70 72 6f  63 65 64 75 72 65 20 6d  |- No procedure m|
00002750  65 72 67 69 6e 67 0a 20  2a 20 20 2d 20 4f 74 68  |erging. *  - Oth|
00002760  65 72 77 69 73 65 2c 20  63 6f 6d 70 69 6c 65 72  |erwise, compiler|
00002770  20 6f 70 74 69 6d 69 7a  61 74 69 6f 6e 73 20 61  | optimizations a|
00002780  72 65 20 61 6c 6c 6f 77  65 64 20 62 75 74 20 73  |re allowed but s|
00002790  68 6f 75 6c 64 20 62 65  20 69 6e 64 69 63 61 74  |hould be indicat|
000027a0  65 64 0a 20 2a 20 20 2d  20 44 65 66 61 75 6c 74  |ed. *  - Default|
000027b0  20 72 65 73 75 6c 74 73  20 61 72 65 20 74 68 6f  | results are tho|
000027c0  73 65 20 77 69 74 68 6f  75 74 20 72 65 67 69 73  |se without regis|
000027d0  74 65 72 20 64 65 63 6c  61 72 61 74 69 6f 6e 73  |ter declarations|
000027e0  0a 20 2a 20 20 53 65 65  20 74 68 65 20 63 6f 6d  |. *  See the com|
000027f0  70 61 6e 69 6f 6e 20 70  61 70 65 72 20 22 52 61  |panion paper "Ra|
00002800  74 69 6f 6e 61 6c 65 20  66 6f 72 20 44 68 72 79  |tionale for Dhry|
00002810  73 74 6f 6e 65 20 56 65  72 73 69 6f 6e 20 32 22  |stone Version 2"|
00002820  20 66 6f 72 20 61 20 6d  6f 72 65 0a 20 2a 20 20  | for a more. *  |
00002830  64 65 74 61 69 6c 65 64  20 64 69 73 63 75 73 73  |detailed discuss|
00002840  69 6f 6e 20 6f 66 20 74  68 65 73 65 20 67 72 6f  |ion of these gro|
00002850  75 6e 64 20 72 75 6c 65  73 2e 0a 20 2a 0a 20 2a  |und rules.. *. *|
00002860  20 20 46 6f 72 20 31 36  2d 42 69 74 20 70 72 6f  |  For 16-Bit pro|
00002870  63 65 73 73 6f 72 73 20  28 65 2e 67 2e 20 38 30  |cessors (e.g. 80|
00002880  31 38 36 2c 20 38 30 32  38 36 29 2c 20 74 69 6d  |186, 80286), tim|
00002890  65 73 20 66 6f 72 20 61  6c 6c 20 63 6f 6d 70 69  |es for all compi|
000028a0  6c 61 74 69 6f 6e 0a 20  2a 20 20 6d 6f 64 65 6c  |lation. *  model|
000028b0  73 20 28 22 73 6d 61 6c  6c 22 2c 20 22 6d 65 64  |s ("small", "med|
000028c0  69 75 6d 22 2c 20 22 6c  61 72 67 65 22 20 65 74  |ium", "large" et|
000028d0  63 2e 29 20 73 68 6f 75  6c 64 20 62 65 20 67 69  |c.) should be gi|
000028e0  76 65 6e 20 69 66 20 70  6f 73 73 69 62 6c 65 2c  |ven if possible,|
000028f0  0a 20 2a 20 20 74 6f 67  65 74 68 65 72 20 77 69  |. *  together wi|
00002900  74 68 20 61 20 64 65 66  69 6e 69 74 69 6f 6e 20  |th a definition |
00002910  6f 66 20 74 68 65 73 65  20 6d 6f 64 65 6c 73 20  |of these models |
00002920  66 6f 72 20 74 68 65 20  63 6f 6d 70 69 6c 65 72  |for the compiler|
00002930  20 73 79 73 74 65 6d 20  75 73 65 64 2e 0a 20 2a  | system used.. *|
00002940  0a 20 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |. **************|
00002950  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
00002980  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 0a 20 2a 0a  |************. *.|
00002990  20 2a 20 20 44 68 72 79  73 74 6f 6e 65 20 28 43  | *  Dhrystone (C|
000029a0  20 76 65 72 73 69 6f 6e  29 20 73 74 61 74 69 73  | version) statis|
000029b0  74 69 63 73 3a 0a 20 2a  0a 20 2a 20 20 5b 43 6f  |tics:. *. *  [Co|
000029c0  6d 6d 65 6e 74 20 66 72  6f 6d 20 74 68 65 20 66  |mment from the f|
000029d0  69 72 73 74 20 64 69 73  74 72 69 62 75 74 69 6f  |irst distributio|
000029e0  6e 2c 20 75 70 64 61 74  65 64 20 66 6f 72 20 76  |n, updated for v|
000029f0  65 72 73 69 6f 6e 20 32  2e 0a 20 2a 20 20 20 4e  |ersion 2.. *   N|
00002a00  6f 74 65 20 74 68 61 74  20 62 65 63 61 75 73 65  |ote that because|
00002a10  20 6f 66 20 6c 61 6e 67  75 61 67 65 20 64 69 66  | of language dif|
00002a20  66 65 72 65 6e 63 65 73  2c 20 74 68 65 20 6e 75  |ferences, the nu|
00002a30  6d 62 65 72 73 20 61 72  65 20 73 6c 69 67 68 74  |mbers are slight|
00002a40  6c 79 0a 20 2a 20 20 20  64 69 66 66 65 72 65 6e  |ly. *   differen|
00002a50  74 20 66 72 6f 6d 20 74  68 65 20 41 64 61 20 76  |t from the Ada v|
00002a60  65 72 73 69 6f 6e 2e 5d  0a 20 2a 0a 20 2a 20 20  |ersion.]. *. *  |
00002a70  54 68 65 20 66 6f 6c 6c  6f 77 69 6e 67 20 70 72  |The following pr|
00002a80  6f 67 72 61 6d 20 63 6f  6e 74 61 69 6e 73 20 73  |ogram contains s|
00002a90  74 61 74 65 6d 65 6e 74  73 20 6f 66 20 61 20 68  |tatements of a h|
00002aa0  69 67 68 20 6c 65 76 65  6c 20 70 72 6f 67 72 61  |igh level progra|
00002ab0  6d 6d 69 6e 67 0a 20 2a  20 20 6c 61 6e 67 75 61  |mming. *  langua|
00002ac0  67 65 20 28 68 65 72 65  3a 20 43 29 20 69 6e 20  |ge (here: C) in |
00002ad0  61 20 64 69 73 74 72 69  62 75 74 69 6f 6e 20 63  |a distribution c|
00002ae0  6f 6e 73 69 64 65 72 65  64 20 72 65 70 72 65 73  |onsidered repres|
00002af0  65 6e 74 61 74 69 76 65  3a 20 20 20 20 20 20 20  |entative:       |
00002b00  20 20 20 20 0a 20 2a 0a  20 2a 20 20 20 20 61 73  |    . *. *    as|
00002b10  73 69 67 6e 6d 65 6e 74  73 20 20 20 20 20 20 20  |signments       |
00002b20  20 20 20 20 20 20 20 20  20 20 20 35 32 20 28 35  |           52 (5|
00002b30  31 2e 30 20 25 29 0a 20  2a 20 20 20 20 63 6f 6e  |1.0 %). *    con|
00002b40  74 72 6f 6c 20 73 74 61  74 65 6d 65 6e 74 73 20  |trol statements |
00002b50  20 20 20 20 20 20 20 20  20 20 33 33 20 28 33 32  |          33 (32|
00002b60  2e 34 20 25 29 0a 20 2a  20 20 20 20 70 72 6f 63  |.4 %). *    proc|
00002b70  65 64 75 72 65 2c 20 66  75 6e 63 74 69 6f 6e 20  |edure, function |
00002b80  63 61 6c 6c 73 20 20 20  20 31 37 20 28 31 36 2e  |calls    17 (16.|
00002b90  37 20 25 29 0a 20 2a 0a  20 2a 20 20 31 30 33 20  |7 %). *. *  103 |
00002ba0  73 74 61 74 65 6d 65 6e  74 73 20 61 72 65 20 64  |statements are d|
00002bb0  79 6e 61 6d 69 63 61 6c  6c 79 20 65 78 65 63 75  |ynamically execu|
00002bc0  74 65 64 2e 20 54 68 65  20 70 72 6f 67 72 61 6d  |ted. The program|
00002bd0  20 69 73 20 62 61 6c 61  6e 63 65 64 20 77 69 74  | is balanced wit|
00002be0  68 0a 20 2a 20 20 72 65  73 70 65 63 74 20 74 6f  |h. *  respect to|
00002bf0  20 74 68 65 20 74 68 72  65 65 20 61 73 70 65 63  | the three aspec|
00002c00  74 73 3a 20 20 20 20 20  20 20 20 20 20 20 20 20  |ts:             |
00002c10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00002c30  0a 20 2a 0a 20 2a 20 20  20 20 2d 20 73 74 61 74  |. *. *    - stat|
00002c40  65 6d 65 6e 74 20 74 79  70 65 0a 20 2a 20 20 20  |ement type. *   |
00002c50  20 2d 20 6f 70 65 72 61  6e 64 20 74 79 70 65 0a  | - operand type.|
00002c60  20 2a 20 20 20 20 2d 20  6f 70 65 72 61 6e 64 20  | *    - operand |
00002c70  6c 6f 63 61 6c 69 74 79  0a 20 2a 20 20 20 20 20  |locality. *     |
00002c80  20 20 20 20 6f 70 65 72  61 6e 64 20 67 6c 6f 62  |    operand glob|
00002c90  61 6c 2c 20 6c 6f 63 61  6c 2c 20 70 61 72 61 6d  |al, local, param|
00002ca0  65 74 65 72 2c 20 6f 72  20 63 6f 6e 73 74 61 6e  |eter, or constan|
00002cb0  74 2e 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |t.              |
00002cc0  20 20 20 20 20 20 20 0a  20 2a 0a 20 2a 20 20 54  |       . *. *  T|
00002cd0  68 65 20 63 6f 6d 62 69  6e 61 74 69 6f 6e 20 6f  |he combination o|
00002ce0  66 20 74 68 65 73 65 20  74 68 72 65 65 20 61 73  |f these three as|
00002cf0  70 65 63 74 73 20 69 73  20 62 61 6c 61 6e 63 65  |pects is balance|
00002d00  64 20 6f 6e 6c 79 20 61  70 70 72 6f 78 69 6d 61  |d only approxima|
00002d10  74 65 6c 79 2e 20 20 20  20 0a 20 2a 0a 20 2a 20  |tely.    . *. * |
00002d20  20 31 2e 20 53 74 61 74  65 6d 65 6e 74 20 54 79  | 1. Statement Ty|
00002d30  70 65 3a 20 20 20 20 20  20 20 20 20 20 20 20 20  |pe:             |
00002d40  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00002d60  20 20 20 20 20 20 20 20  20 20 20 0a 20 2a 20 20  |           . *  |
00002d70  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00002d80  2d 20 20 20 20 20 20 20  20 20 20 20 20 20 6e 75  |-             nu|
00002d90  6d 62 65 72 0a 20 2a 0a  20 2a 20 20 20 20 20 56  |mber. *. *     V|
00002da0  31 20 3d 20 56 32 20 20  20 20 20 20 20 20 20 20  |1 = V2          |
00002db0  20 20 20 20 20 20 20 20  20 20 20 39 0a 20 2a 20  |           9. * |
00002dc0  20 20 20 20 20 20 28 69  6e 63 6c 2e 20 56 31 20  |      (incl. V1 |
00002dd0  3d 20 46 28 2e 2e 29 0a  20 2a 20 20 20 20 20 56  |= F(..). *     V|
00002de0  20 3d 20 43 6f 6e 73 74  61 6e 74 20 20 20 20 20  | = Constant     |
00002df0  20 20 20 20 20 20 20 20  20 20 31 32 0a 20 2a 20  |          12. * |
00002e00  20 20 20 20 41 73 73 69  67 6e 6d 65 6e 74 2c 20  |    Assignment, |
00002e10  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002e20  37 0a 20 2a 20 20 20 20  20 20 20 77 69 74 68 20  |7. *       with |
00002e30  61 72 72 61 79 20 65 6c  65 6d 65 6e 74 0a 20 2a  |array element. *|
00002e40  20 20 20 20 20 41 73 73  69 67 6e 6d 65 6e 74 2c  |     Assignment,|
00002e50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002e60  20 36 0a 20 2a 20 20 20  20 20 20 20 77 69 74 68  | 6. *       with|
00002e70  20 72 65 63 6f 72 64 20  63 6f 6d 70 6f 6e 65 6e  | record componen|
00002e80  74 0a 20 2a 20 20 20 20  20 20 20 20 20 20 20 20  |t. *            |
00002e90  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002ea0  20 20 20 20 2d 2d 0a 20  2a 20 20 20 20 20 20 20  |    --. *       |
00002eb0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00002ec0  20 20 20 20 20 20 20 20  20 33 34 20 20 20 20 20  |         34     |
00002ed0  20 20 33 34 0a 20 2a 0a  20 2a 20 20 20 20 20 58  |  34. *. *     X|
00002ee0  20 3d 20 59 20 2b 7c 2d  7c 22 26 26 22 7c 22 7c  | = Y +|-|"&&"|"||
00002ef0  22 20 5a 20 20 20 20 20  20 20 20 35 0a 20 2a 20  |" Z        5. * |
00002f00  20 20 20 20 58 20 3d 20  59 20 2b 7c 2d 7c 22 3d  |    X = Y +|-|"=|
00002f10  3d 22 20 43 6f 6e 73 74  61 6e 74 20 20 20 20 20  |=" Constant     |
00002f20  36 0a 20 2a 20 20 20 20  20 58 20 3d 20 58 20 2b  |6. *     X = X +|
00002f30  7c 2d 20 31 20 20 20 20  20 20 20 20 20 20 20 20  ||- 1            |
00002f40  20 20 20 20 20 33 0a 20  2a 20 20 20 20 20 58 20  |     3. *     X |
00002f50  3d 20 59 20 2a 7c 2f 20  5a 20 20 20 20 20 20 20  |= Y *|/ Z       |
00002f60  20 20 20 20 20 20 20 20  20 20 32 0a 20 2a 20 20  |          2. *  |
00002f70  20 20 20 58 20 3d 20 45  78 70 72 65 73 73 69 6f  |   X = Expressio|
00002f80  6e 2c 20 20 20 20 20 20  20 20 20 20 20 20 20 31  |n,             1|
00002f90  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 74 77  |. *           tw|
00002fa0  6f 20 6f 70 65 72 61 74  6f 72 73 0a 20 2a 20 20  |o operators. *  |
00002fb0  20 20 20 58 20 3d 20 45  78 70 72 65 73 73 69 6f  |   X = Expressio|
00002fc0  6e 2c 20 20 20 20 20 20  20 20 20 20 20 20 20 31  |n,             1|
00002fd0  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 74 68  |. *           th|
00002fe0  72 65 65 20 6f 70 65 72  61 74 6f 72 73 0a 20 2a  |ree operators. *|
00002ff0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00003010  2d 2d 0a 20 2a 20 20 20  20 20 20 20 20 20 20 20  |--. *           |
00003020  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003030  20 20 20 20 20 31 38 20  20 20 20 20 20 20 31 38  |     18       18|
00003040  0a 20 2a 0a 20 2a 20 20  20 20 20 69 66 20 2e 2e  |. *. *     if ..|
00003050  2e 2e 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |..              |
00003060  20 20 20 20 20 20 31 34  0a 20 2a 20 20 20 20 20  |      14. *     |
00003070  20 20 77 69 74 68 20 22  65 6c 73 65 22 20 20 20  |  with "else"   |
00003080  20 20 20 37 0a 20 2a 20  20 20 20 20 20 20 77 69  |   7. *       wi|
00003090  74 68 6f 75 74 20 22 65  6c 73 65 22 20 20 20 37  |thout "else"   7|
000030a0  0a 20 2a 20 20 20 20 20  20 20 20 20 20 20 65 78  |. *           ex|
000030b0  65 63 75 74 65 64 20 20  20 20 20 20 20 20 33 0a  |ecuted        3.|
000030c0  20 2a 20 20 20 20 20 20  20 20 20 20 20 6e 6f 74  | *           not|
000030d0  20 65 78 65 63 75 74 65  64 20 20 20 20 34 0a 20  | executed    4. |
000030e0  2a 20 20 20 20 20 66 6f  72 20 2e 2e 2e 20 20 20  |*     for ...   |
000030f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003100  20 20 37 20 20 7c 20 20  63 6f 75 6e 74 65 64 20  |  7  |  counted |
00003110  65 76 65 72 79 20 74 69  6d 65 0a 20 2a 20 20 20  |every time. *   |
00003120  20 20 77 68 69 6c 65 20  2e 2e 2e 20 20 20 20 20  |  while ...     |
00003130  20 20 20 20 20 20 20 20  20 20 20 20 20 20 34 20  |              4 |
00003140  20 7c 20 20 74 68 65 20  6c 6f 6f 70 20 63 6f 6e  | |  the loop con|
00003150  64 69 74 69 6f 6e 0a 20  2a 20 20 20 20 20 64 6f  |dition. *     do|
00003160  20 2e 2e 2e 20 77 68 69  6c 65 20 20 20 20 20 20  | ... while      |
00003170  20 20 20 20 20 20 20 20  20 20 31 20 20 7c 20 20  |          1  |  |
00003180  69 73 20 65 76 61 6c 75  61 74 65 64 0a 20 2a 20  |is evaluated. * |
00003190  20 20 20 20 73 77 69 74  63 68 20 2e 2e 2e 20 20  |    switch ...  |
000031a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000031b0  31 0a 20 2a 20 20 20 20  20 62 72 65 61 6b 20 20  |1. *     break  |
000031c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000031d0  20 20 20 20 20 31 0a 20  2a 20 20 20 20 20 64 65  |     1. *     de|
000031e0  63 6c 61 72 61 74 69 6f  6e 20 77 69 74 68 20 20  |claration with  |
000031f0  20 20 20 20 20 20 20 20  20 20 31 0a 20 2a 20 20  |          1. *  |
00003200  20 20 20 20 20 69 6e 69  74 69 61 6c 69 7a 61 74  |     initializat|
00003210  69 6f 6e 0a 20 2a 20 20  20 20 20 20 20 20 20 20  |ion. *          |
00003220  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003230  20 20 20 20 20 20 2d 2d  0a 20 2a 20 20 20 20 20  |      --. *     |
00003240  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003250  20 20 20 20 20 20 20 20  20 20 20 33 34 20 20 20  |           34   |
00003260  20 20 20 20 33 34 0a 20  2a 0a 20 2a 20 20 20 20  |    34. *. *    |
00003270  20 50 20 28 2e 2e 2e 29  20 20 70 72 6f 63 65 64  | P (...)  proced|
00003280  75 72 65 20 63 61 6c 6c  20 20 20 20 31 31 0a 20  |ure call    11. |
00003290  2a 20 20 20 20 20 20 20  75 73 65 72 20 70 72 6f  |*       user pro|
000032a0  63 65 64 75 72 65 20 20  20 20 20 20 31 30 0a 20  |cedure      10. |
000032b0  2a 20 20 20 20 20 20 20  6c 69 62 72 61 72 79 20  |*       library |
000032c0  70 72 6f 63 65 64 75 72  65 20 20 20 20 31 0a 20  |procedure    1. |
000032d0  2a 20 20 20 20 20 58 20  3d 20 46 20 28 2e 2e 2e  |*     X = F (...|
000032e0  29 0a 20 2a 20 20 20 20  20 20 20 20 20 20 20 20  |). *            |
000032f0  20 66 75 6e 63 74 69 6f  6e 20 20 63 61 6c 6c 20  | function  call |
00003300  20 20 20 20 20 36 0a 20  2a 20 20 20 20 20 20 20  |     6. *       |
00003310  75 73 65 72 20 66 75 6e  63 74 69 6f 6e 20 20 20  |user function   |
00003320  20 20 20 20 20 35 20 20  20 20 20 20 20 20 20 20  |     5          |
00003330  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003340  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 0a  |               .|
00003350  20 2a 20 20 20 20 20 20  20 6c 69 62 72 61 72 79  | *       library|
00003360  20 66 75 6e 63 74 69 6f  6e 20 20 20 20 20 31 20  | function     1 |
00003370  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00003390  20 20 20 20 20 20 20 20  20 20 20 20 20 20 0a 20  |              . |
000033a0  2a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |*               |
000033b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000033c0  20 2d 2d 20 20 20 20 20  20 20 20 20 20 20 20 20  | --             |
000033d0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000033e0  20 20 20 20 20 20 20 20  20 20 20 20 20 0a 20 2a  |             . *|
000033f0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00003410  31 37 20 20 20 20 20 20  20 31 37 0a 20 2a 20 20  |17       17. *  |
00003420  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00003440  20 20 20 20 20 20 2d 2d  2d 0a 20 2a 20 20 20 20  |      ---. *    |
00003450  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00003470  20 20 20 20 31 30 33 0a  20 2a 0a 20 2a 20 20 20  |    103. *. *   |
00003480  20 54 68 65 20 61 76 65  72 61 67 65 20 6e 75 6d  | The average num|
00003490  62 65 72 20 6f 66 20 70  61 72 61 6d 65 74 65 72  |ber of parameter|
000034a0  73 20 69 6e 20 70 72 6f  63 65 64 75 72 65 20 6f  |s in procedure o|
000034b0  72 20 66 75 6e 63 74 69  6f 6e 20 63 61 6c 6c 73  |r function calls|
000034c0  0a 20 2a 20 20 20 20 69  73 20 31 2e 38 32 20 28  |. *    is 1.82 (|
000034d0  6e 6f 74 20 63 6f 75 6e  74 69 6e 67 20 74 68 65  |not counting the|
000034e0  20 66 75 6e 63 74 69 6f  6e 20 76 61 6c 75 65 73  | function values|
000034f0  20 61 58 20 2a 0a 20 2a  0a 20 2a 20 20 32 2e 20  | aX *. *. *  2. |
00003500  4f 70 65 72 61 74 6f 72  73 0a 20 2a 20 20 2d 2d  |Operators. *  --|
00003510  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 0a 20 2a 20 20 20  |----------. *   |
00003520  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003530  20 20 20 20 20 20 20 6e  75 6d 62 65 72 20 20 20  |       number   |
00003540  20 61 70 70 72 6f 78 69  6d 61 74 65 0a 20 2a 20  | approximate. * |
00003550  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00003570  20 20 20 70 65 72 63 65  6e 74 61 67 65 0a 20 2a  |   percentage. *|
00003580  0a 20 2a 20 20 20 20 41  72 69 74 68 6d 65 74 69  |. *    Arithmeti|
00003590  63 20 20 20 20 20 20 20  20 20 20 20 20 20 33 32  |c             32|
000035a0  20 20 20 20 20 20 20 20  20 20 35 30 2e 38 20 20  |          50.8  |
000035b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000035c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 0a  |               .|
000035d0  20 2a 0a 20 2a 20 20 20  20 20 20 20 2b 20 20 20  | *. *       +   |
000035e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000035f0  20 20 32 31 20 20 20 20  20 20 20 20 20 20 33 33  |  21          33|
00003600  2e 33 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.3              |
00003610  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003620  0a 20 2a 20 20 20 20 20  20 20 2d 20 20 20 20 20  |. *       -     |
00003630  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003640  20 37 20 20 20 20 20 20  20 20 20 20 31 31 2e 31  | 7          11.1|
00003650  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003660  20 20 20 20 20 20 20 20  20 20 20 20 20 20 0a 20  |              . |
00003670  2a 20 20 20 20 20 20 20  2a 20 20 20 20 20 20 20  |*       *       |
00003680  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 33  |               3|
00003690  20 20 20 20 20 20 20 20  20 20 20 34 2e 38 0a 20  |           4.8. |
000036a0  2a 20 20 20 20 20 20 20  2f 20 28 69 6e 74 20 64  |*       / (int d|
000036b0  69 76 29 20 20 20 20 20  20 20 20 20 20 20 20 31  |iv)            1|
000036c0  20 20 20 20 20 20 20 20  20 20 20 31 2e 36 0a 20  |           1.6. |
000036d0  2a 0a 20 2a 20 20 20 20  43 6f 6d 70 61 72 69 73  |*. *    Comparis|
000036e0  6f 6e 20 20 20 20 20 20  20 20 20 20 20 20 20 32  |on             2|
000036f0  37 20 20 20 20 20 20 20  20 20 20 20 34 32 2e 38  |7           42.8|
00003700  0a 20 2a 0a 20 2a 20 20  20 20 20 20 20 3d 3d 20  |. *. *       == |
00003710  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003720  20 20 20 20 39 20 20 20  20 20 20 20 20 20 20 20  |    9           |
00003730  31 34 2e 33 0a 20 2a 20  20 20 20 20 20 20 2f 3d  |14.3. *       /=|
00003740  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003750  20 20 20 20 20 34 20 20  20 20 20 20 20 20 20 20  |     4          |
00003760  20 20 36 2e 33 0a 20 2a  20 20 20 20 20 20 20 3e  |  6.3. *       >|
00003770  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003780  20 20 20 20 20 20 31 20  20 20 20 20 20 20 20 20  |      1         |
00003790  20 20 20 31 2e 36 0a 20  2a 20 20 20 20 20 20 20  |   1.6. *       |
000037a0  3c 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |<               |
000037b0  20 20 20 20 20 20 20 33  20 20 20 20 20 20 20 20  |       3        |
000037c0  20 20 20 20 34 2e 38 0a  20 2a 20 20 20 20 20 20  |    4.8. *      |
000037d0  20 3e 3d 20 20 20 20 20  20 20 20 20 20 20 20 20  | >=             |
000037e0  20 20 20 20 20 20 20 20  31 20 20 20 20 20 20 20  |        1       |
000037f0  20 20 20 20 20 31 2e 36  0a 20 2a 20 20 20 20 20  |     1.6. *     |
00003800  20 20 3c 3d 20 20 20 20  20 20 20 20 20 20 20 20  |  <=            |
00003810  20 20 20 20 20 20 20 20  20 39 20 20 20 20 20 20  |         9      |
00003820  20 20 20 20 20 31 34 2e  33 0a 20 2a 0a 20 2a 20  |     14.3. *. * |
00003830  20 20 20 4c 6f 67 69 63  20 20 20 20 20 20 20 20  |   Logic        |
00003840  20 20 20 20 20 20 20 20  20 20 20 34 20 20 20 20  |           4    |
00003850  20 20 20 20 20 20 20 20  36 2e 33 0a 20 2a 0a 20  |        6.3. *. |
00003860  2a 20 20 20 20 20 20 20  26 26 20 28 41 4e 44 2d  |*       && (AND-|
00003870  54 48 45 4e 29 20 20 20  20 20 20 20 20 20 20 31  |THEN)          1|
00003880  20 20 20 20 20 20 20 20  20 20 20 20 31 2e 36 0a  |            1.6.|
00003890  20 2a 20 20 20 20 20 20  20 7c 20 20 28 4f 52 29  | *       |  (OR)|
000038a0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000038b0  31 20 20 20 20 20 20 20  20 20 20 20 20 31 2e 36  |1            1.6|
000038c0  0a 20 2a 20 20 20 20 20  20 20 21 20 20 28 4e 4f  |. *       !  (NO|
000038d0  54 29 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |T)              |
000038e0  20 32 20 20 20 20 20 20  20 20 20 20 20 20 33 2e  | 2            3.|
000038f0  32 0a 20 2a 20 0a 20 2a  20 20 20 20 20 20 20 20  |2. * . *        |
00003900  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003910  20 20 20 2d 2d 20 20 20  20 20 20 20 20 20 20 2d  |   --          -|
00003920  2d 2d 2d 2d 0a 20 2a 20  20 20 20 20 20 20 20 20  |----. *         |
00003930  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003940  20 20 36 33 20 20 20 20  20 20 20 20 20 20 31 30  |  63          10|
00003950  30 2e 31 0a 20 2a 0a 20  2a 0a 20 2a 20 20 33 2e  |0.1. *. *. *  3.|
00003960  20 4f 70 65 72 61 6e 64  20 54 79 70 65 20 28 63  | Operand Type (c|
00003970  6f 75 6e 74 65 64 20 6f  6e 63 65 20 70 65 72 20  |ounted once per |
00003980  6f 70 65 72 61 6e 64 20  72 65 66 65 72 65 6e 63  |operand referenc|
00003990  65 29 3a 0a 20 2a 20 20  2d 2d 2d 2d 2d 2d 2d 2d  |e):. *  --------|
000039a0  2d 2d 2d 2d 2d 2d 2d 0a  20 2a 20 20 20 20 20 20  |-------. *      |
000039b0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
000039c0  20 20 20 20 6e 75 6d 62  65 72 20 20 20 20 61 70  |    number    ap|
000039d0  70 72 6f 78 69 6d 61 74  65 0a 20 2a 20 20 20 20  |proximate. *    |
000039e0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00003a00  70 65 72 63 65 6e 74 61  67 65 0a 20 2a 0a 20 2a  |percentage. *. *|
00003a10  20 20 20 20 20 49 6e 74  65 67 65 72 20 20 20 20  |     Integer    |
00003a20  20 20 20 20 20 20 20 20  20 20 20 31 37 35 20 20  |           175  |
00003a30  20 20 20 20 20 20 37 32  2e 33 20 25 0a 20 2a 20  |      72.3 %. * |
00003a40  20 20 20 20 43 68 61 72  61 63 74 65 72 20 20 20  |    Character   |
00003a50  20 20 20 20 20 20 20 20  20 20 20 34 35 20 20 20  |           45   |
00003a60  20 20 20 20 20 31 38 2e  36 20 25 0a 20 2a 20 20  |     18.6 %. *  |
00003a70  20 20 20 50 6f 69 6e 74  65 72 20 20 20 20 20 20  |   Pointer      |
00003a80  20 20 20 20 20 20 20 20  20 20 31 32 20 20 20 20  |          12    |
00003a90  20 20 20 20 20 35 2e 30  20 25 0a 20 2a 20 20 20  |     5.0 %. *   |
00003aa0  20 20 53 74 72 69 6e 67  33 30 20 20 20 20 20 20  |  String30      |
00003ab0  20 20 20 20 20 20 20 20  20 20 36 20 20 20 20 20  |          6     |
00003ac0  20 20 20 20 32 2e 35 20  25 0a 20 2a 20 20 20 20  |    2.5 %. *    |
00003ad0  20 41 72 72 61 79 20 20  20 20 20 20 20 20 20 20  | Array          |
00003ae0  20 20 20 20 20 20 20 20  20 32 20 20 20 20 20 20  |         2      |
00003af0  20 20 20 30 2e 38 20 25  0a 20 2a 20 20 20 20 20  |   0.8 %. *     |
00003b00  52 65 63 6f 72 64 20 20  20 20 20 20 20 20 20 20  |Record          |
00003b10  20 20 20 20 20 20 20 20  32 20 20 20 20 20 20 20  |        2       |
00003b20  20 20 30 2e 38 20 25 0a  20 2a 20 20 20 20 20 20  |  0.8 %. *      |
00003b30  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003b40  20 20 20 20 20 2d 2d 2d  20 20 20 20 20 20 20 2d  |     ---       -|
00003b50  2d 2d 2d 2d 2d 2d 0a 20  2a 20 20 20 20 20 20 20  |------. *       |
00003b60  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003b70  20 20 20 20 32 34 32 20  20 20 20 20 20 20 31 30  |    242       10|
00003b80  30 2e 30 20 25 0a 20 2a  0a 20 2a 20 20 57 68 65  |0.0 %. *. *  Whe|
00003b90  6e 20 74 68 65 72 65 20  69 73 20 61 6e 20 61 63  |n there is an ac|
00003ba0  63 65 73 73 20 70 61 74  68 20 6c 65 61 64 69 6e  |cess path leadin|
00003bb0  67 20 74 6f 20 74 68 65  20 66 69 6e 61 6c 20 6f  |g to the final o|
00003bc0  70 65 72 61 6e 64 20 28  65 2e 67 2e 20 61 20 72  |perand (e.g. a r|
00003bd0  65 63 6f 72 64 0a 20 2a  20 20 63 6f 6d 70 6f 6e  |ecord. *  compon|
00003be0  65 6e 74 29 2c 20 6f 6e  6c 79 20 74 68 65 20 66  |ent), only the f|
00003bf0  69 6e 61 6c 20 64 61 74  61 20 74 79 70 65 20 6f  |inal data type o|
00003c00  6e 20 74 68 65 20 61 63  63 65 73 73 20 70 61 74  |n the access pat|
00003c10  68 20 69 73 20 63 6f 75  6e 74 65 64 2e 20 20 20  |h is counted.   |
00003c20  20 20 20 20 0a 20 2a 0a  20 2a 0a 20 2a 20 20 34  |    . *. *. *  4|
00003c30  2e 20 4f 70 65 72 61 6e  64 20 4c 6f 63 61 6c 69  |. Operand Locali|
00003c40  74 79 3a 20 20 20 20 20  20 20 20 20 20 20 20 20  |ty:             |
00003c50  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00003c70  20 20 20 20 20 20 20 20  20 0a 20 2a 20 20 2d 2d  |         . *  --|
00003c80  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00003c90  2d 0a 20 2a 20 20 20 20  20 20 20 20 20 20 20 20  |-. *            |
00003ca0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003cb0  20 20 20 20 6e 75 6d 62  65 72 20 20 20 20 61 70  |    number    ap|
00003cc0  70 72 6f 78 69 6d 61 74  65 0a 20 2a 20 20 20 20  |proximate. *    |
00003cd0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00003cf0  20 20 20 20 20 20 70 65  72 63 65 6e 74 61 67 65  |      percentage|
00003d00  0a 20 2a 0a 20 2a 20 20  20 20 20 6c 6f 63 61 6c  |. *. *     local|
00003d10  20 76 61 72 69 61 62 6c  65 20 20 20 20 20 20 20  | variable       |
00003d20  20 20 20 20 20 20 20 31  31 34 20 20 20 20 20 20  |       114      |
00003d30  20 20 34 37 2e 31 20 25  0a 20 2a 20 20 20 20 20  |  47.1 %. *     |
00003d40  67 6c 6f 62 61 6c 20 76  61 72 69 61 62 6c 65 20  |global variable |
00003d50  20 20 20 20 20 20 20 20  20 20 20 20 20 32 32 20  |             22 |
00003d60  20 20 20 20 20 20 20 20  39 2e 31 20 25 0a 20 2a  |        9.1 %. *|
00003d70  20 20 20 20 20 70 61 72  61 6d 65 74 65 72 20 20  |     parameter  |
00003d80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003d90  20 20 34 35 20 20 20 20  20 20 20 20 31 38 2e 36  |  45        18.6|
00003da0  20 25 0a 20 2a 20 20 20  20 20 20 20 20 76 61 6c  | %. *        val|
00003db0  75 65 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |ue              |
00003dc0  20 20 20 20 20 20 20 20  20 20 32 33 20 20 20 20  |          23    |
00003dd0  20 20 20 20 20 39 2e 35  20 25 0a 20 2a 20 20 20  |     9.5 %. *   |
00003de0  20 20 20 20 20 72 65 66  65 72 65 6e 63 65 20 20  |     reference  |
00003df0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003e00  20 20 32 32 20 20 20 20  20 20 20 20 20 39 2e 31  |  22         9.1|
00003e10  20 25 0a 20 2a 20 20 20  20 20 66 75 6e 63 74 69  | %. *     functi|
00003e20  6f 6e 20 72 65 73 75 6c  74 20 20 20 20 20 20 20  |on result       |
00003e30  20 20 20 20 20 20 20 20  36 20 20 20 20 20 20 20  |        6       |
00003e40  20 20 32 2e 35 20 25 0a  20 2a 20 20 20 20 20 63  |  2.5 %. *     c|
00003e50  6f 6e 73 74 61 6e 74 20  20 20 20 20 20 20 20 20  |onstant         |
00003e60  20 20 20 20 20 20 20 20  20 20 20 20 35 35 20 20  |            55  |
00003e70  20 20 20 20 20 20 32 32  2e 37 20 25 0a 20 2a 20  |      22.7 %. * |
00003e80  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00003ea0  2d 2d 2d 20 20 20 20 20  20 20 2d 2d 2d 2d 2d 2d  |---       ------|
00003eb0  2d 0a 20 2a 20 20 20 20  20 20 20 20 20 20 20 20  |-. *            |
00003ec0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00003ed0  20 20 20 20 20 32 34 32  20 20 20 20 20 20 20 31  |     242       1|
00003ee0  30 30 2e 30 20 25 0a 20  2a 0a 20 2a 0a 20 2a 20  |00.0 %. *. *. * |
00003ef0  20 54 68 65 20 70 72 6f  67 72 61 6d 20 64 6f 65  | The program doe|
00003f00  73 20 6e 6f 74 20 63 6f  6d 70 75 74 65 20 61 6e  |s not compute an|
00003f10  79 74 68 69 6e 67 20 6d  65 61 6e 69 6e 67 66 75  |ything meaningfu|
00003f20  6c 2c 20 62 75 74 20 69  74 20 69 73 20 73 79 6e  |l, but it is syn|
00003f30  74 61 63 74 69 63 61 6c  6c 79 0a 20 2a 20 20 61  |tactically. *  a|
00003f40  6e 64 20 73 65 6d 61 6e  74 69 63 61 6c 6c 79 20  |nd semantically |
00003f50  63 6f 72 72 65 63 74 2e  20 41 6c 6c 20 76 61 72  |correct. All var|
00003f60  69 61 62 6c 65 73 20 68  61 76 65 20 61 20 76 61  |iables have a va|
00003f70  6c 75 65 20 61 73 73 69  67 6e 65 64 20 74 6f 20  |lue assigned to |
00003f80  74 68 65 6d 0a 20 2a 20  20 62 65 66 6f 72 65 20  |them. *  before |
00003f90  74 68 65 79 20 61 72 65  20 75 73 65 64 20 61 73  |they are used as|
00003fa0  20 61 20 73 6f 75 72 63  65 20 6f 70 65 72 61 6e  | a source operan|
00003fb0  64 2e 0a 20 2a 0a 20 2a  20 20 54 68 65 72 65 20  |d.. *. *  There |
00003fc0  68 61 73 20 62 65 65 6e  20 6e 6f 20 65 78 70 6c  |has been no expl|
00003fd0  69 63 69 74 20 65 66 66  6f 72 74 20 74 6f 20 61  |icit effort to a|
00003fe0  63 63 6f 75 6e 74 20 66  6f 72 20 74 68 65 20 65  |ccount for the e|
00003ff0  66 66 65 63 74 73 20 6f  66 20 61 0a 20 2a 20 20  |ffects of a. *  |
00004000  63 61 63 68 65 2c 20 6f  72 20 74 6f 20 62 61 6c  |cache, or to bal|
00004010  61 6e 63 65 20 74 68 65  20 75 73 65 20 6f 66 20  |ance the use of |
00004020  6c 6f 6e 67 20 6f 72 20  73 68 6f 72 74 20 64 69  |long or short di|
00004030  73 70 6c 61 63 65 6d 65  6e 74 73 20 66 6f 72 20  |splacements for |
00004040  63 6f 64 65 20 6f 72 0a  20 2a 20 20 64 61 74 61  |code or. *  data|
00004050  2e 0a 20 2a 0a 20 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |.. *. **********|
00004060  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |****************|
*
000040a0  2a 0a 20 2a 2f 0a 0a 2f  2a 20 43 6f 6d 70 69 6c  |*. */../* Compil|
000040b0  65 72 20 61 6e 64 20 73  79 73 74 65 6d 20 64 65  |er and system de|
000040c0  70 65 6e 64 65 6e 74 20  64 65 66 69 6e 69 74 69  |pendent definiti|
000040d0  6f 6e 73 3a 20 2a 2f 0a  0a 23 69 66 6e 64 65 66  |ons: */..#ifndef|
000040e0  20 54 49 4d 45 0a 23 75  6e 64 65 66 20 54 49 4d  | TIME.#undef TIM|
000040f0  45 53 0a 23 64 65 66 69  6e 65 20 54 49 4d 45 53  |ES.#define TIMES|
00004100  0a 23 65 6e 64 69 66 0a  20 20 20 20 20 20 20 20  |.#endif.        |
00004110  20 20 20 20 20 20 20 20  2f 2a 20 55 73 65 20 74  |        /* Use t|
00004120  69 6d 65 73 28 32 29 20  74 69 6d 65 20 66 75 6e  |imes(2) time fun|
00004130  63 74 69 6f 6e 20 75 6e  6c 65 73 73 20 20 20 20  |ction unless    |
00004140  2a 2f 0a 20 20 20 20 20  20 20 20 20 20 20 20 20  |*/.             |
00004150  20 20 20 2f 2a 20 65 78  70 6c 69 63 69 74 6c 79  |   /* explicitly|
00004160  20 64 65 66 69 6e 65 64  20 6f 74 68 65 72 77 69  | defined otherwi|
00004170  73 65 20 20 20 20 20 20  20 20 20 2a 2f 0a 0a 23  |se         */..#|
00004180  69 66 64 65 66 20 4d 53  43 5f 43 4c 4f 43 4b 0a  |ifdef MSC_CLOCK.|
00004190  23 75 6e 64 65 66 20 48  5a 0a 23 75 6e 64 65 66  |#undef HZ.#undef|
000041a0  20 54 49 4d 45 53 0a 23  69 6e 63 6c 75 64 65 20  | TIMES.#include |
000041b0  3c 74 69 6d 65 2e 68 3e  0a 23 64 65 66 69 6e 65  |<time.h>.#define|
000041c0  20 48 5a 20 20 20 20 20  43 4c 4b 5f 54 43 4b 0a  | HZ     CLK_TCK.|
000041d0  23 65 6e 64 69 66 0a 20  20 20 20 20 20 20 20 20  |#endif.         |
000041e0  20 20 20 20 20 20 2f 2a  20 55 73 65 20 4d 69 63  |      /* Use Mic|
000041f0  72 6f 73 6f 66 74 20 43  20 68 69 2d 72 65 73 20  |rosoft C hi-res |
00004200  63 6c 6f 63 6b 20 2a 2f  0a 0a 23 69 66 64 65 66  |clock */..#ifdef|
00004210  20 54 49 4d 45 53 0a 23  69 6e 63 6c 75 64 65 20  | TIMES.#include |
00004220  3c 73 79 73 2f 74 79 70  65 73 2e 68 3e 0a 23 69  |<sys/types.h>.#i|
00004230  6e 63 6c 75 64 65 20 3c  73 79 73 2f 74 69 6d 65  |nclude <sys/time|
00004240  73 2e 68 3e 0a 20 20 20  20 20 20 20 20 20 20 20  |s.h>.           |
00004250  20 20 20 20 20 2f 2a 20  66 6f 72 20 22 74 69 6d  |     /* for "tim|
00004260  65 73 22 20 2a 2f 0a 23  65 6e 64 69 66 0a 0a 23  |es" */.#endif..#|
00004270  64 65 66 69 6e 65 20 4d  69 63 5f 73 65 63 73 5f  |define Mic_secs_|
00004280  50 65 72 5f 53 65 63 6f  6e 64 20 20 20 20 20 31  |Per_Second     1|
00004290  30 30 30 30 30 30 2e 30  0a 20 20 20 20 20 20 20  |000000.0.       |
000042a0  20 20 20 20 20 20 20 20  20 2f 2a 20 42 65 72 6b  |         /* Berk|
000042b0  65 6c 65 79 20 55 4e 49  58 20 43 20 72 65 74 75  |eley UNIX C retu|
000042c0  72 6e 73 20 70 72 6f 63  65 73 73 20 74 69 6d 65  |rns process time|
000042d0  73 20 69 6e 20 73 65 63  6f 6e 64 73 2f 48 5a 20  |s in seconds/HZ |
000042e0  2a 2f 0a 0a 23 69 66 64  65 66 20 20 4e 4f 53 54  |*/..#ifdef  NOST|
000042f0  52 55 43 54 41 53 53 49  47 4e 0a 23 64 65 66 69  |RUCTASSIGN.#defi|
00004300  6e 65 20 73 74 72 75 63  74 61 73 73 69 67 6e 28  |ne structassign(|
00004310  64 2c 20 73 29 20 20 20  20 20 20 6d 65 6d 63 70  |d, s)      memcp|
00004320  79 28 26 28 64 29 2c 20  26 28 73 29 2c 20 73 69  |y(&(d), &(s), si|
00004330  7a 65 6f 66 28 64 29 29  0a 23 65 6c 73 65 0a 23  |zeof(d)).#else.#|
00004340  64 65 66 69 6e 65 20 73  74 72 75 63 74 61 73 73  |define structass|
00004350  69 67 6e 28 64 2c 20 73  29 20 20 20 20 20 20 64  |ign(d, s)      d|
00004360  20 3d 20 73 0a 23 65 6e  64 69 66 0a 0a 23 69 66  | = s.#endif..#if|
00004370  64 65 66 20 20 4e 4f 45  4e 55 4d 0a 23 64 65 66  |def  NOENUM.#def|
00004380  69 6e 65 20 49 64 65 6e  74 5f 31 20 30 0a 23 64  |ine Ident_1 0.#d|
00004390  65 66 69 6e 65 20 49 64  65 6e 74 5f 32 20 31 0a  |efine Ident_2 1.|
000043a0  23 64 65 66 69 6e 65 20  49 64 65 6e 74 5f 33 20  |#define Ident_3 |
000043b0  32 0a 23 64 65 66 69 6e  65 20 49 64 65 6e 74 5f  |2.#define Ident_|
000043c0  34 20 33 0a 23 64 65 66  69 6e 65 20 49 64 65 6e  |4 3.#define Iden|
000043d0  74 5f 35 20 34 0a 20 20  74 79 70 65 64 65 66 20  |t_5 4.  typedef |
000043e0  69 6e 74 20 20 20 45 6e  75 6d 65 72 61 74 69 6f  |int   Enumeratio|
000043f0  6e 3b 0a 23 65 6c 73 65  0a 20 20 74 79 70 65 64  |n;.#else.  typed|
00004400  65 66 20 20 20 20 20 20  20 65 6e 75 6d 20 20 20  |ef       enum   |
00004410  20 7b 49 64 65 6e 74 5f  31 2c 20 49 64 65 6e 74  | {Ident_1, Ident|
00004420  5f 32 2c 20 49 64 65 6e  74 5f 33 2c 20 49 64 65  |_2, Ident_3, Ide|
00004430  6e 74 5f 34 2c 20 49 64  65 6e 74 5f 35 7d 0a 20  |nt_4, Ident_5}. |
00004440  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 45  |               E|
00004450  6e 75 6d 65 72 61 74 69  6f 6e 3b 0a 23 65 6e 64  |numeration;.#end|
00004460  69 66 0a 20 20 20 20 20  20 20 20 2f 2a 20 66 6f  |if.        /* fo|
00004470  72 20 62 6f 6f 6c 65 61  6e 20 61 6e 64 20 65 6e  |r boolean and en|
00004480  75 6d 65 72 61 74 69 6f  6e 20 74 79 70 65 73 20  |umeration types |
00004490  69 6e 20 41 64 61 2c 20  50 61 73 63 61 6c 20 2a  |in Ada, Pascal *|
000044a0  2f 0a 0a 2f 2a 20 47 65  6e 65 72 61 6c 20 64 65  |/../* General de|
000044b0  66 69 6e 69 74 69 6f 6e  73 3a 20 2a 2f 0a 0a 23  |finitions: */..#|
000044c0  69 6e 63 6c 75 64 65 20  3c 73 74 64 69 6f 2e 68  |include <stdio.h|
000044d0  3e 0a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |>.              |
000044e0  20 20 2f 2a 20 66 6f 72  20 73 74 72 63 70 79 2c  |  /* for strcpy,|
000044f0  20 73 74 72 63 6d 70 20  2a 2f 0a 0a 23 64 65 66  | strcmp */..#def|
00004500  69 6e 65 20 4e 75 6c 6c  20 30 20 0a 20 20 20 20  |ine Null 0 .    |
00004510  20 20 20 20 20 20 20 20  20 20 20 20 2f 2a 20 56  |            /* V|
00004520  61 6c 75 65 20 6f 66 20  61 20 4e 75 6c 6c 20 70  |alue of a Null p|
00004530  6f 69 6e 74 65 72 20 2a  2f 0a 23 64 65 66 69 6e  |ointer */.#defin|
00004540  65 20 74 72 75 65 20 20  31 0a 23 64 65 66 69 6e  |e true  1.#defin|
00004550  65 20 66 61 6c 73 65 20  30 0a 0a 74 79 70 65 64  |e false 0..typed|
00004560  65 66 20 69 6e 74 20 20  20 20 20 4f 6e 65 5f 54  |ef int     One_T|
00004570  68 69 72 74 79 3b 0a 74  79 70 65 64 65 66 20 69  |hirty;.typedef i|
00004580  6e 74 20 20 20 20 20 4f  6e 65 5f 46 69 66 74 79  |nt     One_Fifty|
00004590  3b 0a 74 79 70 65 64 65  66 20 63 68 61 72 20 20  |;.typedef char  |
000045a0  20 20 43 61 70 69 74 61  6c 5f 4c 65 74 74 65 72  |  Capital_Letter|
000045b0  3b 0a 74 79 70 65 64 65  66 20 69 6e 74 20 20 20  |;.typedef int   |
000045c0  20 20 42 6f 6f 6c 65 61  6e 3b 0a 74 79 70 65 64  |  Boolean;.typed|
000045d0  65 66 20 63 68 61 72 20  20 20 20 53 74 72 5f 33  |ef char    Str_3|
000045e0  30 20 5b 33 31 5d 3b 0a  74 79 70 65 64 65 66 20  |0 [31];.typedef |
000045f0  69 6e 74 20 20 20 20 20  41 72 72 5f 31 5f 44 69  |int     Arr_1_Di|
00004600  6d 20 5b 35 30 5d 3b 0a  74 79 70 65 64 65 66 20  |m [50];.typedef |
00004610  69 6e 74 20 20 20 20 20  41 72 72 5f 32 5f 44 69  |int     Arr_2_Di|
00004620  6d 20 5b 35 30 5d 20 5b  35 30 5d 3b 0a 0a 74 79  |m [50] [50];..ty|
00004630  70 65 64 65 66 20 73 74  72 75 63 74 20 72 65 63  |pedef struct rec|
00004640  6f 72 64 20 0a 20 20 20  20 7b 0a 20 20 20 20 73  |ord .    {.    s|
00004650  74 72 75 63 74 20 72 65  63 6f 72 64 20 2a 50 74  |truct record *Pt|
00004660  72 5f 43 6f 6d 70 3b 0a  20 20 20 20 45 6e 75 6d  |r_Comp;.    Enum|
00004670  65 72 61 74 69 6f 6e 20  20 20 20 44 69 73 63 72  |eration    Discr|
00004680  3b 0a 20 20 20 20 75 6e  69 6f 6e 20 7b 0a 20 20  |;.    union {.  |
00004690  20 20 20 20 20 20 20 20  73 74 72 75 63 74 20 7b  |        struct {|
000046a0  0a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
000046b0  20 20 20 45 6e 75 6d 65  72 61 74 69 6f 6e 20 45  |   Enumeration E|
000046c0  6e 75 6d 5f 43 6f 6d 70  3b 0a 20 20 20 20 20 20  |num_Comp;.      |
000046d0  20 20 20 20 20 20 20 20  20 20 20 20 69 6e 74 20  |            int |
000046e0  20 20 20 20 20 20 20 20  49 6e 74 5f 43 6f 6d 70  |        Int_Comp|
000046f0  3b 0a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |;.              |
00004700  20 20 20 20 63 68 61 72  20 20 20 20 20 20 20 20  |    char        |
00004710  53 74 72 5f 43 6f 6d 70  20 5b 33 31 5d 3b 0a 20  |Str_Comp [31];. |
00004720  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00004730  20 7d 20 76 61 72 5f 31  3b 0a 20 20 20 20 20 20  | } var_1;.      |
00004740  20 20 20 20 73 74 72 75  63 74 20 7b 0a 20 20 20  |    struct {.   |
00004750  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 45  |               E|
00004760  6e 75 6d 65 72 61 74 69  6f 6e 20 45 5f 43 6f 6d  |numeration E_Com|
00004770  70 5f 32 3b 0a 20 20 20  20 20 20 20 20 20 20 20  |p_2;.           |
00004780  20 20 20 20 20 20 20 63  68 61 72 20 20 20 20 20  |       char     |
00004790  20 20 20 53 74 72 5f 32  5f 43 6f 6d 70 20 5b 33  |   Str_2_Comp [3|
000047a0  31 5d 3b 0a 20 20 20 20  20 20 20 20 20 20 20 20  |1];.            |
000047b0  20 20 20 20 20 20 7d 20  76 61 72 5f 32 3b 0a 20  |      } var_2;. |
000047c0  20 20 20 20 20 20 20 20  20 73 74 72 75 63 74 20  |         struct |
000047d0  7b 0a 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |{.              |
000047e0  20 20 20 20 63 68 61 72  20 20 20 20 20 20 20 20  |    char        |
000047f0  43 68 5f 31 5f 43 6f 6d  70 3b 0a 20 20 20 20 20  |Ch_1_Comp;.     |
00004800  20 20 20 20 20 20 20 20  20 20 20 20 20 63 68 61  |             cha|
00004810  72 20 20 20 20 20 20 20  20 43 68 5f 32 5f 43 6f  |r        Ch_2_Co|
00004820  6d 70 3b 0a 20 20 20 20  20 20 20 20 20 20 20 20  |mp;.            |
00004830  20 20 20 20 20 20 7d 20  76 61 72 5f 33 3b 0a 20  |      } var_3;. |
00004840  20 20 20 20 20 20 20 20  20 7d 20 76 61 72 69 61  |         } varia|
00004850  6e 74 3b 0a 20 20 20 20  20 20 7d 20 52 65 63 5f  |nt;.      } Rec_|
00004860  54 79 70 65 2c 20 2a 52  65 63 5f 50 6f 69 6e 74  |Type, *Rec_Point|
00004870  65 72 3b 0a 0a 0a                                 |er;...|
00004876