我编的汇编程序,有问题,请高手赐教修改下!!!

来源:百度知道 编辑:UC知道 时间:2024/06/01 17:10:48
编写统计学生程序,设有十个学生成绩分别是:56 69 84 82 73 88 99 63 100 80,统计低于60分,60~70,70~79,80~89,90~99及100分的人数,并存放到S5, S6, S7, S8, S9, S10的单元中,并显示。

data segment
score db 56,69,84,82,73,88,99,63,100,80
s5 db ?
s6 db ?
s7 db ?
s8 db ?
s9 db ?
s10 db ?
data ends
code segment
assume ds:data,cs:code
start:
mov ax,data
mov ds,ax

mov cx,100
next:
lea si score

mov al,[si]
cmp al,60
jb nextn
inc s5
cmp al,70
jnb next7
inc s6
jmp nextn
next7:
cmp al,80
jnb next8
inc s7
jmp nextn
next8:
cmp al,90
jnb next9
inc s8
jmp nextn
next9:
cmp al,100
jnb next10
inc s9
jmp nextn
next10:
jne nextn
inc s10

nextn:
inc si
loop next
mov ah,1
int 21h
mov ax,4c00h
int 21h
code ends
end start

; 下面的程序是16位汇编,编译通过,运行正确。

; Program Name: Statistic.asm

Statistic SEGMENT
ASSUME CS:Statistic,DS:Statistic
ORG 100H

Start: jmp Begin

Score DB 56,69,84,82,73,88,99,63,100,80 ; 10名同学的成绩
Resault DB ' <60: '
Less60 DB '0',13,10
DB '60-69: '
Score6069 DB '0',13,10
DB '70-79: '
Score7079 DB '0',13,10
DB '80-89: '
Score8089 DB '0',13,10
DB '90-99: '
Score9099 DB '0',13,10
DB ' =100: '
Score100 DB '0',13,10,'$'

Score_Tab DW Less60,Score6069,Score7079,Score8089,Score9099,Score100 ; 各分数段计数地址

Begin: lea si,Score ; 成绩首地址
mov cx,10 ; 10名同学
mov dl,10 ; 用于除10
cld
Read_Score:lodsb ; 提取成绩
div dl ; 除10
cmp al,