DEFINITION MODULE m2md;
(*$ LargeVars:=FALSE *)
(* 06.10.89/jr
   02.04.88/cn
*)

FROM SYSTEM IMPORT ADDRESS,BYTE;
FROM M2Base IMPORT MPtr;

CONST
 maxProcs=1024;
 maxMods=128;
 nil=0;

TYPE
 IndType=(noptr, aptr, bptr);
 ModInfo=RECORD
  l: MPtr; (* LoaderInfo: name, reffile... *)
  bssBase,
  iniBase: LONGINT;
 END;
 ModInfoList=RECORD
  length: CARDINAL;  (* number of loaded modules *)
  contents: ARRAY [0..maxMods] OF ModInfo;
 END;
 ProcInfo=RECORD
  modNo, procNo: INTEGER;
  pc: INTEGER;
  errStart, errStop: LONGINT;
  dataBase: LONGINT;
 END;
 ProcInfoList=RECORD
  length: CARDINAL;  (* length of procedure chain *)
  contents: ARRAY [0..maxProcs] OF ProcInfo;
 END;
 ProcessStatus=ARRAY [0..127] OF CHAR;

VAR
 modInfoList: ModInfoList;
 procInfoList: ProcInfoList;
 processStatus: ProcessStatus;

PROCEDURE InitM2MD; (* nur von m2d aufrufen *)
PROCEDURE ExitM2MD; (* nur von m2d aufrufen *)
(*
 * Not used as long as there is no hexdump mode.
 *
 *  PROCEDURE Low(long:LONGINT):INTEGER;
 *  PROCEDURE High(long:LONGINT):INTEGER;
 *  PROCEDURE MemoryByte(byteAddr:LONGINT):INTEGER;
 *  PROCEDURE MemoryWord(byteAddr:LONGINT):INTEGER;
 *  PROCEDURE MemoryDoubleWord(byteAddr:LONGINT):LONGINT;
 *)

(* PROCEDURE GetModuleList;     jr:done by implementation *)
PROCEDURE GetProcedureChain;
PROCEDURE GetProcessStatus;

PROCEDURE GetValue(adr: LONGINT; ind: IndType; VAR val: ARRAY OF BYTE);
PROCEDURE GetAddress(adr: LONGINT; ind: IndType; VAR radr: ADDRESS);
PROCEDURE GetHIGH(adr: LONGINT; VAR high: LONGINT);

PROCEDURE FindModule(name: ARRAY OF CHAR): INTEGER;

END m2md.
