diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2025-01-11 12:14:28 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2025-01-11 12:14:28 -0500 |
commit | 8fa66b024f91e47d8b5273e8c85ec5f60fe42d5b (patch) | |
tree | 1e3da4ec5bdfbbcb36ebd30ab9c055c45f50f279 /src/cpu.ads | |
parent | cf8c3a51cb01b64ad2bc700fdd2b4906ef864877 (diff) |
initial upload
Diffstat (limited to 'src/cpu.ads')
-rw-r--r-- | src/cpu.ads | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/cpu.ads b/src/cpu.ads new file mode 100644 index 0000000..2fb34f2 --- /dev/null +++ b/src/cpu.ads @@ -0,0 +1,30 @@ +with Ada.Containers.Vectors; +with ISA; + +package CPU is + use ISA; + + package Address_Stack is new Ada.Containers.Vectors + (Index_Type => Natural, Element_Type => Address); + + type Instance is record + Memory : Bank; + Registers : Register_Bank; + Program_Counter : Address := Start_Address; + Address_Register : Address := 0; + Stack : Address_Stack.Vector; + Delay_Timer : Byte := 0; + end record; + + procedure Load_File (Inst : in out Instance; File_Name : String); + + function Get_Opcode (Inst : in out Instance) return Opcode; + + procedure Reg_Store (Inst : in out Instance; VX : Register_Index); + procedure Reg_Load (Inst : in out Instance; VX : Register_Index); + procedure Ret (Inst : in out Instance); + procedure Call (Inst : in out Instance; A : Address); + procedure Jump (Inst : in out Instance; A : Address); + procedure Skip (Inst : in out Instance); + procedure Math (Inst : in out Instance; VX, VY : Register_Index; N : Byte); +end CPU; |