Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INCLUDE Irvine32.inc
- .data
- input1 byte 'Enter 20 marks : ',10,0
- bigger byte 'number of marks bigger or equal 50 : ',10,0
- bigger_num byte 10,'the bigger mark is :',10,0
- smaller_num byte 10,'the smallest mark is :',10,0
- temp1 dword ?
- marks DWORD 20 dup(?)
- count_50 DWORD 0
- the_bigger_mark dword ?
- the_smallest_mark dword ?
- .code
- main PROC
- mov edx , offset input1
- call writestring
- mov ecx , lengthof marks ;loop conter
- mov esi ,0
- l1:
- call readdec
- mov ebx ,eax
- mov marks[esi],ebx
- add esi , type marks
- loop l1
- ;read in array
- mov esi ,0
- mov ecx , lengthof marks
- l2:
- mov ebx , marks[esi]
- cmp ebx,50
- jae l5
- dec count_50
- l5:inc count_50
- add esi ,type marks
- loop l2
- mov edx , offset bigger
- call writestring
- mov eax , count_50
- call writedec
- mov edx , offset smaller_num
- call writestring
- mov esi ,0
- mov ecx , lengthof marks
- mov ebx , marks[0]
- l3:
- cmp marks[esi] ,ebx
- jae ttrue
- mov ebx ,marks[esi]
- ttrue:mov temp1 , ebx
- add esi , type marks
- loop l3
- mov eax , ebx
- call writedec
- mov edx , offset bigger_num
- call writestring
- mov esi ,0
- mov ecx , lengthof marks
- mov ebx , marks[0]
- l4:
- cmp ebx,marks[esi]
- jae ttrue2
- mov ebx ,marks[esi]
- mov temp1,ebx
- ttrue2:mov temp1 ,ebx
- add esi , type marks
- loop l4
- mov eax , ebx
- call writedec
- main ENDP
- END main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement