home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / modu1096.zip / GPMsym / system.def < prev    next >
Text File  |  1996-08-29  |  2KB  |  59 lines

  1. (****************************************************************)
  2. (*                                                              *)
  3. (*         Gardens Point Modula-2 Library Definition            *)
  4. (*                                                              *)
  5. (*                                                              *)
  6. (*     (c) Copyright 1996 Faculty of Information Technology     *)
  7. (*              Queensland University of Technology             *)
  8. (*                                                              *)
  9. (*     Permission is granted to use, copy and change this       *)
  10. (*     program as long as the copyright message is left intact  *)
  11. (*                                                              *)
  12. (****************************************************************)
  13. (*
  14. (* !SYSTEM! *) DEFINITION MODULE SYSTEM;
  15.  
  16.   (* This is a system module; it is known to the compiler and  *)
  17.   (* activated by import. It is pre-loaded, and thus has no    *)
  18.   (* symbol file. Some of the following declarations are sym-  *)
  19.   (* bolic only and use generic forms which cannot be compiled *)
  20.   (* The system types have special semantics in most cases.    *)
  21.  
  22.   TYPE  LOC  = smallest addressable unit;
  23.     BYTE = LOC;
  24.     WORD = ARRAY [0 .. bytes per word - 1] OF LOC;
  25.     ADDRESS = POINTER TO LOC;
  26.  
  27.   PROCEDURE ADR   (VAR v : AnyType) : ADDRESS;
  28.   (* returns storage address of the parameter *)
  29.  
  30.   PROCEDURE ADDADR(a : ADDRESS; i : CARDINAL) : ADDRESS;
  31.   (* returns the address a "incremented" by i *)
  32.  
  33.   PROCEDURE SUBADR(a : ADDRESS; d : CARDINAL) : ADDRESS;
  34.   (* returns the address a "decremented" by i *)
  35.  
  36.   PROCEDURE DIFADR(a, b : ADDRESS) : INTEGER;
  37.   (* returns the difference (a - b) in bytes  *)
  38.  
  39.   PROCEDURE TSIZE (AnyType; optional tags) : CARDINAL;
  40.   (* returns storage size of t, ignoring tags *)
  41.  
  42.   PROCEDURE CAST  (AnyType1; x : AnyType2) : AnyType1;
  43.   (* returns x cast to type AnyType1 *)
  44.  
  45.   PROCEDURE SHIFT (VAR b : BITSET, n : INTEGER) : BITSET;
  46.   PROCEDURE ROTATE(VAR b : BITSET; n : INTEGER) : BITSET;
  47.   (* direction of shifts and rotates is such that
  48.     b := SHIFT(BITSET{0}, 1);
  49.      assigns b = BITSET{1}, rotate is same     *)
  50.  
  51.   PROCEDURE ROUND (r : REAL) : INTEGER;
  52.   (*  returns the integer part of r rounded towards zero. *)
  53.   
  54.   PROCEDURE ENTIER (r : REAL) : INTEGER;
  55.   (*  returns the integer part of r rounded towards -infinity *)
  56.  
  57. END SYSTEM.
  58. *)
  59.