Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Part 1: Write a program that draws an 8x8 chessboard, with alternating gray and

ID: 3916782 • Letter: P

Question

Part 1: Write a program that draws an 8x8 chessboard, with alternating gray and white squares. You can use the SetTextColor and GoToXY procedures from the Irvine32 library. Avoid the use of grlobal variables, and use declared parameters in all procedures. Use short procedures that are focused on a single task.

Part 2: This exercise extends part 1. Every 100 milliseconds, change the color of the colored squares and redisplay the board. Continue until you have shown the board 16 times, using all possible 4 bit background colors. (Thie white squares remain white throughout.)

For: Assembly x86 class

Explanation / Answer

TITLE Chess Board

INCLUDE Irvine32.inc
.data
text BYTE "___"
loopCnt DWORD 8
.code
main PROC
mov ecx, 8
L1:
mov eax, gray
mov eax, ecx
call setTextColor
mov edx, OFFSET text
call writeString

mov eax, black
mov eax, ecx
call setTextColor
mov edx, OFFSET text
call writeString


loop L1

exit
main ENDP
END main