Class SysBase

java.lang.Object
svm.env.SysBase

public abstract class SysBase extends Object

Basic System Routines

Link to GitHub: Source File.

Author:
Simula Standard, S-Port: The Environment Interface, Øystein Myhre Andersen
  • Constructor Details

    • SysBase

      public SysBase()
      Default Constructor
  • Method Details

    • initia

      public static void initia()

      Initialisation of the environment

      Visible sysroutine("INITIA") INITIA;
      import entry(PXCHDL) exchdl  end;
      
      Runtime Stack
         ..., exchdl →
         ...
      

      Initialisation of the environment.

      The import parameter 'exchdl' will be the RADDR of the routine that is to be called if the environment gets control after an interrupt.

    • terminate

      public static void terminate()

      Terminate program

      Visible sysroutine("TERMIN") TERMIN;
      import range(0:3) code; infix(string) msg  end;
      
      Runtime Stack
         ..., code, msg'addr, msg'ofst, msg'nchr →
         ...
      

      Execution of a Simula program will be concluded by a call on terminate.

      code: Completion code:
      	0 - normal termination
      	1 - user requested termination
      	2 - termination after error in user program
      	3 - termination after Simula system error
      
      msg: Possible message to the user.
      
    • stringEqual

      public static void stringEqual()

      Test strings for equality

      Visible sysroutine("STREQL") STREQL;
      import infix(string) str1,str2; export boolean res  end;
      
      Runtime Stack
         ..., str1'oaddr, str1'ofst, str1'nchr, str2'oaddr, str2'ofst, str2'nchr →
         ..., res
      

      First: Pop the two strings off the Runtime stack
      Then test for equality, 'res' true if equals
      Finally: push the 'res' onto the Runtime stack.

    • movein

      public static void movein()

      Move information

      Visible sysroutine("MOVEIN") MOVEIN;
      import ref() from,to; size length  end;
      
      Runtime Stack
         ..., from'oaddr, to'ofst, length'size →
         ...
      

      An implementation will be safe (with regards to overlap) if the area is moved sequentially starting with the object unit identified by "from" (this unit must be moved to the unit identified by "to").

      From:   The "lowest" object address of the area to be moved.
      To:     The "lowest" object address of the destination area.
      Length: The size of the area to be moved.
      
    • zeroarea

      public static void zeroarea()

      Zero fill Area

      Visible inline'routine ("ZEROAREA")  ZEROAREA;
      import ref() fromAddr, toAddr; end;
      
      Runtime Stack
         ..., from'oaddr, to'oaddr →
         ...
      

      The area between fromAddr and toAddr (from included, toAddr not) is to be zero-filled.

      In this implementation the area is null-filled.

    • dwarea

      public static void dwarea()

      Define Work Area

      Visible sysroutine ("DWAREA")  DWAREA;
      import size lng; range(0:255) ano;
      export ref() pool  end;
      
      Runtime Stack
         ..., lng, ano →
         ..., pool
      

      The routine def work area must return a reference to a contiguous area.

      lng: The wanted size of the work area.

      ano: Identification of the work area in question.

      The result 'pool', which is pushed onto the Runtime stack, is the object address of the first allocation point within the reserved area.

    • cputime

      public static void cputime()

      Processor Time Usage

      Visible sysroutine("CPUTIM") CPUTIM;
      export long real sec  end;
      
      Runtime Stack
         ... →
         ..., sec
      

      The elapsed cpu-time measured in seconds is pushed onto the Runtime stack.

    • dattim

      public static void dattim()

      Date and time

      Visible sysroutine("DATTIM") DATTIM;
      import infix(string) item; export integer filled  end;
      
      Runtime Stack
         ..., item'oaddr, item'ofst, item'nchr →
         ..., filled
      

      The result of a call on the routine will be filled into the string 'item'.
      The length of the filled part is pushed onto the Runtime stack.

      The string should have the following syntax:

       "yyyy-mm-dd hh:nn:ss.ppp"
      
    • cblnk

      public static void cblnk()

      Blank fill

      Visible known("CBLNK") C_BLNK; import infix(string) str;
      
      Runtime Stack
         ..., str'addr, str'ofst, str'nchr →
         ...
      

      Blankfill the area specified by the argument 'str'.

    • cmove

      public static void cmove()

      Move characters

      Visible known("CMOVE") C_MOVE; import infix(string) src,dst;
      
      Runtime Stack
         ..., src'addr, src'ofst, src'nchr, dst'addr, dst'ofst, dst'nchr →
         ...
      

      Transfer all the characters in the source 'src' to the destination 'dst'.
      If source is longer than destination, the remaining characters are ignored.
      Blankfill any remaining characters of the destination.

    • verbose

      public static void verbose()

      Verbose

      Visible sysroutine("VERBOSE") VERBOSE;
      export integer result  end;
      
      Runtime Stack
         ... →
         ..., result
      
    • dmpent

      public static void dmpent()

      Dump an Entity

      Visible sysroutine("DMPENT") DMPENT;
      import ref() rtAddr;  end;
      
      Runtime Stack
         ..., rtAddr →
         ...
      

      Dump an Entity on Standard output.