             
             // JP_ADDR (jump to a memory address)
             0x1000: { arg in
-                // Set the program counter to jump
                 self.pc = arg
             },
             

                self.stack[self.sp] = self.pc
            },
            
            // SE_V_BYTE ( skip next instruction if register equals value )
            0x3000: { arg in
                
            },
        ]
    }()

//    let mapping = [
//

//        0x4000: "sne_v_byte", // skip next instruction if register not equals value
//        0x5000: "se_v_v", // skip next instruction if register equals other register
//        0x6000: "ld_v_byte", // set register with value
//        0x7000: "add_v_byte", // add value to register v
//        0x8001: "or_v_v", // OR two registers and store result in first register
//        0x8002: "and_v_v", // AND two registers and store result in first register
//        0x8003: "xor_v_v", // XOR two registers and store result in first register
//        0x8004: "add_v_v", // Add two registers and store result in first register carry flag is set
//        0x8005: "sub_v_v", // Subtract the second register from the first and store result in first register, borrow flag is set when there is no borrow
//        0x8006: "shr_v", // Shift the first register right by one the flag will contain the LSB before the shift (last nibble is ignored in opcode)
//        0x8007: "subn_v_v", // Subtract the first register from the second register and store the result in the first register, borrow flag is set when there is no borrow
//        0x800E: "shl_v", // Shift the first register left by one the flag will containt the RSB before the shift (last nibble is ignored in opcode)
//        0x8000: "ld_v_v", // copy register to another register
//        0x9000: "sne_v_v", // Skip next instruction if the first register does not match the second register
//        0xA000: "ld_i_addr", // The I register is set with the address
//        0xB000: "jp_v0_addr", // Jump to the address of addr + v0

        self.sound = sound
        self.keyboard = keyboard

        self.resest()
    }
    
