CS611
Spring 2003
Programming Assignment 5
Due Sunday April 20


Write a loader for IAS object files. The loader should be written using IAS assembly language.

The loader should read an object file from the card reader. The object file should be placed in memory starting at the address specified by the bottom 12 bits of the AC register. That is, the user of the loader will load the loader into memory, will connect the object file to the card reader, will set the AC register, and then will start the loader executing.

The loader will need to check the header words of the object file to determine the length of the object file.

The loader should check to be sure that object file won't overwrite the loader and won't go off the end of memory. If either of these cases is detected, then the loader should set the MQ register to 0xFFFFFFFFFF and then halt.

When writing the loader, do not assume anything about where in memory the loader will reside when it is executing. The loader will need to determine at execution time where in memory it is lying.

After the object file is read into memory, then some of its address fields will need to be relocated. Only relocate address fields that contain addresses within the input object file. Other addresses should not be modified. In particular, absolute addresses should not be relocated. Consider addresses zero and one to be addresses that should be relocated. However, do not modify the address fields of instructions that do not use the address field (e.g. the MOVE instructions).

After relocating address fields, set the MQ register to 0xAAAAAAAAAA and halt.

An example console command script for loading the sum program (~cs611/public/IAS/sum.asm) to address 3000 is available in ~cs611/public/prog5/example.run.

Grading will be based upon completed, correct functionality:

Your program will be graded primarily by testing it for correct functionality. However, good program structure and documentation is absolutely critical for assembly language programs. Therefore, you may lose points if your program is not properly structured or adequately documented.

Put your IAS code in a file called load.asm.

Your assignment should be submitted for grading from a CIS Linux machine (e.g. turing.unh.edu). To turn in this assignment, type:
~cs611/bin/submit prog5 load.asm

Submissions can be checked from a CIS Linux machine by typing:
~cs611/bin/scheck prog5

To receive full credit for the assignment, you must turn in your files prior to 8am on Monday April 21. Late submissions will be accepted at the penalty of 5 points per day up to one week late.

Remember: as always you are expected to do your own work on this assignment.


Last modified on April 10, 2003.

Comments and questions should be directed to hatcher@unh.edu