Converting opcodes to interface with Memory class