Contents | Prev | Next | Index


The Module SYSTEM

The purpose of the module SYSTEM is to provide certain low-level types and procedures as needed for a given computer and operating system.

It is strongly recommended to restrict the use of the module SYSTEM to specific low-level modules, because such modules are inherently non-portable und unsafe. They are easily recognized due to the identifier SYSTEM appearing in their import list.

The following specifications hold for the implementation of Modula-2 on the Java Virtual Machine.

Module SYSTEM exports a type BYTE with the following characteristics: Variables of type SHORTINT, SHORTCARD, or BOOLEAN can be assigned to variables of type BYTE. Notice that, unlike other Modula-2 implementations, it is not possible to assign variables of type CHAR to variables of type BYTE, because in this Modula-2 implementation CHAR is 2 bytes wide because of the UNICODE support. If a formal parameter is of type ARRAY OF BYTE, then the corresponding actual parameter may be of any type.

Module SYSTEM also exports a type WORD. Variables of this type are assignment comptible with INTEGER, CARDINAL, or CHAR. And if a formal parameter is of type ARRAY OF WORD, then the corresponding type may of any type, whose size is a multiple of WORD size.

Another type exported by module SYSTEM is the type ADDRESS. Variables of any pointer type may be assigned to variables of type ADDRESS. This compiler translates ADDRESS into the java.lang.Object type.

In the following descriptions of the SYSTEM procedures, v stands for a variable, x, y, a, and n for expressions, and T for a type. Most of these procedures correspond to simple Java instructions compiled as inline code.

SYSTEM Function Procedures

SYSTEM Proper Procedures

SYSTEM Exception Handling


Contents | Prev | Next | Index

Canterbury Modula-2 for Java  (Last documentation update Feb 8, 2000)
Copyright © 1998 Mill Hill & Canterbury Corporation, Ltd. All rights reserved
Please send any comments or corrections to mhc@webcom.com