DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦3d930ceb4⟧ Ada Source

    Length: 4096 (0x1000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, generic, package Generic_Bit_Operations, seg_01b4b7

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



generic
    type Integer_Type is range <>;
package Generic_Bit_Operations is

    -- Operations on an integer type as an array of bits.
    -- Bit numbering is left to right, starting from 0.
    -- Arguments specified outside bit range raise Constraint_Error

    -- Note :- The CDFs may allocate 32 bits for integer subtypes.
    -- For eg: integer  range -128..127  may   result in  the
    -- allocation of a 32 bit integer. Hence integer_type'size
    -- must not be relied upon when using this pacakge .
    -- However this package will compute the offset of Bit 0
    -- for any type properly.

    -- Extract the bits from Start .. Start + Length - 1.  Equivalent to
    -- Logical_And with 1 in bits of the extraction range and 0 elsewhere.
    function Extract (W : Integer_Type; Start : Natural; Length : Natural)
                     return Integer_Type;

    -- Extract the single bit at B and return as Boolean
    -- Equivalent to Extract (W, B, 1) /= 0   function Test_Bit (W : Integer_Type; B : Natural) return Boolean;

    -- Replace the specified bits of Into with the rightmost Length bits of W.
    function Insert (W, Into : Integer_Type; Start : Natural; Length : Natural)
                    return Integer_Type;

    -- Set the specified Bit to One or Zero
    procedure Set_Bit_To_One (W : in out Integer_Type; B : Natural);
    procedure Set_Bit_To_Zero (W : in out Integer_Type; B : Natural);

    -- Logical operations on two operands.
    -- For shift operations, positive arguments shift Left and negative
    -- arguments shift Right.
    -- shifting ones into positions outside of Integer will raise Numeric_Error.
    function Logical_And (X, Y : Integer_Type) return Integer_Type;
    function Logical_Or (X, Y : Integer_Type) return Integer_Type;
    function Logical_Xor (X, Y : Integer_Type) return Integer_Type;
    function Logical_Not (X : Integer_Type) return Integer_Type;
    function Logical_Shift
                (X : Integer_Type; Amount : Integer) return Integer_Type;

end Generic_Bit_Operations;

E3 Meta Data

    nblk1=3
    nid=0
    hdr6=6
        [0x00] rec0=18 rec1=00 rec2=01 rec3=002
        [0x01] rec0=13 rec1=00 rec2=02 rec3=006
        [0x02] rec0=03 rec1=00 rec2=03 rec3=000
    tail 0x21517f186836386315cef 0x42a00088462060003