

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!


UMass Amherst Department of Computer Science Handout 11 CMPSCI 201: Architecture and Assembly Language April 16, 2009 Instructor: Prof. Kevin Fu
This programming assignment set is due on Friday, April 24, 2009 by your discussion section. You must hand in your programming assignment in your Edlab account before your assigned discussion section begins. Please contact your TA well ahead of the deadline if you have a question about these procedures. This is an individual programming assignment. See Handout 1 (Course Information) for our policy on collaboration, plagiarism, and late polices. Plagiarism will result in severe penalties. Please mark the top of the programming assignment with your name, CS201, and the date. Points may be deducted if your TA has problems understanding your solution or if your solution is not legible. This assignment is worth 10 points. In this assignment, you will use the principles of subroutines and I/O. You will implement an ASCII Tic-Tac-Toe game for the LC-3! Tic-Tac-Toe is a two-player game with two symbols denoting the two players: X and O. The playing board is a 3x3 grid. The rules are as follows:
Sample Output with a description of what action a player takes for I/O in italics: Welcome to Tic-Tac-Toe X – Which square? [0-8] > (user X enters in 0) X is in spot: 0 O – Which square? [0-8] > (user O enters in 3) O is in spot: 3 X – Which square? [0-8] > (user X enters in 0) That square is already taken. X – Which square? [0-8] > (user X enters in 4) X is in spot: 4 O – Which square? [0-8] > (user O enters in 2) O is in spot: 2 X – Which square? [0-8] > (user X enters in 8) X is in spot: 8 X is the winner! Thanks for playing Tic-Tac-Toe We suggest that you first write a program flow chart before you translate the problem into sequential, iterative, and conditional LC-3 code. Submit your well-documented code and a sample output of the game. Comments should conform to the philosophy discussed in lecture. Make sure to comment at the top of your program the role each register plays in your program. Each major piece of code/subroutine (e.g., sequential, conditional, iterative) should have comments descriptive enough for the reader to understand the purpose of the code, its assumptions, and its result. Avoid redundant single instruction comments when it’s obvious. (e.g., “ADD R0, R0, #1 ; Increment R0” has a redundant comment.) We have zero tolerance for plagiarism. You may not use any resources other than your book, the LC-3 simulator, and the course staff. You may not share code with your peers, borrow code from past students, the Web, e-Bay, the Interwebz, etc. You may borrow code from the book if you document the borrowing. (Hint: Chapter 10 has lots of example code.) Keep in mind that your course staff specialize in fraud detection, pattern matching, and cryptanalysis. We have automated tools to encourage students to “stay honest” about avoiding plagiarism. See Handout 1 for how we handle cases of suspected plagiarism. The long process of prosecuting plagiarism is no fun for anyone— be it students or staff. We thank you for coding and playing with honor. If you have any questions or concerns about the plagiarism policy, contact [email protected].