def _get_imm(asm_str):
    """return int for immediate string and check proper formatting"""
    if len(asm_str.strip().split()) > 1:
        raise SyntaxError('Unexpected separator in immediate')
    if not asm_str.strip().isdigit():
        raise SyntaxError('Immediate not a number')
    return int(asm_str.strip())