班级通信录管理系统的设计与实现汇编语言课程实习报告.doc

上传人:文库蛋蛋多 文档编号:2392956 上传时间:2023-02-17 格式:DOC 页数:21 大小:116KB
返回 下载 相关 举报
班级通信录管理系统的设计与实现汇编语言课程实习报告.doc_第1页
第1页 / 共21页
班级通信录管理系统的设计与实现汇编语言课程实习报告.doc_第2页
第2页 / 共21页
班级通信录管理系统的设计与实现汇编语言课程实习报告.doc_第3页
第3页 / 共21页
班级通信录管理系统的设计与实现汇编语言课程实习报告.doc_第4页
第4页 / 共21页
班级通信录管理系统的设计与实现汇编语言课程实习报告.doc_第5页
第5页 / 共21页
点击查看更多>>
资源描述

《班级通信录管理系统的设计与实现汇编语言课程实习报告.doc》由会员分享,可在线阅读,更多相关《班级通信录管理系统的设计与实现汇编语言课程实习报告.doc(21页珍藏版)》请在三一办公上搜索。

1、 汇编语言课程实习报告实习题目 班级通信录管理系统的设计与实现学生姓名 班级(学号) 院系 信息学院计算机系指导老师 叶晓霞提交时间 班级通信录管理系统的设计与实现1.需求说明: 建立一个班级通信录,可以实现添加、删除、修改、查询一个同学的通信记录;显示所有同学的通信记录;能根据姓名或宿舍号进行排序。通信录包括学号、姓名、电话号码、宿舍号等信息,所有信息最终用文件保存。2.设计说明:以参数形式建立个人的文件,如:你名字为cac,则调用tongxun.exe文件时,以cac为参数,你应输入c: tongxun cac,这样就建立了一个cac的文件记录你收藏的通信资料。将段前缀的说明部分单独作为一

2、段,并将DS固定指向该段;其他数据单元(提示信息等)另设一段,以ES固定指向该段,在引用该段变量时加上ES段前缀即可。3.详细的算法描述: 3.1 程序界面 如上图,0-8八个选项分别实现不同的功能。依次是增加、删除、修改、查询、显示全部信息、生成、按名排列、按寝室排序、退出。3.2 程序思想 在这个实验中,主要的就是子程序的应用这方面,其中修改,删除的子程序都以查找核心算法为基础。这方面的铺垫工作做好后再做好每一块的工作,最后检查下,程序就能完好的运行了。4.源程序与执行结果: 4.1.主要程序代码: dataseg segmenttitlestrdbStudent NO. Name Pho

3、ne Dormitory ,0dh,0ah,$titlelen equ $ - titlestritemrowdbtitlelen dup ( ),0dh,0ah,$handledw?showindb0memptrdw?searchnumberdb20dup( )searchstrdb30dup( )searchphonedb20dup( )searchdormdb20dup( )searchndb0exactmatchdb0inputbufdb34actlendb?inputstrdb34dup( )infomsg1dbInfo: Give your command below ,0dh,0

4、ah,$ infomsg2dbWarning: Unrecognized command,type again ,0dh,0ah,$ infomsg3dbInfo: Input your name below ,0dh,0ah,$ infomsg4dbInfo: Input your phone number below ,0dh,0ah,$ infomsg5dbInfo: Input the number of item below ,0dh,0ah,$ infomsg6dbInfo: Input your student no. below ,0dh,0ah,$ infomsg7dbInf

5、o: Input your dormitory number below ,0dh,0ah,$ msgemptydb,0dh,0ah,$ msg0 db=,0dh,0ah db| |,0dh,0ah db| Welcome to use Address List 0.1 alpha |,0dh,0ah db| |,0dh,0ah db=,0dh,0ah,$msgmenu db0dh,0ah db-,0dh,0ah dbPlease choose an operation:(0-8),0dh,0ah db1- Add 2- Delete 3- Modify,0dh,0ah db4- Query

6、5- List 6- Create,0dh,0ah db7- Sort(name) 8- Sort(dorm) 0- Exit ,0dh,0ah db-,0dh,0ah,$ msgblank db ,$ pathname dbaddress.txt,0 msg1 db Cannot find address.txt ,0dh,0ah,$ msg2 db Program Will Create the File address.txt ,0dh,0ah,$ msg4 db Open File Successfully ,0dh,0ah,$ msg5 db Create File Fail ,0d

7、h,0ah,$ msg6 db Program Terminate ,0dh,0ah,$ msg7 db Create File Successfully ,0dh,0ah,$ msg8 db Read file failed,exit ,0dh,0ah,$ msg9 db Write file failed,exit ,0dh,0ah,$ msgfind db The item you found is: ,0dh,0ah,$ msgferr db Cannot find the item ,0dh,0ah,$ msgferr2 db Check your input! ,0dh,0ah,$

8、msglen equ$ - msgferr2;file buffer recordsizeequ20+30+20+20 filebufdb0 itemlistdb10 dup(20 dup(0),30 dup(0),20 dup(0),20 dup(0)dataseg endscodeseg segmentassume cs:codeseg,ds:dataseg,es:dataseg,ss:datasegmainprocfarpush dsxor ax,axpush axmov ax,datasegmov ds,axmov es,axlea dx,msg0call showmsgcall fi

9、ndfilecall getcommandretmainendpshowmsgprocnearmov ah,9int 21hretshowmsgendpgetcommandprocneargcinput:lea dx,msgmenumov ah,9int 21hmov ah,7 ; get inputint 21hgetcom:cmp al,1jne gc2call additemjmp gcinputgc2:cmp al,2jne gc3call delitemjmp gcinputgc3:cmp al,3jne gc4call edititemjmp gcinputgc4:cmp al,4

10、jne gc5call queryitemjmp gcinputgc5:cmp al,5jne gc6call listitemsjmp gcinputgc6:cmp al,6jne gc7call createfilejmp gcinputgc7:cmp al,7jne gc8call sortnamejmp gcinputgc8:cmp al,8jne gc9call sortdormjmp gcinputgc9:cmp al,0jne gc10call closefileretgc10:jmp gcinputgcexit:retgetcommandendpadditem proc nea

11、rcall getnumbercall getnamecall getphonecall getdormlea di,filebuf ;content starts here inc di mov al,filebuf mov bl,recordsize mul bl add di,ax addstr: lea si,searchnumber mov cx,20 cld rep movsb lea si,searchstr mov cx,30 cld rep movsb mov cx,20 lea si,searchphone cld rep movsb lea si,searchdorm m

12、ov cx,20 cld rep movsb inc filebufretadditem endpgetnumber proc near lea dx,infomsg6 mov ah,9 int 21hgetno: mov ah,0ah lea dx,inputbuf int 21h cmp actlen,0 jbe getno cmp actlen,20 jbe getnonext mov actlen,20getnonext: mov cl,actlen mov ch,0 lea si,inputstr lea di,searchnumber cld rep movsb retgetnum

13、ber endpgetname proc nearlea dx,infomsg3 mov ah,9 int 21hgetn: mov ah,0ah lea dx,inputbuf int 21h cmp actlen,0 jbe getn cmp actlen,20 jbe getnnext mov actlen,20getnnext: mov cl,actlen mov ch,0 lea si,inputstr lea di,searchstr cld rep movsb retgetname endpgetphone proc near lea dx,infomsg4 mov ah,9 i

14、nt 21hgetp: mov ah,0ah lea dx,inputbuf int 21h cmp actlen,0 jbe getp cmp actlen,20 jbe getpnext mov actlen,20getpnext: mov cl,actlen mov ch,0 lea si,inputstr lea di,searchphone cld rep movsb retgetphone endpgetdorm proc nearlea dx,infomsg7 mov ah,9 int 21hgetd: mov ah,0ah lea dx,inputbuf int 21h cmp

15、 actlen,0 jbe getd cmp actlen,20 jbe getdnext mov actlen,20getdnext: mov cl,actlen mov ch,0 lea si,inputstr lea di,searchdorm cld rep movsb retgetdorm endpsearchprocnearmov exactmatch,0lea si,filebufmov al,siinc simov di,sisub di,recordsizepush disealoop:pop di ; cuz cmpsb chaned it, so restoreadd d

16、i,recordsizelea si,searchnumberpush didec almov cx,20cldrepe cmpsbjne seanextmov exactmatch,1sub di,20mov memptr,dijmp searetseanext:cmp al,0jne sealoopsearet:retsearchendpdelitem proc nearcall getnumbercall searchcmp exactmatch,1jne delretmov bl,filebufmov si,memptrdelloop:mov di,siadd si,recordsiz

17、ecldrep movsbdec bljnz delloopdec filebufdelret:retdelitem endpedititem proc nearcall getnumbercall searchcmp exactmatch,1jne editretcall getnamecall getphonecall getdormmov di,memptr editstr: lea si,searchnumber mov cx,20 cld rep movsb lea si,searchstr mov cx,30 cld rep movsb mov cx,20 lea si,searc

18、hphone cld rep movsb lea si,searchdorm mov cx,20 cld rep movsb editret:retedititem endpqueryitem proc nearcall getnumbercall searchcmp exactmatch,1jne queryretmov si,memptrlea di,itemrowmov cx,16rep movsbadd si,4mov cx,16rep movsbadd si,14mov cx,16rep movsbadd si,4mov cx,16rep movsbmov ah,9lea dx,it

19、emrowint 21hqueryret:retqueryitem endplistitems proc nearlea dx,titlestrcall showmsglea si,filebufcmp filebuf,0je listemptymov bl,filebufinc sisub si,recordsizelistloop:add si,recordsizelea di,itemrowmov cx,16rep movsbadd si,4mov cx,16rep movsbadd si,14mov cx,16rep movsbadd si,4mov cx,16rep movsbmov

20、 ah,9lea dx,itemrowint 21hdec blcmp bl,0jne listloopretlistempty:lea dx,msgemptymov ah,9int 21hretlistitems endpcreatefile proc nearmov ah,3chmov cx,0lea dx,pathnameint 21hlea dx,msg7call showmsgretcreatefile endpsortname proc nearretsortname endpsortdorm proc nearretsortdorm endpreadfile proc nearm

21、ov ah,3fhmov bx,handlemov cx,1+recordsize*10lea dx,filebufint 21hsub filebuf,30hretreadfile endpclosefile proc nearmov ah,42hmov al,0mov bx,handlemov cx,0mov dx,0int 21hlea dx,filebufmov bx,handlemov cx,1+10*recordsizemov ah,40hint 21hmov ah,3ehint 21hcall exitproretclosefile endpfindfile proc near;

22、find file ,exist open not exist ,creat mov ah,3dh mov al,2 lea dx,pathname int 21h jc fif ;jump when file not exist mov handle,ax call readfile lea dx,msg4 call showmsg ret fif: lea dx,msg1 call showmsg lea dx,msg2 call showmsg mov ah,3ch mov al,0 mov cx,0 lea dx,pathname int 21h jc ffwrong mov hand

23、le,ax lea dx,msg7 ;create file call showmsg call fillitem ret ffwrong: lea dx,msg5 call showmsg lea dx,msg6 call showmsg call exitpro ;exit when creat failedfindfile endpfillitem proc near ;fill items when create fileadd filebuf,30h ; convert to ascii char mov bx,handle mov ah,40h mov cx,recordsize*

24、10+1 lea dx,filebuf int 21h jc fierr ret fierr: ;write file error lea dx,msg9 call showmsg call exitpro fillitem endpexitpro proc nearmov al,1mov ah,4chint 21hexitpro endpcodeseg endsend main 4.2 程序运行结果:首先增加同学的通信记录,按1开始逐步添加4个部分的信息,2和3可以进行删除和修改操作。5.使用说明 首先按1进行数据的输入,2和3进行数据的修改,4进行数据的查询,5罗列出所有信息,6是生成数据

25、,7和8是排序,0是退出程序。6.个人总结通过这段时间的课程设计,我学习到很多知识,也认识到自己的不足:首先,我们明白了其实认真学习一门语言并不困难,关键是方法和态度,今后要多下功夫。一条好的途径便于快速掌握,熟悉运用语言。其次,真正可称得上“好程序”是要满足一大堆的条件的。可读性、健壮性、可维护性、高效性等等等等条件。其实大部分功能是比较容易实现的,但其后的测试、修改、完善、注释、润色和现在的编写系统文档要用不少的时间。再次,这次的程序训练培养了我们实际分析问题、编程和动手能力,使我们掌握了程序设计的基本技能,提高了我们适应实际,实践编程的能力。最后,我们明白了编程是需要细心和耐心的,特别是在调试的时候,查找错误是很麻烦的,所以我们要养成一个良好的编程习惯,注意标明注释。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 建筑/施工/环境 > 项目建议


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号