资源描述:
《《单片机》读程序题题库》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、《单片机原理及应用》读程序题题库四、阅读下列程序,注释并填写指令执行后的结果(每题10分)ORG0LJMPSTARTORG30HSTART:MOVRO,#20HMOVRl,#30HMOVA,ROADDA,#36HMOVPl,AINCROINCR1ANLA,R1SWAPAPUSHACCMOVPl,APOPBMOVRO,AMOVDPTR,SETBCADDCA,#0MOVX©DPTR,1、#220011AEND(R0)二(Rl)=(Pl)=2、(A)=ORG0LJMPSTARTORG30HMOVSP,#50HMOVR2,#1OHMOVDPTR,83000HCLRAMOVX@D
2、PTR,AINCDPTRDJNZR2,LOOPINCDPHINCDPHMOV20H,#36HSETBOOHMOVA,20HMOVX©DPTR,AINCAINCAPUSHACCXCHA,R2POPDPHADDA,#55HPUSHACCEND(R2)二START:LOOP:(20H)=0START3OHRO,#3OHA,#12HCA,RO©RO,AAADPTR,#2000HDPHPl,AA@DPTR,AA,ROAACCAACC(RO)=(30H)=(DPTR)=3、ORGLJMPORGSTART:MOVMOVSETBADDCMOVSWAPINCMOVINCMOVINCMOV
3、XXCHRLPUSHRLPOPEND(A)=(Pl)=4、ORG0LJMPSTARTORG30HSTART:MOVSP,#50HMOVDPTR,#3000HMOVRO,#20HMOVA,#23HMOVR2,#OFHSETBO1HSETBCADDCA,©ROINCROMOV@RO,ALOOP:DJNZR2,LOOPSWAPAPUSHACCINCDPHMOVX@DPTR,APOPBRRAADDA,BMOVPl,AEND(21H)=(R2)=(A)=⑻二(3100H)=START“ORG0LJMPSTARTORG30HMOVMOVMOVDPTRU1OOOHAL13HRn#20
4、HMOV宪pARLCAXCHA』⑥ROPUSHACCPOPDPLMOVX⑥DPTKADECAPUSHDPHPOPBADD>BMOVpl」CLRAADD>wEND(plT(BT(DPTR)n(Ro)H6,ORG0LJMPSTARTORG30HSTART”MOVMOVMOVMOVSR#50HKp#20HR2L10HA.#24HLoop”MOVf>(20H)HINCRODJNZRNLoopSETBOOHSETBCADDCA・#OOHSWAPAPUSHACCPOPDPHPUSHACCpopBMOV>R2MOVDPL"AMOV>BPUSHACCEND(atgn(20H)n(DPT
5、R)n§n7、ORGL.JMPORG0START30HSTART:MOVDPTR,#21OOHCLRAMOVR1,#3OHSETBCADDCA,R1MOV@R1,APUSHACCPOPDPLRRAMOVRO,AORLA,#24HMOVPl,ASWAPAMOVDPH,AMOVB,#02HADDA,BCLRACC.3SWAPENDA(A)=(RO)=(DPTR)(Pl)二(30H)=8、ORG0LJMPSTARTORG3OHSTART:MOVSP,#50HMOVR3,#10HCLRAMOVRO,#20HLOOP:MOV©RO,AINCROD.JNZR3,LOOPSETBOO
6、HSETBCSUBBA,#OOHMOVDPL,APUSHACCMOVA,R3MOVDPH,APOPACCMOVX@DPTR,AANLA,#55HPUSHACCCLRAEND(A)=(R3)=(20H)=(DPTR)二(SP)LJMPSTARTORG30HSTART:MOVRO,#3OHMOVRl,#20HMOVA,ROADDA,#37HMOVPl,AINCROINCR1ANLA,R1SWAPAPUSHACCMOVPl,ASWAPAPOPBMOVRO,AMOVDPTR,#2200HSETBCADDCA,BMOVX@DPTR,AEND(RO)=(Rl)二(Pl)二⑻二(22
7、00H)(A)=(R2)=(20H)=(DPTR)=(SP)=L.JMPSTARTORG30HSTART:MOVSP,#50HMOVR2,#20HMOVDPTR,#3000HCLRALOOP:MOVX©DPTR,AINCDPTRDJNZR2,LOOPINCDPHINCDPHMOV20H,#38HSETB01HMOVA,20HMOVX@DPTR,AINCAINCAPUSHACCXCHA,R2POPDPHADDA,#55HPUSHACCENDV'ldAONaavVMHddOdVQLOXAOWHdGJNI99VHsnaVdVMSdOOT'蓟ZN