home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Modula / Source / LOADER.DEF < prev    next >
Text File  |  1985-04-25  |  2KB  |  48 lines

  1. DEFINITION MODULE Loader;
  2. (***********************)
  3.  
  4. (* overlay loader for the  Modula system *)
  5.  
  6. (* Vers. 01.11. 1983  P. Fink, ETH    *)
  7.  
  8. FROM SYSTEM IMPORT ADDRESS;
  9. EXPORT QUALIFIED  Call,
  10.                   Load, Unload;
  11.  
  12. PROCEDURE Call
  13.   (VAR OvName : ARRAY OF CHAR;
  14.    VAR result : INTEGER);
  15. (* load and execute overlay OvName, as a subroutine *)
  16. (* OvName can be a module name (max 11 chars significant), or a file name
  17.    (form dev:rep:rep:name.ext).
  18.    Done if: loading, and possibly execution, are errorfree.
  19.    default extension for the load file search will be .LOD
  20.    default dev: will be <nothing>, and alternate dev: is MODLIB:
  21.    result is zero, when everything was ok, otherwise an errornumber
  22.    (system-dependent) *)
  23.  
  24.  
  25. (* more sophisticated functions: (not yet implemented) *)
  26. (* definitely not required for the compiler ! *)
  27. (* INTENDED FOR:
  28.    management of several independent loaded modules.
  29.    useful in M3 for the O.S., on the SMAKY 8 for XS-1.
  30.    consistency is important. it is an error to load when the
  31.    base layer is not loaded, or to unload when overlays are
  32.    still loaded.
  33.    The identification of the base layer for an overlay is
  34.    done at link time.
  35.    specs written by me (PF) *)
  36.  
  37.  
  38. PROCEDURE Load (VAR ovname : ARRAY OF CHAR;  VAR reference: ADDRESS;
  39.                 VAR error : INTEGER);
  40. (* load overlay  ovname  into memory, and execute its initialization part.
  41.    does not unload it. code and data remain in memory *)
  42.  
  43. PROCEDURE Unload (reference: ADDRESS; VAR error: INTEGER);
  44. (* unload the referenced overlay *)
  45.  
  46. END Loader.
  47.  
  48.