Contents | Prev | Next | Index


SYSTEM Proper Procedures

The SYSTEM proper procedures provide basic runtime services and low-level facilities. Some are generic and are expanded like macros during compilation. Others are implemented as genuine procedures in the SYSTEM implementation module. In this compiler all standard-procedures have their origin in the SYSTEM module as well.

The following non-standard procedures are available:

Name Description
INLINE( java_code ) Insert Java code
PROCEDURE IOTRANSFER
( VAR p1,p2:ADDRESS; va:CARDINAL );
not implemented
PROCEDURE LISTEN( ); not implemented
PROCEDURE NEWPROCESS
( p:PROC; a:ADDRESS; n:CARDINAL; VAR p1:ADDRESS );
not implemented
PROCEDURE TRANSFER
( VAR p1,p2:ADDRESS );
not implemented
PROCEDURE ExitProgram
( ExitCode:SHORTCARD );
exit program with a return code
PROCEDURE SetExitProc
( UserProc : PROC );
register an exit procedure for current module

Note: Procedures IOTRANSFER, TRANSFER, LISTEN, and NEWPROCESS are not implemented in this compiler, their corresponding procedure bodies in the SYSTEM implementation module are empty. Procedure SetExitProc can register a parameterless procedure which gets executed when leaving the program. Here is an example how to set it up:

IMPLEMENTATION MODULE <module-id> ;
IMPORT SYSTEM;
...
VAR oldExit : PROC;
...
PROCEDURE MyExit;
BEGIN
  <module finalization code>
  SYSTEM.SetExitProc( oldExit );
END MyExit;
...
BEGIN (* module initialization *)
  oldExit := SYSTEM.GetExitProc( );
  ...
END <module-id>.


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