title: Print the number of each character inside a string in assembly
body: <p>Hey guys im trying to learn assembly and im having this issue right now, so  im trying to get the number each characters inside a string.</p>
  
  <p>for example if I type in "hi" it should output:
  a0
  b0
  ..
  h1
  i1
  ..
  z0</p>
  
  <p>but instead I get random chars, I'll apreciate any help.</p>
  
  <pre><code> data segment
              msg1 db 10,13,': $'
              msg3 db 10,13,' $'
              msg4 db 10,13,'no, character found in the given string $'
              msg5 db ' character(s) found in the given string $'
              char db 97
              count db 0
              p1 label byte
              m1 db 0ffh
              l1 db ?
              auxsi db 0
              p11 db 0ffh dup ('$')
          data ends
          display macro msg
              mov ah,9
              lea dx,msg
              int 21h
          endm
          code segment
              assume cs:code,ds:data
          start:
                  mov ax,data
                  mov ds,ax
  
                  display msg1
  
                  lea dx,p1
                  mov ah,0ah
                  int 21h
  
  
  
                  lea si,p11
  
  
                  mov cl,l1
              mov ch,0
  
      check:
              mov al,[si]
              cmp char,al
              jne skip
              inc count
      skip:
              inc si
              loop check
  
              cmp count,0
              je notfound
  
  
  
              display msg3
  
              mov ah,02h
              mov dl,char
              int 21h
  
  
              mov dl,count
              add dl,30h
              mov ah,2
              int 21h
  
              inc char
              mov count,0
  
              cmp char,123
              jne check
  
              jmp exit
      notfound:
              display msg4
  
      exit:   mov ah,4ch
              int 21h
      code ends
      end 
  
  start
  </code></pre>