|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 11264 (0x2c00)
Types: Ada Source
Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Memoire, seg_020eef
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
└─⟦5a81ac88f⟧ »Space Info Vol 1«
└─⟦this⟧
with Erreur;
with Gui_Interface;
with Octet;
with Text_Io;
with Z_Debug;
with Mot;
package body Memoire is
-- TYPES ----------------------------------------------------------------
type Mem is array (0 .. Adresse.Val_Max_Adresse) of Octet.T_Octet;
task type T_Memoire is
pragma Os_Task (0);
entry Aff_Entre_2_Adresses (Ad_Debut, Ad_Fin : Adresse.T_Adresse);
entry Aff_Depuis_Adresse
(Ad_Debut : Adresse.T_Adresse; Taille : Mot.T_Mot);
entry Acces_Octet (Operation : T_Operation;
Ad : Adresse.T_Adresse;
Donnee : in out Octet.T_Octet);
end T_Memoire;
type Pt_Tache_Memoire is access T_Memoire;
-- VARIABLES ------------------------------------------------------------
La_Memoire : Mem := (others => 0);
Msb, Lsb : Octet.T_Octet;
Tache_Memoire : Pt_Tache_Memoire;
-- PROCEDURES ----------------------------------------------------------
procedure Creer is
begin
Tache_Memoire := new T_Memoire;
end Creer;
--------------------------------------
function Traiter_Ligne_Hexa (Ligne : String) return Boolean is
Defaut : Boolean := False;
Ad_Deb_Chargement, Ad_Fin_Chargement, Ad_Chargement : Adresse.T_Adresse;
Cpt_Octet, Type_Ligne, Checksum, Un_Octet : Octet.T_Octet := 0;
I : Positive;
begin
if Ligne (1) /= ':' then
Defaut := True;
else
Cpt_Octet := Octet.Convert_Ascii_Octet (Ligne (2), Ligne (3));
Ad_Deb_Chargement := Mot.Convert_Ascii_Mot (Ligne (4), Ligne (5),
Ligne (6), Ligne (7));
Type_Ligne := Octet.Convert_Ascii_Octet (Ligne (8), Ligne (9));
Checksum := Octet.Add (Cpt_Octet,
Mot.Poids_Fort (Ad_Deb_Chargement));
Checksum := Octet.Add (Checksum,
Mot.Poids_Faible (Ad_Deb_Chargement));
Checksum := Octet.Add (Checksum, Type_Ligne);
I := 10;
if Type_Ligne = 0 then
Ad_Fin_Chargement :=
Mot.Add (Ad_Deb_Chargement, Mot.Construire (0, Cpt_Octet));
-- Chargement de la ligne ---------------------
Ad_Chargement := Ad_Deb_Chargement;
while Ad_Chargement /= Ad_Fin_Chargement loop
Un_Octet := Octet.Convert_Ascii_Octet
(Ligne (I), Ligne (I + 1));
I := I + 2;
Checksum := Octet.Add (Checksum, Un_Octet);
Memoire.Acces_Octet (Ecrire, Ad_Chargement, Un_Octet);
Ad_Chargement := Mot.Add
(Ad_Chargement, Mot.Construire (0, 1));
end loop;
end if;
-- Verification du checksum -------------------
Un_Octet := Octet.Convert_Ascii_Octet (Ligne (I), Ligne (I + 1));
Checksum := Octet.Add (Checksum, Un_Octet);
if Checksum /= 0 then
Defaut := True;
end if;
end if;
if Defaut then
-- Erreur sur la lecture du fichier hexa;
Erreur.Detectee (6);
end if;
return Defaut;
end Traiter_Ligne_Hexa;
--------------------------------------
procedure Charger_Fichier (Nom : String) is
Fichier : Text_Io.File_Type;
Ligne : String (1 .. 80) := (others => '0');
Longueur : Natural := 0;
Defaut : Boolean := False;
begin
Text_Io.Open (Fichier, Text_Io.In_File, Nom);
while not Text_Io.End_Of_File (Fichier) and then not Defaut loop
if not Text_Io.End_Of_Line (Fichier) then
Text_Io.Get_Line (Fichier, Ligne, Longueur);
Defaut := Traiter_Ligne_Hexa (Ligne);
else
Text_Io.Skip_Line (Fichier);
end if;
end loop;
Text_Io.Close (Fichier);
exception
when Text_Io.Name_Error =>
--Nom de fichier Hexa inconnu !!!
Erreur.Detectee (5);
end Charger_Fichier;
--------------------------------------
procedure Aff_Entre_2_Adresses (Ad_Debut, Ad_Fin : Adresse.T_Adresse) is
begin
Tache_Memoire.Aff_Entre_2_Adresses (Ad_Debut, Ad_Fin);
end Aff_Entre_2_Adresses;
--------------------------------------
procedure Aff_Depuis_Adresse
(Ad_Debut : Adresse.T_Adresse; Taille : Mot.T_Mot) is
begin
Tache_Memoire.Aff_Depuis_Adresse (Ad_Debut, Taille);
end Aff_Depuis_Adresse;
--------------------------------------
procedure Acces_Octet (Operation : T_Operation;
Ad : Adresse.T_Adresse;
Donnee : in out Octet.T_Octet) is
begin
Tache_Memoire.Acces_Octet (Operation, Ad, Donnee);
end Acces_Octet;
--------------------------------------
procedure Detruire is
begin
abort Tache_Memoire.all;
end Detruire;
-- TACHE ----------------------------------------------------------------
task body T_Memoire is
begin
while True loop
select
-------------------------------
accept Aff_Entre_2_Adresses
(Ad_Debut, Ad_Fin : Adresse.T_Adresse) do
for I in Ad_Debut .. Ad_Fin loop
--Octet.Afficher_Octet_Hexa (La_Memoire (I));
null;
end loop;
end Aff_Entre_2_Adresses;
---------------------------------
or
accept Aff_Depuis_Adresse
(Ad_Debut : Adresse.T_Adresse; Taille : Mot.T_Mot) do
for I in Ad_Debut .. Ad_Debut + Taille loop
-- Octet.Afficher_Octet_Hexa (La_Memoire (I));
null;
end loop;
end Aff_Depuis_Adresse;
---------------------------------
or
accept Acces_Octet (Operation : T_Operation;
Ad : Adresse.T_Adresse;
Donnee : in out Octet.T_Octet) do
case Operation is
when Lire =>
Donnee := La_Memoire (Ad);
when Ecrire =>
La_Memoire (Ad) := Donnee;
end case;
end Acces_Octet;
end select;
end loop;
end T_Memoire;
end Memoire;
nblk1=a
nid=9
hdr6=12
[0x00] rec0=25 rec1=00 rec2=01 rec3=03e
[0x01] rec0=1b rec1=00 rec2=03 rec3=078
[0x02] rec0=19 rec1=00 rec2=02 rec3=008
[0x03] rec0=05 rec1=00 rec2=08 rec3=08c
[0x04] rec0=22 rec1=00 rec2=06 rec3=032
[0x05] rec0=23 rec1=00 rec2=07 rec3=00e
[0x06] rec0=00 rec1=00 rec2=0a rec3=05a
[0x07] rec0=27 rec1=00 rec2=05 rec3=048
[0x08] rec0=21 rec1=00 rec2=04 rec3=000
[0x09] rec0=21 rec1=00 rec2=04 rec3=001
tail 0x2150c85c2823788398b53 0x42a00088462060003
Free Block Chain:
0x9: 0000 00 00 00 05 80 02 20 20 02 63 74 65 74 2e 41 64 ┆ ctet.Ad┆