;编的不好,凑合看吧
;在以ENGLISH为首址的字节存贮区中,顺序存放着100名学生的英语考试成绩,请统计其中60分以下的学生人数→DX,如DX
;为0则显示“GOOD!”,否则显示“POOR!”。试编其程序。
title proc410
page 60,132
display macro message
mov ah,9
mov dx,offset message
int 21h
endm
stseg segment stack
db 64 dup(?)
stseg ends
dtseg segment
english db 80,86,77,62,53
message1 db 'poor','$'
message2 db 'good','$'
dtseg ends
cdseg segment
main proc far
assume ds:dtseg,cs:cdseg,ss:stseg
mov ax,dtseg
mov ds,ax
mov bx,offset english
mov cx,5
sub dx,dx
again: cmp byte ptr [bx],60
jc next
inc bx
loop again
jmp end1
next: inc bx
inc dx
loop again
end1: cmp dx,0
je good
display message1
jmp end2
good: display message2
end2: mov ah,4ch
int 21h
main endp
cdseg ends
end main