接受键盘输入字符然后在另一行输出英文字母个数
LEN EQU 50DSEG SEGMENT
BUFF DB LEN
DB ?
DB LEN DUP (?)
MESS DB 'X = $'
DSEG ENDS
CSEG SEGMENT
ASSUME CS:CSEG , DS:DSEG
START: MOV AX,DSEG
MOV DS,AX ;送数据段段值
MOV DX,OFFSET BUFF ;字符串偏移地址
MOV AH,0AH ;键盘接受一个字符串
INT 21H
CALL NEWLINE ;回车换行
MOV CL, BUFF+1 ;得到字符串长度,设
置循环次数
MOV CH,0
JCXZ COK
MOV SI,OFFSET BUFF+2
AGAIN: MOV AL,[SI]
INC SI
CMP AL,'a'
JB NEXT
CMP AL,'z'
JA NEXT
INC BL
NEXT: LOOP AGAIN
COK: MOV DX,OFFSET MESS
CALL DISPMESS
MOV AL,BL
XOR AH,AH
CALL DISPAL
CALL NEWLINE
MOV AX,4C00H
INT 21H
DISPAL PROC
MOV CX,3
MOV DL,10
DISP1: DIV DL
XCHG AH,AL
ADD AL,'0'
PUSH AX
XCHG AH,AL
MOV AH,0
LOOP DISP1
MOV CX,3
DISP2: POP DX
CALL ECHOCH
LOOP DISP2
RET
DISPAL ENDP
DISPMESS PROC
MOV AH,9
INT 21H
RET
DISPMESS ENDP
ECHOCH PROC
MOV AH,2
INT 21H
RET
ECHOCH ENDP
NEWLINE PROC ;回车换行子
程序
PUSH AX
PUSH DX
MOV DL,0DH
MOV AH,2
INT 21H
MOV DL,0AH
MOV AH,2
INT 21H
POP DX
POP AX
RET
NEWLINE ENDP
CSEG ENDS
END START
运行之后输入的一段字符时计算不出英文字符个数,哪个地方错了呢?