Advertisement
MELAMOURI

Untitled

Sep 12th, 2021
1,965
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. INCLUDE Irvine32.inc
  2. .data
  3.  
  4. input1 byte 'Enter 20 marks : ',10,0
  5. bigger byte 'number of marks bigger or equal 50 : ',10,0
  6. bigger_num byte 10,'the bigger mark is :',10,0
  7. smaller_num byte 10,'the smallest mark is :',10,0
  8. temp1 dword ?
  9. marks DWORD 20 dup(?)
  10. count_50 DWORD 0
  11. the_bigger_mark dword ?
  12. the_smallest_mark dword ?
  13. .code
  14.  
  15. main PROC
  16.  
  17. mov edx , offset input1
  18. call writestring
  19.  
  20. mov ecx , lengthof marks ;loop conter
  21. mov esi ,0
  22.  
  23. l1:
  24.  call readdec
  25.  mov ebx ,eax
  26.  
  27.  mov marks[esi],ebx
  28.  add esi , type marks
  29.  loop l1
  30.  
  31.  
  32.  ;read in array
  33.  mov esi ,0
  34.  mov ecx , lengthof marks
  35.  l2:
  36.  
  37.  mov ebx , marks[esi]
  38.  cmp ebx,50
  39.  jae l5
  40.  dec count_50
  41.  l5:inc count_50
  42.  add esi ,type marks
  43.  loop l2
  44.  mov edx , offset bigger
  45.  call writestring
  46.  mov eax , count_50
  47.  call writedec
  48.  
  49.  mov edx , offset smaller_num
  50.  call writestring
  51.  
  52.  mov esi ,0
  53.  mov ecx , lengthof marks
  54.  
  55.  mov ebx , marks[0]
  56.  l3:
  57.  cmp marks[esi] ,ebx
  58.  jae ttrue
  59.  mov ebx ,marks[esi]
  60.  ttrue:mov temp1 , ebx
  61.        
  62.  add esi , type marks
  63.  loop l3
  64.  mov eax , ebx
  65.  call writedec
  66.  
  67.  mov edx , offset bigger_num
  68.  call writestring
  69.  
  70.  mov esi ,0
  71.  mov ecx , lengthof marks
  72.  
  73.   mov ebx , marks[0]
  74.  
  75. l4:
  76.  cmp ebx,marks[esi]
  77.  jae ttrue2
  78.  mov ebx ,marks[esi]
  79.  mov temp1,ebx
  80.  ttrue2:mov temp1 ,ebx
  81.   add esi , type marks
  82. loop l4
  83.  mov eax , ebx
  84.  call writedec
  85. main ENDP
  86. END main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement