Assignment 5, due July 2Includes Machine Problem 3, due July 7
Part of
the homework for 22C:50, Summer 2003
|
Ground rules: The ground rules distributed with MP1 hold for this assignment, with the exception that you may base your solution on the distributed soultion to MP1:
If you wish, you may base your solution to this problem on your solution to MP1 or MP2, but please note the way changes are documented in the posted solution!
The assignment: The assembler, as distributed, only supports absolute assembly. Add support for relocation. Specifically, the location counter should start out relocatable, and all integer constants are absolute, as described in the lecture notes. To do this, you will need to do the following:
Unlike the previous 2 machine problems, this one is not localized to just one part of the assembler! It requires making a modest number of very small changes that are dispersed through the code. You will find that the Unix grep utility is quite handy, for example, to find all source or header files that hold uses of OBJECT_VALUE or to find all uses of some variable of this type.
# scr if ( "$1" != "" ) then echo $1 scr ${argv[2-]} endifHere is a call to this shell script:
scr this is a testPart a: What output does this script produce under the tcsh shell? You may need to use the man command to look at the manual for tcsh, but of course, you can also try running the script.
Part b: Explain the use of recursion in this script.
Part a: The execve() service and the service suggested in the text differ in how control is transferred to the newly loaded program. What is the difference?
Part b: The execve() service and the service suggested in the text differ in the provisions they make for returning control from the newly loaded program to the original program after the new one finishes. What is the difference?