Either submit the source code (.asm) on Ecampus under the "Submit Homework" menu option, or demo the programs to the instructor during lab.


Using x86 assembly language, write a program that plays tic-tac-toe against the computer.  Below is a sample game loop.  It assumes the player is X and computer is O with the player making the first move. 

gameLoop:
        call printBoard
        cinvoke printf, "Your move (1-9)?  "
        cinvoke scanf, "%d", Square
        call placeX
        call checkXWin
        call checkForDraw
        call computerMove
        call checkOWin
        jmp gameLoop 
Example output
Welcome to x86 Assembly Tic-tac-toe!
You will be X's and the computer will be O's.
The squares are number 1 - 9 starting with the top left.
   |   | ---|---|---    |   | ---|---|---    |   |
Your move (1-9)? 5
   |   | O ---|---|---    | X | ---|---|---    |   |
Your move (1-9)? 1
 X |   | O ---|---|---    | X | ---|---|---    |   | O
Etc.