Spring 2001 CSCI 255 Homework 12

You must show your work to receive full credit. This assignment is due Wednesday, 2 May.

Problem 1 and only

Translate the following worthless function from C to LC-2 assembler. Use Chapter 14 style activation records to transmit parameters.


int *dmbprg(int *X, int *Y) {
  if (Y[2] == Y[3])
    *X = Y[2] ;
  else
    *X = Y[2] + 1 ;
  return X ;
}