stack segment stack 'stack'
dw 32 dup(0)
stack ends
data segment
SCORE DB 78,80,95,98,99,91,90,88,85,87,87,89,70,73,74
DB 72,78,74,77,71,70,60,65,68,62,66,55,50,48,30
COUNT DB 0AH,0DH,'>=90 :$'
DB 0AH,0DH,'80~89:$'
DB 0AH,0DH,'70~79:$'
DB 0AH,0DH,'60~69:$'
DB 0AH,0DH,'<60 :$'
TAB DW 5 DUP(0)
data ends
code segment
begin proc far
assume ss: stack, cs: code, ds: data
push ds
sub ax, ax
push ax
mov ax, data
mov ds, ax
MOV BX, 0
MOV CH, 10
MOV DI, 0
AGAIN: CMP BX, 30
JZ OBJ
MOV AL, SCORE[BX]
INC BX
CMP AL, 90
JNC P0
CMP AL, 80
JNC P1
CMP AL, 70
JNC P2
CMP AL, 60
JNC P3
JMP P4
OBJ: CMP DI, 10
JC NS
MOV CH, 0
NA: MOV AX,0
MOV AL, 9
MUL CH
MOV BX, AX
MOV DX, OFFSET COUNT[BX]
MOV AH, 9
INT 21H
MOV AX,0
MOV AL,2
MUL CH
MOV BX, AX