Hello!
I've started learning assembly and I have some problems with a program. I'm trying to write a program that would print some text x-times (x would be inputed by me), but I always get an infinite loop, because it seems that the counter value doesn't get updated in the register in each iteration, therefore it never reaches the "x".
My code
BITS 32
extern printf
extern scanf
global main
section .data
text db "Random text",10,0
input db "%d",10,0
number dd 0
section .text
main:
push dword number
push dword input
call scanf
add esp,8
mov eax,[number]
mov ecx,1
.loop:
push dword text
call printf
add esp,4
inc ecx
cmp ecx,eax
jle .loop
ret
Any help would be much appriciated.