Count alphabets,digits in an array in assembly 8086

Program to Count alphabets,digits in an array in assembly 8086:




; You may customize this and other start-up templates; 
; The location of this template is c:\emu8086\inc\0_com_template.txt

org 100h

.data 

arr dw "53ahmad1hannan89$"

ac db ?

dc db ?

.code    


mov Bx,offset arr    ;move offset of array or address of array

while:

mov Al,[Bx]

cmp Al,24h          ;compare

je exit


cmp Al,41h

jb  digcount

cmp Al,61h

jae  alpha


digcount:

inc Bx

inc dc    

jmp while
   

alpha:

inc Bx

inc ac
     
jmp while


exit:

mov Ah,4Ch    ;exit

int 21h


ret




Comments