学生成绩管理系统-汇编语言(共19页).docx
《学生成绩管理系统-汇编语言(共19页).docx》由会员分享,可在线阅读,更多相关《学生成绩管理系统-汇编语言(共19页).docx(19页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上;=学生成绩管理系统=;*;EQU STATEMENTS GO HEREStructNodeequ32 ;表达式赋值微操作equ page133Node_nameequ0;类似defineNode_numequ12Node_mathsequ18Node_englishequ20Node_chineseequ22Node_othersequ24Node_totalequ26Node_avgequ28Node_nextequ30max_recordequ100max_menu_indexequ9;*;*data_seg segment;define data segmen
2、t;DATA GOES HEREbuf1DB30buf1_slenDB?buf1_dataDB30 dup(?)bufnameDB20bufname_slenDB?bufname_dataDB20 dup(?)bufgetintDB32bufgetint_slenDB?bufgetint_dataDB32 dup(?)str_menuDB0dH, 0aH, =Student marks system=, 0dH, 0aH, 0dH, 0aHDB1)Add Record, 0dH, 0aH, 0dH, 0aHDB2)Print All, 0dH, 0aH, 0dH, 0aHDB3)Save, 0
3、dH, 0aH, 0dH, 0aHDB4)Open, 0dH, 0aH, 0dH, 0aH, 0dH, 0aHDB5)Find, 0dH, 0aH, 0dH, 0aH, 0dH, 0aHDB6)Delete, 0dH, 0aH, 0dH, 0aH, 0dH, 0aHDB0)Exit, 0dH, 0aHDBChoice:$;Error Stringsstr_error_1DBError input!, 0dH, 0aH, $jump_tbDWcase_0DWcase_1DWcase_2DWcase_3DWcase_4DWcase_5DWcase_6headDW?;表头指针info_0dbinpu
4、t num:, $info_1dbinput math:, $info_2dbinput english:, $info_3dbinput chinese:, $ info_4dbinput others:, $info_5dbinput name:, $str_tb_headdbNum, 9,Name, 9, Maths, 9, English, 9, Chinese, 9,Others, 9, Total, 9, Avg, 0dH, 0aHdb=, 0dH, 0aH,$str_tabdb9, $rdatadb(StructNode * (max_record+1) dup(?);全部结点*
5、(100+1)rdata_pdwrdata;下一个可用结点rcountdw00H;当前已分配的结点数newnodedw?pnodedw?file_namedbc:student.txt, 00Hfile_error1dbFailed create file., 0DH, 0AH, $file_error2dbFailed write file., 0DH, 0AH, $file_error3dbFailed open the file., 0DH, 0AH, $file_error4dbFailed read file., 0DH, 0AH, $file_info_1dbsaving the
6、file., 0DH, 0AH, $file_info_2dbWrite to file successfully!, 0DH, 0AH, $file_info_3dbopening the file., 0DH, 0AH, $file_info_4dbread the file successfully!, 0DH, 0AH, $fp1dw?;文件指针data_seg ends;*;*extdata_seg segment;define extra data segment;EXTRA DATA GOES HEREextdata_seg ends;*;*stack_seg segment s
7、tack;define extra data segment;STACK DATA GOES HEREDB100H dup(?)stack_seg ends;*;*program segment;define code segment;*main proc far;main part of programassume cs:program, ds:data_seg, es:extdata_seg, ss:stack_segstart:;set up stack for returnpush dssub ax, axpush ax;set DS register to current data
8、segmentmov ax, data_seg;data_seg segment addrmov ds, ax;into DS registermov ax, extdata_seg;extdata_seg segment addrmov es, ax;into ES registermov ax, stack_seg;stack_seg segment addrmov ss, ax;into SS register;MAIN PART OF PROGRAM GOES HERE;分配链表头结点mov ax, rdata_pmov head, ax;当前头指针就是rdata_padd rdata
9、_p, StructNodemov bx, headmov word ptr bx+Node_next, 00Hlb_print_menu:;打印菜单lea dx, str_menumov ah, 09Hint 21Hcall far ptr getintcmp dx, max_menu_indexja lb_print_menumov di, dxshl di, 1jmp jump_tbdijmp lb_print_menucase_0:;Exitretcase_1:;添加记录call far ptr addrecordjmp lb_print_menucase_2:;打印所有记录call
10、far ptr print_recordjmp lb_print_menucase_3:;保存到文件call far ptr save_recordjmp lb_print_menucase_4:;从文件中读取call far ptr read_recordjmp lb_print_menucase_5:;查找call far ptr find_recordjmp lb_print_menucase_6:;删除call far ptr delete_recordjmp lb_print_menuret;return to DOSmain endp;end of main part of pro
11、gram;*;*sub1 proc near;define subprocedurepush axpush bxpush cxpush dx;main port of sub procedure;exit sub procedurepop dxpop cxpop bxpop axretsub1 endp;end of subprocedure;*;*;print CRLFcrlf proc farpush dxpush axmov dl, 0dHmov ah, 02Hint 21Hmov dl, 0aHmov ah, 02Hint 21hpop axpop dxretcrlf endp;*;*
12、;从键盘输入一个整数,结果保存到dx中getint proc far;define subprocedurepush axpush bxpush cx;main port of sub proceduremov dx, offset bufgetint;offset 偏移地址mov ah, 0aHint 21Hcall far ptr crlfmov ax, offset bufgetint_datapush ax;字符串首地址mov al, bufgetint_slencbw;字节转字push ax;字符串长度push ax;返回值call far ptr decibinpop dxpop
13、axpop ax;exit sub procedurepop cxpop bxpop axretgetint endp;end of subprocedure;*;*;把以十制进数形式存储在字符串中的数转成整数;栈中的参数:;0字符串首地址;1字符串长度;2存放结果decibin_para_lenequ3decibin_str1equword ptrbp+4+(decibin_para_len-0)*2decibin_str1lenequword ptrbp+4+(decibin_para_len-1)*2decibin_retsultequword ptrbp+4+(decibin_para
14、_len-2)*2decibin proc far;save registerspush bpmov bp, sppush axpush bxpush cxpush dxpush sipush dimov bx, 00Hmov cx, decibin_str1lenmov di, decibin_str1decibin_loop1:mov al, byte ptr di ; di为偏移量以字节为单位 把地址送入al and al, 0fHcbwxchg bx, axmov si, 10mul siadd bx, axinc diloop decibin_loop1mov decibin_ret
15、sult, bxexit_decibin:;恢复寄存器pop dipop sipop dxpop cxpop bxpop axpop bpretdecibin endp;*;*;把bx中的数以十进制形式输出;输入:数据存放在bx中binidec proc farpush axpush bxpush cxpush dxpush simov si, 01Hmov cx,10000d;各位依次输出call dec_divmov cx,1000dcall dec_divmov cx,100dcall dec_divmov cx,10dcall dec_divmov cx,1dmov si, 00Hca
16、ll dec_divpop sipop dxpop cxpop bxpop axretbinidec endpdec_div proc nearmov ax,bxmov dx,0div cxmov bx,dx;保留余数mov dl,al;商送入dlcmp si, 00H;输出这一位je lb1_dec_divcmp dl, 00H;处理完毕je exit_dec_divmov si, 00Hlb1_dec_div:add dl,30hmov ah, 02Hint 21Hexit_dec_div:retdec_div endp ;*;*addrecord proc far;define subp
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 学生 成绩管理系统 汇编语言 19
限制150内