资源描述:
《汇编课程设计_打字计时练习》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、汇编课程设计_打字计时练习打字计时练习_汇编课程设计打字计时练习微机原理课程设计_打字计时练习_汇编课程设计说明:这是一个打字计时练习的程序,在缓冲区中预放了一些字母,运行时,可按照屏幕上显示的字母输入练习,每输入完一行按回车键后,可显示出练习输入的时间.stacksegmentparastack'stack'db256dup(0)toplabelwordstackendsdatasegmentparapublic'data'bufferdb16hdup(0)bufpt1dw0bufpt2dw0kbflagdb0promptdb'*pleasepractisetyping*',0dh,0
2、ah,'$'scantabdb0,0,'1234567890-=',8,0db'qwertyuiop[]',0dh,0db'asdfghjkl;',0,0,0,0db'zxcvbnm,./',0,0,0db'',0,0,0,0,0,0,0,0,0,0,0,0,0db'789-456+1230.'evenoldcs9dw?oldip9dw?str1db'abcdefghijklmnopqrstuvwxyz.'db0dh,0ah,'$'str2db'therearesomenewspapersonthetable.'db0dh,0ah,'$'str3db'therearesomeclouds
3、inthesky.'db0dh,0ah,'$'str4db'shealwayseatsherlunchatnoon.'db0dh,0ah,'$'str5db'idonotlikeautumnandwinter.'crlfdb0dh,0ah,'$'colondb':','$'evensaddrdwstr1,str2,str3,str4,str5countdw0secdw0mindw0hoursdw0save_lcdw2dup(?)dataendscodesegmentassumecs:code,ds:data,es:data,ss:stackmainprocfarstart:movax,s
4、tackmovss,axmovsp,offsettoppushdssubax,axpushaxmovax,datamovds,axmoves,ax;movah,0;moval,4;int21h;movah,0bh;movbh,0;movbl,4;int11hmovah,35hmoval,09hint21hmovoldcs9,esmovoldip9,bxpushdsmovdx,segkbintmovds,dxmovdx,offsetkbintmoval,09hmovah,25hint21hpopdsmovah,35hmoval,1chint21hmovsave_lc,bxmovsave_l
5、c+2,espushdsmovdx,segclintmovds,dxmovdx,offsetclintmoval,1chmovah,25hint21hpopdsinal,21handal,11111100bout21h,alfirst:movah,0moval,3int10hmovdx,offsetpromptmovah,9int21hmovsi,0next:movdx,saddr[si]movah,09hint21hmovcount,0movsec,0movmin,0movhours,0stiforever:callkbgettestkbflag,80hjnzendintpushaxc
6、alldispcharpopaxcmpal,0dhjnzforevermoval,0ahcalldispcharcalldisptimeleadx,crlfmovah,09hint21haddsi,2cmpsi,5*2jnenextjmpfirstendint:clipushdsmovdx,save_lcmovax,save_lc+2movds,axmoval,1chmovah,25hint21hpopdspushdsmovdx,oldip9movax,oldcs9movds,axmoval,09hmovah,25hint21hpopdsstiretmainendpclintprocne
7、arpushdsmovbx,datamovds,bxleabx,countincwordptr[bx]cmpwordptr[bx],18jnereturncallinctadj:cmphours,12jlereturnsubhours,12return:popdsstiiretclintendpinctprocnearmovwordptr[bx],0addbx,2incwordptr[bx]cmpwordptr[bx],60jnee