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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply