资源描述:
《《汇编语言程序设计》练习题参考答案》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、《汇编语言程序设计》练习题一参考答案一、简答题1.2.答:字节单元:(30022H)=ABH,(30024H)=EFH字单元:(30021H)=AB34H,(30022H)=CDABH。3.答:(1)MOVBX,OFFSETBLOCK+0AH MOVDX,[BX](2)MOVBX,0AH MOVDX,BLOCK[BX](3)MOVBX,OFFSETBLOCK MOVSI,0AH MOVDX,[BX][SI]4.答:BYTE_VAR425954450CEE00??-01020102??00??01020102??00??0102-0102??WORD_VAR000001
2、0002000000-01000200000001000200000001000200-000001000200????FBFF594245545602-5.答:宏展开:2DATA0DW?2DATA1DW?6.答:可以用来指示存储器地址的寄存器有BX、SP、BP、DI、SI、IP、CS、DS、7.答:该程序的第一个字的物理地址是0AAA40H。8.答:(1)064DH(2)0691H(3)05ECH9.答:(1)MOVAX,[BX+0CH] MOVZERO,AX(2)MOVAX,ARRAY[BX]MOVZERO,AX10答:DATASGSEGMENTAT0E000HWOR
3、D_ARRAYLABELWORDBYTE_ARRAYDB100DUP(?)DATASGENDSSTACKSGSEGMENTPARASTACK'STACK'DW32DUP(?)TOSLABELWORDSTACKSGENDSCODESGSEGMENTORG1000HMAINPROCFARASSUMECS:CODESG,DS:DATASG,ES:DATASG,SS:STACKSGSTART:MOVAX,STACKSGMOVSS,AXMOVSP,OFFSETTOSPUSHDSSUBAX,AXPUSHAXMOVAX,DATASGMOVDS,AXMOVES,AX……RETMAINENDP
4、CODESGENDSENDSTART11.答:CLRBMACRON,ARRAYCLDMOVCX,NMOVAL,20HLEADI,ARRAYREPSTOSBENDM12.答:(1)AX、BX、CX、DX、AH、AL、BH、BL、CH、CL、DH、DL、13.答:唯一正确的是D。14.答:MOVBX,2000HLESDI,[BX]MOVAX,ES:[DI]15.答:(1)10025(2)25(3)2548(4)3(5)10316.答:SENDMACROSCHARS,DCHARSLOCALNEXT,EXITPUSHAXPUSHSIMOVSI,0NEXT:MOVAL,SCHARS[S
5、I]MOVDCHARS[SI],ALCMPAL,24HJZEXITINCSIJMPNEXTEXIT:POPSIPOPAXENDM二、写程序段题1.答:codesegmentassumecs:codemainprocfarstart:pushdsmovax,0pushaxmovah,1int21hsubal,30hcmpal,0jzexitmovcl,almovch,0again:movah,2movdl,7int21hloopagainexit:retmainendpcodeendsendstart2.答:dsegsegmentnumdw76,69,84,90,73,88,9
6、9,63,100,80ndw10s6dw0s7dw0s8dw0s9dw0s10dw0dsegendscodesegmentmainprocfarassumecs:code,ds:dsegstart:pushdssubax,axpushaxmovax,dsegmovds,axcallsub1retmainendpsub1procnearpushaxpushbxpushcxpushsimovsi,0movcx,nnext:movax,num[si]movbx,10divblmovbl,alcbwsubbx,6salbx,1incs6[bx]addsi,2loopnextpopsi
7、popcxpopbxpopaxretsub1endpcodeendsendstart3.答:……movdx,100movsi,0repeat:moval,string[si]cmpal,30hjbgooncmpal,39hjagoonorcl,20h;(cl)51jmpexitgoon:incsidecdxjnzrepeatandcl,0dfh;(cl)50exit:……4.答:dsegsegmentnumdw76,69,84,90,73,88,99,63,100,80ndw10s6dw0s7dw0s8