I am trying to print a two-dimensional array to the screen. My algorithm probably isn't correct but I am having trouble even getting the process to work.
on the call I get ----error A2206: missing operator in expression
This line add ebx,tmpRowSize * rowIndex I get ------error A2026: constant expected
Thanks in advance for any input
TITLE MASM Template (main.asm)
; Program: Maze Game
; Author: Jon Wayman
; Created Date: July 22nd,2008
; Revision date:
INCLUDE Irvine32.inc
INCLUDE Macros.inc
.data
COLS = 20
ROWS = 3
map BYTE 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h
RowSize = ($ - map)
BYTE 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h
BYTE 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h, 23h
.code
main PROC
call printMap RowSize
exit
main ENDP
printMap PROC, tmpRowSize
LOCAL rowIndex, colIndex, count
pushad
mov rowIndex,0
mov colIndex,0
mov ebx,OFFSET map
add ebx,tmpRowSize * rowIndex
mov esi,colIndex
mov ecx,ROWS ; outer loop count
jmp mapL2
mapL1:
mov count,ecx
mov ecx,COLS
call crlf
mapL2:
mov al,[ebx + esi]
call writechar
loop mapL2
mov ecx,count ; outer loop count
loop mapL1
popad
ret
printMap ENDP
END main