汇编中结构体示例

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

实验内容学生成绩管理系统数据输出格式:学号姓名数学英语汇编总分实验要求给出本题目的设计方案,程序设计的流程图,操作步骤,实施办法。2、每个学生的姓名、各门学习成绩由键盘输入并完成相应的数据转换操作(键盘输入操作应有文字提示)。3、计算每个学生的总分成绩,填入相应的存储单元。4、按照总分成绩进行排序(从高到低)。5、按照规定格式进行数据输出显示操作。6、本课题的数据采集至少在5人以上的数据。7、给出调试通过的程序清单,并附文档说明书。8、给出调试中所遇到的问题及解决办法和体会。代码为:crlfmacromovdl,13movah,02hint21hmovdl,10int21hendmstudentstrucnumberdb9dup('$')namesdb9dup('$')mathsdw?englishdw?assembledw?totaldw0studentendsdatasegmentstu_arraystudent10dup();开辟10个学生信息的空间menudb13,10,13,10,13,10,13,10,13,10db'------------MainMenu--------------',13,10db'1.createtheinformationofstudents',13,10db'2.figureoutthetotalscores',13,10db'3.rankthedatas',13,10db'4.displaytheinformation',13,10db'5.exit',13,10db'-----------------------------------',13,10db'pleaseinputyourchioce:$'point_infordb0dh,0ah,'pleasepressanykeytocontinue';'请按任意键继续';input_numdb'pleaseinputthenumberofstudents:$'input_infordb'numnamemathsenglishassemble',0dh,0ah,'$'add_infordbthetotalofstudent'sscoresiscompleted,0dh,0ah,'$'rank_infordbrankingthestudent'sscoresiscompleted,0dh,0ah,'$'disp_infordb'numnamemathsenglishassembletotal',0dh,0ah,'$'chiocedw?numdw?dataendsprogramsegmentassumecs:program,ds:datastart:pushds;保存旧数据段subax,axpushaxmovax,data;设置新数据段movds,axmain_menu:movax,0003h;清屏int10hleadx,menu;输出主菜单movah,09hint21hleadi,chioce;接收选择callinputcmpchioce,1h;根据选择判断跳转jzcreatecmpchioce,2hjzfigurecmpchioce,3hjzrankcmpchioce,4hjzdispcmpchioce,5hjzexit0jmpmain_menu;===========输入=========================create:callsetdatajmpmain_menu;=============连加========================figure:callfigure_totaljmpmain_menu;=============排序========================rank:callarrangejmpmain_menu;=============显示========================disp:calldisplay_inforjmpmain_menu;=============退出========================exit0:MOVAH,4CHINT21H;=============输入数据子程序==============inputprocnearmovbx,0movwordptr[di],0newchar:movah,1hint21hsubal,30hjlexitcmpal,10jnlexitincbxcbwxchgax,wordptr[di]movcx,10mulcxxchgax,wordptr[di]addwordptr[di],axjmpnewcharexit:movcx,6hsubbx,cxsk:MOVDL,''MOVAH,2INT21Hloopskretinputendp;==========读入学号和姓名子程序==============Input_Wordprocnear;movcx,8New_Word:movah,1int21hmovbyteptr[di],alcmpal,''jznext1incdiloopNew_Wordnext1:deccx;cx=cx-1next2:incdi;di=di+1MOVDL,'';show''MOVAH,02HINT21Hmoval,''movbyteptr[di],alloopnext2retInput_Wordendp;===========显示字符串子程序==============displprocnearpushaxpushdxmovah,9movdx,diint21hpopdxpopaxretdisplendp;==========以十进制输出子程序==============OUTPUTPROCNEARMOVBX,10MOVCX,0LAST:MOVDX,0DIVBXPUSHDXINCCXCMPAX,0JNZLASTmovbx,8hsubbx,cxAG:POPDXADDDL,30HMOVAH,2INT21HLOOPAGmovcx,bxsh:MOVDL,''MOVAH,2INT21HloopshRETOUTPUTENDP;==============交换结构体子程序============exchangeprocnearmovsi,0continue:movax,wordptrstu_array[bx+si].numberxchgax,wordptrstu_array[bx+si+26].numbermovwordptrstu_array[bx+si].number,axmovax,wordptrstu_array[bx+si].namesxchgax,wordptrstu_array[bx+si+26].namesmovwordptrstu_array[bx+si].names,axcmpsi,06hjznexttoaddsi,2jmpcontinuenextto:movax,stu_array[bx].mathsxchgax,stu_array[bx+26].mathsmovstu_array[bx].maths,axmovax,stu_array[bx].englishxchgax,stu_array[bx+26].englishmovstu_array[bx].english,axmovax,stu_array[bx].assemblexchgax,stu_array[bx+26].assemblemovstu_array[bx].assemble,axmovax,stu_array[bx].totalxchgax,stu_array[bx+26].totalmovstu_array[bx].total,axretexchangeendp;============读入子程序=============setdataprocnearmovax,0003hint10hleadx,input_nummovah,09hint21hleadi,numcallinputcrlfleadi,input_inforcalldisplmovcx,nummovsi,0LLL:pushcxleadi,stu_array[si].number;InputnumbercallInput_Wordleadi,stu_array[si].names;InputnamescallInput_Wordleadi,stu_array[si].maths;Inputmathscallinputleadi,stu_array[si].english;Inputenglishcallinputleadi,stu_array[si].assemble;Inputassemblecallinputpopcxcrlfaddsi,26loopLLLleadi,point_inforcalldisplmovah,1int21hretsetdataendp;================求和子程序==========figure_totalprocnearmovax,0003hint10hmovcx,nummovsi,0ad:movax,stu_array[si].mathsadcax,stu_array[si].englishadcax,stu_array[si].assemblemovstu_array[si].total,axaddsi,26loopadleadi,add_inforcalldisplleadi,point_inforcalldisplmovah,1int21hretfigure_totalendp;================排序子程序==========arrangeprocnearmovax,0003hint10hmovcx,numDECCXLOOP1:MOVDI,CXMOVBX,0LOOP2:MOVAX,stu_array[bx].totalCMPAX,stu_array[bx+26].totaljgegonextcallexchangegonext:ADDBX,26LOOPLOOP2MOVCX,DILOOPLOOP1leadi,rank_inforcalldisplleadi,point_inforcalldisplmovah,1int21hretarrangeendp;==============显示信息子程序============display_inforprocnearmovax,0003hint10hleadi,disp_inforcalldisplmovcx,nummovsi,0show:pushcxleadi,stu_array[si].numbercalldisplleadi,stu_array[si].namescalldisplmovax,stu_array[si].mathscalloutputmovax,stu_array[si].englishcalloutputmovax,stu_array[si].assemblecalloutputmovax,stu_array[si].totalcalloutputcrlfpopcxaddsi,26loopshowleadi,point_inforcalldisplmovah,1int21hretdisplay_inforendpprogramendsendstart

1 / 8
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功