News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

For...Next Loop ???????????????

Started by WindDancer, March 09, 2005, 02:57:22 PM

Previous topic - Next topic

WindDancer

Hi out there ,

first of all I did what you have said, I read the Tuts of Iczelion and played around with the code !!!!!!!!!!!  :P
Then I tried to modify it and it will also work, but I haven't found a good Tut which explains some code constructs like a For...Next Loop or If...Then or Select Case... or something like that in asm !  :'(

Now the problem is that I have this Code (Iczelion Tut 02 only a msgbox appears) :



.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib

.data

   MsgBoxCaption  db "Iczelion Tutorial No.2",0
   MsgBoxText db "Win32 Assembly is Great!",0

.code

start:

   invoke MessageBox, NULL, addr MsgBoxText, addr MsgBoxCaption, MB_OK
   invoke ExitProcess, NULL

end start


Now I have one MSGBOX on the Screen !!!!!!!!!!!!!!!!!!
But how can I get 200 of the same MSGBOXES on different Coordinates on Screen ?????????????????????


Please help me and thanx a lot to everybody of you !!!!!!!!!!!!!!!!  :dance:



Still learning........

>>> WindDancer <<<

Relvinian

WindDancer,

For-Loops are the combination of the following instructions:

1)   (a label to branch to)
2)   CMP
3)   (some branching instruction -- such as JMP, JNE, JNZ, JE, JZ, etc).

A simple example:


xor eax, eax
mov ecx, 10     ; 10 iterations of the loop
MyLoop:
   add eax, eax        ; double the value each iteration of the loop
   sub ecx, 1
   jnz MyLoop


From this example, you can expand it MANY different ways to play with different kiinds of loops.

Hope this helps

Relvinian