资源描述:
《微机原理习题问题详解》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
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_LENGTHEQU$
2、-CODE大全实用文档5.解:DATASEGMENTBUFFDB‘THISISANSTRINGDISPLAYPROGRAM’,0DH,0AH,’$’DATAENDSCODESEGMENTASSUMECS:CODE,DS:DATASTART :MOVAX,DATAMOVDS,AXMOVDX,OFFSETBUFFMOVAH,9INT21HMOVAH,4CHINT21HCODEENDSENDSTART6.解:DATASEGMENTXDB2YDB8ZDB?DATAENDSSTACKSEGMENTPARASTACK'STACK'大全实用文档DW200DUP(?)STACKE
3、NDSCODESEGMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVAL,XMOVCL,3MOVAH,ALSALAL,CLSALAH,1ADDAL,AHMOVBL,YSARBL,CLADDAL,BLMOVZ,ALMOVAH,4CHINT21HCODEENDSENDSTART8.解:DATASEGMENT大全实用文档XDW2010HYDW7481HZDW3332HMAXDW?DATAENDSSTACKSEGMENTPARASTACK'STACK'DW200DUP(?)STACKENDSCODESEGMENTAS
4、SUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVAX,XMOVBX,YMOVCX,ZCMPAX,BXJGENEXT1XCHGAX,BXNEXT1:CMPAX,CXJGENEXT2XCHGAX,CXNEXT2:MOVZ,AX大全实用文档MOVAH,4CHINT21HCODEENDSENDSTART9.解:DATASEGMENTSTR1DB12H,32H,45H,54HCOUNTEQU$-STR1STR2DBCOUNTDUP(?)DATAENDSSTACKSEGMENTPARASTACK'STACK'DW200DUP(?)S
5、TACKENDSCODESEGMENTASSUMECS:CODE,DS:DATA,ES:DATASTART:MOVAX,DATAMOVDS,AXMOVES,AXLEASI,STR1MOVDI,OFFSETSTR2MOVCX,COUNT大全实用文档CLDREPMOVSBMOVAH,4CHINT21HCODEENDSENDSTART11.解:DATASEGMENTDAT1DB12H,32H,10H,54HCOUNTEQU$-DAT1DAT2DB?DATAENDSSTACKSEGMENTPARASTACK'STACK'DW200DUP(?)STACKENDSCODESE
6、GMENTASSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AXMOVCX,COUNT-1MOVBX,OFFSETDAT1大全实用文档MOVAL,[BX]LP:INCBXCMPAL,[BX]JLENEXT1MOVAL,[BX]NEXT1:LOOPLPMOVDAT2,ALMOVAH,4CHINT21HCODEENDSENDSTART12.解:(1)递归法编程DATASEGMENTRESULTDW?DATAENDSSTACKSEGMENTPARASTACK'STACK'DW200DUP(?)STACKENDSCODESEGMENTA
7、SSUMECS:CODE,DS:DATASTART:MOVAX,DATAMOVDS,AX大全实用文档MOVBX,0MOVDL,5LP:MOVCL,DLMOVAX,0CALLFACADDBX,AXDECDLJNZLPMOVRESULT,BXMOVAH,4CHINT21HFACPROCNEARCMPCL,1JENEXTDECCLCALLFACINCCLMULCLJMPNEXT1NEXT:MOVAL,1NEXT1:RET大全实用文档FACENDPCODEENDSENDSTART(2)普通法编程DATASEGMENTRESULTDW?DATAENDSSTACKSEGMEN
8、TPARA