Assignment 9, due Oct 31
Part of
the homework for CS:2630, Fall 2019
|
On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper in discussion section on Thursday. Some parts of assignments may be submitted on-line and completed in discussion section. Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!
Background: Look at machine problem 4 and the posted solution to Homework 8, problem 1. The first posted solution to problem 1 contains this code to exchange two elements of the array data:
char * temp = data[low]; data[low] = data[high]; data[high] = temp;
a) Write SMAL Hawk code equivalent to the above. Assume R8 contains the address of the array data, R9 contains the index low, and R10 contains the index high, and assume that R3 to R7 are available to use as needed. (0.5 points)
b) The assumptions given above require that, on entry to the SMAL Hawk version of qsort, certain registers must have been saved in the activation record. Which ones? (0.5 points)
a) What USE directives go in each of the two assembly language files? (0.5 points)
b) What INT and EXT directives go in each of the two files? (0.5 points)
c) Write a Makefile for the reorganized version of MP4. (Please do not mess with your code for MP4 in doing this problem!) (0.5 points)