资源描述:
《微机原理习题问题详解.doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
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)(4)4.解:1)MOVAX,OFFSETLNAME2)MOVSI,WORDPTRCODE3)CODE_LENG
2、THEQU$-CODE5.解:DATASEGMENTBUFFDB‘THISISANSTRINGDISPLAYPROGRAM’,0DH,0AH,’$’DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART :MOVAX,DATAMOVDS,AXMOVDX,OFFSETBUFFMOVAH,9INT21HMOVAH,4CHINT21HCODEENDSENDSTART6.解:DATASEGMENTXDB2YDB8ZDB?DATAENDSSTACKSEGMENTPARASTACK'STACK'DW200DU
3、P(?)STACKENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVAL,XMOVCL,3MOVAH,ALSALAL,CLSALAH,1ADDAL,AHMOVBL,YSARBL,CLADDAL,BLMOVZ,ALMOVAH,4CHINT21HCODEENDSENDSTART8.解:DATASEGMENTXDW2010HYDW7481HZDW3332HMAXDW?DATAENDSSTACKSEGMENTPARASTACK'STACK'DW200DUP(?)ST
4、ACKENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVAX,XMOVBX,YMOVCX,ZCMPAX,BXJGENEXT1XCHGAX,BXNEXT1:CMPAX,CXJGENEXT2XCHGAX,CXNEXT2:MOVZ,AXMOVAH,4CHINT21HCODEENDSENDSTART9.解:DATASEGMENTSTR1DB12H,32H,45H,54HCOUNTEQU$-STR1STR2DBCOUNTDUP(?)DATAENDSSTACKSEGME
5、NTPARASTACK'STACK'DW200DUP(?)STACKENDSCODESEGMENTASSUMECS:CODE,DS:DATA,ES:DATASTART:MOVAX,DATAMOVDS,AXMOVES,AXLEASI,STR1MOVDI,OFFSETSTR2MOVCX,COUNTCLDREPMOVSBMOVAH,4CHINT21HCODEENDSENDSTART11.解:DATASEGMENTDAT1DB12H,32H,10H,54HCOUNTEQU$-DAT1DAT2DB?DATAENDSSTACKSEGMENTPA
6、RASTACK'STACK'DW200DUP(?)STACKENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVCX,COUNT-1MOVBX,OFFSETDAT1MOVAL,[BX]LP:INCBXCMPAL,[BX]JLENEXT1MOVAL,[BX]NEXT1:LOOPLPMOVDAT2,ALMOVAH,4CHINT21HCODEENDSENDSTART12.解:(1)递归法编程DATASEGMENTRESULTDW?DATAENDSSTACKSEGME
7、NTPARASTACK'STACK'DW200DUP(?)STACKENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVBX,0MOVDL,5LP:MOVCL,DLMOVAX,0CALLFACADDBX,AXDECDLJNZLPMOVRESULT,BXMOVAH,4CHINT21HFACPROCNEARCMPCL,1JENEXTDECCLCALLFACINCCLMULCLJMPNEXT1NEXT:MOVAL,1NEXT1:RETFACENDPCODEENDSE
8、NDSTART(2)普通法编程DATASEGMENTRESULTDW?DATAENDSSTACKSEGMENTPARASTACK'STACK'DW200DUP(?)STACKENDSCODESEGMENTASSUMECS:CODE,D