希望能在论坛上找到解决方法
题目二: 学生成绩管理
功能描述:
1. 输入学生成绩,每个学生的成绩包括学号、姓名(英文字母)、及三门课的成绩,长度自定。为了简单,也可以不从键盘输入数据,直接在数据段定义学生数据即可。
2. 可按姓名对学生成绩记录进行检索。
3. 显示单科有不及格的学生情况。
注意:显示数据程序见参考资料1(沈美明)p161
assume cs:code,ds:data,ss:stack
data segment
welcom db 0ah,0dh,0ah,0dh,' Welcome to use this program',0ah,0dh
db ' 1.Input the mark',0ah,0dh
db ' 2.Search the name',0ah,0dh
db ' 3.Show the fail',0ah,0dh
db ' 4.Exit',0ah,0dh,'$'
shwcj1 db 0ah,0dh,' name:','$'
shwcj2 db 0ah,0dh,' number: yuwen: shuxue: yingyu: ','$'
shwcj3 db 0ah,0dh,' the fail:',0ah,0dh,'$'
wrong1 db ' Can not fround the name',0ah,0dh,'$'
search db ' Input the name',0ah,0dh,'$'
likef3 db ' Input the marks',0ah,0dh,'$'
likef1 db ' Like: ',0ah,0dh
db ' 4',0ah,0dh
db ' qiuyiqun',0ah,0dh,'$'
likef4 db ' Like: qiuyiqun',0ah,0dh,'$'
likef2 db ' 2008957001 90 90 90',0ah,0dh,'$'
kyword db 20 dup(' ')
name1 db 20 dup(' ')
name2 db 20 dup(' ')
name3 db 20 dup(' ')
name4 db 20 dup(' ')
chji1 db 20 dup(' ')
chji2 db 20 dup(' ')
chji3 db 20 dup(' ')
chji4 db 20 dup(' ')
data ends
stack segment
jcqdz db 30,?,30 dup(?)
stack ends
code segment
; ------------------------------ 主程序
main: mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
again: mov ax,0
lea dx,welcom ; 输出首语
mov ah,9
int 21h
mov ah,1 ; 输入选项
int 21h
call inpt
call srch
call show
cmp al,'4' ; 进入选择4
je exit
jmp again ; 无条件循环
exit: mov ax,4c00h
int 21h
; ------------------------------- 回车换行 cler
cler proc near
push ax
push dx
mov dl,0dh
mov ah,2
int 21h
mov dl,0ah
mov ah,2
int 21h
pop dx
pop ax
ret
cler endp
; ------------------------------- 输入学生成绩数据 inpt
inpt proc near
push ax
push ds
push dx
cmp al,'1'
jne s1
call cler
lea dx,likef3 ; 输出范例句
mov ah,9
int 21h
lea dx,likef1
mov ah,9
int 21h
lea dx,likef2
mov ah,9
int 21h
mov ah,1
int 21h
call cler
sub al,48
mov cx,0
mov cl,al ; 最多四组数据
lea bx,name1
hh: lea dx,[bx] ; 输入名字
mov ah,10
int 21h
call cler
lea dx,[bx+80] ; 输入成绩
mov ah,10
int 21h
call cler
add bx,20
loop hh
s1: pop dx
pop ds
pop ax
ret
inpt endp
; --------------------------------- 根绝名字查找成绩 srch
srch proc near
push ax
push ds
push dx
push bx
cmp al,'2'
jne s2
call cler
lea dx,search ; 提示输入方式
mov ah,9
int 21h
lea dx,likef4
mov ah,9
int 21h
lea dx,kyword ; 输入关键字
mov ah,10
int 21h
mov ax,ds
mov es,ax
lea si,name1
mov cx,4 ; 设置循环变量,查找名字组
sc: lea di,kyword
mov dx,16 ; 设置内循环变量
mov bx,si
x: mov al,[si]
cmp al,[di]
jne next ; 不相等就转跳
cmp di,16
je right
inc si
inc di
dec dx
jnz x
right: call swjg
jmp again
next:
mov si,[bx+16] ; 指向下一个字符串
loop sc
lea dx,wrong1 ; 屏显找不到该名字
mov ah,9
int 21h
s2: pop bx
pop dx
pop ds
pop ax
ret
srch endp
; --------------------------------- 显示名字与成绩 swjg
swjg proc near
push ax
push bx
push dx
push si
call cler
mov ax,0
lea dx,[shwcj1]
mov ah,9
int 21h
lea dx,[bx]
mov ah,9
int 21h
lea dx,[shwcj2]
mov ah,9
int 21h
lea dx,[bx+80]
mov ah,9
int 21h
pop si
pop dx
pop bx
pop ax
ret
swjg endp
; --------------------------------- 显示不及格的成绩 show
show proc near
push dx
push ax
push bx
push si
push bp
cmp al,'3'
jne s3
call cler
lea dx,shwcj3
mov ah,9
int 21h
mov bx,11
mov cx,4
lea si,chji1
bjg: mov dx,6
mov ax,si
c: mov bp,[si+bx]
cmp bp,'60'
jb tt
add bx,3
dec dx
jnz c
add si,20
loop bjg
s3: pop bp
pop si
pop bx
pop ax
pop dx
ret
show endp
tt: push ax
push bx
mov bx,ax
call swjg
pop bx
pop ax
ret
code ends
end main
Copyright (C) Microsoft Corp 1981-1997. All rights reservd.
Assembling: C:\\Documents and Settings\\Administrator\\桌面\\Asm2\\ssglxt.asm
C:\\Documents and Settings\\Administrator\\桌面\\Asm2\\ssglxt.asm(234) : error A2008: syntax error : c
C:\\Documents and Settings\\Administrator\\桌面\\Asm2\\ssglxt.asm(239) : error A2008: syntax error : c
C:\\Documents and Settings\\Administrator\\桌面\\Asm2\\ssglxt.asm(42) : error A2004: symbol type conflict
C:\\Documents and Settings\\Administrator\\桌面\\Asm2\\ssglxt.asm(44) : error A2004: symbol type conflict
C:\\Documents and Settings\\Administrator\\桌面\\Asm2\\ssglxt.asm(261) : warning A4023: with /coff switch, leading underscore required for start address : main
_
Assembly Error
怎么不报错?!
cmp bp,'60'
jb tt
add bx,3
dec dx
jnz c
把c换成其他字符就不会报错了(我试运行过了)
In recentGhd Straighteners Ireland
years, as the capital's economic and social development of strength, the Central enterprises, universities, research christian louboutin very prive institutions, industry christain louboutin technology Alliance and louboutin wedding shoes the role ofchristian louboutin peep toe private enterprises increasingly, to accelerate the shift of capital and economic development, promotelouboutin rolando the industrial structure upgrade instilled greater dynamism and vitality. Beijing attaches great importance to the Christian Shoesdevelopment of these units, special invitations presence of representatives of these units in the first half of the economic situation analysis, and during the Conference held a forum dedicated to listen to everyone in their own development needs and the economic and social development of the capital city of Bruxelles.
Marie Curie
Helen keller
Mitchell Margaret
Emily Bronte
Charlotte Bronte
Anne Bronte
Willa Cather
Jane Austen
Margaret Hilda
Gabriele Munter