                        Modula-2/ST, Release 3.00a
                        --------------------------

                              RELEASE NOTES
                              -------------


MODULA-2 COMPILER, VERSION 3.00a
--------------------------------

All REPORTED compiler bugs have been fixed.

The compiler will accept a list of files to be compiled at one time.
The filename must end with the extension ".bat". This "batch" file
contains the names of the files to be compiled and the options with
which to compile them. For example, file "domod.bat" could be:

  LispIO r
  SExprIO r list
  Lisp

which would compile LispIO and produce a .ref file, compile
SExprIO, proceduce a .ref file and listing, and compile Lisp.
For a real example of this, see the file "GEMDEM.BAT" in the
GEMDEMO folder on disk 2.

Module SYSTEM modifications
---------------------------

The constant NULL has been added to SYSTEM. NULL is compatible
with all pointer and ADDRESS types. It is defined as ADDRESS(0).

The constants

  CONST
    BITSPERBYTE = 8;
    BITSPERWORD = 16;
    BITSPERLONGWORD = 32;

have been added to system.

The SIZE procedure has been made a standard identifier; it does
not need to be (and cannot be) imported from SYSTEM.

Data Types
----------

The type LONGBITSET has been added as a standard type, defined as

TYPE
  LONGBITSET = SET OF [0..BITSPERLONGWORD-1];

It requires four bytes of storage. It is not comatible with the
BITSET type; longbitsets must be qualified, e.g.

  VAR x: LONGBITSET;

  BEGIN
    x := {1,4,9};            (* illegal *)
    x := LONGBITSET{1,4,9}   (* ok *)

New Standard Procedures
-----------------------

MAX and MIN have been implemented. MAX returns the maximal value
of a subrange, enumeration or standard type. MIN returns the minimal
value. Example:

  TYPE
    subrange = [1..100];
    enum = (a,b,c,d,e);

  MIN(INTEGER) = -32768   MIN(subrange) = 1
  MIN(enum)    = a        MIN(CARDINAL) = 0

  MAX(INTEGER) = 32767    MAX(subrange) = 100
  MAX(enum)    = e        MAX(CARDINAL) = 65535

conversions between cardinals and reals:

  FLOAT(x: CARDINAL/LONGCARD): REAL;
  FLOATD(x: CARDINAL/LONGCARD): LONGREAL;
  TRUNC(x: REAL/LONGREAL): CARDINAL;
  TRUNCD(x: REAL/LONGREAL): LONGCARD;

conversion between short and long forms of arithmetic types:

  LONG(x: INTEGER/CARDINAL/REAL): LONGINT/LONGCARD/LONGREAL;
  SHORT(x: LONGINT/LONGCARD/LONGREAL): INTEGER/CARDINAL/REAL;

Note that these two procedures replace type conversions using
LONGINT/INTEGER/CARDINAL/LONGCARD. These type conversions are
currently still supported (to compile existing software), but
they may be removed when the BSI produce their standard for the
Modula-2 language.

The compiler now accepts SET OF CARDINAL, e.g.

  TYPE bigset = SET OF CARDINAL;

The 16-bit limitations of the compiler have been lifted; it is now
a true 32-bit compiler. For example, arrays of >32K can be declared,
and there is no restriction on global or local data size. For example,
the compiler now happily accepts:

  VAR BigArray: ARRAY [0..1023],[0..1023] OF REAL;
      BigString: ARRAY [0..999999] OF CHAR;

Constant expressions
--------------------

A constant expression can now call standard functions, and have
type conversions in. For example,

CONST
  WordSize = TSIZE(WORD);  (*calling standard function*)
  ByteConst = BYTE(0FFH);  (*type conversion*)
  IntConst = INTEGER(55);  (*another conversion*)

The compiler has dynamic heap sizing; when it runs out of storage
for a compilation, a new heap segment is requested from the
operating system. This segment is then used in addition to all
previously allocated heaps. This means that all available memory
will be taken from the machine before a compilation fails.

Compiler options
----------------

Two new compiler options have been added, $Q and $A.
Initially both are set as (*$Q-,$A-*).
Turning on the $Q option will inform the compiler to turn all JSRs
to procedures within this compilation unit into BSRs.
Turning on the $A option will turn all JSRs into BSRs, even calls to
procedures in other compilation units.

As the BSR instruction has a limited addressing range, all short
brances must be within 32Kb of each other. If a branch tries to
go out of this range, the linker will terminate with error 999 or
error 998 - it will not produce a program file. A good rule of thumb
is to check the .LNK and .PRG file sizes: generally, for $Q to work
the .LNK file size should be less than 32Kb, and for $A to work the
.PRG file size should be less than 32Kb.

The $F compiler option has been removed. In its place, three further
options have added. The equivalent of $F+ would be $V+,$R+,$N+.
The options give greater control over the code produced.

$V:  generate overflow-checking code; initially $V- which does not
     check for overflow.

        e.g.

          VAR x, y: CARDINAL;

          BEGIN
            x := 1000;
            y := x * x;       (*would generate an overflow trap*)

$R:  generate range-checking code (distinct from the $T option);
     initially $R- (i.e. no code). This option generates code to
     check values assigned to subranges, cardinal/integer cross-
     assignment and other critical code parts.

        e.g.

           VAR x: CARDINAL; y: INTEGER; z: [1..100];

           BEGIN
             y := -1;         (*o.k.*)
             x := y;          (*would generate a range trap*)
             x := 0; z := x;  (*would generate a range trap*)
           END;

$N:  generate nil-checking code; initially $N- (i.e. no code).
     This will not allow dereferencing of NIL pointers:

        e.g.

        VAR x: POINTER TO CHAR; c: CHAR;

        BEGIN
          x := NIL;
          c := x^;     (*would generate a NIL-dereference trap*)


LONGREALs
---------

The LONGREAL type is supported. LONGREALs are implemented to the
IEEE 64-bit standard, giving a range of E+/-308 with 16 digit
accuracy.

The module RealInOut supports reading and writing of longreals.
The module LongMathLib0 supports transcendental functions on longreals;
LongHyperMathLib offers hyperbolic functions for longreals. Not that
the name of these two modules may change when the BSI produce their
standard library list for Modula-2 implementations.

Value Dynamic Arrays
--------------------

Value dynamic arrays have been implemented. This allows code written
for other compilers to be transported with little change to the
TDI Modula-2 compiler. For example, WriteString could now be declared
as:

  PROCEDURE WriteString(x: ARRAY OF CHAR);

Note that the VAR is not necessary. The whole array is copied onto the
stack when the procedure is entered, so that assignments to that array
will not affect the actual parameter (as is the case with VAR parameters).

Miscellaneous
-------------

- String literals may be assigned to VAR ARRAY OF CHAR or ARRAY OF CHAR
  formal parameters, e.g.

    PROCEDURE GetSystemFileName(VAR name: ARRAY OF CHAR);
    BEGIN
      name := "GEMX"
      ...

- Strings of length one may be passed to VAR ARRAY OF CHAR formal parameters.

- Compile time checking of subranges.

- The suffix "D" may be appended to a decimal number to signify that it is
  a long constant; this allows programs written for the ETH single-pass
  compiler to be ported directly to the TDI native Modula-2 compiler.

- A type identifier may be placed before a subrange to identify the subrange
  base type. For example

    TYPE
      intrange = INTEGER [1..100];

  This is an integer range, not a cardinal range.


M2DESK
------

M2Desk has been enhanced for colour systems. The number of modules
displayed  has been enlarged. The presence of a module component is
now indicated by the use of a coloured area of the desktop - green
indicates the component is present, and red to indicate an out-of-date
component.

MODULA-2 OPTIONS DESK ACCESSORY
-------------------------------

The desk accessory controling the Modula-2 system has been enhanced.
A new system option 'xfer' has been added that automatically chains
between editor, compiler, and linker. DO NOT HAVE THIS OPTION ON
WHEN RUNNING M2DESK - YOU COULD GET VERY CONFUSED.

With this option on, when you write a file you have been editing, the
compiler is automatically called to compile that program. After a
successful compilation the linker will be called; if there are 
compilation errors, the editor will be re-entered and will read in
the affected file.

MODULA LIBRARY BUG FIXES AND IMPROVEMENTS
-----------------------------------------

BIOS        - Improved parameter passing.
              BConOut device parameter passing corrected.

GEMDOS      - Improved parameter passing.
              DaTime use of buffer corrected.
        
GEMFont     - New module describes format of GEM fonts.

GEMX        - Corrected base page format.

LineA       - New module describes and gives access to "Line A" calls.

XBIOS       - Improved parameter passing.
              IORec call corrected.
              SetTimerInterrupt handling of timer parameter corrected.
              ConfigureCursor transposition of parameters fixed.
              GIRead/GIWrite/DoSound calls corrected.
              FloppyRead transposition of track and side parameters corrected.
              ConfigurePrinter definition corrected. Now passed and returns
              PrtConfigSet as parameters.

Conversions - New LONGREAL routines implemented.

FileSystem  - Numerous cases of incorrect setting of "res" and "eof" corrected.

InOut       - Now handles printer correctly.

MathLib0    - exp corrected.

Storage     - ALLOCATE and DEALLOCATE now take LONGCARD amount.
              CreateHeap now able to handle heap over 64K bytes long.

TextIO      - WriteLn now writes to correct stream.
              REad handling of end of stream corrected.
              ReadString from console now no longer needs LF.

