title: How can we count the number of vowels in a string in assembly 8086?
body: <p>I want to count the number of vowels in an input string, written only in minuscules.<br>
  My code is this one, but he doesn't count them right (the <code>cmp</code> instructions are never <code>true</code>)</p>
  
  <pre><code>data segment 
        s db 10 dup(' ')
  data ends
  
  code segment 
  
  assume ds:data, cs:code
  
  debut: mov ax,data
  mov ds,ax
  
  mov dx,offset s
  mov ah,0ah
  int 21h
  
  mov cl,s[1] 
  mov di,offset s
  mov bx,0
  
  nr_vocale: cmp cl,0
  je sfarsit
  mov al,[di]
  cmp al,'a'
  je increment
  mov al,[di]
  cmp al,'e'
  je increment
  mov al,[di]
  cmp al,'i'
  je increment
  mov al,[di]
  cmp al,'o'
  je increment
  mov al,[di]
  cmp al,'u'
  je increment
  inc di
  dec cl
  
  
  increment:  inc bx
   sfarsit: mov dl,bl
   mov ah,2
   int 21h
  
   mov ah,4ch
   int 21h
  
   ends code
  end debut
  </code></pre>