Sage-ST ä

Bitlib

Documentation

BitAnd BitAndDWord BitAndWord BitAndWordEmpty
BitDif BitDifDWord BitDifWord BitKnt
BitKntDWord BitKntWord BitNot BitNotDWord
BitNotWord BitOr BitOrDWord BitOrWord
BitXor BitXorDWord BitXorWord ByteAnd
DWordAnd Excl Incl Included
MaskLeft MaskRight ShiftLeftAround ShiftLeftOff
ShiftLeftOffArray ShiftRightAround ShiftRightOff ShiftRightOffArray
WordAnd




  procedure BitAndWord
             (bitsIn    : in     System.Address;
              bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);

  --*
  --  BitAndWord - Bit-wise AND two word arrays.
  --
  --
  --  This procedure bit-wise ANDs 'bitLength' words from 'bitsIn' with words from
  --  'bitsOut' into words in 'bitsOut'.
  --
  --  CALLING SEQUENCE -
  --
  --    BitAndWord (bitsIn, bitsOut, bitLength)
  --
  --  ENTRY -
  --
  --    bitsIn : System.Address
  --      The address of the input array of words.
  --
  --    bitsOut : System.Address
  --      The address of the output array of words.
  --
  --    bitLength : Modsys.S_Integer32
  --      The number of words to AND.
  --
  --  EXIT -
  --
  --    bitsOut : System.Address
  --      The address of the output array of words which is result of 'bitsIn'
  --      array ANDed with the 'bitsOut' array.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  function BitAndWordEmpty
            (bitsIn    : in     System.Address;
             bitsOut   : in     System.Address;
             bitLength : in     ModSys.S_Integer32) return boolean;

  --*
  --  BitAndWordEmpty - Bit-wise AND word arrays, return empty status.
  --
  --
  --  This function bit-wise ANDs 'bitLength' words from 'bitsIn' with words from
  --  'bitsOut' into words in 'bitsOut', and returns the empty status.
  --
  --  CALLING SEQUENCE -
  --
  --    empty := BitAndWordEmpty (bitsIn, bitsOut, bitLength)
  --
  --  ENTRY -
  --
  --    bitsIn : System.Address
  --      The address of the input array of words.
  --
  --    bitsOut : System.Address
  --      The address of the output array of words.
  --
  --    bitLength : ModSys.S_Integer32
  --      The number of words to AND.
  --
  --  EXIT -
  --
  --    bitsOut : System.Address
  --      The address of the output array of words which is result of 'bitsIn'
  --      array ANDed with the 'bitsOut' array.
  --
  --    empty : boolean
  --      TRUE if the ANDed 'bitsOut' array is empty (has no bits set).
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  procedure BitDif
             (bitsIn    : in     System.Address;
              bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);

  --*
  --  BitDif - Bit-wise AND one byte array with the NOT of another.
  --
  --
  --  This procedure bit-wise ANDs 'bitLength' bytes into 'bitsOut' with the NOT
  --  of bytes from 'bitsIn'.
  --
  --  CALLING SEQUENCE -
  --
  --    BitDif (bitsIn, bitsOut, bitLength)
  --
  --  ENTRY -
  --
  --    bitsIn : System.Address
  --      The address of the input array of bytes (to be NOTed).
  --
  --    bitsOut : System.Address
  --      The address of the output array of bytes.
  --
  --    bitLength : ModSys.S_Integer32
  --      The number of bytes to process.
  --
  --  EXIT -
  --
  --    bitsOut : System.Address
  --      The address of the output array of bytes which is result of NOTed
  --      'bitsIn' array ANDed with the 'bitsOut' array.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  procedure BitDifWord
             (bitsIn    : in     System.Address;
              bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);

  --*
  --  BitDifWord - Bit-wise AND one word array with the NOT of another.
  --
  --
  --  This procedure bit-wise ANDs 'bitLength' words into 'bitsOut' with the NOT
  --  of words from 'bitsIn'.
  --
  --  CALLING SEQUENCE -
  --
  --    BitDifWord (bitsIn, bitsOut, bitLength)
  --
  --  ENTRY -
  --
  --    bitsIn : System.Address
  --      The address of the input array of words (to be NOTed).
  --
  --    bitsOut : System.Address
  --      The address of the output array of words.
  --
  --    bitLength : ModSys.S_Integer32
  --      The number of words to process.
  --
  --  EXIT -
  --
  --    bitsOut : System.Address
  --      The address of the output array of words which is result of NOTed
  --      'bitsIn' array ANDed with the 'bitsOut' array.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  function BitKnt
            (bitsIn    : in     System.Address;
             bitLength : in     ModSys.S_Integer32) return ModSys.S_Integer32;

  --*
  --  BitKnt - Count the set bits in a byte array.
  --
  --
  --  This function counts the set bits in 'bitLength' bytes of 'bitsIn'.
  --
  --  CALLING SEQUENCE -
  --
  --    count := BitKnt (bitsIn, bitLength)
  --
  --  ENTRY -
  --
  --    bitsIn : System.Address
  --      The address of the input array of bytes.
  --
  --    bitLength : ModSys.S_Integer32
  --      The number of bytes to count.
  --
  --  EXIT -
  --
  --    count : ModSys.S_Integer32
  --      The number of bits set in the array.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  function BitKntWord
            (bitsIn    : in     System.Address;
             bitLength : in     ModSys.S_Integer32) return ModSys.S_Integer32;

  --*
  --  BitKntWord - Count the set bits in a word array.
  --
  --
  --  This function counts the set bits in 'bitLength' words of 'bitsIn'.
  --
  --  CALLING SEQUENCE -
  --
  --    count := BitKntWord (bitsIn, bitLength)
  --
  --  ENTRY -
  --
  --    bitsIn : System.Address
  --      The address of the input array of words.
  --
  --    bitLength : ModSys.S_Integer32
  --      The number of words to count.
  --
  --  EXIT -
  --
  --    count : ModSys.S_Integer32
  --      The number of bits set in the array.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  procedure BitNot
             (bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);

  --*
  --  BitNot - Bit-wise NOT a byte array.
  --
  --
  --  This procedure bit-wise NOTs 'bitLength' bytes in 'bitsOut'.
  --
  --  CALLING SEQUENCE -
  --
  --    BitNot (bitsOut, bitLength)
  --
  --  ENTRY -
  --
  --    bitsOut : System.Address
  --      The address of the output array of bytes.
  --
  --    bitLength : ModSys.S_Integer32
  --      The number of bytes to NOT.
  --
  --  EXIT -
  --
  --    bitsOut : System.Address
  --      The address of the output array of bytes which is the complement
  --      (NOT) 'bitsOut' array.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  procedure BitNotWord
             (bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);

  --*
  --  BitNotWord - Bit-wise NOT a word array.
  --
  --
  --  This procedure bit-wise NOTs 'bitLength' words in 'bitsOut'.
  --
  --  CALLING SEQUENCE -
  --
  --    BitNotWord (bitsOut, bitLength)
  --
  --  ENTRY -
  --
  --    bitsOut : System.Address
  --      The address of the output array of words.
  --
  --    bitLength : ModSys.S_Integer32
  --      The number of words to NOT.
  --
  --  EXIT -
  --
  --    bitsOut : System.Address
  --      The address of the output array of words which is the complement
  --      (NOT) 'bitsOut' array.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  procedure BitOrWord
             (bitsIn    : in     System.Address;
              bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);

  --*
  --  BitOrWord - Bit-wise OR two word arrays.
  --
  --
  --  This procedure bit-wise ORs 'bitLength' words from 'bitsIn' with words from
  --  'bitsOut' into words in 'bitsOut'.
  --
  --  CALLING SEQUENCE -
  --
  --    BitOrWord (bitsIn, bitsOut, bitLength)
  --
  --  ENTRY -
  --
  --    bitsIn : System.Address
  --      The address of the input array of words.
  --
  --    bitsOut : System.Address
  --      The address of the output array of words.
  --
  --    bitLength : ModSys.S_Integer32
  --      The number of words to OR.
  --
  --  EXIT -
  --
  --    bitsOut : System.Address
  --      The address of the output array of words which is result of 'bitsIn'
  --      array ORed (UNION) with the 'bitsOut' array.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  procedure BitXor
             (bitsIn    : in     System.Address;
              bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);

  --*
  --  BitXor - Bit-wise XOR two byte arrays.
  --
  --
  --  This procedure bit-wise XORs 'bitLength' bytes from 'bitsIn' into bytes in
  --  'bitsOut'.
  --
  --  CALLING SEQUENCE -
  --
  --    BitXor (bitsIn, bitsOut, bitLength)
  --
  --  ENTRY -
  --
  --    bitsIn : System.Address
  --      The address of the input array of bytes.
  --
  --    bitsOut : System.Address
  --      The address of the output array of bytes.
  --
  --    bitLength : modsys.S_Integer32
  --      The number of bytes to XOR.
  --
  --  EXIT -
  --
  --    bitsOut : System.Address
  --      The address of the output array of bytes which is result of 'bitsIn'
  --      array XORed (EXCLUSIVE OR) with the 'bitsOut' array.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  procedure BitXorWord
             (bitsIn    : in     System.Address;
              bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);

  --*
  --  BitXorWord - Bit-wise XOR two word arrays.
  --
  --
  --  This procedure bit-wise XORs 'bitLength' words from 'bitsIn' into words in
  --  'bitsOut'.
  --
  --  CALLING SEQUENCE -
  --
  --    BitXorWord (bitsIn, bitsOut, bitLength)
  --
  --  ENTRY -
  --
  --    bitsIn : System.Address
  --      The address of the input array of words.
  --
  --    bitsOut : System.Address
  --      The address of the output array of words.
  --
  --    bitLength : ModSys.S_Integer32
  --      The number of words to XOR.
  --
  --  EXIT -
  --
  --    bitsOut : System.Address
  --      The address of the output array of bytes which is result of 'bitsIn'
  --      array XORed (EXCLUSIVE OR) with the 'bitsOut' array.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  function ByteAnd
            (byte1 : in     Unsigned.BYTE;
             byte2 : in     Unsigned.BYTE) return Unsigned.BYTE;

  --*
  --  ByteAnd - AND two bytes together returning the result.
  --
  --
  --  This procedure bit-wise ANDs two bytes and returns the result.
  --
  --  CALLING SEQUENCE -
  --
  --    ANDedByte := ByteAnd (byte1, byte2);
  --
  --  ENTRY -
  --
  --    byte1, byte2 : unsigned.byte
  --      The two bytes to be ANDed.
  --
  --  EXIT -
  --
  --    ANDedByte : unsigned.byte
  --      The result of ANDing the two bytes.
  --




  procedure BitAnd
             (bitsIn    : in     System.Address;
              bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);

  --*
  --  BitAnd - Bit-wise AND two byte arrays.
  --
  --
  --  This procedure bit-wise ANDs 'bitLength' bytes from 'bitsIn' with bytes from
  --  'bitsOut' into bytes in 'bitsOut'.
  --
  --  CALLING SEQUENCE -
  --
  --    BitAnd (bitsIn, bitsOut, bitLength)
  --
  --  ENTRY -
  --
  --    bitsIn : System.Address
  --      The address of the input array of bytes.
  --
  --    bitsOut : System.Address
  --      The address of the output array of bytes.
  --
  --    bitLength : modsys.S_Integer32
  --      The number of bytes to AND.
  --
  --  EXIT -
  --
  --    bitsOut : System.Address
  --      The address of the output array of bytes which is result of 'bitsIn'
  --      array ANDed with the 'bitsOut' array.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  procedure BitOr
             (bitsIn    : in     System.Address;
              bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);

  --*
  --  BitOr - Bit-wise OR two byte arrays.
  --
  --
  --  This procedure bit-wise ORs 'bitLength' bytes from 'bitsIn' with bytes from
  --  'bitsOut' into bytes in 'bitsOut'.
  --
  --  CALLING SEQUENCE -
  --
  --    BitOr (bitsIn, bitsOut, bitLength)
  --
  --  ENTRY -
  --
  --    bitsIn : System.Address
  --      The address of the input array of bytes.
  --
  --    bitsOut : System.Address
  --      The address of the output array of bytes.
  --
  --    bitLength : ModSys.S_Integer32
  --      The number of bytes to OR.
  --
  --  EXIT -
  --
  --    bitsOut : System.Address
  --      The address of the output array of bytes which is result of 'bitsIn'
  --      array ORed (UNION) with the 'bitsOut' array.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  procedure Excl
             (TheSet : in out Unsigned.WORD;
              bit    : in     ModSys.S_Integer32);

  --*
  --  Excl - Clear (set to 0) a bit within a word.
  --
  --
  --  This procedure clears (set to 0) a specified bit within a word.
  --
  --  CALLING SEQUENCE -
  --
  --    Excl (TheSet, bit)
  --
  --  ENTRY -
  --
  --    TheSet : unsigned.WORD
  --      The word containing the bit to be reset.
  --
  --    bit : ModSys.S_Integer32
  --      The number of the bit to reset (0..15).
  --
  --  EXIT -
  --
  --    TheSet : unsigned.WORD
  --      The word containing the cleared bit.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  procedure Incl
             (TheSet : in out Unsigned.WORD;
              bit    : in     ModSys.S_Integer32);

  --*
  --  Incl - Set a bit within a word.
  --
  --
  --  This procedure sets a specified bit within a word.
  --
  --  CALLING SEQUENCE -
  --
  --    Incl (TheSet, bit)
  --
  --  ENTRY -
  --
  --    TheSet : unsigned.WORD
  --      The word containing the bit to be set.
  --
  --    bit : ModSys.S_Integer32
  --      The number of the bit to set (0..15).
  --
  --  EXIT -
  --
  --    TheSet : unsigned.WORD
  --      The word containing the bit that was set.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  function Included
            (set : in     Unsigned.WORD;
             bit : in     ModSys.S_Integer32) return boolean;

  --*
  --  Included - Check if a bit is set in a word.
  --
  --
  --  This function checks the setting of a bit within a word.
  --
  --  CALLING SEQUENCE -
  --
  --    b := Included (TheSet, bit)
  --
  --  ENTRY -
  --
  --    TheSet : unsigned.WORD
  --      The word containing the bit to be checked.
  --
  --    bit : ModSys.S_Integer32
  --      The number of the bit to check (0..15).
  --
  --  EXIT -
  --
  --    b : boolean
  --      TRUE if 'bit' is set in 'set'.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  function MaskLeft
            (bits : in     ModSys.S_Integer32) return Unsigned.WORD;

  --*
  --  MaskLeft - Return mask with specified number of left bits set.
  --
  --
  --  This function returns a word with the specified number of left (higher order)
  --  bits set.  For  example "set  :=  MaskLeft(3);"  returns 'set'  equal to
  --  16#0E000#.
  --
  --  CALLING SEQUENCE -
  --
  --    TheSet := MaskLeft (bits)
  --
  --  ENTRY -
  --
  --    bits : ModSys.S_Integer32
  --      The number of left bits to set (0..16).
  --
  --  EXIT -
  --
  --    TheSet : unsigned.WORD
  --      The word containing 'bits' left bits set.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  function MaskRight
            (bits : in     ModSys.S_Integer32) return Unsigned.WORD;

  --*
  --  MaskRight - Return mask with specified right bits set.
  --
  --
  --  This function returns a word with the specified number of right (lower order)
  --  bits set.  For  example "set  := MaskRight(3);"  returns 'set'  equal to
  --  16#0007#.
  --
  --  CALLING SEQUENCE -
  --
  --    TheSet := MaskRight (bits)
  --
  --  ENTRY -
  --
  --    bits : ModSys.S_Integer32
  --      The number of right bits to set (0..16).
  --
  --  EXIT -
  --
  --    TheSet : unsigned.WORD
  --      The word containing 'bits' right bits set.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  procedure ShiftLeftOff
             (TheSet : in out Unsigned.WORD;
              bits   : in     ModSys.S_Integer32);

  --*
  --  ShiftLeftOff - Shift bits left without wrap around.
  --
  --
  --  This procedure left shifts a word the specified number of bits.  In a left
  --  shift the highest order bits are shifted off first.  The right (lower order)
  --  bits are set to zero(0).
  --
  --  CALLING SEQUENCE -
  --
  --    ShiftLeftOff (TheSet, bits)
  --
  --  ENTRY -
  --
  --    TheSet : unsigned.WORD
  --      The word containing the bits to be shifted.
  --
  --    bits : ModSys.S_Integer32
  --      The number of bits to shift off (0..16).
  --
  --  EXIT -
  --
  --    TheSet : unsigned.WORD
  --      The word with bits shifted left.
  --
  --  EXAMPLE -
  --
  --    See example at end of file.
  --




  procedure ShiftRightOff
             (TheSet : in out Unsigned.WORD;
              bits   : in     ModSys.S_Integer32);

  --*
  --  ShiftRightOff - Shift bits right without wrap around.
  --
  --
  --  This procedure right shifts a word the specified number of bits.  In a right
  --  shift the lowest order bits are shifted off first.  The left (higher order)
  --  bits are set to zero(0).
  --
  --  CALLING SEQUENCE -
  --
  --    ShiftRightOff (TheSet, bits)
  --
  --  ENTRY -
  --
  --    TheSet : unsigned.WORD
  --      The word containing the bits to be shifted.
  --
  --    bits : modsys.S_Integer32
  --      The number of bits to shift off (0..16).
  --
  --  EXIT -
  --
  --    TheSet : unsigned.WORD
  --      The word with bits shifted right.
  --




  procedure ShiftLeftOffArray
             (TheSet   : in     System.Address;
              setBytes : in     ModSys.S_Integer32;
              bits     : in     ModSys.S_Integer32);

  --*
  --  ShiftLeftOffArray - Shift array of bits left without wrap around.
  --
  --
  --  This procedure left shifts an array of bytes the specified number
  --  of bits. In a left shift the  highest order bits are shifted off
  --  first. The right (lower order) bits are set to zero(0).
  --
  --  CALLING SEQUENCE -
  --
  --    ShiftLeftOffArray (TheSet, setBytes, bits);
  --
  --  ENTRY -
  --
  --    TheSet : ADDRESS
  --      The address of the array of bytes containing the bits to
  --      be shifted.
  --
  --    setBytes : Modsys.S_Integer32
  --      The number of bytes in the array to be shifted.
  --
  --    bits : Modsys.S_Integer32
  --      The number of bits to shift off.
  --
  --  EXIT -
  --
  --    TheSet : ADDRESS
  --      The original array with bits shifted.
  --




  procedure ShiftRightOffArray
             (TheSet   : in     System.Address;
              setBytes : in     ModSys.S_Integer32;
              bits     : in     ModSys.S_Integer32);

  --*
  --  ShiftRightOffArray - Shift array of bits right without wrap around.
  --
  --
  --  This procedure right shifts an array of bytes the specified number
  --  of bits. In a right shift the  lowest order bits are shifted off
  --  first. The left (higher order) bits are set to zero(0).
  --
  --  CALLING SEQUENCE -
  --
  --    ShiftRightOffArray (TheSet, setBytes, bits);
  --
  --  ENTRY -
  --
  --    TheSet : ADDRESS
  --      The address of the array of bytes containing the bits to
  --      be shifted.
  --
  --    setBytes : Modsys.S_Integer32
  --      The number of bytes in the array to be shifted.
  --
  --    bits : Modsys.S_Integer32
  --      The number of bits to shift off.
  --
  --  EXIT -
  --
  --    TheSet : ADDRESS
  --      The original array with bits shifted.
  --




  procedure ShiftLeftAround
             (TheSet : in out Unsigned.WORD;
              bits   : in     ModSys.S_Integer32);




  procedure ShiftRightAround
             (TheSet : in out Unsigned.WORD;
              bits   : in     ModSys.S_Integer32);




  procedure BitAndDWord
             (bitsIn    : in     System.Address;
              bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);




  procedure BitOrDWord
             (bitsIn    : in     System.Address;
              bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);




  procedure BitDifDWord
             (bitsIn    : in     System.Address;
              bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);




  procedure BitXorDWord
             (bitsIn    : in     System.Address;
              bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);




  procedure BitNotDWord
             (bitsOut   : in     System.Address;
              bitLength : in     ModSys.S_Integer32);




  function BitKntDWord
            (bitsIn    : in     System.Address;
             bitLength : in     ModSys.S_Integer32) return ModSys.S_Integer32;




  function WordAnd
            (word1 : in     Unsigned.WORD;
             word2 : in     Unsigned.WORD) return Unsigned.WORD;




  function DWordAnd
            (dword1 : in     ModSys.S_Integer32;
             dword2 : in     ModSys.S_Integer32) return ModSys.S_Integer32;




Send mail to   warren.merrill@inl.gov with questions or comments about this web site.
Copyright © 1989-2006 Battelle Energy Alliance