Implemented 2 byte long opcodes

This commit is contained in:
Bartłomiej Szostak 2024-04-21 14:06:20 +02:00
parent efbc5e94b3
commit 90b495d03a
No known key found for this signature in database
GPG Key ID: 562DACF230A18086

View File

@ -2,6 +2,7 @@ with Ada.Text_IO; use Ada.Text_IO;
with Ada.Sequential_IO;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Directories;
with Interfaces; use Interfaces;
procedure sillymachine is
type Byte is mod 256;
@ -102,10 +103,10 @@ begin
Instruction (i) := MemoryArr (PC + i);
end loop;
case Instruction (0) is -- execute the instruction
case Shift_Left(Unsigned_128(Instruction (0)), 8) + Unsigned_128(Instruction (1)) is -- execute the instruction
when 0 => Put_Line("-- japko --");
when 1 => Put_Line("-- banan --");
when 255 => goto THE_END;
when 65535 => goto THE_END; -- exit opcode
when others => New_Line(1);
end case;