def _get_single_reg(asm_str):
    """returns a single register from string and check proper formatting (e.g "r5")"""
    if len(asm_str.split()) > 1:
        raise SyntaxError('Unexpected separator in reg reference')
    if not asm_str.lower().startswith('r'):
        raise SyntaxError('Missing \'r\' character at start of reg reference')
    if not asm_str[1:].isdigit():
        raise SyntaxError('reg reference not a number')
    return int(asm_str[1:])