資源描述:
《單片機習題-讀程序.doc》由會員上傳分享,免費在線閱讀,更多相關內(nèi)容在教育資源-天天文庫。
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??????????
2、???A,DPH執(zhí)行以上指令后A=____________DPTR=__________(3).MOV?????A,#50HMOV?????B,#77HPUSH?????ACCPUSH?????BPOP???????ACCPOP???????B執(zhí)行完本段指令后(A)=_________(B)=_______2.設內(nèi)部RAM中59H單元的內(nèi)容為50H,寫出當執(zhí)行下列程序段后寄存器A,R0和內(nèi)部RAM中50H,51H單元的內(nèi)容為何值?MOVA,59HMOVR0,AMOVA,#00HMOV@R0,AMOVA,#25HMOV
3、51H,AMOV52H,#70H3.已知(A)=83H,(R0)=17H,(17H)=34H。請寫出執(zhí)行完下列程序段后A的內(nèi)容。ANLA,#17HORL17H,AXRLA,@R0CPLA4.試分析下列程序段,當程序執(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)=
4、66H,(33H)=44H,在注釋區(qū)寫出分別執(zhí)行下列指令后果的結(jié)果。?(1)MOV???R1,A?????????;?(2)MOV???R3,#11H??????;?(3)MOV???@R0,#22H?????;?(4)MOV???A,@R0???????;?(5)MOV???B,33H????????;?(6)MOV???40H,R0???????;6.若A=78H,R0=34H,(34H)=DCH,(56H)=ABH,Cy=1,求分別執(zhí)行下列指令后(34H)和(56H)中的數(shù)據(jù)。?(1)ADDC??A,@R0??
5、??????;?(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,R0??????????;(2)ORL????A,#23H????????;(3)XRL????23H,A?????????;(4)RLC????A???????????????;??????????;10.試求下列程序依次運行后有關單元
6、中的內(nèi)容。MOV???20H,#A7H??????????;MOV???C,07H??????????????;ORL????C,/H??????????????;CPL????00H????????????????;SETB???03H????????????????;MOV???A,20H??????????????;RLC????A??????????????????;MOV???20H,A??????????????;11.已知:(60H)=23H,(61H)=61H,以下程序段執(zhí)行后(62H)=????。C
7、LR???????CMOV?????A,#9AHSUBB?????A,60HADD??????A,61HDA????????AMOV?????62H,A12.已知:(A)=02H,(SP)=40H,(41H)=FFH,(42H)=FFH,以下程序段執(zhí)行后(A)=?????.(SP)=??????.(41H)=??????.(42H)=???????.(PC)=????????。POP???????DPHPOP???????DPLMOV?????DPTR,#3000HRR?????????AMOV?????B,AMOV
8、C???A,@A+DPTRPUSH?????ACCMOV?????A,BINC???????AMOVC???A,@A+DPTRPUSH?????ACCRETORG??????3000HDB?????????10H,80H,30H,50H,30H,50H13.以下程序段執(zhí)行后(A)=????????,(30H)=????????。MOV?????