Page 1 of 1

COMPUTER ORGANIZATION X86 32 bits. How can I fix this Infinite loop? TITLE MASM Template (main.asm) I

Posted: Sat May 14, 2022 7:59 pm
by answerhappygod
COMPUTER ORGANIZATION X86 32 bits. How can I fix this Infinite
loop?
TITLE MASM Template

(main.asm)
INCLUDE Irvine32.inc
.data
msg1 BYTE "Enter 5 numbers",0dh, 0ah, 0
arr1 dword 5 dup(0)
msg2 byte "* ",0
msg3 byte ":",0
.code
;---------------------------------------Display
stars------------------
getstars proc
mov esi,offset arr1
mov ecx, 5
label2:
mov eax, [esi]
add esi, 4
mov edx,0
mov ebx,10
div ebx
call writeint
mov edx,offset msg3
call WriteString
;----------------error-----------
mov ecx, eax
label3:
mov edx,offset msg2
call WriteString
;-------------------------------------
loop label3
call crlf
loop label2
ret
getstars endp
;-------------------------------------------------------------------

main PROC
call clrscr
mov esi, offset arr1
mov ecx, 5
label1:
mov edx,offset msg1
call WriteString
call readint
mov [esi],eax
add esi, 4
loop label1
call crlf
mov esi,offset arr1

call getstars
exit
main ENDP
END main