- 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 ...
- 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.
Use ONLY the 21 IAS instructions given in the slides, and use the same syntax.
Write a comment for every line, making it as descriptive as possible.
Format your IAS program NEATLY as above.
Number your answers to match the questions.
Use blank lines between paragraphs and questions.
catyour file at the command line to ensure it is plain text and formatted properly.
Keep lines 80 characters or less.
If you submit a non-plain text file you will receive a ZERO.
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.