During compilation, the compiler generates listings that contain information about the source program, the compilation, and the object module. The TERMINAL option sends diagnostics and statistics to your terminal. The IBM.PRINT environment variable specifies the output directory for printable listing files (see IBM.PRINT for more information on the IBM.PRINT environment variable). The following description of the listing refers to its appearance on a printed page.
This listing for CHIMES program highlights some of the more useful parts of the compiler listing. Figure 3 is similar to the compiler listing for that program.
5724-B67 IBM(R) PL/I for Windows 8.0 (Built:20100729) 2010.07.29 10:14:03 Page 1
Options Specified 1
Environment:
Command: chimes ( options
Line.File Process Statements
1.0 *PROCESS MACRO S A(F) X AG;
2.0 *PROCESS NOT('^') OR('|');
Options Used 2
ADDEXT
+ AGGREGATE(DECIMAL)
+ ATTRIBUTES(FULL)
BIFPREC(31)
BLANK('09'x)
CHECK( NOCONFORMANCE NOSTORAGE )
CMPAT(LE)
CODEPAGE(00819)
NOCOMPILE(S)
NOCOPYRIGHT
CURRENCY('$')
NODBCS
DEFAULT(IBM ASSIGNABLE NOINITFILL NONCONNECTED LOWERINC
DESCRIPTOR DESCLIST DUMMY(ALIGNED) ORDINAL(MIN)
BYADDR RETURNS(BYVALUE) LINKAGE(OPTLINK) NORETCODE
NOINLINE REORDER NOOVERLAP NONRECURSIVE ALIGNED
NULLSYS BIN1ARG NULLSTRADDR NULLSTRPTR(NULL) EVENDEC
SHORT(HEXADEC) ASCII IEEE NATIVE NATIVEADDR E(IEEE))
DEPRECATE(
BUILTIN()
ENTRY()
INCLUDE()
VARIABLE()
)
NODLLINIT
NOEXIT
EXTRN(SHORT)
FLAG(W)
FLOATINMATH(ASIS)
NOGONUMBER
NOGRAPHIC
NOIGNORE
IMPRECISE
INCAFTER(PROCESS(""))
NOINCDIR
INCLUDE(EXT('inc' 'cpy' 'mac'))
NOINITAUTO
NOINITBASED
NOINITCTL
NOINITSTATIC
NOINSOURCE
LANGLVL(NOEXT)
LIBS( SINGLE DYNAMIC )
5724-B67 IBM(R) PL/I for Windows 2010.07.29 10:14:03 Page 2
LIMITS( EXTNAME(100) FIXEDBIN(31,31) FIXEDDEC(15,15) NAME(100) )
LINECOUNT(60)
NOLINEDIR
NOLIST
LISTVIEW(SOURCE)
+ MACRO
MARGINI(' ')
MARGINS(2,72)
MAXGEN(100000)
MAXMSG(W 250)
MAXNEST( BLOCK(17) DO(17) IF(17) )
MAXSTMT(4096)
MAXTEMP(50000)
NOMDECK
MSG(*)
NAMES('@#$' '@#$')
NATLANG(ENU)
NONEST
NOT('^')
NUMBER
OBJECT
NOOFFSET
NOONSNAP
OPTIMIZE(0)
+ OPTIONS(DOC)
OR('|')
+ PP( MACRO )
NOPPCICS
NOPPINCLUDE
NOPPMACRO
NOPPSQL
NOPPTRACE
PRECTYPE(ANS)
PREFIX(CONVERSION FIXEDOVERFLOW INVALIDOP OVERFLOW
NOSIZE NOSTRINGRANGE NOSTRINGSIZE NOSUBSCRIPTRANGE
UNDERFLOW ZERODIVIDE)
PROBE
NOPROCEED(S)
PROCESS(DELETE)
QUOTE('"')
REDUCE
RESEXP
RESPECT()
RULES(IBM BYNAME NODECSIZE ELSEIF EVENDEC GOTO GLOBALDO NOLAXBIF
NOLAXCTL LAXDCL NOLAXDEF LAXENTRY LAXIF LAXINOUT LAXLINK
LAXMARGINS LAXPUNC LAXQUAL LAXSCALE LAXSEMI LAXSTG NOLAXSTRZ
MULTICLOSE PADDING PROCENDONLY STOP UNREF)
NOSEMANTIC(S)
NOSNAP
NOSOSI
+ SOURCE
STATIC(SHORT)
NOSTMT
NOSTORAGE
NOSYNTAX(S)
SYSPARM('')
SYSTEM(WINDOWS)
TERMINAL
5724-B67 IBM(R) PL/I for Windows 2010.07.29 10:14:03 Page 3
NOTEST
USAGE( HEX(SIZE) ROUND(IBM) SUBSTR(STRICT) UNSPEC(IBM) )
WIDECHAR(LITTLEENDIAN)
WINDOW(1950)
XINFO(NODEF NOXML)
XML( CASE(UPPER) )
+ XREF(FULL)
5724-B67 IBM(R) PL/I for Windows 2010.07.29 10:14:03 Page 4
Compiler Source
Line.File
3.0
4.0 /********************************************************************/
5.0 /* */
6.0 /* NAME - CHIMES.PLI */
7.0 /* */
8.0 /* DESCRIPTION */
9.0 /* Plays a tune using system API services */
10.0 /* */
11.0 /* 5639-A83, 5639-A24 (C) Copyright IBM Corp. 1992,1996. */
12.0 /* All Rights Reserved. */
13.0 /* US Government Users Restricted Rights-- Use, duplication or */
14.0 /* disclosure restricted by GSA ADP Schedule Contract with */
15.0 /* IBM Corp. */
16.0 /* */
17.0 /* DISCLAIMER OF WARRANTIES */
18.0 /* The following 'enclosed' code is sample code created by IBM */
19.0 /* Corporation. This sample code is not part of any standard */
20.0 /* IBM product and is provided to you solely for the purpose of */
21.0 /* assisting you in the development of your applications. The */
22.0 /* code is provided "AS IS", without warranty of any kind. */
23.0 /* IBM shall not be liable for any damages arising out of your */
24.0 /* use of the sample code, even if IBM has been advised of the */
25.0 /* possibility of such damages. */
26.0 /* */
27.0 /********************************************************************/
28.0
29.0 CHIMES: PROC OPTIONS(MAIN); /* Play a tune using DOSBEEP tones */
30.0
31.0 DCL ( REST VALUE( 0 ), /* Declare Named Constants */
32.0 G4 VALUE( 392 ), /* for note and rest tone */
33.0 C5 VALUE( 523 ), /* values and timings. */
34.0 D5 VALUE( 587 ),
35.0 E5 VALUE( 657 ),
36.0 WHOLE VALUE( 800 ) ) FIXED BIN(31);
37.0
38.0 DCL NOTES(19,2) STATIC NONASGN FIXED BIN(31)
39.0 3 INIT( E5, (WHOLE/2), /* Declare tone and timing */
40.0 C5, (WHOLE/2), /* for each note of tune. */
41.0 D5, (WHOLE/2),
42.0 G4, (WHOLE), /* Initial values may be */
43.0 REST, (WHOLE/2), /* restricted expressions */
44.0 G4, (WHOLE/2), /* using Named Constants */
45.0 D5, (WHOLE/2), /* previously defined in */
46.0 E5, (WHOLE/2), /* this program. */
47.0 C5, (WHOLE),
48.0 REST, (WHOLE/2),
49.0 E5, (WHOLE/2),
50.0 C5, (WHOLE/2),
51.0 D5, (WHOLE/2),
52.0 G4, (WHOLE),
53.0 REST, (WHOLE/2),
54.0 G4, (WHOLE/2),
55.0 D5, (WHOLE/2),
56.0 E5, (WHOLE/2),
5724-B67 IBM(R) PL/I for Windows 2010.07.29 10:14:03 Page 5
Line.File
57.0 C5, (WHOLE) );
58.0
59.0 DCL I FIXED BIN(31);
60.0
61.0 /* Declare external APIs called by chimes. */
62.0
64.0 DCL BEEP ENTRY( FIXED BIN(31), FIXED BIN(31) ) /* tone, time */
65.0 EXT( 'Beep' ) /* External name of function */
66.0 OPTIONS( BYVALUE /* Pass parameters by value */
67.0 LINKAGE(STDCALL));
68.0
69.0
70.0 DCL SLEEP ENTRY( FIXED BIN(31) ) /* Time duration only */
71.0 EXT( 'Sleep' )
72.0 OPTIONS( BYVALUE
73.0 LINKAGE(STDCALL) );
88.0
89.0 /* Play all of the notes and rests of the tune using a do loop. */
90.0
91.0 DO I = LBOUND(NOTES,1) TO HBOUND(NOTES,1);
92.0 IF NOTES(I,1) ^= 0 /* Note the use of ?for logical NOT */
93.0 THEN CALL BEEP( NOTES(I,1), NOTES(I,2) );
94.0 ELSE CALL SLEEP( NOTES(I,2) );
95.0 END;
96.0
97.0 END;
5724-B67 IBM(R) PL/I for Windows 2010.07.29 10:14:03 Page 6
Attribute/Xref Table 4
Line.File Identifier Attributes
64.0 BEEP CONSTANT EXTERNAL('Beep')
ENTRY( BYVALUE FIXED BIN(31,0),
BYVALUE FIXED BIN(31,0) )
OPTIONS( LINKAGE ( STDCALL ) )
Refs: 93.0
33.0 C5 CONSTANT FIXED BIN(31,0)
Refs: 38.0 38.0 38.0 38.0
29.0 CHIMES CONSTANT EXTERNAL
ENTRY()
OPTIONS( LINKAGE ( OPTLINK ) )
34.0 D5 CONSTANT FIXED BIN(31,0)
Refs: 38.0 38.0 38.0 38.0
35.0 E5 CONSTANT FIXED BIN(31,0)
Refs: 38.0 38.0 38.0 38.0
32.0 G4 CONSTANT FIXED BIN(31,0)
Refs: 38.0 38.0 38.0 38.0
+++++++ HBOUND BUILTIN
Refs: 91.0
59.0 I AUTOMATIC FIXED BIN(31,0)
Refs: 92.0 93.0 93.0 94.0
Sets: 91.0
+++++++ LBOUND BUILTIN
Refs: 91.0
38.0 NOTES STATIC NONASSIGNABLE DIM(1:19,1:2) FIXED BIN(31,0) INITIAL
Refs: 91.0 91.0 92.0 93.0 93.0 94.0
31.0 REST CONSTANT FIXED BIN(31,0)
Refs: 38.0 38.0 38.0
70.0 SLEEP CONSTANT EXTERNAL('Sleep')
ENTRY( BYVALUE FIXED BIN(31,0) )
OPTIONS( LINKAGE ( STDCALL ) )
Refs: 94.0
36.0 WHOLE CONSTANT FIXED BIN(31,0)
Refs: 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0 38.0
38.0 38.0 38.0 38.0
5724-B67 IBM(R) PL/I for Windows 2010.07.29 10:14:03 Page 7
Aggregate Length Table 5
Line.File Dims Offset Total Size Base Size Identifier
38.0 2 0 152 4 NOTES
5724-B67 IBM(R) PL/I for Windows 2010.07.29 10:14:03 Page 8
No Compiler Messages
File Reference Table 6
File Included From Name
0 C:\pliz\newfe\chimes.pli
3
Component Return Code Messages (Total/Suppressed) Time 7
MACRO 0 0 / 0 0 secs
Compiler 0 0 / 0 0 secs
End of compilation of CHIMESBy generating these statement numbers during compilation, you can locate lines that need editing (indicated in messages, for example) without having to refer to the listing.
If you specify the XREF option, the compiler prints a cross-reference table containing a list of the identifiers in the source program together with the Line.File number (the statement number inside the file and the file number, respectively) in which they appear in the compiler listing.
An identifier appears in the Sets: part of the cross-reference table if it is:
If there are unreferenced identifiers, they are displayed in a separate table (not shown in this example).
If you specify ATTRIBUTES and XREF (as in this example), the two tables are combined.
Explicitly-declared variables are listed with the number of the DECLARE statement in which they appear. Implicitly-declared variables are indicated by asterisks and contextually declared variables (HBOUND and LBOUND in this example) are indicated by plus (+) signs. (Undeclared variables are also listed in a diagnostic message.)
The attributes INTERNAL and REAL are never included; they can be assumed unless the respective conflicting attributes, EXTERNAL and COMPLEX, are listed.
For a file identifier, the attribute FILE always appears, and the attribute EXTERNAL appears if it applies; otherwise, only explicitly declared attributes are listed.
For an array, the dimension attribute is printed first. If the bound of an array is a restricted expression, the value of that expression is shown for the bound; otherwise an asterisk is shown.
If the length of a bit string or character string is a restricted expression, that value is shown, otherwise an asterisk is shown.
| Heading | Description |
|---|---|
| Line.File | The statement number and file number in which the aggregate is declared |
| Offset | The byte offset of each element from the beginning of the aggregate |
| Total Size | The total size in bytes of the aggregate |
| Base Size | The size in bytes of the data type |
| Identifier | The name of the aggregate and the element within the aggregate |
Only messages of the severity above that specified by the FLAG option are issued. The messages, statements, and return code appear on your screen unless you specify the NOTERMINAL compile-time option.