DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Assembly (http://www.daniweb.com/forums/forum125.html)
-   -   XY position (http://www.daniweb.com/forums/thread190429.html)

heshangho May 4th, 2009 8:29 pm
XY position
 
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

Alex_ May 5th, 2009 4:27 am
Re: XY position
 
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)


All times are GMT -4. The time now is 6:43 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC