The file PROJECT:5DATA.DAT contains records that are each 35 bytes long. Each record consists of a 24-character encrypted name, an Id number (a longword), a 5-character date, and a counter (a word). The counter values range from 1 to 500. The date is in the form mm/dd where dd is a day number and mm is a month number (leading zeros are used). The file may contain as many as 1000 records of this form.
You will be given a Pascal procedure called LOAD that is designed to read the records of the file into an array in memory. The LOAD procedure takes two arguments: the location of the array, and the location of a word that is to hold the number of records. When LOAD is called, it fills the array, counts the records, and puts the count in the word to hold the number of records.
You will also be given a FORTRAN procedure called SORT that is designed to sort the records in the file on the basis of the date field of each record. The SORT procedure takes two arguments: the location of a descriptor for the first record of the array and the location of the number of records. When SORT is called, it reorders the records in the array, leaving them sorted in ascending order on the date values.
You must write two assembly language procedures that MUST be placed in a file that is SEPARATE from the file holding the main program. The first procedure, called FREQUENCY, must generate range frequencies for the counter values in the records. FREQUENCY must determine the number of times the counter values occurs in each range: 1-10, 11-20, 21-30, 31-40, etc. (in ranges of 10 for as far as necessary). FREQUENCY must take four arguments: the location of the array of records, the location of a frequency array (holding one entry for each range), the location of the number of records, and the location to hold the number of ranges used.
The second procedure, called DATELIST, must display the names from all records which contain a specified date. DATELIST MUST assume that the array of records is sorted on date and MUST take advantage of that fact. DATELIST must take three arguments: the location of the array of records, the location of the date to look for, and the location of the number of records.
You must write an assembly language main program that does the following steps in order.
1. Calls LOAD to read in the records.
2. Calls SORT to organize the records.
3. Calls FREQUENCY to compute the array of frequencies.
4. Displays a table of frequencies complete with labeling to identify each frequency. The display should only include
lines up to the largest frequency range found; it should not include all possible ranges.
5. Repeatedly prompts for a date and calls DATELIST to display the names from all records that contain that date. The looping
should continue until the entered date consists of nothing but a carriage return.
Hand in a .LIS listing of your main program and a .LIS listing of your procedures (you may put both procedures in the same file). Also, hand in a captured program execution (using CARBON) in which you run the program and enter the following dates: 01/01, 09/14, 10/10, 11/09, 12/15, 13/01.