Program to generate 20 Even no and then saved and display them by after making Odd

Program to generate 20  Even no and then saved and display them by after making Odd
Assembly Language 

include irvine32.inc

.data
arr dword 20 DUP(?)
msg byte " Even NO: ",0,13h,10h
msg1 byte " After converting it into ODD: ",0,13h,10h
count dword 0
num dword 0
divied dword 0

.code
main proc
call clrscr
call crlf

mov esi,0
.while count != 20
;call randomize
call random32

mov eax,100
call randomrange

mov num,eax
mov edx,0
mov ebx,2
div ebx

.IF edx == 0
.IF num < 42

call crlf
mov edx,offset msg
call writestring

call settextcolor
mov eax,100
call delay

mov eax,num
call writedec
mov arr[esi],eax
add esi,4
inc count

.endif
.endif
.endw

mov esi,0
mov count,0

call crlf

.repeat
call crlf
mov edx,offset msg1
call writestring

mov eax,arr[esi]
add eax,1
call writeint
add esi,4
inc count

.until count == 20

exit
main endp

end main


No comments

Powered by Blogger.