汇编机考复习版题目代码by zlj_第1页
汇编机考复习版题目代码by zlj_第2页
汇编机考复习版题目代码by zlj_第3页
汇编机考复习版题目代码by zlj_第4页
汇编机考复习版题目代码by zlj_第5页
已阅读5页,还剩43页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

BUF1DB20DBDB20BUF2DB13,10,18DUP(?)DATAENDSCODEMOVDS,AXMOVES,AXLEADX,BUF1MOVAH,0AHINT21HLEASI,BUF1+2MOVCL,BUF1[1]MOVCH,0ADDSI,CXDECSIMOVAL,[SI]MOV[DI],ALDECSIINCDIDECCXMOVBYTEPTRMOVAH,09HINT21HINT21HCODEENDSENDSTARTABUF1DB20DBDB20DUP(?)NUM1DB?NUM2DB?BUF3DB13,10BUF2DB'NUM1=',0,0,13,10,'NUM2=',0,0,13,10,'$'DATAENDSCODEMOVDS,AXMOVES,AXLEADX,BUF1MOVAH,0AHINT21HLEASI,BUF1+2MOVCL,BUF1+1MOVCH,0MOVAL,BYTEPTR[SI]CMPAL,''JNZTO1INCNUM1JMPTOOJNZTOOINCNUM2JMPTOOINCSIDECCXJNZAGAINMOVDL,10MOVAH,0DIV MOVWORDPTRBUF2+7,AXMOVDL,10MOVAH,0DIV MOVWORDPTRLEADX,BUF3MOVAH,09HINT21HINT21HCODEENDSENDSTARTACC,并将结果显示在屏幕上BUF1DB20DBDB20BUF2DB13,10,24DUP(?)DATAENDSCODEMAINPROCFARMOVDS,AXMOVES,AXCALLINPUTCALLOUTPUTMAINENDPINPUTPROCLEADX,BUF1MOVAH,0AHINT21HINPUTCHANGEPROCLEASI,BUF1+2LEADI,BUF2+2MOVCL,BUF1+1MOVCH,0CMPBYTEPTRBUF1[SI],'A'JNZAGAIN1JMPTO1MOVAL,BUF1[SI]MOVBUF2[DI],ALJMPTO1INCSIINCLOOPAGAINMOVBUF2[DI],'$'CHANGEENDPCHANGE1PROCMOVBUF2[DI],'C'INCDIMOVBUF2[DI],'C'CHANGE1ENDPOUTPUTPROCLEADX,BUF2MOVAH,09HINT21HOUTPUTENDPMOVAH,4CHINT21HCODEENDSENDMAINBUF1DBDBDB20BUF2DB13,10,20DUP(?)DATAENDSCODEMOVDS,AXMOVES,AXLEADX,BUF1MOVAH,0AHINT21HLEASI,BUF1+2LEADI,BUF2+2MOVCL,BUF1+1MOVCH,0CMPBYTEPTRBUF1[SI],41HJGETO1MOVAL,BYTEPTRBUF1[SI]MOVBYTEPTRBUF2[DI],ALJMPTO2INCSIINCMOVBYTEPTRBUF2[DI],'$'JMPTO4CMPBYTEPTRBUF1[SI],5AHJLETO3MOVAL,BYTEPTRBUF1[SI]MOVBYTEPTRBUF2[DI],ALJMPTO2MOVAL,BYTEPTRBUF1[SI]ADDAL,20HMOVBYTEPTRBUF2[DI],ALJMPTO2TO4:;TO4MOVAH,09HINT21HINT21HCODEENDSENDSTART键盘输入一个十进制数(字类型),其他通过,CHECKBUF1DB5DBDB5 DBBUF3DB13,10,0,0,0,0,0,'$'BUF4DBDATAENDSCODESEGMENTMAINPROCFARMOVDS,AXMOVES,AXCALLINPUTCALLOUTPUTJMPRMAININPUTPROCMOVAH,0AHINT21HCALLCHECKINPUTCHECKPROCLEAMOVCL,BUF1+1MOVCH,0JAETO1JMPTO4JLETO3JMPTO4JMPTO4CHECKOUTPUT1PROCLEADX,BUF4MOVAH,09HINT21HOUTPUT1OUTPUTPROCLEASI,BUF1+2MOVCL,BUF1+1MOVCH,0DECCXSUBAX,30HMULMIN;MUL一定要乘INCSIMOVBH,0MOVBL,BUF1[SI]SUBBX,30HADDAX,BXMOVBL,ALANDAL,0FHADDAL,30HCMPAL,'9'JGTOO1JMPTOO2MOVBUF3[7],ALANDBL,0F0HMOVCL,4SHRBL,CLADDBL,30HCMPBL,'9'JGTOO3JMPTOO4ADDBL,07HJMPTOO4MOVMOVBH,AHADDAH,30HCMPAH,'9'JGTOO5JMPTOO6JMPTOO6MOVBUF3[5],AHANDBH,0F0HMOVCL,4SHRBH,CLADDBH,30HJGTOO7JMPTOO8ADDBH,07HJMPTOO8MOVBUF3[4],BHLEADX,BUF3MOVAH,09HINT21HOUTPUTENDPMOVAH,4CHINT21HCODEENDSENDMAINBUF1DB5DBDB5BUF2DB13,10,'ERROR!$' DW10MIN1DWBUF3DB13,10,16DUP(?),'$'DATAENDSCODEMAINPROCFARMOVDS,AXMOVES,AXCALLINPUTCALLCHECKMAINENDPINPUTPROCINT21HINPUTCHECKPROCLEASI,BUF1+2MOVCL,BUF1+1MOVCH,0JAETO1JMPTO4JBETO3JMPTO4LOOPAGAINJMPTO4CHECKOUTPUT1PROCLEADX,BUF2MOVAH,09HINT21HOUTPUT1OUTPUTPROCLEASI,BUF1+2MOVCL,BUF1+1MOVCH,0DECCXSUBAX,30HMULMININCSIMOVBH,0MOVBL,BUF1[SI]SUBBX,30HADDAX,BXMOVMOVCL,16;想一下MOVCH,0XORDX,DXDIVMIN1ADDDL,30HMOVBUF3[SI],DLDECSIDECCXMOVAH,09HINT21HOUTPUTENDPMOVAH,4CHINT21HCODEENDSENDMAIN;键盘输入一个二进制数(字类型DATASEGMENTBUF1DBDBDB18 DBPRINTDB13,10,'ERROR!$';?BUF2DB13,10,0,0,0,0,'H','$'DATAENDSCODESEGMENTMAINPROCFARMOVDS,AXMOVES,AXCALLINPUTCALLCHECKMOVAH,4CHINT21HMAININPUTPROCMOVAH,0AHINT21HINPUTCHECKPROCLEASI,BUF1+1MOVDL,BUF1[SI]CMPDL,16JMPTO1JMPTO1CHECKOUTPUT1PROCLEADX,PRINTMOVAH,09HINT21HINT21HOUTPUT1OUTPUTPROCLEASI,BUF1+2XORAX,AXXORCX,CXMOVCL,BUF1+1DECCXSUBAX,30HINCSIXORMOVBL,BUF1[SI]SUBBL,30HADDAX,BXPUSHAXMOVBL,ALANDAL,0FHADDAL,30HCMPAL,'9'JGTO2JMPTO3JMPTO3;LEADI,BUF2+5MOVBUF2[5],ALANDBL,0F0HMOVCL,4SHRBL,CLADDBL,30HCMPBL,'9'JG;ADDBL,30HJMPTO5ADDBL,07HJMPTO5MOVPOPDXMOVDL,DHMOVBL,DLANDDL,0FHADDDL,30HCMPDL,'9'JGTO6;ADDDL,30HJMPTO7ADDDL,07HJMPTO7;DECMOVBUF2[3],DLANDBL,0F0HMOVCL,4SHRBL,CLADDBL,30HCMPBL,'9'JGTO8;ADDDH,30HJMPTO9ADDBL,07HJMPTO9;DECMOVBUF2[2],BLLEADX,BUF2MOVAH,09HINT21HOUTPUTENDPCODEENDSENDMAINBUF1DB18DBDB18 DB2;DBDWMINNDWBUF2DB13,10,0,0,0,0,0,'$'DATAENDSCODEMAINPROCFARMOVDS,AXMOVES,AXCALLINPUTCALLOUTPUTMOVAH,4CHINT21HMAININPUTPROCMOVAH,0AHINT21HINPUTOUTPUTPROCLEASI,BUF1+2XORAX,AXXORCX,CXMOVCL,BUF1+1DECCXINCSIXORMOVBL,BUF1[SI]SUBBL,30HADDAX,BXPUSHAXXORCX,CXMOVCX,5MOVDI,6POPAXXORDX,DXDIVMINNADDDL,30HMOVBUF2[DI],DLDECDILEADX,BUF2MOVAH,09HINT21HOUTPUTENDPCODEENDSENDMAIN;键盘输入一个十六进制数(字类型DATASEGMENTBUF1DBDBDB5 DBMINNDWBUF2DB13,10,0,0,0,0,'$'BUF3DB13,10,'ERROR!$'DATAENDSCODESEGMENTMAINPROCFARMOVDS,AXMOVES,AXCALLINPUTJMPRINT21HMAINENDPINPUTPROCMOVAH,0AHINT21HINPUTCHECKPROCLEASI,BUF1+2MOVCL,BUF1+1XORCH,CHMOVBL,BUF1[SI]CMPBL,'0'JBTO1CMPBL,'9'JATO2JBTO1CMPBL,'Z'JATO1JMPTOOOCALLINCLOOPAGAINJMPJIESHUCHECKOUTPUT1PROCLEADX,BUF3MOVAH,09HINT21HOUTPUT1OUTPUTPROCXORCX,CXMOVCL,BUF1+1XORAX,AXLEASI,BUF1+2CMPAL,'9'JGJMPTO4JMPTO4DECCXINCSIXORMOVBL,BUF1[SI]CMPBL,'9'JGSUBBL,30HJMPTO6JMPTO6ADDAX,BXXORCX,CXMOVCX,4MOVDI,5XORDX,DXDIVMINNADDDL,30HMOVBUF2[DI],DLDECDIMOVAH,09HINT21HOUTPUTENDPCODEENDSENDMAINDATASEGMENTBUF1DB38H,4AH,0C5H,83H,9CH,0B4H,7FH,0C4H,05H,0F5HBUF2DB13,10,'SUM=',0,0,0,'NUM=-',0,'$' DB10DATAENDSCODESEGMENTMAINPROCFARMOVDS,AXMOVES,AXCALLOUTPUTINT21HMAINENDPOUTPUTPROCXORAX,AXXORCX,CXMOVCX,10;MOVSI,0MOVDL,0JGETO1NEGBUF1[SI]INCDLXORMOVBL,BUF1[SI]ADDAX,BXINCXORCX,CXMOVCX,3MOVDI,8DIVMINMOVDECDIMOVDI,14ADDDL,30HMOVBUF2[DI],DLLEADX,BUF2MOVAH,09HINT21HOUTPUTENDPCODEENDSEND;09,1099,100BUF1DB12DBDB12BUF2DB'NUM0-9=','NUM'DATAENDSCODEMAINPROCFARMOVDS,AXMOVES,AXCALLINPUTCALLOUTPUTMOVAH,4CHINT21HMAINENDPINPUTPROCMOVAH,0AHINT21HINPUTENDPOUTPUTPROC;09,10BUF1DB62DBDB62LEADATASEGMENTBUF1DBDBDB62BUF2DB13,10,'N0-9=',0,'N10-99=',0,'N>=100=',0,'$' DB0 DB DB0DATAENDSCODESEGMENTMAINPROCFARMOVDS,AXMOVES,AXCALLINPUTCALLOUTPUTMOVAH,4CHINT21HMAININPUTPROCMOVAH,0AHINT21HINPUTOUTPUTPROCXORCX,CXMOVCX,10XORMOVAX,WORDPTRBUF1[SI]XCHGAL,AHJGTO1XORMOVAX,WORDPTRBUF1[SI+2]XCHGAL,AHJGTO1XORMOVAL,BYTEPTRBUF1[SI+4]CMPAL,30HJZTO4ADDC2,1JMPTOADDC1,1JMPTOADDC3,1JMPTOADDSI,6XORBL,BLMOVBL,C1ADDBL,30HMOVBYTEPTRXORBL,BLMOVBL,C2ADDMOVBYTEPTRXORBL,BLMOVBL,C3ADDMOVBYTEPTRBUF2[23],BLLEADX,BUF2INT21HOUTPUTENDPCODEENDSENDMAIN743216、527864BCDBUF1DB8DBDB8BUF2DBDBDB8DUP(?)PRINTDBBUF3DB13,10,9DUP(?),'$'DATAENDSCODEMAINPROCFARMOVDS,AXMOVES,AXCALLINPUT1CALLINPUT2CALLOUTPUT2MOVAH,4CHINT21HMAININPUT1PROCLEADX,BUF1MOVAH,0AHINT21HINPUT1INPUT2PROCLEADX,BUF2MOVAH,0AHINT21HINPUT2OUTPUT1PROCLEADX,PRINTMOVAH,09HINT21HOUTPUT1OUTPUT2PROCXORCX,CXMOVCX,6XORAL,ALLEASI,BUF1+7XORBX,BXMOVADCAL,BUF2[DI]MOVBUF3[BX],ALDECSIDECDIDECLOOPMOVBUF3[BX],0ADCBUF3[BX],0XORCX,CXMOVCX,7MOVBX,4ADDBUF3[BX],30HINCBXLEADX,BUF3MOVAH,09HINT21HOUTPUT2CODEENDSENDMAINLEASI,BUF1+7;为了从最低位开始相加LEADI,BUF2+7;为了从最低位开始相加XORBX,BXMOVBX,10;BXSIDIBUF3MOVAL,BUF1[SI]ADCSIDIBUF1BUF2的末尾,计算时又使用了BUF1BUF22次。BUF1=0,无所谓,但是LEAMOVSI,MOVDI,MOVADCMOVAL,[SI]ADCAL,BUF1DB8DBDB8BUF2DBDBDB8DUP(?)PRINTDBBUF3DB13,10,9DUP(?),'$'DATAENDSCODEMAINPROCFARMOVAX,DATAMOVDS,AXMOVES,AXCALLINPUT1CALLINPUT2CALLOUTPUT2MOVAH,4CHINT21HMAINENDPINPUT1PROCMOVAH,0AHINT21HINPUT1INPUT2PROCLEADX,BUF2MOVAH,0AHINT21HINPUT2OUTPUT1PROCLEADX,PRINTMOVAH,09HINT21HOUTPUT1OUTPUT2PROCXORCX,CXMOVCX,6XORAL,ALMOVSI,7MOVDI,7XORBX,BXMOVADCAL,BUF2[DI]MOVBUF3[BX],ALDECSIDECDIDECLOOPAGAINMOVBUF3[BX],0ADCBUF3[BX],0XORCX,CXMOVCX,7MOVBX,4ADDBUF3[BX],30HINCBXLEADX,BUF3MOVAH,09HINT21HOUTPUT2ENDPCODEENDSENDMAIN;1ah;;;ASCII码值不同DATASEGMENTBUF1DB19DBDB19 DWBUF2DB13,10,'SUM=',0,0,0,'$'DATAENDSCODEMAINPROCFARMOVDS,AXMOVES,AXCALLINPUTCALLOUTPUTMOVAH,4CHINT21HMAINENDPINPUTMOVAH,0AHINT21HINPUTOUTPUTPROCXORCX,CXMOVCX,6XORAX,AXXORMOVBX,WORDPTRBUF1[SI]XCHGBL,BHJGTO1SUBBH,30HJMPTO2SUBBH,37HJMPTO2JGTO3SUBBL,30HJMPTO4SUBBL,37HJMPTO4PUSHCXXORCL,CLMOVCL,4SHLBH,CLPOPCXORBL,BHXORBH,BHADDAX,BXADDSI,3XORCX,CXMOVCX,3MOVDI,8XORDX,DXDIVMINADDDL,30HMOVBUF2[DI],DLDECDILEADX,BUF2MOVAH,09HINT21HOUTPUTENDPCODEENDSENDMAIN;从键盘输入一串可显示字符(以回车符结束;DATASEGMENTBUF1DBDBDB20 DB DB DBBUF2DB13,10,'KONG=',0,'SHU=',0,'ZIMU=',0,'$'DATAENDSCODEMAINPROCFARMOVDS,AXMOVES,AXCALLINPUTCALLOUTPUTMOVAH,4CHINT21HMAININPUTPROCMOVAH,0AHINT21HINPUTOUTPUTPROCXORCX,CXMOVCL,BUF1+1LEASI,BUF1+2JZTOENDJZTO1JBTOXUNJATO2ADDSZ,1ADDKG,1JBTOXUNJATO3ADDZM,1JBTOXUNJATOXUNADDZM,1INCJATO4ADDKG,30HJMPTO5ADDKG,37HJMPTO5JATO6ADDSZ,30HJMPTO7ADDSZ,37HJMPTO7CMPZM,9JATO10ADDZM,30HJMPTO11ADDZM,37HJMPTO11MOVDI,7XORBL,BLMOVMOVBUF2[DI],BLXORBL,BLMOVMOVBUF2[DI+5],BLXORBL,BLMOVLEADX,BUF2INT21HOUTPUTENDPCODEENDSENDMAIN;;DATASEGMENTBUF1DW DW DWBUF2DB13,10,'MIN=',0,0,0,0,'MAX=',0,0,0,0,'$'DATAENDSCODEMAINPROCFARMOVDS,AXMOVES,AXCALLOUTPUTMOVAH,4CHINT21HMAINOUTPUTPROCXORCX,CXMOVCX,10XORBX,BXMOVBX,0XORDX,DXMOVSI,0MOVDX,WORDPTRBUF1[BX]CMPDX,WORDPTRBUF1[SI]JBTO1MOVBX,SIJMPTO2ADDSI,2;!!!INCSI!BUF1XORAX,AXMOVAX,WORDPTRBUF1[BX]XORDX,DXMOVDX,AXXORBL,BLMOVBL,ALCMPAL,9JGJMPTO4MOVMOVBUF2[DI],ALANDBL,0F0HXORCL,CLMOVCL,4SHRBL,CLCMPBL,9JGTO5ADDBL,30HJMPTO6ADDBL,37HJMPTO6DECMOVXORBH,BHMOVBH,DHANDDH,0FHCMPDH,9JGADDDH,30HJMPTO8ADDDH,37HJMPTO8DECMOVBUF2[DI],DHANDBH,0F0HXORCL,CLMOVCL,4SHRBH,CLCMPBH,9JGTO9ADDBH,30HJMPTO10ADDBH,37HJMPTO10DECMOVXORCX,CXMOVCX,10MOVSI,0XORBX,BXMOVBX,0XORDX,DXMOVDX,WORDPTRBUF1[BX]CMPDX,WORDPTRBUF1[SI]JATO11MOVBX,SIJMPTO12ADDSI,2;!!!INCSI!BUF1XORMOVAX,WORDPTRBUF1[BX]XORDX,DXMOVDX,AXXORBL,BLMOVBL,ALCMPAL,9JGTO13JMPTO14JMPTO14MOVMOVBUF2[DI],ALANDBL,0F0HXORCL,CLMOVCL,4SHRBL,CLCMPBL,9JGTO15ADDBL,30HJMPTO16ADDBL,37HJMPTO16DECMOVXORBH,BHMOVBH,DHANDDH,0FHCMPDH,9JGTO17ADDDH,30HJMPTO18ADDDECMOVBUF2[DI],DHANDBH,0F0HXORCL,CLMOVCL,4SHRBH,CLCMPBH,9JGTO19ADDBH,30HJMPTO20ADDBH,37HJMPTO20DECMOVMOVAH,09HINT21HOUTPUTENDPCODEENDSEND;10个字节数(无符号数DATASEGMENTBUF1DBDBDB31BUF2DB13,10,'MAX=',0,0,'H','MIN=',0,0,'H','$'DATAENDSCODEMAINPROCFARMOVDS,AXMOVES,AXCALLINPUTMOVAH,4CHINT21HMAININPUTPROCMOVAH,0AHINT21HINPUTXORAX,AXLEASI,BUF1+2MOVAX,WORDPTRBUF1[SI]XCHGAL,AHJGTO1JMPTO2JMPTO2JGTO3JMPTO4JMPTO4XORCL,CLMOVCL,4SHLAH,CLORAL,AH;ALXORMOVDL,AL;DLXORCX,CXMOVCX,9ADDSI,3XORMOVBX,WORDPTRBUF1[SI]XCHGBL,BHJGTO5SUBBL,30HJMPTO6SUBBL,37HJMPTO6JGTO7SUBBH,30HJMPTO8SUBBH,37HJMPTO8PUSHCXXORCL,CLMOVCL,4SHLBH,CLORBL,BHPOPCXCMPAL,BLJGETO9JMPTO9CMPDL,BLJLETO10MOVDL,BLJMPTO10ADDSI,3LOOPAGAINXORDH,DHXORAH,AHPUSHDXPUSHAXMOVDI,7MOVDI,14LEADX,BUF2MOVAH,09HINT21HOUTPUTPROCPOPAXXORBL,BLMOVBL,ALCMPAL,9JGTOO1JMPTOO2JMPTOO2ANDBL,0F0HXORCL,CLMOVCL,4SHRBL,CLCMPBL,9JGTOO3ADDBL,30HJMPTOO4ADDBL,37HJMPTOO4MOVBUF2[DI],ALDECDIMOVBUF2[DI],BLOUTPUTENDPCODEENDSENDMAINDATASEGMENTBUF1DBDBDB20BUF2DBDBDB20BUF3DBDBDB20 DW DW DW0PRINTDB13,10,'$' 55535DUP(?)DATAENDSCODEMAINPROCFARMOVAX,DATAMOVDS,AXMOVES,AXCALLINPUT1CALLINPUT2CALLINPUT3MOVAH,4CHINT21HMAININPUT1PROCLEADX,BUF1MOVAH,0AHINT21HINPUT1ENDPINPUT2PROCLEADX,BUF1MOVAH,0AHINT21HINPUT2ENDPINPUT3PROCLEADX,BUF3MOVAH,0AHINT21HINPUT3OUTPUT1PROCLEADX,BUF1MOVAH,09HINT21HOUTPUT1ENDPOUTPUT2PROCLEADX,BUF2MOVAH,09HINT21HOUTPUT2ENDPOUTPUT3PROCXORCX,CXMOVCL,BUF1+1MOVSI,CXMOVBUF1[SI+2],0MOVAH,3DHMOVAL,2INT21HMOVXORCX,CXMOVCL,BUF2+1MOVSI,CXMOVBUF2[SI+2],0MOVAH,3DHMOVAL,2INT21HMOVB2,AXX

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论