DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦1c24e5826⟧ TextFile

    Length: 8377 (0x20b9)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

with Text_Io;

package body Registres is

    use Z80_Defs;

    -- TYPES --------------------------------------------------------------
    type T_Reg_Prime is
        record
            Fort : Octet.T_Octet;
            Faible : Octet.T_Octet;
        end record;


    -- VARIABLES -----------------------------------------------------------

    Tab_Simple : array (Registre_Simple) of Octet.T_Octet;

    Tab_Prime : array (Registre_Double range Af_Prime .. Hl_Prime) of
                   T_Reg_Prime;

    Tab_Double : array (Registre_Double range Ix .. Pc) of Mot.T_Mot;


    -- PROCEDURES ----------------------------------------------------------

    function Lire_Simple (Le_Registre : Z80_Defs.Registre_Simple)
                         return Octet.T_Octet is
    begin
        return Tab_Simple (Le_Registre);
    end Lire_Simple;


    ------------------------------------------------------------------------

    procedure Reset is

    begin
        for I in Registre_Simple loop
            Tab_Simple (I) := 0;
        end loop;

        for I in Registre_Double range Af_Prime .. Hl_Prime loop
            Tab_Prime (I).Fort := 0;  
            Tab_Prime (I).Faible := 0;
        end loop;

        for I in Registre_Double range Ix .. Pc loop
            Tab_Double (I) := 0;
        end loop;


    end Reset;

    ------------------------------------------------------------------------

    function Lire_Double
                (Le_Registre : Z80_Defs.Registre_Double) return Mot.T_Mot is

        Resultat : Mot.T_Mot := 0;

    begin
        case Le_Registre is

            when Ix .. Pc =>
                Resultat := Tab_Double (Le_Registre);

            when Af_Prime .. Hl_Prime =>
                Resultat := Mot.Construire (Tab_Prime (Le_Registre).Fort,
                                            Tab_Prime (Le_Registre).Faible);

            when Af =>  
                Resultat := Mot.Construire (Tab_Simple (A), Tab_Simple (F));

            when Bc =>
                Resultat := Mot.Construire (Tab_Simple (B), Tab_Simple (C));

            when De =>
                Resultat := Mot.Construire (Tab_Simple (D), Tab_Simple (E));

            when Hl =>
                Resultat := Mot.Construire (Tab_Simple (H), Tab_Simple (L));

        end case;

        return Resultat;

    end Lire_Double;

    ------------------------------------------------------------------------

    procedure Ecrire_Simple (Le_Registre : Z80_Defs.Registre_Simple;
                             Un_Octet : Octet.T_Octet) is
    begin
        Tab_Simple (Le_Registre) := Un_Octet;
    end Ecrire_Simple;

    ------------------------------------------------------------------------

    procedure Ecrire_Double
                 (Le_Registre : Z80_Defs.Registre_Double; Un_Mot : Mot.T_Mot) is
    begin
        case Le_Registre is
            when Ix .. Pc =>
                Tab_Double (Le_Registre) := Un_Mot;

            when Af_Prime .. Hl_Prime =>
                Tab_Prime (Le_Registre).Fort := Mot.Poids_Fort (Un_Mot);
                Tab_Prime (Le_Registre).Faible := Mot.Poids_Faible (Un_Mot);

            when Af =>
                Tab_Simple (A) := Mot.Poids_Fort (Un_Mot);
                Tab_Simple (F) := Mot.Poids_Faible (Un_Mot);
            when Bc =>
                Tab_Simple (B) := Mot.Poids_Fort (Un_Mot);
                Tab_Simple (C) := Mot.Poids_Faible (Un_Mot);
            when De =>
                Tab_Simple (D) := Mot.Poids_Fort (Un_Mot);
                Tab_Simple (E) := Mot.Poids_Faible (Un_Mot);
            when Hl =>
                Tab_Simple (H) := Mot.Poids_Fort (Un_Mot);
                Tab_Simple (L) := Mot.Poids_Faible (Un_Mot);
        end case;
    end Ecrire_Double;

    ------------------------------------------------------------------------

    procedure Echange_Octet (Octet_1, Octet_2 : in out Octet.T_Octet) is
        Un_Octet : Octet.T_Octet;
    begin
        Un_Octet := Octet_1;
        Octet_1 := Octet_2;
        Octet_2 := Un_Octet;
    end Echange_Octet;

    ------------------------------------------------------------------------

    procedure Echange_Af_Reg_Prime is

        Reg_Fort, Reg_Faible : Octet.T_Octet;
    begin
        Echange_Octet (Tab_Prime (Af_Prime).Fort, Tab_Simple (A));
        Echange_Octet (Tab_Prime (Af_Prime).Faible, Tab_Simple (F));
    end Echange_Af_Reg_Prime;

    ------------------------------------------------------------------------

    procedure Echange_De_Hl is

        Reg_Fort, Reg_Faible : Octet.T_Octet;
    begin
        Echange_Octet (Tab_Simple (D), Tab_Simple (H));
        Echange_Octet (Tab_Simple (E), Tab_Simple (L));
    end Echange_De_Hl;


    ------------------------------------------------------------------------

    procedure Echange_Bc_De_Hl_Reg_Prime is

        Reg_Fort, Reg_Faible : Octet.T_Octet;
    begin
        Echange_Octet (Tab_Prime (Bc_Prime).Fort, Tab_Simple (B));
        Echange_Octet (Tab_Prime (Bc_Prime).Faible, Tab_Simple (C));

        Echange_Octet (Tab_Prime (De_Prime).Fort, Tab_Simple (D));
        Echange_Octet (Tab_Prime (De_Prime).Faible, Tab_Simple (E));

        Echange_Octet (Tab_Prime (Hl_Prime).Fort, Tab_Simple (H));
        Echange_Octet (Tab_Prime (Hl_Prime).Faible, Tab_Simple (L));

    end Echange_Bc_De_Hl_Reg_Prime;

    -----------------------------------------------------------------------

    procedure Afficher is

    begin  
        Text_Io.Put_Line ("");
        Text_Io.Put_Line ("-- REGISTRES -------------------------------");
        Text_Io.Put_Line ("");

        Text_Io.Put_Line ("   A          F ");  
        Text_Io.Put ("   ");  
        Octet.Afficher_Octet_Hexa (Tab_Simple (A));  
        Text_Io.Put ("         ");
        Octet.Afficher_Octet_Binaire (Tab_Simple (F));
        Text_Io.Put_Line ("");
        Text_Io.Put_Line ("");

        Text_Io.Put_Line ("   B          C ");  
        Text_Io.Put ("   ");
        Octet.Afficher_Octet_Hexa (Tab_Simple (B));
        Text_Io.Put ("         ");  
        Octet.Afficher_Octet_Hexa (Tab_Simple (C));
        Text_Io.Put_Line ("");
        Text_Io.Put_Line ("");

        Text_Io.Put_Line ("   D          E ");  
        Text_Io.Put ("   ");  
        Octet.Afficher_Octet_Hexa (Tab_Simple (D));
        Text_Io.Put ("         ");
        Octet.Afficher_Octet_Hexa (Tab_Simple (E));
        Text_Io.Put_Line ("");
        Text_Io.Put_Line ("");

        Text_Io.Put_Line ("   H          L ");  
        Text_Io.Put ("   ");
        Octet.Afficher_Octet_Hexa (Tab_Simple (H));
        Text_Io.Put ("         ");  
        Octet.Afficher_Octet_Hexa (Tab_Simple (L));
        Text_Io.Put_Line ("");
        Text_Io.Put_Line ("");

        Text_Io.Put_Line ("   I          R ");  
        Text_Io.Put ("   ");  
        Octet.Afficher_Octet_Hexa (Tab_Simple (I));
        Text_Io.Put ("         ");
        Octet.Afficher_Octet_Hexa (Tab_Simple (R));
        Text_Io.Put_Line ("");
        Text_Io.Put_Line ("");

        Text_Io.Put_Line (""); --------------------

        Text_Io.Put ("   AF' : ");
        Octet.Afficher_Octet_Hexa (Tab_Prime (Af_Prime).Fort);
        Octet.Afficher_Octet_Hexa (Tab_Prime (Af_Prime).Faible);
        Text_Io.Put_Line ("");

        Text_Io.Put ("   BC' : ");
        Octet.Afficher_Octet_Hexa (Tab_Prime (Bc_Prime).Fort);
        Octet.Afficher_Octet_Hexa (Tab_Prime (Bc_Prime).Faible);
        Text_Io.Put_Line ("");

        Text_Io.Put ("   DE' : ");
        Octet.Afficher_Octet_Hexa (Tab_Prime (De_Prime).Fort);
        Octet.Afficher_Octet_Hexa (Tab_Prime (De_Prime).Faible);
        Text_Io.Put_Line ("");

        Text_Io.Put ("   HL' : ");
        Octet.Afficher_Octet_Hexa (Tab_Prime (Hl_Prime).Fort);
        Octet.Afficher_Octet_Hexa (Tab_Prime (Hl_Prime).Faible);
        Text_Io.Put_Line ("");



        Text_Io.Put_Line (""); ---------------------------

        Text_Io.Put ("   IX  : ");
        Mot.Afficher_Mot_Hexa (Tab_Double (Ix));
        Text_Io.Put_Line ("");

        Text_Io.Put ("   IY  : ");
        Mot.Afficher_Mot_Hexa (Tab_Double (Iy));
        Text_Io.Put_Line ("");

        Text_Io.Put ("   sp  : ");
        Mot.Afficher_Mot_Hexa (Tab_Double (Sp));
        Text_Io.Put_Line ("");

        Text_Io.Put ("   pc  : ");  
        Mot.Afficher_Mot_Hexa (Tab_Double (Pc));
        Text_Io.Put_Line ("");

    end Afficher;


end Registres;