Spring 2002 CSCI 255 Project 1

This assignment is due Monday, 8 April.

Write an LC-2 assembly language program to perform the following four C statements:

    R0 = R4 * 17 + 5 ;
    R1 = (R4 &&  R5) - 3 ;
    R2 = ~R4 + ~R5 ;
    R3 = (R4 & R5) - 3 ;

Follow the following rules:

  1. Your program sets the values of registers R0, R1, R2, and R3 based on the values of registers R4 and R5.
  2. Your program should not change the values of R4 and R5.
  3. Your program it is free to use R6 and R7 as "scratch" registers.
  4. Your program should be loaded at x3000.
  5. Your program will terminate execution with a HALT system call.

If you have any doubt about what the output how this program should compute its answer, you should download and run the the original C program.

Turning in this assignment

This assignment is to be turned in by copying it to your Computer Science Unix directory. First create a protected directory csci/255/proj1 as shown below:

Then save your completed assembly program in the file proj1.asm within your csci/255/proj1 directory.