Department of Electrical and Computer Engineering
University of Texas at Austin
EE 306
Fall 2004
Y. N. Patt, Instructor
Siddharth Balwani, Linda Bigelow, Tommy Buell, Jeremy Carrillo, Aamir Hasan,
Danny Lynch, Rustam Miftakhutdinov, Veynu Narasiman, Vishal Parikh, Basit Sheikh, TAs

Programming Assignment 4 (Assembly Language)
Due: Sunday, November 21, 11:59pm

You must do the programming assignment by yourself. You are permitted to get help ONLY from the TAs and the instructor. The file you submit should be an assembly language file called nim.asm. This is the only file you need to submit. Your program should start at memory location x3000. Submission instructions are posted on the class website in the Software and Documentation section. If you are having trouble submitting, please email Danny ( or Linda (

1. The Game of Nim
Nim is a simple two-player game that probably originated in China (although the name is thought be German, from nimm the German word for "take"). There are many variations of this game with respect to the type of counters used (stones, matches, apples, etc.), the number of counters in each row, and the number of rows in the game board.

2. Rules
In our variation of Nim, the game board consists of three rows of rocks. Row A contains 3 rocks, Row B contains 5 rocks, and Row C contains 8 rocks.

The rules are as follows:

3. What to do

4. Sample Input/Output
An example of the input/output for a game being played can be found here. To receive full credit for your program, your input/output format MUST EXACTLY MATCH the format in the example.

5. Hints and Suggestions