DATA SEGMENT
STRING DB '1.Assemble language is very hard to study.2.You must pay more attention.'
COUNT EQU $-STRING;求串长度
UCCOUNT DB ?;存大写字母个数
LCCOUNT DB ?;存小写字母个数
NCOUNT DB ?;存数字个数
SCOUNT DB ?;存空格个数
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
LEA SI,STRING
MOV CX,COUNT
NEXT:
MOV AL,[SI]
CMP AL,20H
JNZ NEXTN
INC SCOUNT
JMP NEXT1
NEXTN:
CMP AL,30H
JB NEXT1
CMP AL,39H
JA NEXTLC
INC NCOUNT
JMP NEXT1
NEXTLC:
CMP AL,41H
JB NEXT1
CMP AL,5AH
JA NEXTUC
INC LCCOUNT
JMP NEXT1
NEXTUC:
CMP AL,61H
JB NEXT1
CMP AL,7AH
JA NEXT1
INC LCCOUNT
NEXT1:
INC SI
LOOP NEXT
MOV AH,4CH
INT 21H
CODE ENDS
END START