Machine Problem 5, due Jul. 22

Part of the homework for CS:2630, Spring 2015
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

An assignment

Write code for the INTTOS function that you wrote as part of solving MP4, but write it as a separate assembly from your test program, so that you have to link it to the test program in order to run it.

This means, of corse, that your code must include a line INT INTTOS to tell the linker about your code.

Testing

You are only submitting your code for INTTOS, but you need to test it with some separately assembled main program.

If you want to link it with the test program we will use during grading, make sure you do not have a file named mp5test.o in your directory and then use the following link command:

link mp5.o mp5test.o

If you link it with your code first, as shown above, your code will be loaded at address 100016 so most of the bus traps you get will be easy to relate to your assembly listings. If you reverse the order of the object files, your code will be loaded after our test program, making it harder to figure out bus traps.

This test program is a bit demanding: It makes sure to allocate the buffer passed to your program with return addresses or other fragile data stored just off to each end of the buffer, so that you are almost guaranteed a bus trap if your program reaches off either end of the buffer.

The test program outputs the number it is converting and the number base before each conversion, and it buffers up an entire line of output before it does any output. For your information, my code for the INTTOS function from MP4 is 99 lines long, including the title, comments and scattered blank lines.

You are, of course, free to create your own test programs, and you are free to use the main program posted as a partial solution to MP4. The complete solution to MP4 will not be posted until after the due date for MP5, since half of the code is the same.

A Strong Suggestion

If you are completely happy with the code you submitted for MP4, this assignment should not be much work. If, on the other hand, you think you can do better, please take the time to improve on your solution. This assignment is intended to give good students an opportunity to write "professional quality" code, and for poor students, it offers something of a second chance.

Professional quality means not only compact and efficient code, but also clear and easy to read comments, not too wordy and not too terse, and using notation efficiently to convey program structure and organization.

Since this is a programming course, any student expecting to pass the course ought to be able to do well on at least one of the later programming assignments. If you have had difficulty up to this point, this assignment serves as something of a last chance because the final assignment is guaranteed to be hard.

Submission

Submit your work in the mp5 directory in the CS2630 submit directory. As usual, your submission should be named mp5.a