Spring 2001 CSCI 255 Homework 8

This assignment is due Monday, 2 April.

Problem 1 and only

This homework is, in style, similar to Lab 7. Be sure you understand the lab before attempting the homework.

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


    R0 = R3 ^ R4 ;
    R1 = R3 != R4 ;
    R2 = R3 || R4 ;

Follow the following rules:

  1. Your program sets the values of registers R0, R1, and R2 based on the values of registers R3 and R4.
  2. Your program should not change the values of R3 and R4.
  3. Your program it is free to use R5, 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.

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/home8 as shown below:

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