您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 其它行业文档 > 汇编语言程序设计答案+廖建明-chap6
6.1C6.2D6.3D6.4C6.5B6.6L0:MOVAL,0RET6.7IPIPCSIPCSIP6.8IPSP=(SP)+n(n)IPCSSP=(SP)+n(n)6.9IPCSSP=(SP)+46.106.116.12CALLIPJMP6.13FARCALLNEAR6.14BX;(BX);SHIFT6.156.16DATASEGMENTNDB5DATAENDSSTACKSEGMENTDW20HDUP(0)STACKENDSCODESEGMENTASSUMECS:CODE,DS:DATA,SS:STACKBEGIN:MOVAX,DATAMOVDS,AXMOVAL,NCALLFACT;5!MOVRESULT,DXDECNMOVAL,NCALLFACT;4!ADDRESULT,DXDECNMOVAL,NCALLFACT;3!ADDRESULT,DXMOVAH,4CHINT21HFACTPROCNEAR;MOVDX,1CMPAL,0JZDONEPUSHAXDECALCALLFACTPOPAXMULDLMOVDX,AXDONE:RETFACTENDPCODEENDSENDBEGIN6.176181MOVAX,DATAMOVDS,AXMOVSI,OFFSETNUMMOVCX,COUNTMOVDX0CALLFMOVAH,4CHINT21HFPROCLOP:MOVDI,OFFSETNUM20ADDDIDXINCDXXORBL,BLMOVAX,[SI]LOP20:CMPAX,20JCSUB5SUBAX,20INTBLJMPLOP20SUB5:MOV[DI],BLXORBL,BLLOP5:CMPAX,5JCSUB2SUBAX,5INTBLJMPLOP5SUB2:ADDDI,COUNTDI=DI+2*COUNTMOV[DI],BLXORBL,BLLOP2:CMPAX,2JCSUB1SUBAX,2INTBLJMPLOP2SUB1:ADDDI,COUNTSHL1DI=DI+2*COUNTMOV[DI],BLXORBL,BLLOP1:CMPAX,1JCDONESUBAX,1INTBLJMPLOP1DONEADDDICOUNTADDDICOUNTADDDICOUNTDI=DI+3*COUNTMOV[DI]BLADDSI2LOOPLOPRETFENDPEODEENDS2BEGIN:MOVAX,DATAMOVDS,AXMOVSI,OFFSETNUMMOVDIOFFSETNUM20MOVCX,COUNTPUSHSIPUSHDIPUSHCXCALLFMOVAH,4CHINT21HFPROCPUSHAXPUSHBXPUSHCXPUSHSIPUSHDIMOVBP,SPMOVCX,12[BP]MOVDI,14[BP]MOVSI,16[BP]LOP:XORBL,BLMOVAX,[SI]LOP20:CMPAX,20JCSUB5SUBAX,20INCBLJMPLOP20SUB5:MOV[DI],BLXORBL,BLLOP5:CMPAX,5JCSUB2SUBAX,5INCBLJMPLOP5SUB2:MOV[DI+COUNT],BLXORBL,BLLOP2:CMPAX,2JCSUB1SUBAX,2INCBLJMPLOP2SUB1:MOV[DI+COUNT+COUNT],BLXORBL,BLLOP1:CMPAX,1JCDONESUBAX,1INCBLJMPLOP1DONE:MOV[DI+COUNT+COUNT+COUNT],BLADDSI,2INTDILOOPLOPRETFENDPCODEENDSENDBEGIN
本文标题:汇编语言程序设计答案+廖建明-chap6
链接地址:https://www.777doc.com/doc-5660953 .html