,从键盘输入一字符串(字符个数不超过80,用回车符结束),统计其中字母、数字及其它字符的个数,分别存入letter、digit和other三个变量中。;******;//////////////////////////////////////////////////////////////////;程序名:;作者:;完成日期:;程序说明:;//////////////////////////////////////////////////////////////////.;数据段;stringdb'Hello,Everybody!',0dh,0ah,'$';此处添加一些初始化过的变量定义string1db'pleaseinputastring:',0dh,0ah,'$'string2db'numberofletters:',0dh,0ah,'$'string3db'numberofdigits:',0dh,0ah,'$'string4db'numberofothers:',0dh,0ah,'$';;;程序起始点,建立DS、SSleadx,string1movah,09hint21hmovcx,100w1:movah,01hint21hcmpal,0dhjzover2cmpal,30hjbothercmpal,39hjahigher1jmpdigitalhigher1:cmpal,41hjbotherjahigher2jmpletterhigher2:cmpal,61hjbothercmpal,7Ahjaotherjmpletterjmpoverother:incothersjmpoverletter:inclettersjmpoverdigital:incdigitjmpoverjmpoverover:noploopw1over2:callendlineleadx,string2movah,09hint21hxorax,axmoval,letterscalldisplaycallendlineleadx,string3movah,09hint21hxorax,axmoval,digitcalldisplaycallendlineleadx,string4int21hxorax,axmoval,otherscalldisplaymovah,earmovah,02hmovdl,0Ahint21hmovah,02hmovdl,earmovbl,10divblpushaxmovdl,aladddl,30hmovah,02hint21hpopaxmovdl,ahadddl,30hmovah,;程序结束点,,在数据段定义两个长度相等的字符串STRING1和STRING2,从键盘输入一个字符串并存入STRING1,;数据段string3db'pleaseinputastring1:',0dh,0ah,'$'string4db'essful,outputastring2:',0dh,0ah,'$'string1db81db0db81dup(?)string2dbsizeofstring1dup(?).const;;;程序起始点,建立DS、SSleadx,string3movah,09hint21hmovah,0ahmovdx,offsetstring1int21hmovah,2movdl,0ahint21hmovbl,string1+1movbh,0movbyteptr[string1+2+bx],'$'movsi,offsetstring1[2]movdi,offsetstring2next:cmpbyteptr[si],'$'jedonemovax,[si]mov[di],axincsiincdijmpnextdone:movah,09hleadx,string4int21hmovah,09hmovdx,;程序结束点,返回DOSend;//////////////////////////////////////////////////////////////////;程序名:;作者:;完成日期:;程序说明:;//////////////////////////////////////
汇编程序 来自淘豆网www.taodocs.com转载请标明出处.