.386
.MODEL FLAT

ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD

INCLUDE io.h            ; header file for input/output

cr      EQU     0dh     ; carriage return character
Lf      EQU     0ah     ; line feed

.STACK  4096            ; reserve 4096-byte stack

.DATA                   ; reserve storage for data
  Prompt1 byte "Please enter strings(The max is 80):",0
  Prompt2 byte cr,Lf,"Number char(s): ",0
  Prompt3 byte cr,"Other char(s): ",0
  Prompt4 byte cr,"Letter char(s): ",0
  Value   byte 80 DUP(?)
  sum     byte 6 DUP(?),0

.CODE                           ; start of main program code
_start:
   mov bx,0
   mov cx,0
   mov dx,0
   output Prompt1
   input Value,80
   mov al,Value
   mov sum,al
a: cmp sum,'0'
   jb b
   cmp sum,'9'
   jbe as
   cmp sum,'A'
   jb b
   cmp sum,'Z'
   jbe d
   cmp sum,'a'
   jb b
   cmp sum,'z'
   jbe d

b: cmp sum,0dh
   je endprogram
   inc bx
   mov al,Value+1
   mov sum,al
   jmp a

as: inc cx
   mov al,Value+1
   mov sum,al
   jmp a

d: inc dx
   mov al,Value+1
   mov sum,al
   jmp a

endprogram: itoa sum,bx
    output Prompt3
    output sum

    itoa sum,cx
    output Prompt2
    output sum

    itoa sum,dx
    output Prompt4
    output sum






        INVOKE  ExitProcess, 0  ; exit with return code 0
PUBLIC _start                   ; make entry point public

END                             ; end of source code