MP2-README - ECE190 - Fall 09 MP2 SKELETON AND GAMEBOARD: Create a folder called 'mp2' in your ece190 directory and change to it. Then download mp2.tar from the ece190 website. Use the command 'wget [file to download]' Example: wget http://courses.ece.illinois.edu/ECE190/machine_problems/fall09/mp2/mp2.tar Now unzip the files using the command 'tar -xvf [file to unzip]' Example: tar -xvf mp2.tar This will unzip the file to your current folder. mp2.asm is your skeleton file which provides you with all of the strings you will be needing for this MP. YOU MUST RENAME THIS FILE TO mp2.1.asm FOR CHECKPOINT 1 AND mp2.2.asm FOR CHECKPOINT 2. NO OTHER NAMES WILL BE ACCEPTED FOR HANDIN. Three boards of various sizes have also been provided, but make sure to assemble them using lc3as first. This makes it so that you will not have to create your own boards. To load a board for your program, load the object file for the board and then the object file for your code. For example, to load the easyboard for checkpoint 1, open lc3sim and type: file easyboard.obj file mp2.1.obj GETTING THE TEST CASES: Download the appropriate test case files from the ece190 website using the above method http://courses.ece.illinois.edu/ECE190/machine_problems/fall09/mp2/test2.1.tar http://courses.ece.illinois.edu/ECE190/machine_problems/fall09/mp2/test2.2.tar Unzip each file using the above methods. TESTING YOUR PROGRAM: First assemble your MP and all gameboard files (make sure it is named mp2.1.asm for MP2.1 and mp2.2.asm for MP2.2). Now run the command 'lc3sim -s [.scr file] > [output file]' Example: lc3sim -s test2.1.1.scr > out2.1.1 This will run the first test for MP2.1 (test2.1.1) and output it to the file 'out2.1.1'. You can now compare these files against the .gold files using vimdiff Example: vimdiff out2.1.1 test2.1.1.gold The console output should match EXACTLY. If there are any extra spaces or line feeds, YOU WILL NOT GET FULL CREDIT. However, if vimdiff shows that the registers have different values, you should be fine. You should also make sure that your gameboard files have not been modified as this may give you bad results. Even though you are provided these test cases, make sure to thoroughly test your program before handing it in. FREQUENTLY ASKED QUESTIONS (FAQ) Q: What does a linefeed do? A: A linefeed is used when text needs to be put on the next line. For example, writing XXXXXXXX would print: XXXXXXXX However, if you need to split it into two rows of 4, you would write XXXX\nXXXX. \n represents a linefeed, or x000A in ASCII. This would produce: XXXX XXXX Id you want to know more about linefeeds, go to http://en.wikipedia.org/wiki/Newline Q: Why do I need to print out 50 linefeeds before displaying the gameboard? A: When the actual game is being played, the gameboard will be displayed: - At the beginning of the turn - After the player enters the coordinates of the first character to reveal - After the player enters the coordinates of the second character to reveal If the characters do not match, they are both covered up. If the gameboard is displayed immediately after both characters have been revealed, the player can easily see which characters have been covered up and "cheat" on their next turn. If 50 linefeeds are printed, the player will not be able to see the previously printed board (unless they scroll up screen). Basically this is just an anti-cheating measure so that the game actually requires memorization. Q: What is the correct handin command? A: Checkpoint 1: handin --MP 2.1 mp2.1.asm Checkpoint 2 handin --MP 2.2 mp2.2.asm Q: Is it alright if any lines are highlighted red in vimdiff? A: None of the console output should be highlighted in red. HOWEVER, it may be possible that your final register values (which are printed at the end of the test) may be different than the gold version. This is OK. For an example of this, view this: http://courses.ece.illinois.edu/ECE190/machine_problems/fall09/mp2/vimdiff.png. Q: Do these row and column start at 0 or 1? A: Both the row and column start at 0. This means that the top-left piece should correspond to (0,0).