试题详情
简答题数组SCORE中存有一个班级40名学生的英语课程成绩。按照0~59,60~74,75~84,85~100统计各分数段人数,存入N0,N1,N2,N3变量内。
  • DATASEGEMNT
    SCORE DW 40 DUP(?);运行前置入具体数据
    N0 DW ?
    N1 DW ?
    N2 DW ?
    N3 DW ?
    DATAENDS
    CODESEGMENT
    ASSUME CS:CODE,DS:DATA
    START:
    MOV AX,DATA
    MOV DS,AX
    MOV N0,0;各计数器清零
    MOV N1,0
    MOV N2,0
    MOV N3,0
    LEA SI,SCORE
    MOV CX,40
    AGAIN:MOV AX,[SI]
    CMP AX,59;分段测试
    JAL1
    L0:INC N0
    JMP NEXT
    L1:CMP AX,74
    JA L2
    INC N1
    JMP NEXT
    L2:CMP AX,84
    JA L3
    INC N2
    JMP NEXT
    L3:CMP AX,100
    JAN EXT
    INC N3
    NEXT:ADD SI,2
    LOOP AGAIN
    EXIT:MOV AX,4C00H
    INT 21H
    CODEENDS
    END START
  • 关注下方微信公众号,在线模考后查看

热门试题