I am very new to assembly and I just picked up some online tutorials about it so I'm trying to practice.
Here's the snippet of a code which makes a textbox appear:
segment .data
TITLE db 'Message',0
TEXT dd 'This is a message',0
segment .text
global start
extern MessageBoxA
extern ExitProcess
start:
push 0
push TITLE
push TEXT
push 0
call MessageBoxA
push 0
call ExitProcess
I found some online tutorials how to make a for loop, so I made this:
segment .data
TITLE db 'Message',0
TEXT dd 'This is a message',0
segment .text
global start
extern MessageBoxA
extern ExitProcess
start:
mov ecx,5
loop1:
push 0
push TITLE
push TEXT
push 0
call MessageBoxA
push 0
dec ecx
jnz loop1
call ExitProcess
I tried to implement a simple for loop which would make the textbox appear five times following this tutorial on stackoverflow
However what this does is it makes it re-appear every time I press "OK" which leads me to think I may have made an infinite loop. My question is, how do I modify this so it is correct?