資源描述:
《單片機(jī)讀程序復(fù)習(xí)》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在應(yīng)用文檔-天天文庫。
1、1.寫出下列指令執(zhí)行的結(jié)果(1).MOVA,#20HMOVR0,#20HMOV@R0,AANL??A,??#0FHORL??A,??#80HXRL??A,??@R0A=__________;????R0=????????????;???????(20H)=__________(2).MOV?????DPTR,#2314HMOV?????R0,DPHMOV?????14H,#22HMOV?????R1,DPLMOV?????23H,#56HMOV?????A,@R0XCH?????????????A,DPH執(zhí)行以上指令后A=____________DPTR=__________
2、(3).MOV?????A,#50HMOV?????B,#77HPUSH?????ACCPUSH?????BPOP???????ACCPOP???????B執(zhí)行完本段指令后(A)=_________(B)=_______2.設(shè)內(nèi)部RAM中59H單元的內(nèi)容為50H,寫出當(dāng)執(zhí)行下列程序段后寄存器A,R0和內(nèi)部RAM中50H,51H單元的內(nèi)容為何值?MOVA,59HMOVR0,AMOVA,#00HMOV@R0,AMOVA,#25HMOV51H,AMOV52H,#70H3.已知(A)=83H,(R0)=17H,(17H)=34H。請(qǐng)寫出執(zhí)行完下列程序段后A的內(nèi)容。ANLA,#17HO
3、RL17H,AXRLA,@R0CPLA4.試分析下列程序段,當(dāng)程序執(zhí)行后,位地址00H,01H中的內(nèi)容為何值?P1口的8條I/0線為何狀態(tài)?CLRCMOVA,#66HJCLOOP1CPLCSETB01HLOOP1:ORLC,ACC.0JBACC.2,LOOP2CLR00HLOOP2:MOVP1,A5.若A=11H,R0=33H,B=55H,(11H)=22H,(22H)=66H,(33H)=44H,在注釋區(qū)寫出分別執(zhí)行下列指令后果的結(jié)果。?(1)MOV???R1,A?????????;?(2)MOV???R3,#11H??????;?(3)MOV???@R0,#22H????
4、?;?(4)MOV???A,@R0???????;?(5)MOV???B,33H????????;?(6)MOV???40H,R0???????;6.若A=78H,R0=34H,(34H)=DCH,(56H)=ABH,Cy=1,求分別執(zhí)行下列指令后Y和Cy中的數(shù)據(jù)。?(1)ADDC??A,@R0????????;?(2)SUBB???A,56H???????;?(3)DEC????@R0??????????;?(4)INC?????56H?????????;7.若A=B7H,R0=5EH,(23H)=A1H,Cy=0,將分別執(zhí)行下列指令的結(jié)果寫在注釋區(qū)。(1)ANL????A
5、,R0??????????;(2)ORL????A,#23H????????;(3)XRL????23H,A?????????;(4)RLC????A???????????????;8.分別用一條指令實(shí)現(xiàn)下列功能。(1)若進(jìn)位位不為0,則轉(zhuǎn)PROM1程序段執(zhí)行。(2)使PC=2000H。(3)若A中的數(shù)據(jù)不等于100,則程序轉(zhuǎn)至PROM3。(4)若A中數(shù)據(jù)等于0,則程序轉(zhuǎn)至PROM4。(5)將R5中數(shù)據(jù)減1,若R5中數(shù)據(jù)不等于0,則程序轉(zhuǎn)至PROM5。(6)子程序返回。9.已知外RAM(2040H)=50H,ROM(2090H)=96H,內(nèi)RAM(20H)=85H,試求下列程
6、序依次運(yùn)行后有關(guān)單元中的內(nèi)容。MOV????DPTP,#2040H?????????;MOVX??A,@DPTR??????????????;MOVC??A,@A+DPTR????????????;ADD????A,20H???????????????;DA?????A????????????????????;SWAP???A????????????????????;10.試求下列程序依次運(yùn)行后有關(guān)單元中的內(nèi)容。MOV???20H,#A7H??????????;MOV???C,07H??????????????;ORL????C,/H??????????????;CPL???
7、?00H????????????????;SETB???03H????????????????;MOV???A,20H??????????????;RLC????A??????????????????;MOV???20H,A??????????????;11.已知:(60H)=23H,(61H)=61H,以下程序段執(zhí)行后(62H)=????。CLR???????CMOV?????A,#9AHSUBB?????A,60HADD??????A,61HDA????????AMOV?????62H,A12.已知