资源描述:
《汇编课程设计_简易文本编辑器》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、汇编课程设计_简易文本编辑器简易文本编辑器双击可执行文件wbbjq.exe,在出现的界面中输入任意文本内容,利用DEL键、BACKSPACE键、HOME键、END键、上下左右光标键对文本进行全屏幕编辑,按f1键激活菜单file,下移光标,选择save,输入文件名。也可以选择FILE菜单的其他菜单项,他们的功能均可实现。按f10激活帮助,按ESC键退出帮助。red_chrmacro;读取字符宏定义movah,0int16hendmstringmacrop1;输入字符光标movah,9leadx,p1int21hen
2、dmwinmacroopr1,opr2,opr3,opr4,opr5,opr6;建立窗口movah,06hmoval,opr1movbh,opr2movch,opr3movcl,opr4movdh,opr5movdl,opr6int10hendmpos_cursemacroop1,op2,op3;定义光标位置movah,2movbh,op1movdh,op2movdl,op3int10hendmpos_getmacro;显示光标位置movah,03hmovbh,0int10hendmdatasegment;定义数
3、据段menudb'FileEditHelp$'mass_1db'F1ActivefileF10Activehelp','$'manu_1db'New',13,10,'$'manu_2db'Open',13,10,'$'manu_3db'Save',13,10,'$'manu_4db'Saveas',13,10,'$'manu_5db'Exit','$'handledw?message1db'Pleaseinputfilename:','$'message2db'Pleaseinputsavefilename:',
4、'$'message3db'Pleaseinputopenfilename:','$'message4db'***Thefileisnotsave!Saveitnow?(Y/N)***:','$'pathdb50dup(0),'$'bufferdb2000dup(?)bakdb3850dup(0)linedb?rowdb?chardb?help_mas1db'welcomeuseeditor!$';帮助内容help_mas2db'pleasethefirstactivehelp!$'help_mas3db'goo
5、dlucky!!$'help_mas4db'==========================================================$'help_mas5db'PressF1toactivefile.$'help_mas6db'YoucanuseDOWNcursorkeytochoosethefuction$'help_mas7db'PressF10toshowthehelpmassage.PressEscToQuit$'datedb'today??/??/','$' ;调用
6、日期hangliedb'???//???','$' ;行//列dataendscodesegmentmainprocfar;主程序assumecs:code,ds:datastart:pushdssubax,axpushaxmovax,datamovds,axcallwind calleditretmainendpwindprocnear;创建窗口子程序win0,3eh,1,0,24,79;定义窗口背景win1,1fh,0,0,0,79win0,1fh,24,0,24,79
7、show:;显示菜单位置及内容pos_curse0,0,1movah,9leadx,menuint21hshow_2: ;显示状态栏位置及内容pos_curse0,24,1movah,9leadx,mass_1int21hcallwin3callwin4pos_curse0,1,0movrow,dhmovline,dlwindendpeditprocnearchar_get:;读字符callcomcomprocnear;定义功能鍵pos_getmovrow,dhmovline,dlfirst:pos_curse0
8、,row,linej00:movah,0int16h;从键盘读字符ah=扫描码al=字符码pushaxleadx,buffermovbuffer[bx],alincbxcmpah,48h;上jzup_1cmpah,50h;下jzdown_1cmpah,4bh;左jzleftcmpah,4dh;右jzrightcmpah,1ch;回车jzenter_1callfuc_key