MODULE Sys; (* SJ *)

(* Note : this module is physically identical to SYSTEM, but you can only
   use the identifiers declared here with System.?, whereas the compiler
   routines like NEW can only be used with SYSTEM.? . Therefore both
   modules must appear in the import list, though only one is linked later.
*)

TYPE basepage* = POINTER TO RECORD
                   LowTPA*,  HighTPA*,  TextBase*,  TextLen*,  DataBase*,
                   DataLen*,  BssBase*,  BssLen*,  DTA*,  Parent* : LONGINT;
                   LoadDrv*,  CurrDrv* : CHAR;
                   Rsv1     : INTEGER;
                   Env*     : LONGINT;
                   Rsv2     : ARRAY 50H OF CHAR;
                   ComLen*  : SHORTINT; (* 0..127 *)
                   Command* : ARRAY 127 OF CHAR;
                 END(*RECORD*);
     haltproc* = PROCEDURE ( Value : INTEGER );


VAR Basepage* : basepage;

 (* points to the basepage of the linked program or, wenn running as module
    to the basepage of OBERON.PRG. In the commandline of the basepage,
    Loader.Call writes the Command given to it. Modules that use the feature
    of taking parameters, can read them out of the variable Basepage.Command.
    When running as a stand alone program, Basepage points to the basepage
    of the program and parameters are also in Basepage.Command. Notice
    that you can test if your program is called as an accessory, then
    Basepage.Parent is 0 *)

VAR Halt* : haltproc;

 (* this procedure is called if a HALT-command occurs. The parameter is the
    same as the one of HALT in the source file. System links a procedure
    which calls GEMDOS.Pterm. Oberon links a procedure which show an alert
    where the user can choose to cancel running, debug or continue. You
    can link your own routine if you wish *)

VAR Loader*,ModuleCall* : BOOLEAN;
 (* Loader is TRUE if running under the oberon load time linking environment.
    Then ModuleCall is TRUE if the module was called, else a single procedure
    from the module is called *)

    MiNT*   : BOOLEAN;

 (* TRUE if running under MiNT, the multitasking environment *)

    FPU*    : BOOLEAN;

 (* TRUE if there is a floating point unit. (set if there is a cookie "_FPU") *)

END Sys.
