Hi I keep getting an error when trying to assemble and run my code and would like to know why. It says there is a syntax error in line 21 and "directive must be in control block" error in line 23. The program is supposed to write a square made up of alternating blue and white vertical bars, as such |. This is my exact hw exercise:
Write a test program that uses INVOKE to call WriteColor-
Char, and displays a color square (10 rows by 20 columns) with alternating pairs of blue and white vertical bars. Call a separate procedure when printing each row of the square.
This is my code so far (I couldn't think of another way to implement this program so I just did a bunch of IF statements for the alternating):
INCLUDE Irvine32.inc
.data
bluec DWORD 1
whitec DWORD 15
letter DWORD '|'
WriteColorChar PROTO,l1:DWORD,bc:DWORD,wc:DWORD
.code
main PROC
INVOKE WriteColorChar,letter,bluec,whitec
exit
main ENDP
WriteColorChar PROC,l1:DWORD,bc:DWORD,wc:DWORD
mov edx,0
.WHILE edx < 19
.IF (ecx=0) || (ecx=2) || (ecx=4) || (ecx=6) || (ecx=8) || (ecx=10) || (ecx=12) || (ecx=14) || (ecx=16) || (ecx=18)
mov eax,bc
.ELSEIF
mov eax,wc
.ENDIF
call SetTextColor
mov eax,0
mov eax,l1
call Row1
add edx,1
.ENDW
call crlf
; next row and so on
ret
WriteColorChar ENDP
Row1 PROC
call WriteChar
ret
Row1 ENDP
END main