private int parseLine(String line)
    {
        //preprocessing: remove extra whitespace, comments, lowercase
        int commentPos = line.indexOf('#');
        if (commentPos >= 0)
            line = line.substring(0, commentPos);
        line = line.trim().toUpperCase();

        int i = 0; // Current position in the string

        //If the line contains no code just skip it
        if (line.length() == 0)
            return 0; // empty string

        //Verbose output for the user if requested
        if (m_verbose)
        {
            System.out.print(line);
            for(int j = 0; j < (25 - line.length()); j++)
                System.out.print(" ");
        }

        //Check for a label and parse it if found
        if (line.charAt(i) == ':')
            return parseLabel(line, i);

        //Otherwise it must be an instruction
        return parseInstruction(line, i);
    }//parse