title: Find the maximum number of consecutive digits in a row
body: <p>I have some problems with this code. I need to count number of consecutive digits in a row. I use masm assembly language. Here is my code:</p>
  
  <pre><code> Extrn OutInt:Far       
   data segment
   string db 100 dup ('$')
   string2 db 'Input the string!', 0dh,0ah, '$'
   string3 db 'Count -    $'
   data ends 
   code segment
   assume cs:code,ds:data
   start:
    mov ax, data
    mov ds, ax
    mov ah,9
    lea dx,string2
    int 21h       
    mov ah,0ah
    lea dx,string
    int 21h     
    mov ah,9
    lea dx,string3
    int 21h
  
    mov si,offset A
    mov BX,0
    mov DX,0
    mov CX,100
    looperunda:
    lodsb
    test AL,10000000b
    je nosigno
    cmp BX,DX
    jnb neatral
    mov BX,DX
    xor DX,DX
    jmp neatral
    nosigno:
    inc DX
    neatral:
    loop looperunda
  
    mov ax, 16
    Call OutInt   
  
   code ends
   end start
  </code></pre>
  
  <p>OutInt:</p>
  
  <pre><code>Title OutInt 
  CodeSg  Segment PARA 'Code'
  OutInt  Proc FAR
  Assume CS:CodeSg
  Public OutInt   
  aam 
  add ax,3030h 
  mov dl,ah 
  mov dh,al 
  mov ah,02 
  int 21h 
  mov dl,dh 
  int 21h
  
  mov ah, 10h
  int 16h 
  mov ax, 4c00h
  int 21h
  OutInt endp 
  CodeSg ENDS
  END OutInt 
  </code></pre>
  
  <p>The program must work like that :
  "
  Input the string!</p>
  
  <p>aa23333c</p>
  
  <p>Count - 4
  "</p>
  
  <p>But My code doesn't work. Could anyone help me, please? Where is the mistake?</p>