Tools needed: editor of your choice
m4 macro processor
SPARC instruction set
Concepts needed: SPARC assembly language
for loop at assembly language level
SPARC subroutines
Create arrayfuntion.m
This is the Sparc assembly code that will have the functions to manipulate arrays from main.c. All you have to do is to write the functions, in Sparc language, to compute sum, getmax, count_positives, and average. The average function should also call the sum function.
main will do the following:
-declare the array
-invoke the functions, passing the starting address of the array and the number of elements to process
-print the results
TASK:
-create "arrayfns.m" - use m4 defines to name the registers. the names must be used in your source code.
-call m4 to process "arrayfns.m" and produce arrayfns.s (m4 arrayfns.m >arrayfns.s)
-compile using gcc
gcc main.c arrayfns.s
-create a data file and test using ./[login to view URL] [login to view URL]
DUE April 1, 2013 10PM