资源描述:
《秒表汇编语言程序》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、DATASSEGMENTSESDB30H;秒的十位SEDDB30H;秒的个位MIDDB3AH;中间冒号DSSDB30H;分秒十位DSGDB30H;分秒个位REDDB'READY:ENTERANYKEY!$';提示字符DATASENDSSTACKSSEGMENTPARASTACK'STACK'STADW100DUP(?)STACKSENDSCODESSEGMENTASSUMECS:CODES,DS:DATAS,SS:STACKSSTART:MOVAX,DATASMOVDS,AX;显示提示字符,dos调用MOVDX,OFFSETREDMO
2、VAH,9INT21HCALLQINP;调用置数据于12行36列并清屏子过程CALLDISP;调用显示子过程;检测是否有键按下LP0:MOVAH,7;若有则al=输入字符的ASCII码;无则0INT21HCMPAL,0JNZLP1JMPLP0LP1:CMPAL,53HJNZLP0LP2:MOVAH,0;BIOS调用,取计时单位INT1AHADDDX,2;2表示每110ms即11ds进行一次循环计数MOVBX,DXLP3:MOVAH,00HINT1AHCMPDX,BXJNZLP3CALLQINP;调用置数据于12行36列并清屏子过程CA
3、LLDISP;调用显示子过程;检测是否有键按下LP4:MOVAH,1INT16HCMPAL,0JZLP5CMPAL,48HJNZW1JMPLP0W1:CMPAL,50HJNZLP5CALLZHLJMPLP0LP5:INCDSG;计算各位数值INCDSSCMPDSG,39HJNGLP6INCDSSSUBDSG,10LP6:CMPDSS,39HJNGLP2SUBDSS,10INCSEDCMPSED,39HJNGLP2INCSESMOVSED,30HCMPSES,36HJNZLP2CALLZHL;调用置零子过程;返回dosEXIT:MOVA
4、H,4CHINT21H;定义显示秒表数字子过程DISPPROCNEARMOVDL,SESMOVAH,02HINT21HMOVDL,SEDMOVAH,02HINT21HMOVDL,MIDMOVAH,02HINT21HMOVDL,DSSMOVAH,02HINT21HMOVDL,DSGMOVAH,02HINT21HRETDISPENDP;定义置零子程序ZHLPROCNEARMOVSES,30HMOVSED,30HMOVDSS,30HMOVDSG,30HCALLQINPCALLDISPRETZHLENDP;定义清屏子程序QINPPROCNEA
5、R;清除屏幕原来的数字并置光标位置于12行36列(显示器软中断调用)MOVBH,0MOVDH,12MOVDL,36MOVAH,2INT10H;BIOS视频I/O中断调用RETQINPENDPCODESENDSENDSTART