DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: ┃ B T ┃
Length: 6019 (0x1783) Types: TextFile Names: »B«
└─⟦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⟧
with Octet; with Text_Io; package body Mot is -- VARIABLES ------------------------------------------------------------- -- PROCEDURES ------------------------------------------------------------ -------------------------------------------------------------------------- -- PROCEDURES D'AFFICHAGE ET DE LECTURE -------------------------------------------------------------------------- procedure Afficher_Mot_Hexa (Mot : T_Mot) is Msb, Lsb : Octet.T_Octet; begin Msb := Poids_Fort (Mot); Lsb := Poids_Faible (Mot); Octet.Afficher_Octet_Hexa (Msb); Octet.Afficher_Octet_Hexa (Lsb); end Afficher_Mot_Hexa; -------------------------------------------------------------------------- function Lire_Mot_Hexa return T_Mot is Msb, Lsb : Octet.T_Octet; begin Text_Io.Put ("MSB > "); Msb := Octet.Lire_Octet_Hexa; Text_Io.Put ("LSB > "); Lsb := Octet.Lire_Octet_Hexa; return (Construire (Msb, Lsb)); end Lire_Mot_Hexa; ------------------------------------------------------------------------- function Construire (Octet_1, Octet_2 : Octet.T_Octet) return T_Mot is Un_Mot : T_Mot := 0; begin Un_Mot := T_Mot (Octet_1) * 256 + T_Mot (Octet_2); return Un_Mot; end Construire; ------------------------------------------------------------------------- function Poids_Fort (Mot : T_Mot) return Octet.T_Octet is begin return Octet.T_Octet (Mot / 256); end Poids_Fort; ------------------------------------------------------------------------- function Poids_Faible (Mot : T_Mot) return Octet.T_Octet is begin return Octet.T_Octet (Mot mod 256); end Poids_Faible; ------------------------------------------------------------------------- procedure Add_8_Bit_C (Octet_1 : in out Octet.T_Octet; Octet_2 : Octet.T_Octet; Carry : in out Boolean) is Bit_Octet_1 : Octet.T_Bit_Octet; Bit_Octet_2 : Octet.T_Bit_Octet; begin Bit_Octet_1 := Octet.Convert_Bit (Octet_1); Bit_Octet_2 := Octet.Convert_Bit (Octet_2); for I in Octet.Num_Bit loop Octet.Add_Bit_C (Bit_Octet_1 (I), Bit_Octet_2 (I), Carry); end loop; Octet_1 := Octet.Convert_Octet (Bit_Octet_1); end Add_8_Bit_C; ------------------------------------------------------------------------- function Add (Mot_1, Mot_2 : T_Mot) return T_Mot is Resultat : T_Mot := 0; Msb_2, Lsb_2, Msb_Resultat, Lsb_Resultat : Octet.T_Octet; Carry : Boolean := False; begin Msb_Resultat := Poids_Fort (Mot_1); Lsb_Resultat := Poids_Faible (Mot_1); Msb_2 := Poids_Fort (Mot_2); Lsb_2 := Poids_Faible (Mot_2); Add_8_Bit_C (Lsb_Resultat, Lsb_2, Carry); Add_8_Bit_C (Msb_Resultat, Msb_2, Carry); Resultat := Construire (Msb_Resultat, Lsb_Resultat); return Resultat; end Add; ------------------------------------------------------------------------- function Neg (Mot : T_Mot) return T_Mot is Un_Mot : T_Mot; begin Un_Mot := not Mot; Un_Mot := Add (Un_Mot, 1); return Un_Mot; end Neg; ------------------------------------------------------------------------- function Sub (Mot_1, Mot_2 : T_Mot) return T_Mot is begin return (Add (Mot_1, Neg (Mot_2))); end Sub; -------------------------------------------------- function "not" (Mot : T_Mot) return T_Mot is Msb, Lsb : Octet.T_Octet; begin Msb := Poids_Fort (Mot); Lsb := Poids_Faible (Mot); Msb := Octet."not" (Msb); Lsb := Octet."not" (Lsb); return (Construire (Msb, Lsb)); end "not"; ------------------------------------------------------------------------- procedure Convert_Mot_Ascii (Un_Mot : Mot.T_Mot; Car_1, Car_2, Car_3, Car_4 : in out Character) is Msb, Lsb : Octet.T_Octet; begin Msb := Mot.Poids_Fort (Un_Mot); Lsb := Mot.Poids_Faible (Un_Mot); Octet.Convert_Octet_Ascii (Msb, Car_1, Car_2); Octet.Convert_Octet_Ascii (Lsb, Car_3, Car_4); end Convert_Mot_Ascii; ------------------------------------------------------------------------ function Convert_Mot_String (Un_Mot : Mot.T_Mot) return String is Car1, Car2, Car3, Car4 : Character; begin Convert_Mot_Ascii (Un_Mot, Car1, Car2, Car3, Car4); return Car1 & Car2 & Car3 & Car4; end Convert_Mot_String; ------------------------------------------------------------------------ function Convert_Ascii_Mot (Car_1, Car_2, Car_3, Car_4 : Character) return Mot.T_Mot is Msb, Lsb : Octet.T_Octet; Le_Mot : Mot.T_Mot; begin Msb := Octet.Convert_Ascii_Octet (Car_1, Car_2); Lsb := Octet.Convert_Ascii_Octet (Car_3, Car_4); Le_Mot := Mot.Construire (Msb, Lsb); return Le_Mot; end Convert_Ascii_Mot; function Convert_String_Mot (Str : String) return Mot.T_Mot is begin case Str'Length is when 1 => return Convert_Ascii_Mot ('0', '0', '0', Str (Str'First)); when 2 => return Convert_Ascii_Mot ('0', '0', Str (Str'First), Str (Str'First + 1)); when 3 => return Convert_Ascii_Mot ('0', Str (Str'First), Str (Str'First + 1), Str (Str'First + 2)); when 4 => return Convert_Ascii_Mot (Str (Str'First), Str (Str'First + 1), Str (Str'First + 2), Str (Str'First + 3)); when others => return 0; end case; end Convert_String_Mot; end Mot;