Description
Purpose: Learn assembly language functions. Additionally, become more familiar with program control instructions, function handling, and stacks. Points: 125 Assignment: Write four simple assembly language functions described below. You will be provided a main function that calls the following functions (for each set of data). ● Write a void function, gnomeSort(), to sort the numbers into descending order (large to small). You must use the gnome Sort algorithm (from assignment 7) and modify the sort order. ● Write a void function, basicStats(), to find the minimum, median, maximum, sum, and average for a list of numbers. This function must call the listMedian() function tin find the median. ● Write a value returning function, listMedian(), to find the median value of a sorted list of numbers. Note, for an odd number of items, the median value is defined as the middle value. For an even number of values, it is the integer average of the two middle values. This function should return a result in the eax register in accordance with the standard calling convention. ● Write a value returning function, corrCoefficient(), to compute the correlation coefficient1 for the two data sets. The correlation coefficient formula is as follows: r = (∑ i=0 n−1 xi y i) √ (∑ i=0 n−1 xi 2 ) (∑ i=0 n−1 yi 2 ) Where ∑ is the summation of the values, and n is the count of points (length). This function uses the provided square root code function (next page). This function should return a floating point result in the xmm0 register in accordance with the standard calling convention. All data should be treated as unsigned integers (MUL, and DIV). The functions must be in a separate assembly file (ast8procs.asm). The files will be assembled individually and linked together. 1 For more information, refer to: http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient Source: www.xkcd.com/552 Submission: • All source files must assemble and execute on Ubuntu with yasm. • Submit source files ◦ Submit a copy of the program source file via the on-line submission. ◦ Only the functions file (ast8procs.asm) will be submitted. • Once you submit, the system will score the project and provide feedback. ◦ If you do not get full score, you can (and should) correct and resubmit. ◦ You can re-submit an unlimited number of times before the due date/time. • Late submissions will be accepted for a period of 24 hours after the due date/time for any given lab. Late submissions will be subject to a ~2% reduction in points per an hour late. If you submit 1 minute – 1 hour late -2%, 1-2 hours late -4%, … , 23-24 hours late -50%. This means after 24 hours late submissions will receive an automatic 0. Program Header Block All source files must include your name, section number, assignment, NSHE number, and program description. The required format is as follows: ; Name: ; NSHE ID: ; Section: