added some bigint code

This commit is contained in:
2014-02-21 16:08:43 +00:00
parent 262d29f262
commit a9bd93d6f4
3 changed files with 177 additions and 9 deletions

View File

@ -1383,7 +1383,7 @@ end if;
-----------------------------------------------------------------------------
function Make_Bigint (Interp: access Interpreter_Record;
Size: in Pointer_Object_Size) return Object_Pointer is
Size: in Half_Word_Object_Size) return Object_Pointer is
Ptr: Object_Pointer;
begin
Ptr := Allocate_Half_Word_Object(Interp, Size);
@ -2647,6 +2647,22 @@ Ada.Text_IO.Put_Line (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> LOOP ITERATION XXXXXX C
exception
when Stream_End_Error =>
-- this is not a real error. this indicates the end of input stream.
declare
A: aliased Object_Pointer;
B: aliased Object_Pointer;
begin
Push_Top (Interp, A'Unchecked_Access);
Push_Top (Interp, B'Unchecked_Access);
--A := Make_Bigint (Interp.Self, Value => 16#0FFFFFFF_FFFFFFFF#);
--B := Make_Bigint (Interp.Self, Value => 16#0FFFFFFF_FFFFFFFF#);
--for I in 1 .. 11 loop
--A := Bigint.Add (Interp.Self, A, B);
--end loop;
A := Make_Bigint (Interp.Self, Value => 16#FFFF_00000001#);
B := Make_Bigint (Interp.Self, Value => 16#0000_0000000F#);
A := Bigint.Subtract (Interp.Self, A, B);
Pop_tops (Interp, 2);
end;
Ada.Text_IO.Put_LINE ("=== BYE ===");
Pop_Tops (Interp, 1);
if Aliased_Result /= null then