资源描述:
《微机原理习题答案》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、第四章8086/8088指令系统8.解:MOVBX,DXMOVDX,0MOVCX,2MULCXPUSHAXPUSHDXMOVAX,BXMOVDX,0MULCXPUSHAXPUSHDXPOPCXPOPDXPOPBXPOPAX;AX乘以2的结果放在BX:AX,DX乘以2的结果放在CX:DX9.解:ORAL,0F0H;与1或置1ANDAL,0FCH;与0与清零XORAL,0CH;与1异或取反第5章汇编语言程序设计3.(1)(2)9/9(4)4.解:1)MOVAX,OFFSETLNAME2)MOVSI,WORDPTRCODE3)CODE_
2、LENGTHEQU$-CODE5.解:DATASEGMENTBUFFDB‘THISISANSTRINGDISPLAYPROGRAM’,0DH,0AH,’$’DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART :MOVAX,DATAMOVDS,AXMOVDX,OFFSETBUFFMOVAH,9INT21HMOVAH,4CHINT21HCODEENDSENDSTART6.解:DATASEGMENTXDB2YDB8ZDB?DATAENDSSTACKSEGMENTPARASTACK'STACK'DW
3、200DUP(?)STACKENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATA9/9MOVDS,AXMOVAL,XMOVCL,3MOVAH,ALSALAL,CLSALAH,1ADDAL,AHMOVBL,YSARBL,CLADDAL,BLMOVZ,ALMOVAH,4CHINT21HCODEENDSENDSTART8.解:DATASEGMENTXDW2010HYDW7481HZDW3332HMAXDW?DATAENDSSTACKSEGMENTPARASTACK'STACK'DW20
4、0DUP(?)STACKENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVAX,XMOVBX,YMOVCX,ZCMPAX,BXJGENEXT1XCHGAX,BXNEXT1:CMPAX,CXJGENEXT2XCHGAX,CXNEXT2:MOVZ,AXMOVAH,4CHINT21HCODEENDSENDSTART9/99.解:DATASEGMENTSTR1DB12H,32H,45H,54HCOUNTEQU$-STR1STR2DBCOUNTDUP(?)DATAE
5、NDSSTACKSEGMENTPARASTACK'STACK'DW200DUP(?)STACKENDSCODESEGMENTASSUMECS:CODE,DS:DATA,ES:DATASTART:MOVAX,DATAMOVDS,AXMOVES,AXLEASI,STR1MOVDI,OFFSETSTR2MOVCX,COUNTCLDREPMOVSBMOVAH,4CHINT21HCODEENDSENDSTART11.解:DATASEGMENTDAT1DB12H,32H,10H,54HCOUNTEQU$-DAT1DAT2DB?DATAENDS
6、STACKSEGMENTPARASTACK'STACK'DW200DUP(?)STACKENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVCX,COUNT-1MOVBX,OFFSETDAT1MOVAL,[BX]LP:INCBXCMPAL,[BX]JLENEXT1MOVAL,[BX]9/9NEXT1:LOOPLPMOVDAT2,ALMOVAH,4CHINT21HCODEENDSENDSTART12.解:(1)递归法编程DATASEGMENTRESULTDW?
7、DATAENDSSTACKSEGMENTPARASTACK'STACK'DW200DUP(?)STACKENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVBX,0MOVDL,5LP:MOVCL,DLMOVAX,0CALLFACADDBX,AXDECDLJNZLPMOVRESULT,BXMOVAH,4CHINT21HFACPROCNEARCMPCL,1JENEXTDECCLCALLFACINCCLMULCLJMPNEXT1NEXT:MOVAL,1NEXT1:
8、RETFACENDPCODEENDSENDSTART9/9(2)普通法编程DATASEGMENTRESULTDW?DATAENDSSTACKSEGMENTPARASTACK'STACK'DW200DUP(?)STACKENDSCODESEGMENT