diff --git a/src/shardware.adb b/src/shardware.adb index c9fd4f5..231702a 100644 --- a/src/shardware.adb +++ b/src/shardware.adb @@ -145,7 +145,17 @@ package body Shardware is procedure Trap (Registers : RegArrU; Memory : in out ByteArr; MemorySize : in out Unsigned_32) is begin case Registers(0) is - when 0 => null; + when 0 => + declare + Pointer : Unsigned_32 := Registers (4) - 1; + Length : Integer := Integer(Registers (3)); + CharBuff : String (1 .. Length); + begin + Get_Line(CharBuff ,Length); + for i in 1 .. Length loop + Memory (Pointer + Unsigned_32(i)) := Character'Pos(CharBuff (i)); + end loop; + end; when 1 => declare Pointer : Unsigned_32 := Registers (4) - 1; @@ -155,7 +165,7 @@ package body Shardware is for i in 1 .. Length loop CharBuff (i) := Character'Val(Memory (Pointer + Unsigned_32(i))); end loop; - Put_Line(CharBuff); + Put(CharBuff); end; when others => null; end case;