Bit&Byte operations : Register problems with StonyBrookModula-2 32-bit
Hello,
Does anyone have the following procedures for a 32-bit environment ? Or :
Could anyone give me a tip for creating them ?
I do have them for 16-bit (written in Assembler !), but they don't function
in a 32-bit environment.
1) Clear( at : ADDRESS;
size : CARDINAL );
(* Move size bytes with 0 on address 'at' *)
2) MoveBytes( to,
from : ADDRESS;
size : CARDINAL );
(* Moves size bytes starting at 'from' to address 'to' *)
3) MoveBytesForward( to,
from : ADDRESS;
size : CARDINAL );
(* Moves size bytes starting at address 'from' to address 'from'+size *)
4) MoveBytesBackward( to,
from : ADDRESS;
size : CARDINAL);
(* Moves size bytes starting at 'from'+size to address 'from' *)
5) Fill( at : ADDRESS ;
totSz : CARDINAL;
fillup : ADDRESS ;
fillSz : CARDINAL );
(* Move fillSz bytes from 'fillup' to address 'at' for complete size
totSz;
'at' will be completely filled up with 'fillup' *)
6) Compare( word1,
word2 : ADDRESS;
size : CARDINAL ) : CARDINAL;
(* Check first size bytes from 'word1' with the first size bytes from
'word2' *)
7) Locate( Word : ADDRESS ;
WordLen : CARDINAL;
bytes : ADDRESS ;
NumBytes : CARDINAL ) : CARDINAL;
(* Find bytes (with length NumBytes) in Word (Length WordLen) and return
the
starting position *)
Thanks for any help.