home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / MODULAV2GERMAN.DMS / in.adf / Def.zoo / Arts.def < prev    next >
Encoding:
Modula Definition  |  1988-07-31  |  3.7 KB  |  126 lines

  1. (*                _____________________________________________
  2.  *         //    /                                             \         //
  3.  *        //     \          Amiga Run Time System              /        //
  4.  *    \\ //      /           2.0 / 30.07.88 / ms               \    \\ //
  5.  *     \X/       \_____________________________________________/     \X/
  6.  *)
  7. (* $N- *)
  8. DEFINITION MODULE Arts;
  9.  
  10. FROM SYSTEM IMPORT
  11.  ADDRESS,LONGSET;
  12.  
  13. CONST
  14.  maxModName=32; maxKeys=3;
  15.  
  16. TYPE
  17.  ErrorType=(trap,exception,system,assertion,breakPoint,explicit);
  18.  SysErr=(halt,illCase,fctReturn,stkOvl,illCall);
  19.  ErrorFrame=RECORD
  20.   pc: ADDRESS;
  21.   dRegs: ARRAY [0..7] OF LONGINT;
  22.   aRegs: ARRAY [8..15] OF ADDRESS;
  23.   CASE error: ErrorType OF
  24.   | trap: trapNr: INTEGER;
  25.   | exception: exceptionMask: LONGSET
  26.   | system: sysErr: SysErr
  27.   | assertion,breakPoint,explicit:
  28.   END;
  29.   header,body: ADDRESS
  30.  END;
  31. (*
  32.  * ModuleInfo is the definition of the info structure produced by the Linker
  33.  * This definitons are used by the Linker, the Loader and Arts.
  34.  * You, instead, should not use it!
  35.  *)
  36.  ModType=(none,mod,lib,noImp,optLib,rsc);
  37.  ModName=ARRAY [0..maxModName-1] OF CHAR;
  38.  ModKeys=ARRAY [0..maxKeys-1] OF CARDINAL;
  39.  ModuleId=RECORD
  40.   type: INTEGER; (* ORD(ModType) *)
  41.   name: ModName;
  42.   CASE :ModType OF
  43.   | lib,optLib:
  44.    pad: INTEGER;
  45.    libVersion: LONGINT;
  46.   | mod, noImp:
  47.    keys: ModKeys;
  48.   | rsc:
  49.   END
  50.  END;  
  51.  ModuleInfo=RECORD
  52.   id: ModuleId;
  53.   CASE :ModType OF
  54.   | lib,optLib:
  55.    libPtr: ADDRESS;
  56.    fixup: ADDRESS;
  57.   | mod:
  58.    modPtr: ADDRESS;
  59.    dataPtr: ADDRESS;
  60.   | rsc:
  61.    rscSeg: ADDRESS;
  62.    rscPtr: ADDRESS;
  63.   END;
  64.  END;
  65.  ModuleInfoPtr=POINTER TO ModuleInfo;
  66.  
  67. VAR
  68. (*
  69.  * environment values. these are copied into these variables to have them
  70.  * at a save place. to crash the program just change these values.
  71.  * Note: not all of these values are valid. it depends on the program
  72.  * startup if workbench or CLI values are valid. see wbStarted.
  73.  * Here come the initial CLI arguments and CLI result value, it is init to 0,
  74.  * set your return value before program exit
  75.  *)
  76.  stackSize: LONGINT;
  77.  dosCmdBuf: ADDRESS; (* {a0} *)
  78.  dosCmdLen: LONGINT; (* {d0} *)
  79.  returnVal: LONGINT;
  80. (*
  81.  * we run from workbench if wbStarted is TRUE
  82.  *)
  83.  wbStarted: BOOLEAN;
  84.  startupMsg: ADDRESS;
  85. (*
  86.  * Modula-2 environment variables. errorFrame is filled with the 
  87.  * processor/program state when an an error, an exception, a trap
  88.  * or a user interrupt occurs.
  89.  * moduleInfo is used to open and close Amiga-libraries and of
  90.  * course to know which modules are linked into this program.
  91.  *)
  92.  stackTop: ADDRESS;
  93.  errorFrame: ErrorFrame;
  94.  moduleInfo: ModuleInfoPtr; (* {d7} *)
  95.  
  96. (*
  97.  * PROCEDURE Startup(proc{a1+adir}: PROC; modInfo{d7}: ModuleInfoPtr): LONGINT;
  98.  * is the real declaration for Startup, the definition below is
  99.  * just a dummy declaration to access older values on the stack.
  100.  *)
  101. PROCEDURE Startup(base,stk: LONGINT): LONGINT;
  102.  
  103. (* Compiler Support *)
  104. PROCEDURE StkChk(need{0}: LONGINT);
  105. PROCEDURE SystemError(err{0}: SysErr); (* SystemError(halt) = HALT *)
  106. PROCEDURE Mulu32(x{0},y{1}: LONGINT): LONGINT;
  107. PROCEDURE Divu32(x{0},y{1}: LONGINT): LONGINT;
  108. PROCEDURE Muls32(x{0},y{1}: LONGINT): LONGINT;
  109. PROCEDURE Divs32(x{0},y{1}: LONGINT): LONGINT;
  110.  
  111. (* Run Time Support *)
  112. PROCEDURE Assert(condition: BOOLEAN; msg: ADDRESS);
  113. PROCEDURE BreakPoint(msg: ADDRESS);
  114. PROCEDURE Call(p: PROC);
  115. PROCEDURE CurrentLevel(): INTEGER;
  116. PROCEDURE DebugProcedure(debugger: PROC);
  117. PROCEDURE DetectCtrlC(on{0}: BOOLEAN);
  118. PROCEDURE Error(header,body: ADDRESS);
  119. PROCEDURE RemoveDebugProc(debugger: PROC);
  120. PROCEDURE RemoveTermProc(p: PROC);
  121. PROCEDURE Requester(header,body,pos,neg: ADDRESS): BOOLEAN;
  122. PROCEDURE Terminate(level: INTEGER);
  123. PROCEDURE TermProcedure(p: PROC);
  124.  
  125. END Arts.
  126.