DATA SEGMENT
GRADE DB 76,69,84,90,73,88,99,63,100,80
MES1 DB '60-69:$'
MES2 DB '70-79:$'
MES3 DB '80-89:$'
MES4 DB '90-99:$'
MES5 DB '100:$'
C1 DB 0
C2 DB 0
C3 DB 0
C4 DB 0
C5 DB 0
CNT EQU 10
DATA ENDS
STACK SEGMENT PARA 'STACK'
DB 100 DUP(0)
STACK ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
MAIN PROC FAR
START: MOV AX,DATA
MOV DS,AX
CALL COUNT
MOV AH,4CH
INT 21H
RET
MAIN ENDP
COUNT PROC NEAR
MOV AX,DATA
MOV DS,AX
MOV CX,CNT
MOV AL,0
LEA SI,GRADE
LOP1:MOV BX,[SI]
INC SI
CMP BX,60
JL NEXT
CMP BX,69
JG LOP2
MOV AL,C1
INC AL
MOV C1,AL
JMP NEXT
LOP2:CMP BX,79
JG LOP3
MOV AL,C2
INC AL
MOV C2,AL
JMP NEXT
LOP3:CMP BX,89
JG LOP4
MOV AL,C3
INC AL
MOV C3,AL
JMP NEXT
LOP4:CMP BX,99
JG LOP5
MOV AL,C4
INC AL
MOV C4,AL
JMP NEXT
LOP5:MOV AL,C5
INC AL
MOV C5,AL
NEXT:LOOP LOP1
MOV DX,OFFSET MES1
MOV AH,09H
INT 21H
MOV DL,C1
ADD DL,30H
MOV AH,02H
INT 21H
MOV DX,OFFSET MES2
MOV AH,09H
INT 21H
MOV DL,C2
ADD DL,30H
MOV AH,02H
INT 21H
MOV DX,OFFSET MES3
MOV AH,09H
INT 21H
MOV DL,C3
ADD DL,30H
MOV AH,02H
INT 21H
MOV DX,OFFSET MES4
MOV AH,09H
INT 21H
MOV DL,C4
ADD DL,30H
MOV AH,02H
INT 21H
MOV DX,OFFSET MES5
MOV AH,09H
INT 21H
MOV DL,C5
ADD DL,30H
MOV AH,02H
INT 21H
RET
COUNT ENDP
CODE ENDS
END START