[INHERIT ('SYS$LIBRARY:STARLET.PEN')]
MODULE Init;

{ Routines for performing the INIT command }

(****************** Declare External Variables and Constants ******************)

%INCLUDE 'HEX$DIRECTORY:HEXGLOB.INC/NOLIST'

(****************** External Homemade Routine Declarations ********************)

[EXTERNAL] PROCEDURE Check_Extra_Chars; EXTERN;

(******************************************************************************)
(*									      *)
(*			    Procedure Do_Init				      *)
(*									      *)
(******************************************************************************)

[GLOBAL] FUNCTION Do_Init: INTEGER;

{ This function initializes the virtual memory to the specified value (default
  is FF) and resets the Offset, Transfer, Program_Name, Low and High variables.
}

VAR
	I	: INTEGER;

BEGIN

  Program_Name := '        ';
  Offset := 0;
  Transfer := 0;
  High := 0;
  Low := 4294967295;
  Use_1 := 1;
  Use_2 := 1;

  FOR I := 0 TO VM_Size DO
    VM[I] := With_Param;

  Do_Init := SS$_NORMAL;

END;

(******************************************************************************)

END. { module init }
