|
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: 5120 (0x1400) Types: Ada Source Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Counter, seg_058d95
└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000 └─⟦cfc2e13cd⟧ »Space Info Vol 2« └─⟦this⟧
with Text_Io; package body Counter is procedure Reset (The_Object : in out Object) is begin The_Object.The_Value := Default; The_Object.The_Mode := Constrained; end Reset; procedure Set (The_Object : in out Object; To_Value : Integer := Default) is begin The_Object.The_Value := To_Value; end Set; procedure Set (The_Object : in out Object; To_Mode : Mode) is begin The_Object.The_Mode := To_Mode; end Set; procedure Up (The_Object : in out Object; Count : Positive := 1) is begin if The_Object.The_Mode = Circular then The_Object.The_Value := (The_Object.The_Value + Count) mod (Maximum - Minimum); end if; if The_Object.The_Mode = Constrained then if (The_Object.The_Value + Count > Maximum) then The_Object.The_Value := Maximum; raise Overflow; else The_Object.The_Value := The_Object.The_Value + Count; end if; end if; if The_Object.The_Mode = Checked then The_Object.The_Value := The_Object.The_Value + Count; if (The_Object.The_Value > Maximum) then raise Overflow; end if; end if; exception when Overflow => Text_Io.Put_Line ("Exception OVERFLOW detectee dans la procedure Up!!!"); end Up; procedure Down (The_Object : in out Object; Count : Positive := 1) is begin if The_Object.The_Mode = Circular then The_Object.The_Value := (The_Object.The_Value - Count) mod (Maximum - Minimum); end if; if The_Object.The_Mode = Constrained then if (The_Object.The_Value - Count < Minimum) then The_Object.The_Value := Minimum; raise Underflow; else The_Object.The_Value := The_Object.The_Value - Count; end if; end if; if The_Object.The_Mode = Checked then The_Object.The_Value := The_Object.The_Value - Count; if (The_Object.The_Value < Minimum) then raise Underflow; end if; end if; exception when Underflow => Text_Io.Put_Line ("Exception UNDERFLOW detectee dans la procedure Down!!!"); end Down; function Get (The_Object : in Object) return Integer is begin return The_Object.The_Value; end Get; end Counter;
nblk1=4 nid=3 hdr6=6 [0x00] rec0=22 rec1=00 rec2=01 rec3=004 [0x01] rec0=1a rec1=00 rec2=04 rec3=020 [0x02] rec0=16 rec1=00 rec2=02 rec3=000 [0x03] rec0=06 rec1=6b rec2=90 rec3=442 tail 0x21766d09888e23caf8bf2 0x42a00088462060003 Free Block Chain: 0x3: 0000 00 00 02 d5 80 1f 3d 20 54 68 65 5f 4f 62 6a 65 ┆ = The_Obje┆