Facebook
From Nouman, 1 Month ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 169
  1. Task 3
  2.  
  3. include irvine32.inc
  4. include macros.inc
  5.  
  6.  
  7. .data
  8.  title1 byte "Choose Your Favourite Fruit",0
  9.  msg byte "Select 'Yes' if you'd like to rank your top 3 favourite fruits, or select 'No' to exit",0
  10.  favFruits byte 3, 20 dup(0)
  11.  
  12. .code
  13. main proc
  14.  
  15.  lea edi, favFruits
  16.  lea ebx, title1
  17.  lea edx, msg
  18.  call MsgBoxAsk
  19.  
  20.  cmp eax, 06h
  21.  je yess
  22.  mwrite "Exiting the Program"
  23.  call crlf
  24.  jmp exittt
  25.  
  26.  yess:
  27.   mwrite "Enter your top 3 Favourite Fruits: "
  28.   call crlf
  29.   mov ecx, 3
  30.   l1:
  31.    push ecx
  32.    mwrite "Enter the Fruit : "
  33.    mov edx, edi
  34.    mov ecx, 20
  35.    call readstring
  36.  
  37.    add edi, 20
  38.    pop ecx
  39.   loop l1
  40.  
  41.  mwrite "Your top 3 Favourite Fruits are :"
  42.  call crlf
  43.  mov ecx, 3
  44.  lea edi, favFruits
  45.  l2:
  46.   mov edx, edi
  47.   call writestring
  48.   add edi, 20
  49.   call crlf
  50.  loop l2
  51.  exittt:
  52.  
  53. exit
  54. main endp
  55. end main
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.