Forward and reverse mapping from commands to opcodes