dos_compilers/Logitech Modula-2 v34/M2LIB/DEF/BLOCKOPS.DEF
2024-07-02 07:25:31 -07:00

52 lines
2.1 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

DEFINITION MODULE BlockOps;
(* Block operations.
Blocks are defined with a starting address and a size, i.e. the number
of bytes they contain.
*)
FROM SYSTEM IMPORT ADDRESS;
PROCEDURE BlockMoveForward (destination, source : ADDRESS;
size : CARDINAL);
(* Moves size bytes from source to destination, starting at the address
of source and going up until address of (source+size) is reached *)
PROCEDURE BlockMoveBackward (destination, source : ADDRESS;
size : CARDINAL);
(* Moves size bytes from source to destination, starting at (source+size)
and going down until address of source is reached *)
PROCEDURE BlockMove (destination, source : ADDRESS;
size : CARDINAL);
(* Moves size bytes from source to destination, test is made on the
addresses of source and destination to decide whether MoveBackward or
MoveForward is to be used. Note that because of this comparison,
Move is slightly slower than the two previous procedures *)
PROCEDURE BlockClear (block : ADDRESS;
size : CARDINAL);
(* Fills size bytes with 0, starting from block. *)
PROCEDURE BlockSet (block : ADDRESS;
blockSize : CARDINAL;
pattern : ADDRESS;
patternSize : CARDINAL);
(* Fills blockSize bytes starting from block with the pattern of
patternSize bytes. *)
PROCEDURE BlockEqual (block1, block2 : ADDRESS;
size : CARDINAL): BOOLEAN;
(* Returns TRUE if the blocks starting at left and right have the same
first size bytes. *)
PROCEDURE BlockPosition (block : ADDRESS;
blockSize : CARDINAL;
pattern : ADDRESS;
patternSize : CARDINAL): CARDINAL;
(* Searches pattern in block, returns the index of the first successful
match, MaxCard if no match. *)
END BlockOps.