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

⟦ddccead0c⟧ TextFile

    Length: 1058 (0x422)
    Types: TextFile
    Names: »B«

Derivation

└─⟦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

SEPARATE (Test_Socket_Level)
FUNCTION Byte_String_To_Integer
            (Bs : Byte_Defs.Byte_String) RETURN Unix_Base_Types.Int IS

   Int_Length : CONSTANT := 4;

   Result : Unix_Base_Types.Int := 0;

   Negative : Boolean := False;

   Shifter : Integer := 0;

   Normalized_Bs : Byte_Defs.Byte_String (0 .. Int_Length - 1) :=
      (OTHERS => 0);

BEGIN

   IF Bs'Length < Int_Length THEN
      Normalized_Bs
         ((Normalized_Bs'Last - Bs'Length) + 1 .. Normalized_Bs'Last) := Bs;
   ELSE
      Normalized_Bs := Bs ((Bs'Last - Int_Length) + 1 .. Bs'Last);
   END IF;

   IF Normalized_Bs (0) > Byte_Defs.Byte (2 ** 7 - 1) THEN
      Negative := True;
   END IF;

   FOR I IN REVERSE Normalized_Bs'Range LOOP
      IF Negative THEN
         Normalized_Bs (I) := Byte_Defs.Byte'Last - Normalized_Bs (I);
      END IF;

      Result  := Result + Integer (Normalized_Bs (I)) * (2 ** Shifter);
      Shifter := Shifter + 8;
   END LOOP;

   IF Negative THEN
      RETURN -Result - 1;
   ELSE
      RETURN Result;
   END IF;


END Byte_String_To_Integer;