当前位置:文档之家› 汇编语言版学生管理系统

汇编语言版学生管理系统

汇编语言课程实习报告实习题目学生成绩管理系统学生姓名班级(学号)院系指导老师提交时间成绩目录题目一:学生成绩管理系统 (3)二、总体设计 (4)程序主界面: (7)主程序流程图 (12)详细设计 (14)菜单模块 (14)输入模块 (15)主程序代码 (17)调试过程 (28)总结: (31)参考文献: (32)题目一:学生成绩管理系统基本功能:1、输入学生各门功课成绩;(假设3门功课,每门功课有唯一编号)2、对学生成绩记录进行查询检索(按学号、姓名)3、能修改指定学号的学生成绩;4、对学生成绩排序(按总成绩降序排列);5、、统计指定学号的学生的平均成绩在屏幕上显示;6、统计指定编号课程的平均成绩在屏幕上显示;7、每门课程成绩分析:在屏幕上显示3门课程的各个分数段的学生人数;(分数段为:>=90;80~89;70~79;60~69;<=59)8、退出系统功能二、总体设计功能结构图设计依据程序的功能需求,描述该系统功能的结构图如下:图1 系统功能结构图student strucnames db 18 dup ('$')maths dw?english dw?chinese dw?total dw0avg dw0student endsDATAS SEGMENTstu_array student 10 dup(<>)构建了student结构体,在存储方面使得结构变得简单。

insert proc nearinc numscur1 0altert mes7scur 1altert mes4sub bh,bhmov bl,numbindec bxcrlfmov ah,09lea dx,mesint 21hsub ah,ahmov al,28dmul nummov si,axscur 2mov ah,0ahlea dx,stu_array[si].namessub bh,bhmov bl,stu_array[si+1].namesmov stu_array[si+bx+2].names,'$'int 21hscur 3call decibinmov stu_array[si].maths,bxadd stu_array[si].total,bxscur 4call decibinmov stu_array[si].english,bxadd stu_array[si].total,bxscur 5call decibinmov stu_array[si].chinese,bxadd stu_array[si].total,bxmov bl,3mov ax, stu_array[si].totaldiv blsub ah,ahmov stu_array[si].avg,axretinsert endp用num做全局变量为学生的编号,在学生查询方面比较便利。

程序主界面:Insert子程序界面:Modify子程序界面:Query子程序界面:学生平均成绩分析界面:学科成绩界面:分数段界面:依据程序的功能的划分,各功能定义如下:(1)插入学生成绩功能名:insert功能描述:通过此功能可以插入一名学生的成绩信息,学号、姓名、语文成绩、数学成绩、英语成绩。

(2)学生平均成绩功能名:Printit功能描述:通过此功能指定学号的学生平均成绩(3)学科平均成绩功能名:Academic功能描述:通过此功能可以显示指定编号的学科平均成绩。

(4)查询学生成绩功能名:query功能描述:通过此功能可以查询一名学生的成绩信息,学号、姓名、语文成绩、数学成绩、英语成绩。

(5)修改学生成绩功能名:modify功能描述:通过此功能可以修改一名学生的成绩信息,学号、姓名、语文成绩、数学成绩、英语成绩。

(6)学生成绩排名功能名:rank功能描述:通过此功能可以查看学生成绩总分排名。

(7)各科分数段人数功能名:Analysiss功能描述:通过此功能可以查看每科分数段人数。

(8)退出学生成绩管理系统功能名:esc功能描述:退出成绩管理系统主程序流程图详细设计菜单模块student strucnames db 18 dup ('$')maths dw?english dw?chinese dw?total dw0avg dw0student endsDATAS SEGMENTstu_array student 10 dup(<>)recname db 18 dup('$')num db 0num1 dw0num2 dw0num3 dw0num4 dw0num5 dw0num6 dw0rec dw 0mes db' Name:',13,10db' Maths:',13,10db' English:',13,10db' Chinese:',13,10,'$'mes1 db' Can`t find the student!$'mes2 db'-------------------Main Menu------------------',13,10,13,10 db'I.Insert the information',13,10,13,10db'M.Modify the information',13,10,13,10db'Q.Query the student',13,10,13,10db'C.Char for query the student',13,10,13,10db'P.Printit the student average scores',13,10,13,10db'S.Student performance analysiss',13,10,13,10db'R.Rank of sum grade',13,10,13,10db'G.Academic average',13,10,13,10db'E.ESC',13,10,13,10db'-------Student Grade Management System--------',13,10,'$' mes3 db'Please input num of the student:$'mes4 db'Num of the student is:$'mes5 db'-------Query the student-----------$'mes6 db'-------Modify the information------$'mes7 db'-------Insert the information------$'mes8 db'-------Student average scores------',13,10db' Name:',13,10db'Avgscore:',13,10,'$'mes9 db'-------Maths Analysiss-------------',13,10db' >=90:',13,10db' 80~80:',13,10db' 70~79:',13,10db' 60~69:',13,10db' <=59:',13,10,'$'mes10 db'-------English Analysiss-----------',13,10db' >=90:',13,10db' 80~80:',13,10db' 70~79:',13,10db' 60~69:',13,10db' <=59:',13,10,'$'mes11 db'-------Chinese Analysiss-----------',13,10db' >=90:',13,10db' 80~80:',13,10db' 70~79:',13,10db' 60~69:',13,10db' <=59:',13,10,'$'mes12 db'There is no data!$'mes13 db'---------M->Avg of maths------------',13,10,13,10 db'---------N->Avg of english----------',13,10,13,10db'---------C->Avg of chinese----------',13,10db'Please input the char:$'mes14 db' Maths:$'mes15 db' English:$'mes16 db' Chinese:$'sum dw 30 dup(' ')输入模块menu:call clear_screenscur1 1push axpush bxpush cxpush dxpush simov ah,2mov bh,0mov dh,1mov dl,0int 10hmov ah,09lea dx,mes2int 21hmov ah,1int 21hcmp al,'i'jz iicmp al,'q'jz qqcmp al,'m'jz mmcmp al,'p'jz PPcmp al,'s'jz ss2cmp al,'c'jz cccmp al,'r'jz rrcmp al,'g'jz ggcmp al,'e'jz eejmp menugg:call clear_screencall Academic_averagejmp menurr:call clear_screencall rankjmp menuii:call clear_screencall insertjmp menuqq:call clear_screencall queryjmp menumm:call clear_screencall modifyjmp menupp:call clear_screencall student_pjmp menuss2:call clear_screencall score_analysisjmp menucc:call clear_screencall query_charjmp menu;此处输入代码段代码ee:MOV AH,4CHINT 21H主程序代码START:MOV AX,DATASMOV DS,AXmenu:call clear_screenscur1 1push axpush bxpush cxpush dxpush simov ah,2mov bh,0mov dh,1mov dl,0int 10hmov ah,09lea dx,mes2int 21hmov ah,1int 21hcmp al,'i'jz iicmp al,'q'jz qqcmp al,'m'jz mmcmp al,'p'jz PPcmp al,'s'jz ss2cmp al,'c'jz cccmp al,'r'jz rrcmp al,'g'jz ggcmp al,'e'jz eejmp menugg:call clear_screencall Academic_averagejmp menurr:call clear_screencall rankjmp menuii:call clear_screencall insertjmp menuqq:call clear_screencall queryjmp menumm:call clear_screencall modifyjmp menupp:call clear_screencall student_pjmp menuss2:call clear_screencall score_analysisjmp menucc:call clear_screencall query_charjmp menu;此处输入代码段代码ee:MOV AH,4CHINT 21H;********************子程序代码query_char proc nearcmp num,0jz qc_exitmov ah,0ahlea dx,recnameint 21hsub bh,bhmov bl,recname+1mov recname[bx+2],'$'scur 1sub ah,ahmov al,28dmul nummov bx,axmov ah,09lea dx,stu_array[bx].namesadd dx,2int 21hcrlflea dx,recnameadd dx,2mov ah,09int 21hlea di,recnameadd di,2lea si,stu_array[bx].namesadd si,1sub ch,chmov cl,recname+1cldrepz cmpsbjz qc_exit1crlfsub dh,dhmov dl,numqc_loop:sub ah,ahmov al,28dmul nummov si,axlea di,stu_array[si].namesadd di,2lea si,recnameadd si,1sub ch,chmov cl,recname+1cldrepz cmpsbjz qc_exit1dec dlcmp dl,0jz qc_exitjmp qc_loopqc_exit:scur 6altert mes1crlfqc_exit1:mov ah,01mov dl,0ahint 21hretquery_char endp;**********************insert proc nearinc numscur1 0altert mes7scur 1altert mes4sub bh,bhmov bl,numbindec bxcrlfmov ah,09lea dx,mesint 21hsub ah,ahmov al,28dmul nummov si,axscur 2mov ah,0ahlea dx,stu_array[si].namessub bh,bhmov bl,stu_array[si+1].namesmov stu_array[si+bx+2].names,'$'int 21hscur 3call decibinmov stu_array[si].maths,bxadd stu_array[si].total,bxscur 4call decibinmov stu_array[si].english,bxadd stu_array[si].total,bxscur 5call decibinmov stu_array[si].chinese,bxadd stu_array[si].total,bxmov bl,3mov ax, stu_array[si].totaldiv blsub ah,ahmov stu_array[si].avg,axretinsert endp;**************************** query proc nearscur1 0altert mes5crlfmov ah,09lea dx,mesint 21hsno:sub dh,dhmov dl,numaltert mes3call decibinq:cmp dx,0jz errorcmp bx,dxjz idec dxcmp dx,0jz errorjmp qi:sub ah,ahmov al,28dmul dlmov si,axscur 1mov ah,09lea dx,stu_array[si].namesadd dx,2int 21hcrlfscur 2bindec stu_array[si].mathscrlfscur 3bindec stu_array[si].englishcrlfscur 4bindec stu_array[si].chinesemov ah,1mov dl,0ahint 21hjmp q_exiterror:mov ah,09lea dx,mes1int 21hcrlfmov ah,1mov dl,0ahint 21hq_exit:retquery endp;********************************** modify proc nearscur1 0altert mes6crlfmov ah,09lea dx,mesint 21hsno1:sub dh,dhmov dl,numaltert mes3call decibinq1:cmp dx,0jz error1cmp bx,dxjz i1dec dxcmp dx,0jz error1jmp q1i1:sub ah,ahmov al,28dmul dlmov si,axscur 1mov ah,0ahlea dx,stu_array[si].namesint 21hsub bh,bhmov bl,stu_array[si+1].namesmov stu_array[si+bx+2].names,'$'call decibinmov stu_array[si].maths,bxadd stu_array[si].total,bxscur 3call decibinmov stu_array[si].english,bxadd stu_array[si].total,bxscur 4call decibinmov stu_array[si].chinese,bxadd stu_array[si].total,bxmov bl,3mov ax, stu_array[si].totaldiv blsub ah,ahmov stu_array[si].avg,axjmp m_exiterror1:crlfmov ah,09lea dx,mes1int 21hcrlfmov ah,1mov dl,0ahint 21hm_exit:retmodify endp;*********************************** score_analysis proc nearsub ch,chmov cl,nummov dx,cxcmp cx,0jz s_aexitloop1: ;mathscall loop2loop loop1scur1 0altert mes9scur 1bindec num1crlfscur 2bindec num2crlfscur 3bindec num3crlfscur 4bindec num4crlfscur 5bindec num5crlfmov num1,0mov num2,0mov num3,0mov num4,0mov num5,0;**************************sub ch,chmov cl,nummov dx,cxcmp cx,0jz s_aexitloop5: ;englishcall loop3loop loop5scur1 6altert mes10scur 7bindec num1crlfscur 8bindec num2crlfscur 9bindec num3crlfscur 10bindec num4crlfscur 11bindec num5crlfmov num1,0mov num2,0mov num3,0mov num4,0;****************************** sub ch,chmov cl,nummov dx,cxcmp cx,0jz s_aexitloop6: ;chinesecall loop4loop loop6scur1 12altert mes11scur 13bindec num1crlfrank proc nearscur1 0altert mes17cmp num,0jz r_exit1mov bx,0sub ch,chmov cl,nummov si,0xch:add si,28dadd bx,2mov ax,stu_array[si].totalmov sum[bx],axloop xchsub bh,bhmov bl,numfmax1:inc scuinc ranknumcall fmaxdec bxjnz fmax1jmp r_exitr_exit1:scur 2altert mes12jmp r_exit0r_exit:mov bx,0sub ch,chxch1:add bx,2mov ax,0mov sum[bx],axloop xch1mov scu,1mov ranknum,0r_exit0:mov ah,01mov dl,0ahint 21hretrank endp;*****************************fmax proc nearpush bxsub ah,ahmov cl,nummov ax,summov bx,2mov si,0 ;偏移地址初始为0,放在sis:cmp ax,sum[bx]jb ajmp ba:mov ax,sum[bx];mov si,bx ;记录值大的偏移地址b:add bx,2loop smov ax,sum[si]mov max,axsub bh,bhmov bl,2mov ax,sidiv blmov maxnum2,axmov bx,siscur1 scubindec maxnum2scur2 scubindec maxsub ah,ahmul blmov bx,axscur sculea dx,stu_array[bx].namesadd dx,2mov ah,09int 21hscur3 scubindec ranknumcrlfmov sum[si],0pop bxretfmax endp调试过程使用说明:根据界面输入字母即可调用全部功能总结:这学期通过学习汇编程序设计,使我认识到它是计算机语言里的第一个语言。

相关主题