Iron Spring PL/I Compiler

OS/2 Version 0.9.2
1 Jul, 2011

Release Notes

Introduction

This document provides information on using the Iron Spring PL/I compiler and compiled programs on the OS/2 platform. For information on the Linux platform, see the corresponding document
readme_linux.

The current version still contains bugs. As a user of beta software, you can help improve the compiler. See the section Reporting bugs.

Trademarks
eComStation is a trademark of Serenity Systems International.
Gnu is a trademark of the Free Software Foundation.
IBM is a trademark of IBM, Inc.
Intel is a trademark of Intel Corporation.
Iron Spring is a trademark of Iron Spring Software.
Linux is a registered trademark of Linus Torvalds.
VAX is a trademark of Hewlett-Packard, Inc.
WATCOM is a trademark of Sybase, Inc. and its subsidiaries.

License

<boring-legal-stuff>
This license a legal agreement between you and Iron Spring Software. Your use of this software signifies that you agree to the terms of this license.

Iron Spring Software grants you the right to use and copy the Iron Spring PL/I compiler and library freely. You may distribute programs compiled using the compiler and/or linked with the library under any terms you wish without restriction. The source to the library is licensed under the terms of the Gnu Lesser General Public License (LGPL).

All material is copyright Iron Spring Software, 2008, 2009, 2010, 2011.

THE COMPILER AND LIBRARY ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COMPILER AND LIBRARY IS WITH YOU. SHOULD THEY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
</boring-legal-stuff>

Contents

This distribution includes the executable for the PL/I compiler PLIC.EXE, the runtime DLL, the static and import libraries lib\static\prf.lib and \lib\prf.lib, and the sources for the library and sample programs.

  pli-0.9.2
    |
    +-----------------------samples----------------lib
    |                          |                    |
 plic.exe                   (Sample sources and     +--------------------------static---include----source
 (compiler executable)       %include files,        PL/I DLL (prf.dll)         |         |         |
 (documentation, etc.)       sample makefiles       Import Library (prf.lib)   |         |         +--------asm
                             and module definition  (.obj files for all        |         |   (PL/I source)   |   
                             file).                  library procedures).      |         |               (assembler
                                                                               |  (%include files          source)
                                                                               |    required by                                                                                      
                                                                               |     library).
                                                                               |
                                                                      prf.lib (static library)
                                                                      OS2386.lib

Requirements

The folowing software is required to run the OS/2 version of the compiler: The following software is recommended:

Installation

  1. Unpack the distribution file into a directory named "x:\pli-0.9.2", (Specify your desired drive in place of 'x'.)
  2. Only the compiler (x:\pli-0.9.2\plic.exe) and either the static runtime library (x:\pli-0.9.2\lib\static\prf.lib) OR the DLL (x:\pli-0.9.2\lib\prf.dll) and the import library (x:\pli-0.9.2\lib\\prf.lib) are required. You should already have a version of OS2386.LIB. If you don't, you can use the one supplied in "x:\pli-0.9.2\lib\static\OS2386.lib".
  3. Move the compiler to a directory in your PATH or add x:\pli-0.9.2 to your path in config.sys.
  4. If you are using the DLL version of the library, move prf.dll to a directory in LIBPATH, or add (x:\pli-0.9.2\lib) to your LIBPATH in CONFIG.SYS and reboot. In order to link compiled programs you also need to make the import library prf.lib available by moving it to a directory listed in the LIB environment variable. Alternatatively, you can add the line "LIB = x:\pli-0.9.2\lib" to your makefiles.
  5. If you are using the static version of the library (x:\pli-0.9.2\lib\static\prf.lib), move it [and x:\pli-0.9.2\lib\static\OS2386.lib if required] to a directory listed in the LIB environment variable. Alternatatively, you can add the line "LIB = x:\pli-0.9.2\lib\static" to your makefiles.
  6. Test the sample programs. Two makefiles are provided: 'makefile' links with the DLL, 'makefile.static' links with the static library. CD to the directory "x:\pli-0.9.2\samples" and type "make" for the DLL version, or "make -f makefile.static" for the static version. If you don't have make available, you can manually type the commands in the makefile. The sample programs "numwrd", "filedump", "print_listing", and "libver" build to executables, the remainder should generate object files.
  7. Test numwrd. Enter ".\numwrd 123". The program should display the result "one hundred twenty-three".
  8. You might want access to the %INCLUDE files in "x:\pli-0.9.2\lib\include" or "x\pli-0.9.2\samples" for your own programming.

A later version will be installable using the WarpIN installer.

Using the compiler

The "samples" directory contains two sample makefiles that can be used to compile and link PL/I programs. You should copy these and modify them for your requirements. "Makefile.static" is an example of a compile and link using the static version of the runtime library. "Makefile" is an example linking against the runtime DLL. The library named "prf.lib" contains object files in the static directory, and import definitions for the runtime DLL in the non-static directory.

Linking PL/I programs

The following command statically links a PL/I program with the runtime library.
LINK386 /m:f /a:8 /st:0x100000 ${OBJ},,,${LIBDIR}\prf.lib+${LIBDIR}\OS2386.lib,${DEF};

The following command links a PL/I program with the PL/I runtime DLL.
LINK386 /m:f /a:8 /st:0x100000 ${OBJ},,,${LIBDIR}\prf.lib,${DEF};

Documentation

The Iron Spring PL/I Compiler Programming Guide contains a description of the features of the compiler. Except as noted in the Programming Guide under Compiler Differences and Restrictions this compiler is compatible with the IBM "PL/I for MVS and VM Compiler 1.1". A complete language reference in HTML will be available as part of a future release.

Documentation for the IBM compiler is available online.

Changes in the current version

Changes in version 0.9.2
PL/I multitasking has been added, including the TASK, EVENT, and PRIORITY options of the CALL statement, the WAIT statement, and the COMPLETION and STATUS builtin functions and pseudovariables.
SIZE is now recognized as a synonym for the STORAGE builtin function.
Structure assignments BY NAME are now allowed.
JWAsm is now used to assemble code for both the OS/2 and Linux libraries.
EXTERNAL data items are now aligned on a DWORD (4-byte) boundary instead of 8-byte.
 
Changes in version 0.9.1
The SINH, COSH, TANH, and CS builtins have been added.
The PACKAGE statement is now supported.
The INITIAL CALL option is now supported.
Floating-point pictures are now allowed, for output only.
 
Changes in version 0.9.0
The version numbering scheme was changed to more standard system.
The compiler now supports Linux as a host and a target.
The ERF, ERFC, and EXP builtins have been added.
Page headings have been added to the compiler listings.
 
Changes in version 0.8c
Exponentiation is allowed for powers of non-integers. Edit-directed I/O handles complex format specifications correctly. Float values can be written with LIST- and DATA-directed output. Single-argument calls to HBOUND, LBOUND, and DIM are allowed. COMPLEX constants are generated correctly.
 
Changes in version 0.8b
Version 0.8b was never officially released; it included mainly a "HIPER" fix for a bug that prevented generation of correct ELF objects. Other changes include previously-unimplemented cases of the CURRENTSTORAGE builtin for unaligned bit strings and structures, and initialization of static unaligned bit data. The HEXIMAGE, ADD, MULTIPLY, and DIVIDE builtins were added.
 
Changes in version 0.8a
List-directed input is now implemented.
The condition-handling builtins, DATAFIELD, ONCHAR, ONCODE, ONCOUNT, ONFILE, ONKEY, ONLOC, and ONSOURCE, and the pseudovariables ONCHAR and ONSOURCE were added. DATAFIELD and ONKEY always return the null string, since the corresponding data-directed input and the KEY condition are not currently implemented. ONCOUNT always returns zero since multiple conditions can not occur.
The DISPLAY statement was added.
A cross-reference listing can now be produced.
Subscripted statement label constants are now allowed.
The compiler can now optionally generate ELF object files.
The range of allowed arguments for the STRING builtin was restricted (see the description of STRING in the programming guide), and code for all allowable argument types was completed.
 
Changes in version 0.7b
The BOOL, COS, COSD, LOG, LOG10, LOG2, SIN, SIND, SQRT, TAN, and TAND builtins were added.
The UNION attribute was implemented.
Bit string AND, OR, and NOT now works with strings of arbitrary length.
Better code is now generated for the RETURN statement when a procedure contains multiple entries.
FLOAT data can now be output using the F-format.
 
Changes in version 0.7a Version 0.7a includes a completely rewritten code generator that produces object files, with optional assembler output. This is a major enhancement over previous versions that generated assembler output only. Because of the scope of the change this is still an alpha release. Assuming no major problems with the new code, the next version should be a beta.

A great deal of effort was made to ensure that the generated object code is identical to that produced by ALP in previous versions. No attempt has been made to improve the quality of the code, even in cases where improvements were identified. Although the instructions are identical the code is packaged somewhat differently in the object file. In most cases the files created by PL/I should be smaller than the corresponding file generated by ALP.

Because of this change the ALP asssembler has been changed from a required to an optional program. It is still required if you need to assemble the .asm output of the compiler or the assembler programs in the library.   Changes in version 0.6a The principal change is repackaging the library as both a DLL and a static library. The %REPLACE preprocessor statement has been implemented to provide limited support for named constants, pending implementation of the full preprocessor. The procedure and entry option FROMALIEN was added to allow 'callbacks' to PL/I procedures from C or assembler code.   Changes in version 0.5e Conversion between scaled FIXED BINARY and FIXED DECIMAL is now supported. PUT DATA has been largely implemented, except for arrays of structures. The COLUMN and SKIP format-items are now supported.   Changes in version 0.5d The compiler will now honor alternate characters for OR or NOT coded on the command line. Character strings can use either the single (') or the double (") quote characters as delimiters. All FIXED to FLOAT conversion routines now correctly handle constants and scaled values. The DEFINED attribute now accepts any valid reference as the base variable.

Bugs fixed in the current version

This is a cumulative fix list since the inital alpha version.
Bug
number
Fixed
in version
Description
1980.9.2 DO REPEAT should allow nonarithmetic control variable.
1970.9.2 Based variable argument to STORAGE should not require locator.
1780.9.2 Bad descriptor passed for adjustable arg if parm is also adjustable.
1770.9.2 Bad descriptor passed for adjustable string parameter.
1760.9.2 PAGESIZE(0) should suppress formfeeds.
1750.9.2 BIT builtin result may be incorrect.
1740.9.2 TIME builtin always returns 0 ms.
1730.9.2 EXIT statement causes compiler trap in GCALL.
1710.9.2 SKIP format item without relative line defaults to SKIP(0) instead of (1).
1700.9.2 Problems mapping structure containing unions.
1690.9.2 Compiler trap if dummy argument size is larger than 32767.
1680.9.2 Compiler trap on leading spaces in picture repetition factor.
1670.9.2 Compiler trap generating error message on invalid conversion to program control variable.
1650.9.2 Overly aggressive optimization of register assignments causes REGX error 990-02
1640.9.2 Based adjustable data causes various errors.
1620.9.2 SIZE not recognized as synonym for STORAGE builtin.
1610.9.2 Incorrect references generated for members of structure parameters.
1600.9.2 Incorrect assignment of arrays of unaligned bit strings.
1590.9.1 Compiler traps when builtins are called with program control arguments where computational arguments are expected, and visa-versa.
1580.9.1 Various compiler problems using the initial attribute with static unaligned bit strings.
1570.9.1 The HEXIMAGE builtin generates incorrect code when the first argument is a pointer reference (not pointer expression).
1560.9.1 The COMPARE builtin generates incorrect results after fix for bug 148.
1540.9.1 Some comparisons of character data to literals cause error 990, code 05 in MX.
1530.9.1 Incorrect code generated for conversion of scaled pictured data to arithmetic.
1520.9.1 Incorrect scaling on move of arithmentic to pictured data.
1510.9.1 Incorrect code generated for some bit string assignments.
1500.9.1 Remote formats generate incorrect code.
1480.9.1 The COMPARE builtin reverses the order of the operands.
1470.9.1 [Invalid] Unary pointer expression causes compiler trap.
1460.9.1 Converting WORD integer to FLOAT causes error 990, code 14 in MX.
1450.9.1 Entry returning expression with adjustable bounds or lengths does not produce error message.
1440.9.1 ENTRY arguments to procedures with SYSTEM linkage generate errors or incorrect code.
1430.9.0Established ON-Unit not invoked for conditions raised during stream I/O.
1420.9.0Initialization of AUTO data whose declaration appears in a DO-Group, IF-Statement, etc. causes compiler trap.
1410.9.0A null ON-Unit was taking the implicit action rather than the normal return action for the condition.
1400.9.0'FOFL' not recognized as abbreviation for 'FIXEDOVERFLOW'.
1390.9.0ON FIXEDOVERFLOW generating search for incorrect ONCODE.
1370.9.0Reference to the descriptor of adjustable data declared in a containing block causes compiler error 03 in MX.
1340.9.0Incorrect code generated for ¬<expression>.
1330.9.0Concatenation of character string and bit string generates bit result.
1300.9.0Null hex character strings cause compiler trap with stack overflow.
1290.9.0'DB' in pictures reversed the sign.
1260.9.0Syntax errors in the parameter list of an internal procedure caused compiler trap.
1250.9.0Invalid characters in a picture not disgnosed.
'CR' in pictures formatted incorrectly.
1240.9.0ENTRY statement incorrectly generating error 233.
1230.9.0No check made that variable specified as default locator for BASED variable is actually a pointer.
Use of undeclared parameter as default locator generated incorrect code with no error message.
1220.9.0DELAY statement caused compiler trap.
1210.9.0Move 32-bit immediate bit string to memory used incorrect byte order.
1200.9.0ON ENDFILE without a file name incorrectly defaulted to SYSIN rather than produce error message.
1190.9.0Implicit action for ENDPAGE ignores the condition.
1180.9.0Compiler trap on DO statement if BY is omitted and loop index is not FIXED BINARY.
1170.9.0Bit string dummy arguments overlayed on stack.
1160.9.0Non-integer subscripts not truncating.
1150.8cEnabling SUBSCRIPTRANGE can cause "compiler error" messages.
1140.8cLIST-directed input fails to read the last data item in the stream if it is a quoted string.
1120.8cThe DISPLAY statement does not free storage allocated for its argument list.
1110.8cGenerated code loading the address of an external data item generates incorrect relocation for ELF.
1070.8cHEXIMAGE causes compiler trap if called with non-syntactically-correct argument list.
1040.8bREPEAT builtin generating incorrect output if count is greater than one.
1020.8bPUT with E-format output incorrect if rounding causes value to be renormalized.
970.8bDISPLAY(ptr) correctly diagnoses error, but fails to recover.
940.8bSTORAGE and CURRENTSTORAGE of a scalar non-string produce incorect results.
930.8aThe DISPLAY statement traps when called with pictured data.
920.8aConversion of pictured data to character incorrect.
900.8aAdjustable structures may not be correctly mapped at run time.
880.8aCompiler does not allow specification of full pathname for %INCLUDE files.
860.8aUse of [currently unsupported] structure expression causes compiler trap.
850.8aSTORAGE(array) returns the size of one array element.
840.8aWRITE FILE(x) KEY(...) causes message 'Unrecognized keyword KEY."
820.8aCompiling a CALL statement to an INTERNAL ENTRY which had syntax errors causes compiler trap.
810.8a'PUT ();' without the DATA, EDIT, or LIST option can cause the runtime error "Invalid intrinsic call.
330.8aGOTO the THEN or ELSE clause of an IF-statement causes trap 5 at run time.
780.7bFLOAT constants erroneously match already- generated constants.
770.7bFloating point and decimal division generates incorrect results with new code generator.
760.7bDuplicate declarations containing the INITIAL or DEFINED attribute or adjustable lengths or bounds cause trap.
730.7bErrors in minor structure alignment cause storage overlays.
720.7bF-format output prints incorrectly when library is compiled with new code generator.
710.7bIncorrect code for the SIZE condition for FIXED BINARY data generated by new code generator.
700.7bCompiler traps when too few arguments supplied for builtin function.
640.7aSyntax error in expression in 'DO WHILE()' or 'DO UNTIL()' causes trap 5.
630.7aCompare character string of length<=4 to character string of length>4 generates incorrect output.
610.7aFLOAT zeroes convert incorrectly.
600.7aScaled FIXED to FLOAT constant conversions generate incorrect output.
580.7aENDPAGE condition not raised when page size exceeded.
560.7aPTRADD builtin generates incorrect output
550.7a'PUT (PLIRETV)' generates incorrect output.
540.7aUse of BYTE builtin in expression causes trap 5.
520.6aVarious conditions cause extra unused storage to be reserved on the stack.
490.6aArray declaration with bound information missing [DCL a ()...] causes trap 5.
460.6aMissing final END statement causes ending code not to be generated.
440.5eXCPT_FLOAT_DENORMAL_OPERAND if control variable for an iterative DO is FLOAT.
430.5eSubscripting EXTERNAL data generates incorrect output.
400.5eDeclaring a parameter with the PICTURE attribute causes compiler trap 5.
390.5eReturning an adjustable string from a procedure with multiple entry points returns the null string.
350.5eINDEX(SUBSTR(x... generates incorrect code.
330.5eAlignment may cause length of adjustable descriptors to be miscalculated.
320.5eGOTO an undeclared label variable causes compiler trap 5.
310.5eGOTO out of an iterative DO statement causes compiler trap 5.
300.5eWRITE FROM a structure causes error.
290.5eKEYFROM option not recognized on WRITE statement.
280.5eArithmetic with STATIC variables caused spradic traps.
260.5eEntry name text not generated for second and subsequent labels of a PROCEDURE or ENTRY statement.
230.5ePUT to SYSPRINT in an ON-Unit entered as result of an error caused by I/O to SYSPRINT causes infinite loop
200.5dScaled divisors were not handled correctly.
180.5dF format output had the decimal point placed incorrectly and the data not correctly rounded.
160.5dStructures declared with the LIKE attribute had the level number of the last member set incorrectly.
140.5dThe third and fourth arguments to ADD, SUBTRACT, MULTIPLY and DIVIDE handled incorrectly.
110.5dThe INITIAL, BASED, and DEFINED attributes and adjustable bounds and lengths not working correctly in factored declarations.
80.5cAssignment to expression generates incorrect error message.
70.5cTrap in structure declaration for ',;'.
60.5cLENGTH(<expression>) generates spurious error message.
50.5cF-Format output incorrect.
30.5bPLITABS linked incorrectly.
20.5bConversion of arithmetic data to character may cause various errors.
10.5bAllocating temporary stack storage >4K may cause Trap 5.

Modifying the Runtime Library

The document
About the Iron Spring PL/I Library Contains information necessary to modify or extend the runtime library. Most users of Iron Spring PL/I will probably not be interesting in making modifications to the library.

Support

No formal support is provided for pre-release versions of Iron Spring PL/I. Bugs will be fixed on a best-efforts basis only, and the fix included in the next distributed version.

A Yahoo! group "ISPLI" (http://tech.groups.yahoo.com/group/ISPLI) is available as a user forum for problems, tips, etc. The developers also monitor this group.

Reporting bugs

For the current version of the compiler, a bug is one of the following:
  1. Any compiler trap.
  2. Incorrect output not caused by a flagged unimplemented feature (compile-time message 995 or run-time UNIMPLEMENTED condition.
  3. Compile-time message 990 (Compiler error).
  4. Output of the compiled program different from that produced when the program is compiled with the IBM compiler, except for differences noted.
Features not implemented in the current version will be added in future versions. In the meantime, their absence should at least be indicated by an error message.

Before reporting a bug, please make sure you are running the most recent release.

The following information is required to report a bug:

  1. A brief description of the problem (trap, incorrect output, etc.)
  2. The host operating system: OS/2 or Linux.
  3. The command-line options used to compile this program.
  4. The current compiler version obtained by running "PLIC -V".
  5. A small sample program ilustrating the problem. Please make sure you imbed or supply all the %include files required to compile the sample.
Hopefully, all this information will be small enough to be sent as plain text in a mail message. Otherwise please attach a zip file. No other formats will be accepted.

Mail bug reports to:

   bugs@iron-spring.com


version 0.9.2, 1 Jul, 2011
http://www.iron-spring.com