(*
    Title: 	Hopefully machine coded
    LastEdit:	"Wed Jan  6 14:39:58 1988"
    Author: 	Derek McAuley,Oms1,4663,329629
		Cambridge University Computer Laboratory
*)

DEFINITION MODULE MCLib;

FROM SystemTypes IMPORT String;
FROM SYSTEM      IMPORT ADDRESS;

EXPORT QUALIFIED 
  BytePtr, 
  
  MoveBytes, MoveOverlapBytes, ClearBytes, SetBytes, SetWords,
  
  HashBytes, HashWords;
  

TYPE 
  BytePtr = String;

PROCEDURE MoveBytes(from, to:BytePtr; n:CARDINAL);
  (* This does a move upwards in store, very very fast. Recommended for
     all byte and word block moves. *)

PROCEDURE MoveOverlapBytes(from, to:BytePtr; n:CARDINAL);
  (* This does a test, and either ascending or descending move *)

PROCEDURE ClearBytes(at:BytePtr; n:CARDINAL);

PROCEDURE SetBytes(at:BytePtr; n:CARDINAL; to:CHAR);

PROCEDURE SetWords(at:ADDRESS; nOfWords:CARDINAL; to:CARDINAL);

PROCEDURE HashBytes(at:BytePtr; n:INTEGER; mod:CARDINAL):CARDINAL;
  (* n < 0 means use NULL termination *)

PROCEDURE HashWords(at:ADDRESS; n, mod:CARDINAL):CARDINAL;

END MCLib.
