资源描述:
《汇编各种编程代码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、响铃datasegmentNdb?flogdw?flagdw?countdw?fredw50000logdw30000str1db'thebellisring','$'dataendscodesegment'CODE'assumecs:code,ds:datastart:movax,datamovds,axmoval,1chmovah,35hint21hpushespushbxpushdsmovcount,1movflag,0leadx,ringmovax,segringmovds,axmoval,
2、1chmovah,25hint21hpopdsinal,21handal,11111110bout21h,alstiK0:cmpflag,1JnzK1callsoundleadx,str1movah,9Hint21Hmovflag,0movcount,182movdl,0dhmovah,2int21hmovdl,0ahmovah,2int21hK1:movah,0bhint21hcmpal,0JzK0popbxpopdsmoval,1chmovah,25hint21hmovah,4chint21hr
3、ingprocpushaxpushbxpushdxpushcxmovax,datamovds,axdeccountJnzK7movflag,1K7:popcxpopdxpopbxpopaxiretringendpsoundprocpushaxpushcxpushdxmovbx,fremovcx,logmovdx,cxinal,61handal,0fchlk:xoral,2out61h,almovcx,bxlk1:looplk1decdxjnzlkpopdxpopcxpopaxretsoundendp
4、codeendsendstart4-11从键盘上输入一串一‘$’为结束符的字符串,然后对其中的非数值字符计数,以十六进制形式输出显示。CODESEGMENTASSUMECS:CODESTART:MOVBL,0LOOP1:MOVAH,1INT21HCMPAL,’$’JENEXTCMPAL,30HJBNEXT1CMPAL,39HJBELOOP1NEXT1:INCBLJMPLOOP1NEXT:MOVCH,2ROTATE:MOVCL,4ROLBL,CLMOVDL,BLANDDL,0FHADDDL,30HCM
5、PDL,3AHJLPRINTITADDDL,7PRINTIT:MOVAH,2INT21HDECCHJNZROTATEmovah,1int21hMOVAX,4C00HINT21HCODEENDSENDSTART4-12从键盘上输入一串一回车符为结束符的字符串,每输入一个大写字母,则将其转换成小写字母并转换成大写字母显示。CODESEGMENTASSUMECS:CODESTART:MOVAH,1INT21HCMPAL,0DHJEEXITCMPAL,41HJBSTARTCMPAL,5AHJBENEXT1C
6、MPAL,61HJBSTARTCMPAL,7AHJASTARTSUBAL,20HJMPNEXT2NEXT1:ADDAL,20HNEXT2:MOVDL,ALMOVAH,2INT21HJMPSTARTEXIT:movah,1int21hMOVAX,4C00HINT21HCODEENDSENDSTART4-15从键盘输入一串以“回车符”为结束标志的字符串,并按字母数字及其他字符分类计数,然后显示这三类计数值。DATASEGMENTXDB0YDB0ZDB0DATAENDSCODESEGMENTASSUMED
7、S:DATA,CS:CODESTART:MOVAX,DATAMOVDS,AXLOOP1:MOVAH,1INT21HCMPAL,0DHJENEXTCMPAL,30HJBNEXT3CMPAL,39HJBENEXT1CMPAL,41HJBNEXT3CMPAL,5AHJBENEXT2CMPAL,61HJBNEXT3CMPAL,7AHJBENEXT2NEXT3:INCZJMPLOOP1NEXT2:INCYJMPLOOP1NEXT1:INCXJMPLOOP1NEXT:LEASI,XMOVAH,2MOVDL,0A
8、HINT21HMOVDH,3LOOP2:MOVBL,[SI]MOVCH,2ROTATE:MOVCL,4ROLBL,CLMOVDL,BLANDDL,0FHADDDL,30HCMPDL,3AHJLPRINTITADDDL,7PRINTIT:MOVAH,2INT21HDECCHJNZROTATEINCSIDECDHJNZLOOP2movah,1int21hMOVAX,4C00HINT21HCODEENDSENDSTARTDATASEGMENTDATDB'0'BUFDB0DH