package vm;

import vm.exceptions.CpuException;
import vm.exceptions.MemoryReadException;


public class CPU {
    private static final int USER_PROGRAM_START_ADDRESS = 0x200;
    private static final int STACK_SIZE = 16;
    private static final int REGISTERS_NUMBER = 16;

    private int programCounter;
    private Memory memory;
    private Stack stack;
    private RegisterManager registerManager;


    public CPU(Memory memory) {
        this.memory = memory;

        stack = new Stack(STACK_SIZE);
        registerManager = new RegisterManager(REGISTERS_NUMBER);
        programCounter = USER_PROGRAM_START_ADDRESS;
    }

    public void execute() throws CpuException {
        try {
            char opcode = memory.readOpcode(programCounter);
        } catch (MemoryReadException e) {
            throw new CpuException("Unable to read opcode from memory.");
        }
    }
}

@@ -280,19 +280,20 @@
 private 
-int
+char
  program
@@ -398,16 +398,72 @@
 anager;%0A
+    private int delayTimer;%0A    private int soundTimer;%0A
 %0A%0A    pu
@@ -676,16 +676,64 @@
 DDRESS;%0A
+        delayTimer = 0;%0A        soundTimer = 0;%0A
     %7D%0A%0A 

Add delay and sound timer to CPU