CSCI 370: IAS

Overview

  1. Let A, B, and C be arrays of 100 integers. Assume the arrays begin at locations 100, 200, and 300, respectively. Write an IAS program to compute C[J] = A[J] + B[J], for J = 99, 98, …, 0. You MUST start at the end of each array and work your way toward the beginning. This will result in cleaner, more concise and efficient code.

I have started the program for you below. You MUST use this tabular format. Fill in missing cells and add as many rows as necessary (the last address should be LESS THAN 14L). Note constants are stored in locations 0, 1, and 2, and instructions begin at 3L.

Hint: Your code will have to modify itself using the address modify instructions.

Location   Contents           Comment             
--------   --------           -------             
0          1                  Constant        
1          100                Constant         
2          99                 Constant J
3L         LOAD M(199)        AC <-- A[J]        
3R         ?                  AC <-- A[J] + B[J] 
4L         ?                  Write C[J]       
4R         LOAD M(2)          ?                 
5L         ?                  AC <-- J - 1    
5R         ?                  Branch to 6R if AC >= 0 
6L         HALT               Terminate program         
...
  1. Describe the process that the CPU must undertake to read a value from memory AND to write a value to memory. Mention register MAR, register MBR, and read and write signals.

Additional Requirements

Submission

Submit your PLAIN TEXT file using Autolab. Ensure your file ONLY consists of printable characters and is neatly formatted, PARTICULARLY the table that contains the IAS program.