您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > 微机实验课后练习完整(广工)
1说明:本份资料仅供备考使用,程序的正确性有待进一步验证。1.1STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3500HDATA1DB5DUP(?)ORG350AHDATA2DB5DUP(?)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXLEASI,DATA1LEADI,DATA2MOVCX,0005HMOVAH,00HA1:MOVAL,[SI]SUBAL,30HJCERRORADDAL,30HMOVBL,39HSUBBL,ALJCERRORSUBAL,30HMOV[DI],ALINCDIINCSILOOPA1JMPSTOPERROR:MOV[DI],0FFFFHINCDIINCSILOOPA1STOP:HLTINT03HCODEENDSENDSTART1.2STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3500HDATA1DB2DUP(?)ORG3510HDATA2DB5DUP(?)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVDI,OFFSETDATA1MOVSI,OFFSETDATA2MOVAX,[DI]MOVBX,2710H;十进制数的10000MOVCX,0005HA1:MOVDX,0000HDIVBXADDAL,30HMOV[SI],ALINCSIPUSHDXMOVAX,BXMOVBX,0AHMOVDX,0000HDIVBXMOVBX,AXPOPDXMOVAX,DXLOOPA1INT03HCODEENDSENDSTART1.3STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3500HDATA1DB2DUP(?)ORG350AHDATA2DB4DUP(?)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVDI,OFFSETDATA1MOVSI,OFFSETDATA2MOVAX,[DI]MOVCX,0004HMOVBX,1000HA1:MOVDX,0000HDIVBXCMPAL,0AHJAEA3ADDAL,30HA2:MOV[SI],ALINCSIPUSHDXMOVAX,BXMOVBX,0010HMOVDX,0000HDIVBXMOVBX,AXPOPDXMOVAX,DXLOOPA1INT03HA3:SUBAL,0AHADDAL,41HJMPA2CODEENDSENDSTART21.4STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3500HDATA1DB8DUP(?)ORG3510HDATA2DB8DUP(?)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVDI,OFFSETDATA1MOVSI,OFFSETDATA2MOVCX,0004HMOVBL,0AHMOVAH,00HA1:MOVAL,[DI]MULBLINCDIMOVDL,[DI]ADDAL,DLMOV[SI],ALINCDIINCSILOOPA1INT03HCODEENDSENDSTART1.5STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3600HDATA1DB?ORG3610HJIEGUODB?DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXLEASI,DATA1LEADI,JIEGUOXORCH,CHMOVCL,04HMOVDL,0AHMOVDH,04HA1:MOVAL,[SI]ANDAL,0FHMOVBL,ALMOVAL,[SI]SHRAL,CLMULDLADDAL,BLMOV[DI],ALINCSIINCDIDECDHJNZA2JMPA3A2:JMPA1A3:INT03HCODEENDSENDSTART1.6STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3500HDATA1DB2DUP(?)ORG3510HDATA2DB5DUP(?)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVDI,OFFSETDATA1MOVSI,OFFSETDATA2MOVAX,[DI]MOVBX,2710H;十进制数的10000MOVCX,0005HA1:MOVDX,0000HDIVBXMOV[SI],ALINCSIPUSHDXMOVAX,BXMOVBX,0AHMOVDX,0000HDIVBXMOVBX,AXPOPDXMOVAX,DXLOOPA1INT03HCODEENDSENDSTART2.1STACKSEGMENTSTACKDW64(?)STACKENDSDATASEGMENTORG3700HXLDB08HXHDB02HYLDB09HYHDB05HZLDB04HZHDB03HORG3710HQLDB?QHDB?DATAENDSCODESEGMENTASSUME3CS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVAH,00HMOVDH,01HMOVDL,0AHMOVAL,XLADDAL,YLCMPAL,0AHJAEM1A1:CMPAL,ZLJBM2A2:SUBAL,ZLMOVQL,ALADDAH,XHADDAH,YHSUBAH,ZHMOVQH,AHJMPSTOPM1:ADDAH,DHSUBAL,DLJMPA1M2:SUBAH,DHADDAL,DLJMPA2STOP:HLTINT03HCODEENDSENDSTART2.2STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3000HDATA1DB10H,20H,30H,40H,50H,60HORG3010HJIEGUODW?DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVSI,OFFSETDATA1MOVDI,OFFSETJIEGUOMOVCX,0005HMOVAL,[SI]MOVAH,00HA1:INCSIADDAL,[SI]JCA2LOOPA1A2:INCAHLOOPA1MOVBL,06HDIVBLMOV[DI],ALINCDIMOVDL,0AHMOVAH,00HDIVDLMOV[DI],ALMOV[DI+01H],AHINT03HCODEENDSENDSTART2.3STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3500HDATA1DB?ORG3510HJIEGUODB?DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXLEASI,DATA1LEADI,JIEGUOMOVCX,0002HMOVAL,[SI]A1:INCSIADDAL,[SI]LOOPA1MOV[DI],ALINCDIMOVBL,04HMULBLMOVDL,64HMOVAH,00HDIVDLMOV[DI],ALINCDIMOVAL,AHMOVAH,00HMOVDL,0AHDIVDLMOV[DI],ALINCDIMOV[DI],AHINT03HCODEENDSENDSTART2.4STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3050HDATA1DW8DUP(?)ORG3060HJIEGUODW?DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXLEASI,DATA1LEADI,JIEGUOMOVCX,0004MOVAH,00H4SAHFA1:MOVAX,[SI]ADCAX,[SI+08H]MOVWORDPTR[DI],AXINCDIINCDIINCSIINCSILOOPA1INT03HCODEENDSENDSTART2.5STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3300HXLDB08HXHDB06HYLDB09HYHDB05HZLDB06HZHDB03HORG3310HQDB?DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVDI,OFFSETQA1:MOVAL,XLCMPAL,ZLJBA2M1:SUBAL,YLMOVAH,XHSUBAH,YHADDAL,ZLCMPAL,0AHJAEA3M2:MOV[DI],ALINCDIADDAH,ZHMOV[DI],AHJMPA4A2:DECAHADDAL,0AHJMPM1A3:INCAHSUBAL,0AHJMPM2A4:INT03HCODEENDSENDSTART2.6STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3000HXDQ9876543219876765HYDQ5643289548323977HJIEGUODW?DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXLEASI,XLEADI,JIEGUOMOVCX,0004HA1:MOVAX,[SI]MOVBX,[SI+08H]SBBAX,BXMOVWORDPTR[DI],AXINCDIINCDIINCSIINCSILOOPA1INT03HCODEENDSENDSTART3.1STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3500HDATA1DB26DUP(?)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVDI,OFFSETDATA1MOVCL,[DI]XORCH,CHMOVBL,CHMOVDH,CHMOVDL,CHINCDIA1:MOVAL,[DI]TESTAL,80HJEA2INCBLINCDILOOPA1JMPA4A2:CMPAL,00HJEA3INCDHINCDILOOPA1JMPA4A3:INCDLINCDILOOPA1JMPA4A4:MOV[DI+06H],DHMOV[DI+07H],BLMOV[DI+08H],DL5INT03HCODEENDSENDSTART3.2STACKSEGMENTSTACKDW64DUP(?)STACKENDSDATASEGMENTORG3200HDATA1DB4DUP(?)ORG3204HDATA2DB2DUP(?)DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVDI,OFFSETDATA1MOVSI,OFFSETDATA2MOVCX,0003HMOVBL,[DI]MOVDL,[DI+01H]MOVDH,[DI+02H]A1:CMPBL,DLJEA2CMPBL,DHJEA3MOV[SI],DIJMPSTOPA2:CMPBL,DHJEA4ADDDI,0002HMOV[SI],DIJMPSTOPA3:ADDDI,0001HMOV[SI],DIJMPSTOPA4:MOV[SI]
本文标题:微机实验课后练习完整(广工)
链接地址:https://www.777doc.com/doc-5055677 .html