Implemented 2 byte long opcodes
This commit is contained in:
parent
efbc5e94b3
commit
90b495d03a
@ -2,6 +2,7 @@ with Ada.Text_IO; use Ada.Text_IO;
|
|||||||
with Ada.Sequential_IO;
|
with Ada.Sequential_IO;
|
||||||
with Ada.Command_Line; use Ada.Command_Line;
|
with Ada.Command_Line; use Ada.Command_Line;
|
||||||
with Ada.Directories;
|
with Ada.Directories;
|
||||||
|
with Interfaces; use Interfaces;
|
||||||
|
|
||||||
procedure sillymachine is
|
procedure sillymachine is
|
||||||
type Byte is mod 256;
|
type Byte is mod 256;
|
||||||
@ -102,10 +103,10 @@ begin
|
|||||||
Instruction (i) := MemoryArr (PC + i);
|
Instruction (i) := MemoryArr (PC + i);
|
||||||
end loop;
|
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 0 => Put_Line("-- japko --");
|
||||||
when 1 => Put_Line("-- banan --");
|
when 1 => Put_Line("-- banan --");
|
||||||
when 255 => goto THE_END;
|
when 65535 => goto THE_END; -- exit opcode
|
||||||
when others => New_Line(1);
|
when others => New_Line(1);
|
||||||
end case;
|
end case;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user