Hi guys,

I am trying set cursor postion in the screen and print a value.But this loop gives me a unlimited loop..can anyone help me to figure out whats wrng.?

mov ecx,5
L1:
		
	mov XYPos.X, eax
	mov XYPos.Y, ebx
	INVOKE GetStdHandle, STD_OUTPUT_HANDLE
	mov consoleHandle, eax
	
	INVOKE SetConsoleCursorPosition, ConsoleHandle, XYPos

	mov eax, 3
	Call WriteDec
	
	inc ebx
                add edx, 3
	loop l1

I don't know how to work with the cursor but looping looks like this...

cmp ax,bx ; compares the values
jng L1 ;  jumps to L1 if ax is not greater (jng=Jump if Not Greater)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.