求BUF里各个字符的个数,哪错了,求助!!!
DSEG SEGMENTBUF DB 'ABCDEAAAAAAAAAAAA$'
COUNT DB 26 DUP(0)
DSEG ENDS
SSEG SEGMENT STACK
STK DB 100 DUP (?)
SSEG ENDS
CSEG SEGMENT
ASSUME DS:DSEG,SS:SSEG,CS:CSEG
START:MOV AX,DSEG
MOV DS,AX
MOV SI,OFFSET BUF
L1: CMP BYTE PTR[SI],'$'
JZ L2
MOV BL,[SI]
SUB BL,'A'
MOV BH,0
INC COUNT[BX]
INC SI
JMP L1
L2: CALL PRINT
HLT
HEXASC PROC NEAR
PUSH AX
PUSH CX
MOV AL,[DI]
AND AL,0F0H
MOV CL,4
SHR AL,CL
CMP AL,9
JBE L5
ADD AL,7
L5: ADD AL,30
MOV BH,AL
MOV AL,[DI]
AND AL,0FH
CMP AL,9
JBE L6
ADD AL,7
L6: ADD AL,30
MOV BL,AL
POP AX
POP CX
RET
HEXASC ENDP
PRINT PROC NEAR
MOV DI,OFFSET COUNT
MOV CX,26
L3: CMP BYTE PTR[DI],0
JZ L4
MOV DX,26
SUB DX,CX
ADD DX,'A'
MOV AH,2
INT 21H
CALL HEXASC
MOV AH,2
MOV DL,BH
INT 21H
MOV AH,2
MOV DL,BL
INT 21H ;输出个数
MOV AH,2
MOV DL,0AH
INT 21H
MOV AH,2
MOV DL,0DH
INT 21H
L4: INC DI
LOOP L3
RET
PRINT ENDP
CSEG ENDS
END START