|
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 - download
Length: 5120 (0x1400) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Cl35_Message, seg_041e11
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
with Machine_Io; with Text_Io; -- trace package body Cl35_Message is Other_Bytes : constant := 7; Header : constant := 16#01#; Trailer_1 : constant := 16#F1#; Trailer_2 : constant := 16#F2#; procedure Write_Msg (Message : in Object) is To_Send : My_Types.Byte_String (1 .. (Message.Data'Length + Other_Bytes)); begin To_Send (1) := Header; To_Send (2) := Message.Addr_Lecteur; To_Send (3) := My_Types.Byte ((Message.Data'Length + 1) / 100); To_Send (4) := My_Types.Byte ((Message.Data'Length + 1) mod 100); To_Send (5) := Message.Cmd; if Message.Data'Length > 0 then for I in Message.Data'Range loop To_Send (5 + I) := Message.Data (I); end loop; end if; To_Send ((To_Send'Last) - 1) := Trailer_1; To_Send (To_Send'Last) := Trailer_2; Machine_Io.Open (With_Mode => Machine_Io.Write_Mode); Machine_Io.Write (S => To_Send); Machine_Io.Close; end Write_Msg; procedure Read_Msg (Message : in out Object) is To_Read : My_Types.Byte; K : Integer := 0; Rec_Len : Natural; begin Machine_Io.Open (With_Mode => Machine_Io.Read_Mode); loop To_Read := Machine_Io.Read; Message.Addr_Lecteur := Machine_Io.Read; Rec_Len := (Natural (Machine_Io.Read) * 100) + Natural (Machine_Io.Read - 1); Message.Datalen := Message.Datalen + Rec_Len; Message.Cmd := Machine_Io.Read; if Message.Data'Length > 0 then for I in Message.Data'Range loop K := K + 1; Message.Data (K) := Machine_Io.Read; end loop; end if; To_Read := Machine_Io.Read; To_Read := Machine_Io.Read; exit when Rec_Len /= Message.Data_Max; Send_Ack (Message => Message); end loop; Machine_Io.Close; end Read_Msg; procedure Send_Ack (Message : in Object) is To_Send : My_Types.Byte_String (1 .. Other_Bytes); begin To_Send := (1 => Header, 2 => Message.Addr_Lecteur, 3 => 0, 4 => 1, 5 => 16#06#, 6 => Trailer_1, 7 => Trailer_2); end Send_Ack; end Cl35_Message;
nblk1=4 nid=4 hdr6=6 [0x00] rec0=1b rec1=00 rec2=01 rec3=048 [0x01] rec0=1d rec1=00 rec2=03 rec3=04e [0x02] rec0=17 rec1=00 rec2=02 rec3=000 [0x03] rec0=18 rec1=00 rec2=04 rec3=000 tail 0x21742ab6e86285fd274ee 0x42a00088462060003 Free Block Chain: 0x4: 0000 00 00 02 8b 80 01 3b 01 00 27 20 20 20 20 20 20 ┆ ; ' ┆