

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Problem 1 (10 points): MP3 Warm-up
The computation involved in creating the next generation for the "Life" game is fairly expensive. One potential method of avoiding extra computations is to not compute anything if and only if there are less than two live cells in the board (because under those conditions it is guaranteed that all cells will be dead in the next generation).
Try writing the code for a subroutine that scans a 4x4 board (i.e. table of 16 elements) to determine the number of live cells. The table starts at x4000. Also as you may recall a dead cell is represented by x0000 and a live cell by x0001.
Specifics
Problem 2 (10 points): Debugging
For this part, you will be given a LC-3 assembly language program with a few bugs.
Your task is to find the bugs by inspection and/or by debugging with the LC-3 simulator and fix them. The program only contains a few bugs (3-4) which you must fix by inserting, deleting, or modifying only a few lines of code (3-6).
You may not change the input/output location/format or behavior of the program specified in the program description (in other words, you may only change what is not specified).
Modification of non-buggy code and excessive modification of buggy code will be penalized. We suggest copying the code to a temporary location for experimental modification.
Problem Description:
This program produces a pseudorandom permutation of the numbers from 0 to x1FF, and stores the numbers in consecutive memory locations starting at xDE20. This implies that each memory location is unique and between 0 and x1FF. The correct output is defined by the xor_map function and starts with the following:
xDE20: x xDE21: x xDE22: x008A xDE23: x01CF
Specifics: