我的一个汇编语言的循环程序设计运行时提示有一个错误,但又不知道哪里错了,请大家帮帮忙,谢谢!
DSEGENDSCSEGSEGMENTassumecs:CSEG,ds:DSEGstart:movax,dsegmovds,axmovdi,10movbx,0loop:m...
DSEG ENDS
CSEG SEGMENT
assume cs:CSEG, ds:DSEG
start: mov ax, dseg
mov ds, ax
mov di,10
mov bx,0
loop:
mov ax,grade[bx]
mov dx,1
mov cx,10
lea si,grade
next:
cmp ax,[si]
jge no_count
inc dx
no_count:
add si,2
loop next
mov rank[bx],dx
add bx,2
dec di
jne loop
mov ax, 4c00h
int 21h
CSEG ENDS
end start 展开
CSEG SEGMENT
assume cs:CSEG, ds:DSEG
start: mov ax, dseg
mov ds, ax
mov di,10
mov bx,0
loop:
mov ax,grade[bx]
mov dx,1
mov cx,10
lea si,grade
next:
cmp ax,[si]
jge no_count
inc dx
no_count:
add si,2
loop next
mov rank[bx],dx
add bx,2
dec di
jne loop
mov ax, 4c00h
int 21h
CSEG ENDS
end start 展开
1个回答
展开全部
DSEG SEGMENT;缺少数据段定义开始伪操作
GRADE DW 10 DUP(?);需要对变量进行定义
RANK DW 10 DUP(?);需要对变量进行定义
DSEG ENDS
CSEG SEGMENT
assume cs:CSEG, ds:DSEG
start: mov ax, dseg
mov ds, ax
mov di,10
mov bx,0
loop1: ;loop是循环指令助词符,不能用做指令标号,故改成loop1
mov ax,grade[bx]
mov dx,1
mov cx,10
lea si,grade
next:
cmp ax,[si]
jge no_count
inc dx
no_count:
add si,2
loop next
mov rank[bx],dx
add bx,2
dec di
jne loop1
mov ax, 4c00h
int 21h
CSEG ENDS
end start
GRADE DW 10 DUP(?);需要对变量进行定义
RANK DW 10 DUP(?);需要对变量进行定义
DSEG ENDS
CSEG SEGMENT
assume cs:CSEG, ds:DSEG
start: mov ax, dseg
mov ds, ax
mov di,10
mov bx,0
loop1: ;loop是循环指令助词符,不能用做指令标号,故改成loop1
mov ax,grade[bx]
mov dx,1
mov cx,10
lea si,grade
next:
cmp ax,[si]
jge no_count
inc dx
no_count:
add si,2
loop next
mov rank[bx],dx
add bx,2
dec di
jne loop1
mov ax, 4c00h
int 21h
CSEG ENDS
end start
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询