IUP Computer Science
CO 300   Assembly Language
Spring 1988

Program #6    (due 21 April 1988)


    Write a program that uses two simple procedures to perform some character operations.

    One procedure must scan an array of 80 characters and count the words contained in it.  In the array, after each word (except the last) is one blank; after the last word, the rest of the array contains all blanks.  The procedure must take two arguments:  a descriptor for the character array and a byte in which the number of words found is to be placed.

    The other procedure must examine an array of up to 25 single-byte values and determine the highest and lowest values in the array.  The procedure must take four arguments:  the array, the number of values in the array, the highest value in the array and the lowest value in the array.  These last two are output arguments (represent results produced by the procedure).

    The program should proceed by asking the person at the terminal to enter up to 25 lines of text.  After reading in each line, call the first procedure and store the number of words found on the line in one element of a byte array.  Repeatedly read lines and store the number of words until the person at the terminal enters a line that contains only a period (.) at the beginning of the line.  Eliminate the '? ' prompt for the reading so the full 80 characters are available.  The program will have to adjust the entered line before calling the first procedure so that it meets the requirements of that procedure.

    After reading in all the lines, call the second procedure to determine what were the most and least words found on a line.   Then, display the number of lines entered, the highest number of words found on a line and the lowest number of words found on a line.  Display sufficient annotation to explain what these numbers represent.

    Hand in the .LIS listing of your program and a PHOTO log that demonstrates that it works.  Enter at least five lines of input for the PHOTO log.