def parseDisassemblyFile(fileName):
    """ Parses a disassembly file and returns instructions in a list """
    instructions = []
    lines = open(fileName).read().split('\n')
    # Parse the lines
    stIndex, endIndex = 0, 0
    for i in range(len(lines)):
        if lines[i].find("<") != -1:
            stIndex = lines[i].index(">")+2
            if lines[i][stIndex:].find("#") != -1:
                endIndex = lines[i][stIndex:].rindex("#") - 1
            elif lines[i][stIndex:].find("<") != -1:
                endIndex = lines[i][stIndex:].rindex("<") - 1
            else:
                endIndex = len(lines[i][stIndex:])
            instructions.append(lines[i][stIndex:][:endIndex])
            stIndex, endIndex = 0, 0 # Reset indices
    return instructions