adds switch statement for opcodes