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

⟦3d63cffa1⟧ Ada Source

    Length: 3072 (0xc00)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Fifo, seg_027812

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



with Text_Io;
package body Fifo is

    Tab : array (1 .. Size) of Element;
    Head, Tail : Positive := 1;


    procedure Clear is
    begin
        Head := 1;
        Tail := 1;
    end Clear;


    function Is_Empty return Boolean is
    begin
        return Head = Tail;
    end Is_Empty;


    function Is_Full return Boolean is
    begin
        if Tail = Size then
            return Head = 1;
        else
            return Tail + 1 = Head;
        end if;
    end Is_Full;


    procedure Get (Item : out Element) is
    begin
        Item := Tab (Head);
        if Head = Size then
            Head := 1;
        else
            Head := Head + 1;
        end if;
    end Get;


    procedure Put (Item : in Element) is
    begin
        Tab (Tail) := Item;
        if Tail = Size then
            Tail := 1;
        else
            Tail := Tail + 1;
        end if;
    end Put;


    procedure Image is
        I : Positive := Head;
    begin
        Text_Io.Put_Line ("------------- Fifo ---------------");
        Text_Io.Put_Line ("Size = " & Positive'Image (Size));
        if not Is_Empty then
            while I /= Tail loop
                Text_Io.Put_Line ("Indice " & Positive'Image (I) &
                                  Ascii.Ht & Element_Image (Tab (I)));
                if I = Size then
                    I := 1;
                else
                    I := I + 1;
                end if;
            end loop;
        else
            Text_Io.Put_Line ("Fifo is empty");
        end if;
    end Image;

end Fifo;

E3 Meta Data

    nblk1=2
    nid=0
    hdr6=4
        [0x00] rec0=36 rec1=00 rec2=01 rec3=01e
        [0x01] rec0=15 rec1=00 rec2=02 rec3=001
    tail 0x21520b24e83ac5ed62b40 0x42a00088462060003