CS 270, Spring 2014
Programming Assignment PA6
More Assembly Required

PA6 due Thursday, Mar. 27 at 11:59pm, no late submissions.


This assignment completes the previous one, with the same three objectives:
  1. To learn how to write an LC3 assembly program of significant size,
  2. to extend your familiarity with the LC3 instruction set,
  3. and to further understand the manipulation of floating-point numbers.

The Assignment

This assignment requires you to complete all the functions in LC3 assembly code from the previous assignment. The remaining functions include right_shift, flt16_get_exp, flt16_add, and flt16_sub to support floating point addition and subtraction on 16-bit (half precision) floating point values. You can find documentation on this format, which is also defined by the IEEE 754 specification here. A short description of the half precision format is as follows: The protocol for calling functions has already been presented in the recitation. You can follow the same procedure when debugging your program, as shown below.

Getting Started

Perform the following steps:
  1. Create a PA6 directory in your cs270 directory for this assignment.
  2. Copy the starter file PA6.asm into the directory.
  3. Merge the functions you have already written in PA5.asm.
  4. Assemble the program with the command ~cs270/lc3tools/lc3as PA6.asm.
  5. Implement the remaining functions in the file (see testing below).
  6. Fix all assembler errors and make sure that PA6.obj and PA6.sym are created.
  7. Start the simulator with the command ~cs270/lc3tools/lc3sim-tk.
  8. Use the button to browse for and load your object code, called PA6.obj.
  9. Setup the Option, Param1, and Param2 fields with the values you want to test.
  10. Run your program by clicking on the Continue button.
  11. When the program stops, examine the value stored at memory location Result.
  12. Hit the Reset button and return to step 9) to start a new test.

Important Information

We have made two changes to the specification after PA5 to simplify the assignment. The first is that handling normalization of the operands is optional. You can receive up to 20 extras points on the assignment for implementing this, or you can assume that the exponents of the operands will be equal, see the Grading Criteria below. Note that you still must do normalization of the result (on either direction). The second change is that when the exponents differ, the first operand will always have a larger exponent than the second, so you only need to handle this case.

Grading Criteria

For the preliminary testing will help you verify the additional functions listed below. Note, the tests will remain the same for final grading, but the values of the floating point numbers added and subtracted will vary! The order of testing is intended to push you in the direction of incremental development, which is highly desirable for this assignment, since the flt32_add method is very long. The current solution from the instructor has ~75 lines, without operand normalization. Here are the preliminary tests for PA6:

Assignment Submission

Submit the single file PA6.asm to the Checkin tab on the course website, and check your preliminary results.

© 2014 CS270 Colorado State University. All Rights Reserved.