diff --git a/src/sillymachine.adb b/src/sillymachine.adb index fa3d8b1..e5cf25b 100644 --- a/src/sillymachine.adb +++ b/src/sillymachine.adb @@ -60,8 +60,13 @@ begin goto THE_END; end if; I := I + 1; + if I = 16 then + goto END_VALID; + end if; end loop; + << END_VALID >> + Bin_IO.Close(F); Put_Line("Header passed"); if Argument_Count > 1 then @@ -75,7 +80,18 @@ begin MemoryArr (i) := 0; end loop; - + I := 0; + Bin_IO.Open(F, Bin_IO.In_File, FileName); + while not Bin_IO.End_Of_File (F) loop + Bin_IO.Read(F, Value); + MemoryArr(I) := Value; + I := I + 1; + end loop; + Bin_IO.Close(F); + + for i in 0 .. 15 loop + Put_Line(Byte'Image(MemoryArr (i))); + end loop; end;