(*  6.2.84  *)

MODULE M_Halt;

(*$E-*)
(*
        print message on screen and return to CP/M
        EXPORT Halt;
*)
(*$E+*)

EXTERNAL FUNCTION @BDOS (F: INTEGER; P: INTEGER ) : INTEGER;


PROCEDURE Halt ( Message: STRING );
VAR
  Result: INTEGER;

BEGIN
  Message := CONCAT (CHR (13), CHR (10), Message, '$');
  Result := @BDOS (9, ADDR (Message)+1) (* print string *);
  Result := @BDOS (0, 0) (* stop program, return to CP/M *);
END (* Halt *);

(*
        print message on screen
        EXPORT Message;
*)


PROCEDURE Message ( Message: STRING );
VAR
  Result: INTEGER;

BEGIN
  Message := CONCAT (CHR (13), CHR (10), Message, '$');
  Result := @BDOS (9, ADDR (Message)+1) (* print string *);
END (* Message *);

MODEND.
