• 1.07 MB
  • 2022-04-22 11:18:41 发布

《单片机》读程序题题库答案.pdf

  • 36页
  • 当前文档由用户上传发布,收益归属用户
  1. 1、本文档共5页,可阅读全部内容。
  2. 2、本文档内容版权归属内容提供方,所产生的收益全部归内容提供方所有。如果您对本文有版权争议,可选择认领,认领后既往收益都归您。
  3. 3、本文档由用户上传,本站不保证质量和数量令人满意,可能有诸多瑕疵,付费之前,请仔细先通过免费阅读内容等途径辨别内容交易风险。如存在严重挂羊头卖狗肉之情形,可联系本站下载客服投诉处理。
  4. 文档侵权举报电话:19940600175。
'《单片机原理及应用》读程序题题库答案2、ORG0LJMPSTART;跳转到(PC)=0030H处四、阅读下列程序,注释并填写指令执行后的结果(每题10分)1、ORG0ORG30HLJMPSTART;跳转到(PC)=0030H处START:MOVSP,#50H;#50H->SP(SP)=50HORG30HMOVR2,#10H;#10H->R2(R2)=10HSTART:MOVR0,#20H;#20H->R0(R0)=20HMOVDPTR,#3000H;#3000H->DPTR(DPTR)=3000HMOVR1,#30H;#30H->R1(R1)=30HCRLA;0->A(A)=0MOVA,R0;(R0)->A(A)=20HLOOP:MOVX@DPTR,A;(A)->(DPTR)ADDA,#36H;(A)+#36H->A(A)=56HINCDPTR;(DPTR)+1->DPTRMOVP1,A;(A)->P1(P1)=56HDJNZR2,LOOP;(R2)-1->R2若(R2)不等于零则转移到LOOP处INCR0;(R0)+1->R0(R0)=21HINCDPH;(DPH)+1->DPH(DPH)=31H(R2)=00H(DPL)=10HINCR1;(R1)+1->R0(R1)=31HINCDPH;(DPH)+1->DPH(DPH)=32HANLA,R1;(A)&(R1)->A(A)=10HMOV20H,#36H;#36H->(20H)(20H)=36HSWAPA;累加器A的高低4位交换(A)=01HSETB00H;位地址00H置120H.0=1(20H)=37HPUSHACC;累加器A内容压栈MOVA,20H;(20H)->A(A)=37HMOVP1,A;(A)->P1(P1)=01HMOVX@DPTR,A;(A)->(DPTR)(DPTR)=3210H(3210H)=37HPOPB;堆栈内容出栈到B寄存器(B)=01HINCA;(A)+1->A(A)=38HMOVR0,A;(A)->R0(R0)=01HINCA;(A)+1->A(A)=39HMOVDPTR,#2200H;#2200H->DPTR(DPTR)=2200HPUSHACC;累加器A内容压栈(SP)=51HSETBC;1->Cy(Cy)=1XCHA,R2;累加器A的内容与R2内容互换(A)=00H(R2)=39HADDCA,#0;(A)+0+(Cy)->A(A)=02HPOPDPH;堆栈内容弹到DPH(DPH)=39HMOVX@DPTR,A;(A)->(DPTR)(2200H)=02HADDA,#55H;(A)+#55H->A(A)=55HENDPUSHACC;累加器A内容压栈(R0)=01H(R1)=31H(P1)=01HEND(B)=01H(2200H)=02H(A)=55H(R2)=39H(20H)=37H(DPTR)=3910H(SP)=51H第1页共36页 3、ORG04、ORG0LJMPSTART;跳转到(PC)=0030H处LJMPSTART;跳转到(PC)=0030H处ORG30HORG30HSTART:MOVR0,#30H;#30H->R0(R0)=30HSTART:MOVSP,#50H;#50H->SP(SP)=50HMOVA,#12H;#12H->A(A)=12HMOVDPTR,#3000H;#3000H->DPTR(DPTR)=3000HSETBC;(Cy)=1MOVR0,#20H;#20H->R0(R0)=20HADDCA,R0;(A)+(R0)+Cy->A(A)=43HMOVA,#23H;#23H->A(A)=23HMOV@R0,A;(A)->(R0)(30H)=43HMOVR2,#0FH;#0FH->R2(R2)=0FHSWAPA;累加器A高低4位交换(A)=34HSETB01H;置位20H.1(20H.1)=1INCA;(A)+1->A(A)=35HSETBC;置位Cy(Cy)=1MOVDPTR,#2000H;#2000H->DPTR(DPTR)=2000HADDCA,@R0;(A)+((R0))+Cy->A(A)=26HINCDPH;(DPH)+1->DPH(DPH)=21HINCR0;(R0)+1->R0(R0)=21HMOVP1,A;(A)->P1(P1)=35HMOV@R0,A;(A)->((R0))(21H)=26HINCA;(A)+1->A(A)=36HLOOP:DJNZR2,LOOP;(R2)-1->R2若R2内容不等于零则转移MOVX@DPTR,A;(A)->(DPTR)(2100H)=36HSWAPA;累加器A内容的高低4位交换(A)=62HXCHA,R0;(A)R0(A)=30H(R0)=36HPUSHACC;累加器A内容入栈RLA;累加器A内容循环左移(A)=60HINCDPH;(DPH)+1->DPH(DPH)=31HPUSHACC;累加器A的内容入栈MOVX@DPTR,A;(A)->(DPTR)(3100H)=62HRLA;累加器A内容循环左移(A)=0C0HPOPB;堆栈内容弹出到B(B)=62HPOPACC;堆栈内容弹出到累加器A(A)=60HRRA;累加器A内容循环右移(A)=31HENDADDA,B;(A)+(B)->A(A)=93H(A)=60H(R0)=36H(DPTR)=2100HMOVP1,A;(A)->P1(P1)=93HEND(P1)=35H(30H)=43H(21H)=26H(R2)=00H(A)=93H(B)=62H(3100H)=62H第2页共36页 5、ORG06、ORG0LJMPSTART;跳转到(PC)=0030H处LJMPSTART;跳转到(PC)=0030H处ORG30HORG30HSTART:MOVDPTR,#1000H;#1000H->DPTR(DPTR)=1000HSTART:MOVSP,#50H;#50H->SP(SP)=50HMOVA,#13H;#13H->A(A)=13HMOVR0,#20H;#20H->R0(R0)=20HMOVR0,#20H;#20H->R0(R0)=20HMOVR2,#10H;#10H->R2(R2)=10HSETBC;1->Cy(Cy)=1MOVA,#24H;#24H->A(A)=24HMOV@R0,A;(A)->((R0))(20H)=13HLOOP:MOV@R0,A;(A)->((R0))RLCA;累加器A的内容带进位循环左移(A)=27HINCR0;(R0)+1->R0XCHA,@R0;累加器A的内容与20H单元的内容互换(A)=13H(20H)=27HDJNZR2,LOOP;(R2)-1->R2若R2内容不等于0则跳转到LOOP处PUSHACC;累加器A的内容入栈SETB00H;1->位地址为00H的位(20H.0)=1(20H)=25HPOPDPL;堆栈内容弹出到DPL(DPL)=13HSETBC;1->Cy(Cy)=1MOVX@DPTR,A;(A)->(DPTR)(1013H)=13HADDCA,#00H;(A)+00H+(Cy)->A(A)=25HDECA;(A)-1->A(A)=12HSWAPA;累加器A内容高低四位互换(A)=52HPUSHDPH;DPH内容压栈PUSHACC;累加器A内容压栈POPB;堆栈内容弹出到B(B)=10HPOPDPH;堆栈内容弹出到DPH(DPH)=52HADDA,B;(A)+(B)->A(A)=22HPUSHACC;累加器A内容压栈MOVP1,A;(A)->P1(P1)=22HPOPB;堆栈内容弹出到B(B)=52HCLRA;累加器A内容清零MOVA,R2;(R2)->A(A)=00HADDA,B;(A)+(B)->A(A)=10HMOVDPL,A;(A)->DPL(DPL)=00HENDMOVA,B;(A)+(B)->A(A)=52H(P1)=22H(B)=10H(20H)=27H(DPTR)=1013H(R0)=20HPUSHACC;累加器A内容压栈(SP)=51HEND(A)=52H(R2)=00H(20H)=25H(DPTR)=5200H(SP)=51H第3页共36页 7、ORG08、ORG0LJMPSTART;跳转到(PC)=0030H处LJMPSTART;跳转到(PC)=0030H处ORG30HORG30HSTART:MOVDPTR,#2100H;#2100H->DPTR(DPTR)=2100HSTART:MOVSP,#50H;#50H->SP(SP)=50HCLRA;0->A(A)=00HMOVR3,#10H;#10H->R3(R3)=10HMOVR1,#30H;#30H->R1(R1)=30HCLRA;累加器A内容清零(A)=00HSETBC;1->Cy(Cy)=1MOVR0,#20H;#20H->R0(R0)=20HADDCA,R1;(A)+(R1)+Cy->A(A)=31HLOOP:MOV@R0,A;(A)->((R0))MOV@R1,A;(A)->((R1))(30H)=31HINCR0;(R0)+1->R0PUSHACC;累加器A的内容压栈DJNZR3,LOOP;(R3)-1->R3若R3不等于零则跳转到LOOP处POPDPL;堆栈内容弹出到DPL(DPL)=31HSETB00H;1->位地址00H位(20H.0)=1(20H)=01HRRA;累加器A的内容循环右移(A)=98HSETBC;1->Cy(Cy)=1MOVR0,A;(A)->R0(R0)=98HSUBBA,#00H;(A)-00H-Cy->A(A)=0FFHORLA,#24H;(A)or24H->A(A)=0BCHMOVDPL,A;(A)->DPL(DPL)=0FFHMOVP1,A;(A)->P1(P1)=0BCHPUSHACC;累加器A的内容压栈SWAPA;累加器A的内容高低四位交换(A)=0CBHMOVA,R3;(R3)->A(A)=00HMOVDPH,A;(A)->DPH(DPH)=0CBHMOVDPH,A;(A)->DPH(DPH)=00HMOVB,#02H;#02H->B(B)=02HPOPACC;堆栈内容弹出到A(A)=0FFHADDA,B;(A)+(B)->A(A)=0CDHMOVX@DPTR,A;(A)->(DPTR)(00FFH)=0FFHCLRACC.3;0->ACC.3(A)=0C5HANLA,#55H;(A)and55H->A(A)=55HSWAPA;累加器A的内容高低四位交换(A)=5CHPUSHACC;累加器A的内容压栈(SP)=51HENDCLRA;累加器A内容清零(A)=00H(A)=5CH(R0)=98H(DPTR)=0CB31H(P1)=0BCH(30H)=31HEND(A)=00H(R3)=00H(20H)=01H(DPTR)=00FFH(SP)=51H第4页共36页 9、ORG010、ORG0LJMPSTART;跳转到(PC)=0030H处LJMPSTART;跳转到(PC)=0030H处ORG30HORG30HSTART:MOVR0,#30H;#30H->R0(R0)=30HSTART:MOVSP,#50H;#50H->SP(SP)=50HMOVR1,#20H;#20H->R1(R1)=20HMOVR2,#20H;#20H->R2(R2)=20HMOVA,R0;(R0)->A(A)=30HMOVDPTR,#3000H;#3000H->DPTR(DPTR)=3000HADDA,#37H;(A)+#36H->A(A)=67HCLRA;0->A(A)=0MOVP1,A;(A)->P1(P1)=67HLOOP:MOVX@DPTR,A;(A)->(DPTR)INCR0;(R0)+1->R0(R0)=31HINCDPTR;(DPTR)+1->DPTRINCR1;(R1)+1->R0(R1)=21HDJNZR2,LOOP;(R2)-1->R2若(R2)不等于零则转移到LOOP处ANLA,R1;(A)&(R1)->A(A)=21HINCDPH;(DPH)+1->DPH(DPH)=31H(R2)=00H(DPL)=20HSWAPA;累加器A的高低4位交换(A)=12HINCDPH;(DPH)+1->DPH(DPH)=32HPUSHACC;累加器A内容压栈MOV20H,#38H;#36H->(20H)(20H)=38HMOVP1,A;(A)->P1(P1)=12HSETB01H;位地址01H置120H.1=1(20H)=3AHSWAPA;累加器A的高低4位交换(A)=21HMOVA,20H;(20H)->A(A)=3AHPOPB;堆栈内容出栈到B寄存器(B)=12HMOVX@DPTR,A;(A)->(DPTR)(DPTR)=3220H(3220H)=3AHMOVR0,A;(A)->R0(R0)=21HINCA;(A)+1->A(A)=3BHMOVDPTR,#2200H;#2200H->DPTR(DPTR)=2200HINCA;(A)+1->A(A)=3CHSETBC;1->Cy(Cy)=1PUSHACC;累加器A内容压栈(SP)=51HADDCA,B;(A)+(B)+(Cy)->A(A)=34HXCHA,R2;累加器A的内容与R2内容互换(A)=00H(R2)=3CHMOVX@DPTR,A;(A)->(DPTR)(2200H)=34HPOPDPH;堆栈内容弹到DPH(DPH)=3CHENDADDA,#55H;(A)+#55H->A(A)=55H(R0)=21H(R1)=21H(P1)=12H(B)=12H(2200H)=34HPUSHACC;累加器A内容压栈END(A)=55H(R2)=3CH(20H)=3AH(DPTR)=3C20H(SP)=51H第5页共36页 11、ORG012、ORG0LJMPSTART;跳转到(PC)=0030H处LJMPSTART;跳转到(PC)=0030H处ORG30HORG30HSTART:MOVR0,#20H;#20H->R0(R0)=20HSTART:MOVSP,#50H;#50H->SP(SP)=50HMOVA,#31H;#31H->A(A)=31HMOVDPTR,#2000H;#3000H->DPTR(DPTR)=2000HSETBC;(Cy)=1MOV20H,#06H;#06H->20H(20H)=06HADDCA,R0;(A)+(R0)+Cy->A(A)=52HMOVR0,#20H;#20H->R0(R0)=20HMOV@R0,A;(A)->(R0)(20H)=52HMOVA,#35H;#35H->A(A)=35HSWAPA;累加器A高低4位交换(A)=25HMOVR2,#10H;#10H->R2(R2)=10HDECA;(A)-1->A(A)=24HSETB00H;置位20H.0(20H.0)=1(20H)=07HMOVDPTR,#2000H;#2000H->DPTR(DPTR)=2000HSETBC;置位Cy(Cy)=1INCDPH;(DPH)+1->DPH(DPH)=21HADDCA,@R0;(A)+((R0))+Cy->A(A)=3DHDECDPL;(DPL)-1->DPL(DPL)=0FFHINCR0;(R0)+1->R0(R0)=21HMOVP1,A;(A)->P1(P1)=24HMOV@R0,A;(A)->((R0))(21H)=3DHINCA;(A)+1->A(A)=25HLOOP:DJNZR2,LOOP;(R2)-1->R2若R2内容不等于零则转移MOVX@DPTR,A;(A)->(DPTR)(21FFH)=25HSWAPA;累加器A内容的高低4位交换(A)=0D3HXCHA,R0;(A)R0(A)=20H(R0)=25HPUSHACC;累加器A内容入栈RLA;累加器A内容循环左移(A)=40HINCDPH;(DPH)+1->DPH(DPH)=21HPUSHACC;累加器A的内容入栈MOVX@DPTR,A;(A)->(DPTR)(2100H)=0D3HRLA;累加器A内容循环左移(A)=80HPOPB;堆栈内容弹出到B(B)=0D3HPOPACC;堆栈内容弹出到累加器A(A)=40HRRA;累加器A内容循环右移(A)=0E9HENDADDA,B;(A)+(B)->A(A)=0BCH(A)=40H(R0)=25H(DPTR)=21FFH(P1)=24H(20H)=52HMOVP1,A;(A)->P1(P1)=0BCHEND(21H)=3DH(R2)=00H(A)=0BCH(B)=0D3H(2100H)=0D3H第6页共36页 13、ORG014、ORG0LJMPSTART;跳转到(PC)=0030H处LJMPSTART;跳转到(PC)=0030H处ORG30HORG30HSTART:MOVDPTR,#2000H;#2000H->DPTR(DPTR)=2000HSTART:MOVSP,#60H;#60H->SP(SP)=60HMOVA,#36H;#36H->A(A)=36HMOVR0,#20H;#20H->R0(R0)=20HMOVR0,#30H;#30H->R0(R0)=30HMOVR2,#10H;#10H->R2(R2)=10HSETBC;1->Cy(Cy)=1MOVA,#24H;#24H->A(A)=24HMOV@R0,A;(A)->((R0))(30H)=36HLOOP:MOV@R0,A;(A)->((R0))RLCA;累加器A的内容带进位循环左移(A)=6DHINCR0;(R0)+1->R0XCHA,@R0;累加器A的内容与20H单元的内容互换(A)=36H(30H)=6DHDJNZR2,LOOP;(R2)-1->R2若R2内容不等于0则跳转到LOOP处PUSHACC;累加器A的内容入栈SETB01H;1->位地址为01H的位(20H.1)=1(20H)=26HPOPDPL;堆栈内容弹出到DPL(DPL)=36HSETBC;1->Cy(Cy)=1MOVX@DPTR,A;(A)->(DPTR)(2036H)=36HADDCA,20H;(A)+(20H)+(Cy)->A(A)=4BHDECA;(A)-1->A(A)=35HSWAPA;累加器A内容高低四位互换(A)=0B4HPUSHDPH;DPH内容压栈PUSHACC;累加器A内容压栈POPB;堆栈内容弹出到B(B)=20HPOPDPH;堆栈内容弹出到DPH(DPH)=0B4HADDA,B;(A)+(B)->A(A)=55HPUSHACC;累加器A内容压栈MOVP1,A;(A)->P1(P1)=55HPOPB;堆栈内容弹出到B(B)=0B4HCLRA;累加器A内容清零MOVA,R2;(R2)->A(A)=00HADDA,B;(A)+(B)->A(A)=20HMOVDPL,A;(A)->DPL(DPL)=00HENDADDA,B;(A)+(B)->A(A)=0B4H(P1)=55H(B)=20H(30H)=6DH(DPTR)=2036H(R0)=30HPUSHACC;累加器A内容压栈(SP)=61HEND(A)=0B4H(R0)=30H(20H)=26H(DPTR)=0B400H(SP)=61H第7页共36页 15、ORG016、ORG0LJMPSTART;跳转到(PC)=0030H处LJMPSTART;跳转到(PC)=0030H处ORG30HORG30HSTART:MOVDPTR,#1100H;#1100H->DPTR(DPTR)=1100HSTART:MOVSP,#60H;#60H->SP(SP)=60HCLRA;0->A(A)=00HMOVR3,#20H;#20H->R3(R3)=20HMOVR1,#20H;#20H->R1(R1)=20HMOVA,#20H;#20H->A(A)=20HSETBC;1->Cy(Cy)=1MOVR0,#20H;#20H->R0(R0)=20HADDCA,R1;(A)+(R1)+Cy->A(A)=21HLOOP:MOV@R0,A;(A)->((R0))MOV@R1,A;(A)->((R1))(20H)=21HINCR0;(R0)+1->R0INCA;(A)+1->A(A)=22HDJNZR3,LOOP;(R3)-1->R3若R3不等于零则跳转到LOOP处INCA;(A)+1->A(A)=23HSETB02H;1->位地址02H位(20H.2)=1(20H)=24HPUSHACC;累加器A的内容压栈SETBC;1->Cy(Cy)=1POPDPL;堆栈内容弹出到DPL(DPL)=23HSUBBA,20H;(A)-(20H)-Cy->A(A)=0FBHRRA;累加器A的内容循环右移(A)=91HMOVDPL,A;(A)->DPL(DPL)=0FBHMOVR0,A;(A)->R0(R0)=91HPUSHACC;累加器A的内容压栈ORLA,#24H;(A)or#24H->A(A)=0B5HMOVA,R3;(R3)->A(A)=00HMOVP1,A;(A)->P1(P1)=0B5HMOVDPH,A;(A)->DPH(DPH)=00HSWAPA;累加器A的内容高低四位交换(A)=5BHPOPACC;堆栈内容弹出到A(A)=0FBHMOVDPH,A;(A)->DPH(DPH)=5BHMOVX@DPTR,A;(A)->(DPTR)(00FBH)=0FBHMOVB,#02H;#02H->B(B)=02HANLA,#55H;(A)and55H->A(A)=51HADDA,B;(A)+(B)->A(A)=5DHPUSHACC;累加器A的内容压栈(SP)=61HCLRACC.4;0->ACC.4(A)=4DHSWAPA;累加器A内容高低4位交换(A)=15HSWAPA;累加器A的内容高低四位交换(A)=0D4HENDEND(A)=15H(R3)=00H(20H)=24H(DPTR)=00FBH(SP)=61H(A)=D4H(R0)=91H(DPTR)=5B23H(P1)=0B5H(20H)=21H第8页共36页 17、ORG018、ORG0MOVR2,#8;#8->R2(R2)=8HMOVSP,#60H;#60H->SP(SP)=60HMOVR0,#30H;#30H->R0(R0)=30HMOVDPTR,#1000H;#1000H->DPTR(DPTR)=1000HCLRA;#0->A(A)=0MOVR0,#40H;#40H->R0(R0)=40HCPLA;累加器A的内容取反,(A)=0FFHMOVA,#40H;#40H->A(A)=40HLOOP:MOV@R0,A;(A)->(R0)(30H)~(37H)=0FFHMOVR2,#8;#8->R2(R2)=08HINCR0;(R0)+1->R0LOOP:MOV@R0,A;(A)->(R0)(40H)~(47H)=40HDJNZR2,LOOP;(R2)-1->R2,(R2)≠0则转移到LOOP处INCR0;(R0)+1->R0MOVB,R2;(R2)->B(B)=(R2)=0DJNZR2,LOOP;(R2)-1->R2,(R2)≠0则转移到LOOP处INCB;(B)+1->B(B)=1MOVR0,#40H;#40H->R0(R0)=40HMOVA,R0;(R0)->A(A)=(R0)=38HMOVR2,#8;#8->R2(R2)=08HCLRC;0->CyCy=0LOOP1:MOVA,@R0;((R0))->AADDCA,B;(A)+(B)+Cy->A(A)=39HINCA;(A)+1->AMOVR0,A;(A)->R0(R0)=(A)=39HANLA,#0FH;(A)and#0FH->ARLCA;累加器A的内容带进位左移,(A)=72HMOVX@DPTR,A;(A)->(DPTR)(1000H)~(1007H)=01HMOVDPTR,#1234H;#1234H->DPTR(DPTR)=1234HINCR0;(R0)+1->R0MOVX@DPTR,A;(A)->(DPTR)(1234H)=72HINCDPTR;(DPTR)+1->DPTRSWAPA;累加器A的内容高低4位交换,(A)=27HDJNZR2,LOOP1;(R2)-1->R2,(R2)≠0;则转移到LOOP1处PUSHACC;累加器内容入栈PUSHDPL;DPL内容入栈(SP)=61HPOPDPH;堆栈内容弹出到DPH(DPH)=27HPOPB;堆栈内容弹出到B寄存器,(B)=08H,(SP)=60HENDPUSHDPH;DPH内容压栈(SP)=61HPOPACC;堆栈内容弹出到累加器A,(A)=10H,(SP)=60H(R0)=39H(A)=27HADDA,B;(A)+(B)->A(A)=18HPUSHB;寄存器B内容压栈(SP)=61H(33H)=0FFH(DPTR)=2734H(1234H)=72HEND评分办法:指令注释占5分,对于程序段注释部分写对的学生可酌情给1-4分;程序段执行结果每(A)=18H(B)=08H空1分,共5分。(42H)=40H(1004H)=01H(SP)=61H评分办法:指令注释占5分,对于程序段注释部分写对的学生可酌情给1-4分;程序段执行结果每空1分,共5分。第9页共36页 19、ORG020、ORG0MOVR0,#20H;#20H->R0(R0)=20HMOVSP,#50H;#50H->SP(SP)=50HMOVA,#40H;#40H->A(A)=40HMOVR0,#20H;#20H->R0(R0)=20HSETBC;1->CyCy=1MOVB,R0;(R0)->B(B)=20HADDCA,R0;(A)+(R0)+Cy->A(A)=61HMOVA,#30H;#30H->A(A)=30HMOVR2,#8;#8->R2(R2)=08HADDA,B;(A)+(B)->A(A)=50HLOOP:MOV@R0,A;(A)->(R0)(20H)~(27H)=61HSETBC;1->CyCy=1INCR0;(R0)+1->R0RRCA;累加器A的内容带进位循环右移(A)=0A8HCy=0DJNZR2,LOOP;(R2)-1->R2(R2)≠0则跳转到LOOP处MOV@R0,A;(A)->(R0)(20H)=0A8HMOVP1,R2;(R2)->P1(P1)=0SETB00H;1->20H.0(20H)=0A9HCLR00H;0->20H.0(20H)=60HMOVDPTR,#1000H;#1000H->DPTR(DPTR)=1000HMOVA,20H;(20H)->A(A)=60HMOVX@DPTR,A;(A)->(DPTR)(1000H)=0A8HPUSHACC;累加器A的内容入栈INCDPL;(DPL)+1->DPL(DPL)=01H(DPTR)=1001HPOPDPH;弹栈到DPH(DPH)=60HMOVA,@R0;((R0))->A(A)=0A9HMOVA,25H;(25H)->A(A)=61HMOVX@DPTR,A;(A)->(DPTR)(1001H)=0A9HMOVDPL,A;(A)->DPL(DPL)=61HSWAPA;累加器A的内容进行高低四位交换(A)=9AHENDORLA,#0FH;(A)or#0FH->A(A)=9FHPUSHACC;累加器A的内容入栈(SP)=51H(20H)=60H(22H)=61HPOPDPL;弹栈到DPL(DPL)=9FH(DPTR)=109FH(SP)=50HPUSHACC;累加器A的内容入栈(SP)=51H(DPTR)=6061H(P1)=00H(R0)=28HEND评分办法:指令注释占5分,对于程序段注释部分写对的学生可酌情给1-4分;程序段执行结果每空1(Cy)=0(SP)=51H分,共5分。(DPTR)=109FH(1000H)=0A8H(1001H)=0A9H评分办法:指令注释占5分,对于程序段注释部分写对的学生可酌情给1-4分;程序段执行结果每空1分,共5分。第10页共36页 21、ORG022、ORG0MOVR0,#30H;#30H->R0(R0)=30HMOVSP,#60H;#60H->SP(SP)=60HMOVR2,#8;#8->R2(R2)=8MOVR0,#20H;#20H->R0(R0)=20HLOOP:MOVA,R2;(R2)->A(A)=08HMOVR2,#8;#8->R2(R2)=08HMOV@R0,A;(A)->(30H)(30H)~(37H)=08H~01HMOVA,#0EEH;#0EEH->A(A)=0EEHINCR0;(R0)+1->R0CPLA;累加器A的内容取反(A)=11HDJNZR2,LOOP;(R2)-1->R2若(R2)≠0则;跳转到LOOP处。LOOP:MOV@R0,A;(A)->(R0)(20H)~(27H)=11HMOVA,30H;(30H)->A(A)=08HINCR0;(R0)+1->R0MOVB,A;(A)->B(B)=08HDJNZR2,LOOP;(R2)-1->R2若(R2)≠0则跳转到LOOP处。MOVA,31H;(31H)->A(A)=07HMOVA,R0;(R0)->A(A)=28HADDA,B;(A)+(B)->A(A)=0FHSETBC;1->Cy(Cy)=1MOVDPTR,#1000H;#1000H->DPTR(DPTR)=1000HADDCA,21H;(A)+(21H)+Cy->A(A)=3AH(Cy)=0MOVX@DPTR,A;(A)->(DPTR)(1000H)=0FHMOVP1,A;(A)->P1(P1)=3AHSWAPA;累加器A的内容高低四位交换(A)=0F0HCLR00H;0->20H.0(20H)=10HDECDPL;(DPL)-1->DPL(DPL)=0FFHMOVA,20H;(20H)->A(A)=10HMOVX@DPTR,A;(A)->(DPTR)(10FFH)=0F0HSWAPA;累加器内容高低四位交换(A)=01HSETBC;1->Cy(Cy)=1PUSHACC;累加器A的内容入栈(SP)=61HRRCA;累加器A的内容带进位循环右移(A)=0F8HMOVDPH,#10H;#10H->DPH(DPH)=10HMOVR0,A;(A)->R0(R0)=0F8HPOPDPL;堆栈内容弹出到DPL(DPL)=01H(DPTR)=1001H(SP)=60HENDMOVX@DPTR,A;(A)->(DPTR)(1001H)=01H(R0)=0F8H(Cy)=0PUSHACC;累加器A的内容入栈(SP)=61HEND(32H)=06H(DPTR)=10FFH(1000H)=0FH(Cy)=0(P1)=3AH评分办法:指令注释占5分,对于程序段注释部分写对的学生可酌情给1-4分;程序段执行结果每空1分,共5分。(R2)=00H(DPTR)=1001H(SP)=61H评分办法:指令注释占5分,对于程序段注释部分写对的学生可酌情给1-4分;程序段执行结果每空1分,共5分。第11页共36页 23、ORG024、ORG0MOVR0,#20H;#20H->R0(R0)=20HMOVSP,#60H;#60H->SP(SP)=60HMOVR2,#8;#8->R2(R2)=08HMOVA,#88H;#88H->A(A)=88HMOVA,#0F8H;#0F8H->A(A)=0F8HCPLA;累加器A的内容取反(A)=77HANLA,#0FH;(A)and#0FH->A(A)=08HADDA,#1;(A)+1->A(A)=78HLOOP:MOV@R0,A;(A)->(R0)(20H)~(27H)=08HSETBC;1->Cy(Cy)=1INCR0;(R0)+1->R0RRCA;累加器A的内容带进位循环右移(A)=0BCHDJNZR2,LOOP;(R2)-1->R2若(R2)≠0则跳转到LOOPMOVDPTR,#2000H;#2000H->DPTR(DPTR)=2000HSETB00H;1->20H.0(20H)=09HMOVX@DPTR,A;(A)->(DPTR)(2000H)=0BCHMOVA,20H;(20H)->A(A)=09HMOV20H,A;(A)->20H(20H)=0BCHSWAPA;累加器A的内容高低四位交换,(A)=90HSETB00H;1->20H.0(20H)=0BDHMOVP1,A;(A)->P1(P1)=90HMOVA,20H;(20H)->A(A)=0BDHADDA,21H;(A)+(21H)->A(A)=98HMOVR0,#0F0H;#0F0H->R0(R0)=0F0HMOVDPTR,#1000H;#1000H->DPTR(DPTR)=1000HORLA,R0;(A)or(R0)->A(A)=0FDHMOVX@DPTR,A;(A)->(DPTR)(1000H)=98HPUSHACC;累加器A的内容入栈(SP)=61HORLA,#0FH;(A)or#0FH->A(A)=9FHPOPDPL;堆栈内容弹出到DPL(DPL)=0FDH(SP)=60HINCDPTR;(DPTR)+1->DPTR,(DPTR)=1001HSWAPA;累加器A的内容高低四位交换(A)=0DFHMOVX@DPTR,A;(A)->(DPTR)(1001H)=9FHPUSHACC;累加器A的内容入栈(SP)=61HDECDPL;(DPL)-1->DPL(DPL)=00H(DPTR)=1000HPOPDPL;堆栈内容弹出到DPL(DPL)=0DFH(DPTR)=20DFH(SP)=60HDECDPL;(DPL)-1->DPL(DPL)=0FFH(DPTR)=10FFHINCA;(A)+1->A(A)=0E0HENDMOVP1,A;(A)->P1(P1)=0E0H(R2)=00H(P1)=90HEND(DPTR)=10FFH(1000H)=98H(1001H)=9FH(P1)=0E0H(20H)=0BDH评分办法:指令注释占5分,对于程序段注释部分写对的学生可酌情给1-4分;程序段执行结果每空1分,共5分。(DPTR)=20DFH(2000H)=0BCH(SP)=60H评分办法:指令注释占5分,对于程序段注释部分写对的学生可酌情给1-4分;程序段执行结果每空1分,共5分。第12页共36页 25、ORG026、ORG0MOVR2,#8;#8->R2,(R2)=08HMOVSP,#60H;#60H->SP,(SP)=60HMOVR0,#30H;#30H->R0,(R0)=30HMOVDPTR,#1000H;#1000H->DPTR,(DPTR)=1000HMOVA,#0DEH;#0DEH->A,(A)=0DEHMOVR0,#40H;#40H->R0,(R0)=40HCPLA;累加器A的内容取反,(A)=21HMOVA,#40H;#40H->A,(A)=40HMOV@R0,A;(A)->(R0),(30H)=21HMOVR2,#8;#8->R2,(R2)=08HMOVB,R2;(R2)->B,(B)=08HLOOP:MOV@R0,A;(A)->(R0)INCB;(B)+1->B,(B)=09HINCA;(A)+1->AMOVA,R0;(R0)->A,(A)=30HINCR0;(R0)+1->R0CLRC;0->Cy,(Cy)=0DJNZR2,LOOP;(R2)-1->R2,若(R2)≠0则转移到LOOP处。ADDCA,B;(A)+(B)->A,(A)=39H;(40H)~(47H)=40H~47H,(A)=48HMOVR0,A;(A)->R0,(R0)=39HXCHA,41H;累加器A的内容与41H单元的内容交换。(A)=41H,(41H)=48HRLCA;累加器A的内容带进位循环左移(A)=72HANLA,#0FH;(A)and#0FH->A,(A)=01HMOVDPTR,#1234H;#1234H->DPTR,(DPTR)=1234HMOVX@DPTR,A;(A)->(DPTR),(1000H)=01HMOVX@DPTR,A;(A)->(DPTR),(1234H)=72HPUSHDPL;DPL内容压栈,(SP)=61HSWAPA;累加器A的内容高低4位交换(A)=27HPOPB;堆栈内容弹出到B,(B)=00H,(SP)=60HENDPUSHDPH;DPH内容压栈,(SP)=61HPOPACC;堆栈内容弹出到A,(A)=10H,(SP)=60H(A)=27H(B)=09HADDA,B;(A)+(B)->A,(A)=10HPUSHB;寄存器B的内容压栈,(SP)=61H(30H)=21H(R0)=39H(1234H)=72HEND(A)=10H(B)=00H评分办法:注释写对可得5分(不要求写出相应寄存器内容),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。(42H)=42H(1000H)=01H(SP)=61H评分办法:注释写对可得5分(不要求写出相应寄存器内容),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第13页共36页 27、ORG028、ORG0MOVR0,#20H;#20H->R0,(R0)=20HMOVSP,#70H;#70H->SP,(SP)=70HMOVA,#40H;#40H->A,(A)=40HMOVR0,#30H;#30H->R0,(R0)=30HSETBC;1->Cy,Cy=1MOVB,R0;(R0)->B,(B)=30HADDCA,R0;(A)+(R0)+Cy->A,(A)=61HMOVA,#30H;#30H->A,(A)=30HMOV@R0,A;(A)->(R0)(20H)=61HADDA,B;(A)+(B)->A,(A)=60HMOVP1,A;(A)->P1,(P1)=61HSETBC;1->Cy,Cy=1MOVA,20H;(20H)->A,(A)=61HRRCA;累加器A的内容带进位循环右移(A)=0B0H,Cy=0PUSHACC;累加器A的内容入栈MOV@R0,A;(A)->(R0),(30H)=0B0HPOPDPH;堆栈内容弹出到DPH,(DPH)=61HINC@R0;((R0))+1->(R0),(30H)=0B1HMOVA,R0;(R0)->A,(A)=20HMOVDPTR,#1000H;#1000H->DPTR,(DPTR)=1000HMOVDPL,A;(A)->DPL,(DPL)=20HMOVX@DPTR,A;(A)->(DPTR),(1000H)=0B0HENDINCDPL;(DPL)+1->DPL,(DPL)=01HMOVA,@R0;((R0))->A,(A)=0B1H(20H)=61HCy=0MOVX@DPTR,A;(A)->(DPTR),(1001H)=0B1HSWAPA;累加器A的内容高低4位交换(A)=1BH(DPTR)=6120H(P1)=61H(R0)=20HORLA,#0FH;(A)or#0FH->A,(A)=1FHPUSHACC;累加器A的内容入栈,(SP)=71H评分办法:注释写对可得5分(不要求写出相应寄存器内容),程序运行结果写对可得5分(每个结果1END分)。若仅写对部分注释可酌情给1-4分。(A)=1FH(SP)=71HCy=0(1000H)=0B0H(1001H)=0B1H评分办法:注释写对可得5分(不要求写出相应寄存器内容),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第14页共36页 29、ORG030、ORG0MOVR0,#30H;#30H->R0,(R0)=30HMOVSP,#60H;#60H->SP,(SP)=60HMOVR2,#8;#8->R2,(R2)=08HMOVR0,#30H;#30H->R0,(R0)=30HMOVA,R2;(R2)->A,(A)=08HMOVR2,#8;#8->R2,(R2)=08HMOV@R0,A;(A)->(R0),(30H)=08HMOVA,#0EEH;#0EEH->A,(A)=0EEHMOVA,R0;(R0)->A,(A)=30HCPLA;累加器A的内容取反,(A)=11HMOVB,A;(A)->B,(B)=30HLOOP:MOV@R0,A;(A)->(R0)ADDA,B;(A)+(B)->A,(A)=60HINCR0;(R0)+1->R0MOVDPTR,#1000H;#1000H->DPTR,(DPTR)=1000HINCA;(A)+1->AMOVX@DPTR,A;(A)->(DPTR),(1000H)=60HDJNZR2,LOOP;(R2)-1->R2,若(R2)≠0则跳转SWAPA;累加器A内容高低四位交换(A)=06H;执行完后,(R2)=0,(R0)=38H,(30H)~(37H)=11H~18HDECDPL;(DPL)-1->DPL,(DPL)=0FFH(DPTR)=10FFHMOVX@DPTR,A;(A)->(DPTR),(10FFH)=06HMOVA,R0;(R0)->A,(A)=38HSETBC;1->Cy,Cy=1MOVP1,A;(A)->P1,(P1)=38HRRCA;累加器A内容带进位循环右移(A)=83H,Cy=0ADDA,#10H;(A)+#10H->A,(A)=48HMOVR0,A;(A)->R0,(R0)=83HXCHA,R2;累加器A的内容与R2的内容交换END;(A)=00H,(R2)=48HPUSHACC;累加器A内容压栈,(SP)=61H(R0)=83HCy=0MOVDPH,#10H;#10H->DPH,(DPH)=10HPOPDPL;弹栈到DPL,(DPL)=00H,(SP)=60H(30H)=08H(DPTR)=10FFH(1000H)=60HMOVX@DPTR,A;(A)->(DPTR),(1000H)=00HPUSHACC;累加器A内容压栈,(SP)=61H评分办法:注释写对可得5分(不要求写出相应寄存器内容),程序运行结果写对可得5分(每个结果1END分)。若仅写对部分注释可酌情给1-4分。(A)=00H(P1)=38H(R2)=48H(DPTR)=1000H(SP)=61H评分办法:注释写对可得5分(不要求写出相应寄存器内容),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第15页共36页 31、ORG032、ORG0MOVR0,#20H;#20H->R0,(R0)=20HMOVSP,#60H;#60H->SP,(SP)=60HMOVR2,#8;#8->R2,(R2)=08HMOVA,#88H;#88H->A,(A)=88HMOVA,#0F9H;#0F9H->A,(A)=0F9HCPLA;累加器A的内容取反,(A)=77HANLA,#0FH;(A)and#0FH->A,(A)=09HADDA,#1;(A)+#1->A,(A)=78HMOV@R0,A;(A)->(R0),(20H)=09HSETBC;1->Cy,Cy=1MOVA,20H;(20H)->A,(A)=09HSWAPA;累加器A的内容高低4位交换,(A)=90HRRCA;累加器A的内容带进位循环右移,(A)=0BCH,Cy=0MOVP1,A;(A)->P1,(P1)=90HMOVDPTR,#1200H;#1200H->DPTR,(DPTR)=1200HADDA,R2;(A)+(R2)->A,(A)=98HMOVX@DPTR,A;(A)->(DPTR),(1200H)=0BCHMOVDPTR,#1100H;#1100H->DPTR,(DPTR)=1100HMOVR2,#8;#8->R2,(R2)=08HMOVX@DPTR,A;(A)->(DPTR),(1100H)=98HDJNZR2,$;(R2)-1->R2,若(R2)≠0则转移。该指令执行完时,(R2)=0ORLA,#0FH;(A)or#0FH->A,(A)=9FHADDA,R2;(A)+(R2)->A,(A)=0BCHINCDPTR;(DPTR)+1->DPTR,(DPTR)=1101HORLA,#0F0H;(A)or#0F0H->A,(A)=0FCHMOVX@DPTR,A;(A)->(DPTR),(1101H)=9FHPUSHACC;累加器A的内容压栈,(SP)=61HDECDPL;(DPL)-1->DPL,(DPL)=00HPOPDPL;弹栈到DPL,(DPL)=0FCH,(SP)=60HDECDPL;(DPL)-1->DPL,(DPL)=0FFH,(DPTR)=11FFHENDINCA;(A)+1->A,(A)=0FDHMOVP1,A;(A)->P1,(P1)=0FDH(20H)=09H(P1)=90HEND(DPTR)=11FFH(1100H)=98H(1101H)=9FH(P1)=0FDH(R2)=00H评分办法:注释写对可得5分(不要求写出相应寄存器内容),程序运行结果写对可得5分(每个结果1(DPTR)=12FCH(1200H)=0BCH(SP)=60H分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第16页共36页 33、ORG034、ORG0LJMPSTART;跳转到START处LJMPSTART;跳转到START处ORG30HORG30HSTART:MOVR0,#30H;#30H→R0,(R0)=30HSTART:MOVSP,#50H;#50H→SP,(SP)=50HMOVR1,#20H;#20H→R1,(R1)=20HMOVR2,#10H;#10H→R2,(R2)=10HMOVA,R0;(R0)→A,(A)=30HMOVDPTR,#2000H;#2000H→DPTR,(DPTR)=2000HADDA,#37H;(A)+#37H→A,(A)=67HCLRA;0→A,(A)=0MOVP1,A;(A)→P1,(P1)=67HLOOP:MOVX@DPTR,A;(A)→(DPTR)INCR0;(R0)+1→R0,(R0)=31HINCDPTR;(DPTR)+1→DPTRINCR1;(R1)+1→R1,(R1)=21HDJNZR2,LOOP;(R2)-1→R2,(R2)≠0则跳转到LOOP处XCHA,R1;A与R1的内容交换,(A)=21H,(R1)=67HINCDPH;(DPH)+1→DPHSWAPA;累加器内容高低4位交换,(A)=12HINCDPH;(DPH)+1→DPH,(DPH)=22HPUSHACC;累加器内容入栈MOV20H,#38H;#38H→20H,(20H)=38HMOVP1,A;(A)→P1,(P1)=12HSETB02H;1→20H.2,(20H)=3CHSWAPA;累加器内容高低4位交换,(A)=21HMOVA,20H;(20H)→A,(A)=3CHMOVR0,A;(A)→R0,(R0)=21HMOVX@DPTR,A;(A)→(DPTR),(DPTR)=2210H,(2210H)=3CHMOVDPTR,#2200H;#2200H→DPTR,(DPTR)=2200HINCA;(A)+1→A,(A)=3DHSETBC;1→Cy,(Cy)=1INCA;(A)+1→A,(A)=3EHADDCA,R1;(A)+(R1)+Cy→A,(A)=89HPUSHACC;累加器内容入栈,(SP)=51HPOPDPL;堆栈内容弹出到DPL,(DPTR)=2212HORLA,R2;(A)or(R2)→A,(A)=3EHMOVX@DPTR,A;(A)→(DPTR),(2212H)=89HPOPDPH;堆栈内容弹出到DPH,(DPH)=3EH,(SP)=50HENDADDA,#67H;(A)+#67H→A,(A)=0A5HPUSHACC;累加器内容入栈,(SP)=51H(R0)=21H(R1)=67H(P1)=12H(A)=89H(DPTR)=2212HEND评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程(A)=0A5H(R2)=0(20H)=3CH(DPTR)=3E10H(SP)=51H序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第17页共36页 35、ORG036、ORG0LJMPSTART;跳转到START处LJMPSTART;跳转到START处ORG30HORG30HSTART:MOVDPTR,#2100H;#2100H→DPTR,(DPTR)=2100HSTART:MOVSP,#50H;#50H→SP,(SP)=50HCLRA;0→A,(A)=0MOVR3,#20H;#20H→R3,(R3)=20HMOVR1,#30H;#30H→R1,(R1)=30HCLRA;0→A,(A)=0SETBC;1→Cy,(Cy)=1MOVR0,#20H;#20H→R0,(R0)=20HADDCA,R1;(A)+(R1)+Cy→A,(A)=31HLOOP:MOV@R0,A;(A)→(R0),此循环执行完(20H)~(3FH)=0~1FHMOV@R1,A;(A)→(R1),(30H)=31HINCA;(A)+1→APUSHACC;累加器内容入栈INCR0;(R0)+1→R0POPDPL;堆栈弹出到DPL,(DPL)=31HDJNZR3,LOOP;(R3)-1→R3,若(R3)≠0则转移RLCA;累加器内容带进位循环左移,(A)=62HSETB07H;1→20H.7,(20H)=80H,(A)=20HMOVR0,A;(A)→R0,(R0)=62HSETBC;1→Cy,(Cy)=1ANLA,#3CH;(A)and#3CH→A,(A)=20HSUBBA,#00H;(A)-#00H-Cy→A,(A)=1FHMOVP1,A;(A)→P1,(P1)=20HMOVDPL,A;(A)→DPL,(DPL)=1FHSWAPA;累加器内容高低4位交换,(A)=02HPUSHACC;累加器内容压栈,(SP)=51HMOVDPH,A;(A)→DPH,(DPH)=02HMOVA,R3;(R3)→A,(A)=0MOVB,#02H;#02H→B,(B)=02HMOVDPH,A;(A)→DPH,(DPH)=0ADDA,B;(A)+(B)→A,(A)=04HPOPACC;堆栈内容弹出到A,(A)=1FH,(SP)=50HCLRACC.3;0→ACC.3,(A)=04HMOVX@DPTR,A;(A)→(DPTR),(001FH)=1FHSWAPA;累加器内容高低4位交换,(A)=40HORLA,#55H;(A)or#55H→A,(A)=5FHENDPUSHACC;累加器内容压栈,(SP)=51HXRLA,#0;(A)○+#0→A,(A)=5FH(A)=40H(R0)=62H(DPTR)=0231H(P1)=20H(30H)=31HEND评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以使用文字进行注释),程序运行结果写(A)=5FH(R3)=0(20H)=80H(DPTR)=001FH(SP)=51H对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以使用文字进行注释),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第18页共36页 37、ORG038、ORG0MOVR0,#20H;R0←#20H,(R0)=20HMOVSP,#70H;SP←#70H,(SP)=70HMOVR2,#8;R2←#8,(R2)=08HMOVA,#77H;A←#77H,(A)=77HMOVA,#0F9H;A←#0F9H,(A)=0F9HCPLA;累加器内容取反,(A)=88HORLA,#03H;A←(A)or#03H,(A)=0FBHADDA,#1;A←(A)+#1,(A)=89HMOV@R0,A;(R0)←(A),(20H)=0FBHSETBC;Cy←1,(Cy)=1CLR07H;bit07H←0,(20H)=7BHRLCA;累加器内容带进位左移,(A)=13HMOVA,20H;A←(20H),(A)=07BHMOVDPTR,#2000H;DPTR←#2000H,(DPTR)=2000HSWAPA;累加器高低4位交换,(A)=0B7HMOVX@DPTR,A;(DPTR)←(A),(2000H)=13HMOVP1,A;P1←(A),(P1)=0B7HMOVR2,#8;R2←#8,(R2)=08HADDA,R2;A←(A)+(R2),(A)=0BFHDJNZR2,$;R2←(R2)-1,若(R2)≠0则转移MOVDPTR,#3000H;DPTR←#3000H,(DPTR)=3000HADDA,R2;A←(A)+(R2),(A)=13HMOVX@DPTR,A;(DPTR)←(A),(3000H)=0BFHORLA,#30H;A←(A)or#30H,(A)=33HORLA,#0FH;A←(A)or#0FH,(A)=BFHPUSHACC;累加器A的内容入栈,(SP)=71HINCDPTR;DPTR←(DPTR)+1,(DPTR)=3001HPOPDPL;堆栈内容弹出到DPL,(SP)=70H,(DPL)=33HMOVX@DPTR,A;(DPTR)←(A),(3001H)=0BFHINCA;A←(A)+1,(A)=34HDECDPL;DPL←(DPL)-1,(DPL)=00HMOVP1,A;P1←(A),(P1)=34HDECDPL;DPL←(DPL)-1,(DPL)=0FFHPUSHDPH;DPH内容入栈,(SP)=71HENDEND(20H)=7BH(P1)=0B7H(P1)=34H(R2)=00H(DPTR)=30FFH(3000H)=0BFH(3001H)=0BFH评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),(DPTR)=2033H(2000H)=13H(SP)=71H程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第19页共36页 39、ORG040、ORG0MOVR0,#20H;R0←#20H,(R0)=20HMOVSP,#60H;SP←#60H,(SP)=60HMOVR0,#20H;R0←#20H,(R0)=20HMOVA,#20H;A←#20H,(A)=20HMOVB,R0;B←(R0),(B)=20HSETBC;Cy←1,(Cy)=1MOVA,#30H;A←#30H,(A)=30HADDCA,R0;A←(A)+(R0)+(Cy),(A)=41HADDA,B;A←(A)+(B),(A)=50HMOVR2,#8;R2←#8,(R2)=08HSETBC;Cy←1,(Cy)=1LOOP:MOV@R0,A;(R0)←(A),循环结束(20H)~(27H)=41H~48HRLCA;累加器内容带进位循环左移,(A)=0A1H,(Cy)=0INCA;A←(A)+1MOV@R0,A;(R0)←(A),(20H)=0A1HINCR0;R0←(R0)+1SETB01H;bit01H←1,(20H.1)=1,(20H)=0A3HDJNZR2,LOOP;R2←(R2)-1,若(R2)≠0则跳转到LOOP处MOVDPTR,#2100H;DPTR←#2100H,(DPTR)=2100HMOVP1,R2;P1←(R2),(P1)=0MOVX@DPTR,A;(DPTR)←(A),(2100H)=0A1HSETB07H;bit07H←1,(20H.7)=1,(20H)=0C1HINCDPL;DPL←(DPL)+1,(DPTR)=2101HMOVA,20H;A←(20H),(A)=0C1HMOVA,@R0;A←((R0)),(A)=0A3HMOVX@DPTR,A;(DPTR)←(A),(2101H)=0A3HPUSHACC;累加器A的内容压栈SWAPA;累加器内容高低4位交换,(A)=03AHPOPDPH;堆栈弹出到DPH,(DPH)=0C1HANLA,#0FH;A←(A)and#0FH,(A)=0AHMOVA,25H;A←(25H),(A)=46HPUSHACC;累加器A内容压栈,(SP)=61HMOVDPL,A;DPL←(A),(DPL)=46HPOPDPL;堆栈弹出到DPL,(DPL)=0AH,(DPTR)=210AH,(SP)=60HENDPUSHACC;累加器A内容压栈,(SP)=61HEND(20H)=0C1H(22H)=43H(Cy)=0(SP)=61H(DPTR)=0C146H(P1)=0H(R0)=28H(DPTR)=210AH(2100H)=0A1H(2101H)=0A3H评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第20页共36页 41、ORG042、ORG0MOVR0,#20H;R0←#20H,(R0)=20HMOVSP,#70H;SP←#70H,(SP)=70HMOVR2,#8;R2←#8,(R2)=08HMOVA,#88H;A←#88H,(A)=88HMOVA,#59H;A←#59H,(A)=59HCPLA;累加器内容取反,(A)=77HORLA,#02H;A←(A)or#02H,(A)=5BHADDA,#1;A←(A)+1,(A)=78HMOV@R0,A;(R0)←(A),(20H)=5BHSETBC;Cy←1,(Cy)=1SETB07H;20H.7←1,(20H)=0DBHRLCA;累加器内容带进位循环左移,(A)=0F1H,(Cy)=0MOVA,20H;A←(20H),(A)=0DBHMOVDPTR,#3000H;DPTR←#3000H,(DPTR)=3000HXCHA,R0;A←→R0,(A)=20H,(R0)=0DBHMOVX@DPTR,A;(DPTR)←(A),(3000H)=0F1HMOVP1,A;P1←(A),(P1)=20HMOVR2,#0FH;R2←#0FH,(R2)=0FHADDA,R2;A←(A)+(R2),(A)=28HINCR2;R2←(R2)+1,(R2)=10HMOVDPTR,#1000H;DPTR←#1000H,(DPTR)=1000HDJNZR2,$;R2←(R2)-1,如果(R2)≠0则转移。MOVX@DPTR,A;(DPTR)←(A),(1000H)=28HADDCA,R2;A←(A)+(R2)+(Cy),(A)=0F1HORLA,#0FH;A←(A)or#0FH,(A)=2FHANLA,#3FH;A←(A)and#3FH,(A)=31HINCDPTR;DPTR←(DPTR)+1,(DPTR)=1001HPUSHACC;累加器内容压栈,(SP)=71H,(71H)=31HANLA,#0F1H;A←(A)and#0F1H,(A)=21HPOPDPL;堆栈弹出到DPL,(DPL)=31H,(SP)=70HMOVX@DPTR,A;(DPTR)←(A),(1001H)=21HINCA;A←(A)+1,(A)=32HDECDPL;DPL←(DPL)-1,(DPTR)=1000HMOVP1,A;P1←(A),(P1)=32HENDPUSHDPH;DPH内容压栈,(SP)=71H,(71H)=30HEND(20H)=0DBH(P1)=20H(P1)=32H(Cy)=0(DPTR)=1000H(1000H)=28H(1001H)=21H(DPTR)=3031H(3000H)=0F1H(SP)=71H评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第21页共36页 43、ORG044、ORG0MOVR0,#20H;R0←#20H,(R0)=20HMOVSP,#70H;SP←#70H,(SP)=70HMOVR0,#20H;R0←#20H,(R0)=20HMOVA,#30H;A←#30H,(A)=30HMOVB,R0;B←(R0),(B)=20HSETBC;Cy←1,(Cy)=1MOVA,#30H;A←#30H,(A)=30HADDCA,R0;A←(A)+(R0)+(Cy),(A)=51HMULAB;BA←A×B,(B)=06H,(A)=00HMOVR2,#10H;R2←#10H,(R2)=10HSETBC;Cy←1,(Cy)=1LOOP:MOV@R0,A;(R0)←(A),循环执行完成后,(20H)~(2FH)=51H~60HRRCA;累加器内容带进位循环右移,(A)=80H,(Cy)=0ADDA,#1;A←(A)+1MOV@R0,A;(R0)←(A),(20H)=80HINCR0;R0←(R0)+1SETB06H;20H.6←1,(20H)=0C0HDJNZR2,LOOP;R2←(R2)-1,若(R2)≠0则转移。MOVDPTR,#1000H;DPTR←#1000H,(DPTR)=1000HMOVP1,R2;P1←(R2),(R2)=0MOVX@DPTR,A;(DPTR)←A,(1000H)=80HSETB07H;20H.7←1,(20H)=0D1HINCDPL;DPL←(DPL)+1,(DPL)=01HXCHA,20H;A←→20H,(A)=0D1H,(20H)=61HMOVA,@R0;A←(R0),(A)=0C0HMOVX@DPTR,A;(DPTR)←(A),(1001H)=0C0HINCA;A←(A)+1,(A)=0D2HSWAPA;A7~4←→A3~0,(A)=0CHPUSHACC;累加器内容压栈ORLA,#0FH;A←(A)or#0FH,(A)=0FHPOPDPH;堆栈内容弹出到DPH,(DPH)=0D2HPUSHACC;累加器内容压栈,(SP)=71H,(71H)=0FHMOVA,24H;A←(24H),(A)=55HPOPDPL;堆栈弹出到DPL,(DPL)=0FH,(SP)=70HMOVDPL,A;DPL←(A),(DPL)=55HPUSHACC;累加器内容压栈,(SP)=71H,(71H)=0FHENDEND(20H)=61H(2FH)=60H(Cy)=0(SP)=71H(DPTR)=0D255H(P1)=00H(R0)=30H(DPTR)=100FH(1000H)=80H(1001H)=0C0H评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第22页共36页 45、ORG046、ORG0LJMPSTART;无条件跳转到START处MOVSP,#60H;SP←#60H,(SP)=60HORG30HMOVA,#77H;A←#77H,(A)=77HSTART:MOVR0,#21H;R0←#21H,(R0)=21HCPLA;A←A,(A)=88HMOVR2,#1AH;R2←#1AH,(R2)=1AHMOVA,#33H;A←#33H,(A)=33HCLRC;Cy←0,(Cy)=0XRLA,#0FFH;A←A○+#0FFH,(A)=0CCHSUBBA,#13H;A←(A)-#13H-(Cy),(A)=75H,(Cy)=0MOV@R0,A;(R0)←(A),(21H)=0CCHRRA;A循环右移一位,(A)=0BAHSETB08H;21H.0←1,(21H)=0CDHMOVDPTR,#1200H;DPTR←#1200H,(DPTR)=1200HMOVA,21H;A←(21H),(A)=0CDHMOVX@DPTR,A;(DPTR)←(A),(1200H)=0BAHXCHA,R0;A←→R0,(A)=21H,(R0)=0CDHMOVP1,A;P1←(A),(P1)=21HMOVR2,#10H;R2←#10H,(R2)=10HADDA,R2;A←(A)+(R2),(A)=3BHDECR2;R2←(R2)-1,(R2)=0FHMOVDPTR,#2301H;DPTR←#2301H,(DPTR)=2301HDJNZR2,$;R2←(R2)-1,如果(R2)≠0则转移,否则继续执行。MOVX@DPTR,A;(DPTR)←(A),(2301H)=3BHORLA,#0CH;A←(A)∨#0CH,(A)=0BEHANLA,#0FH;A←A∧#0FH,(A)=0BHMOVP2,R2;P2←(R2),(P2)=00HINCDPTR;DPTR←(DPTR)+1,(DPTR)=2302HORLA,#88H;A←A∨#88H,(A)=8BHPUSHACC;累加器内容压栈,SP=(SP)+1,(SP)=61HMOVX@DPTR,A;(DPTR)←(A),(2302H)=8BHPOPDPH;堆栈弹出到DPH,SP=(SP)-1,(SP)=60H,(DPH)=0BEHDECDPH;DPH←(DPH)-1,(DPH)=22H,(DPTR)=2202HINCA;A←(A)+1,(A)=0BFHENDPUSHACC;累加器内容压栈,SP=(SP)+1,(SP)=61HPOPDPL;堆栈弹出到DPL,SP=(SP)-1,(SP)=60H,(DPL)=0BFH(21H)=0CDH(P1)=21HEND(P2)=00H(Cy)=0(DPTR)=2202H(2301H)=3BH(2302H)=8BH评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),(DPTR)=0BEBFH(1200H)=0BAH(SP)=60H程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第23页共36页 47、ORG048、ORG0LJMPSTART;无条件跳转到START处MOVR0,#20H;R0←#20H,(R0)=20HORG30HMOVA,#70H;A←#70H,(A)=70HSTART:MOVSP,#65H;SP←#65H,(SP)=65HSETBC;Cy←1,(Cy)=1MOVR0,#03H;R0←#03H,(R0)=03HSUBBA,R0;A←(A)-(R0)-Cy,(A)=4FHMOVB,R0;B←(R0),(B)=03HMOVR2,#4;R2←#4,(R2)=04HMOVA,#30H;A←#30H,(A)=30HDIVAB;A←A/B,B←余数,(A)=10H,(B)=00HLOOP:MOV@R0,A;(R0)←(A),循环执行完(20H)~(23H)=4FH,51H,53H,55HSETBC;Cy←1,(Cy)=1ADDA,#2;A←(A)+2,循环执行完(A)=57HRLCA;累加器内容带进位循环左移一次,(A)=21H,(Cy)=0INCR0;R0←(R0)+1,循环执行完(R0)=24HMOVR0,#20H;R0←#20H,(R0)=20HDJNZR2,LOOP;R2←(R2)-1,如果(R2)≠0则转移,否则继续执行。MOV@R0,A;(R0)←(A),(20H)=21HMOVP2,R2;P2←(R2),(P2)=00HSETB07H;20H.7←1,(20H)=0A1HMOVDPTR,#2000H;DPTR←#2000H,(DPTR)=2000HSETB09H;21H.1←1,(21H)=53HMOVX@DPTR,A;(DPTR)←(A),(2000H)=21HXCHA,21H;A←→21H,(21H)=57H,(A)=53HINCDPL;DPL←(DPL)+1,(DPL)=01H,(DPTR)=2001HINCA;A←(A)+1,(A)=54HMOVA,@R0;A←((R0)),(A)=(20H)=0A1HPUSHACC;累加器内容压栈MOVX@DPTR,A;(DPTR)←(A),(2001H)=0A1HPOPDPL;堆栈内容弹出到DPL,(DPL)=54HSWAPA;累加器内容半字节交换,(A)=1AHANLA,#0FH;A←(A)∧#0FH,(A)=0AHMOVA,22H;A←(22H),(A)=53HPUSHACC;累加器内容压栈,SP=(SP)+1,(SP)=66HMOVDPH,A;DPH←(A),(DPH)=53H,(DPTR)=5354HPOPDPH;堆栈内容弹出到DPH,SP=(SP)-1,(SP)=65H,(DPH)=0AH,(DPTR)=0A01HENDPUSHACC;累加器内容压栈,SP=(SP)+1,(SP)=66HEND(20H)=4FH(23H)=55H(Cy)=0(SP)=66H(DPTR)=0A01H(2000H)=21H(2001H)=0A1H(DPTR)=5354H(P2)=00H(R0)=24H评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第24页共36页 49、ORG050、ORG0LJMPSTART;程序跳转到START处MOVSP,#70H;SP←#70H,(SP)=70HORG30HMOVA,#86H;A←#86H,(A)=86HSTART:MOVR0,#21H;R0←#21H,(R0)=21HCPLA;累加器内容取反,(A)=79HMOVR2,#39H;R2←#39H,(R2)=39HMOVA,#34H;A←#34H,(A)=34HCLRC;Cy←0,(Cy)=0XRLA,#0;A←(A)○+#00H,(A)=34HSUBBA,#0ACH;A←(A)-#0ACH-(Cy),(A)=0CDH,(Cy)=1MOV@R0,A;(R0)←(A),(21H)=34HRRCA;累加器内容带进位循环右移,(A)=0E6H,(Cy)=1SETB09H;21H.1←1,(21H)=36HMOVDPTR,#1730H;DPTR←#1730H,(DPTR)=1730HMOVA,#87H;A←#87H,(A)=87HMOVX@DPTR,A;(DPTR)←(A),(1730H)=0E6HXCHDA,@R0;ACC.0~ACC.3←→21H.0~21H.3,(A)=86H,(21H)=37HMOVP2,A;P2←(A),(P2)=86HMOVR2,#47H;R2←#47,(R2)=47HADDA,R2;A←(A)+(R2),(A)=0BFHDECR2;R2←(R2)-1,(R2)=46HMOVDPTR,#3421H;DPTR←#3421H,(DPTR)=3421HDJNZR2,$;R2←(R2)-1,如果(R2)≠0则转移。MOVX@DPTR,A;(DPTR)←(A),(3421H)=0BFHORLA,#0C1H;A←(A)∨#0C1H,(A)=0E7HORLA,#0FH;A←(A)∨#0FH,(A)=0BFHMOVP1,R2;P2←(R2),(P1)=0INCDPTR;DPTR←(DPTR)+1,(DPTR)=3422HANLA,#77H;A←(A)∧#77H,(A)=37HPUSHACC;累加器内容压栈,(SP)=71HMOVX@DPTR,A;(DPTR)←(A),(3422H)=37HPOPDPL;堆栈弹出到DPL,(DPL)=0E7H,(SP)=70HDECDPH;DPH←(DPH)-1,(DPH)=33HINCA;A←(A)+1,(A)=0E8HDECDPL;DPL←(DPL)-1,(DPH)=21HPUSHACC;累加器内容压栈,(SP)=71HENDPOPDPH;堆栈弹出到DPH,(DPH)=0E8H,(SP)=70HPUSHDPH;DPH内容压栈,(SP)=71H(21H)=37H(P2)=86HEND(P1)=00H(Cy)=1(DPTR)=3321H(3421H)=0BFH(3422H)=37H(DPTR)=0E8E7H(1730H)=0E6H(SP)=71H评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第25页共36页 51、ORG052、ORG0LJMPSTART;跳转到START处MOVSP,#5FH;SP←#5FH,(SP)=5FHORG30HMOVA,#88H;A←#88H,(A)=88HSTART:MOVR0,#20H;R0←#20H,(R0)=20HCPLA;A←A,(A)=77HMOVR2,#5AH;R2←#5AH,(R2)=5AHMOVA,#33H;A←#33H,(A)=33HSETBC;Cy←1,(Cy)=1ORLA,#0F0H;A←(A)∨#0FH,(A)=0F3HADDCA,#20H;A←(A)+20H+Cy,(A)=98H,(Cy)=0MOV@R0,A;(R0)←(A),(20H)=0F3HRLA;A循环左移,(A)=31HCLR06H;bit06H←0,(20H)=0B3HMOVDPTR,#1000H;DPTR←#1000H,(DPTR)=1000HMOVA,20H;A←(20H),(A)=0B3HMOVX@DPTR,A;(DPTR)←(A),(1000H)=31HMOVP2,A;P2←(A),(P2)=0B3HXCHA,R0;(A)←→(R0),(A)=20H,(R0)=0B3HMOVR2,#5FH;R2←#5FH,(R2)=5FHADDA,R2;A←(A)+(R2),(A)=7AHINCR2;R2←(R2)+1,(R2)=60HMOVDPTR,#2000H;DPTR←#2000H,(DPTR)=2000HDJNZR2,$;R2←(R2)-1,(R2)≠0则转移。执行完毕(R2)=0MOVX@DPTR,A;(DPTR)←(A),(2000H)=7AHORLA,#13H;A←(A)∨#13H,(A)=33HXRLA,#0FFH;A←(A)○+#0FFH,(A)=85HMOVP1,R2;P1←(R2),(P1)=00HINCDPTR;DPTR←(DPTR)+1,(DPTR)=2001HANLA,#03H;A←(A)∧#03H,(A)=01HPUSHACC;SP←(SP)+1,(SP)←(A),(SP)=60HMOVX@DPTR,A;(DPTR)←(A),(2001H)=01HPOPDPL;DPL←((SP)),SP←(SP)-1,(SP)=5FH,(DPL)=33HPUSHACC;SP←(SP)+1,(SP)←(A)INCA;A←(A)+1,(A)=34HPOPDPH;DPH←((SP)),SP=(SP)-1,(DPH)=01HPUSHACC;SP←(SP)+1,(SP)←(A),(SP)=60HENDPOPDPH;DPH←((SP)),SP←(SP)-1,(SP)=5FH,(DPH)=34H(R2)=5AH(P2)=0B3HPUSHDPH;SP←(SP)+1,(SP)←(DPH),(SP)=60HEND(DPTR)=0101H(2000H)=7AH(2001H)=01H(P1)=00H(Cy)=0评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),(DPTR)=3433H(1000H)=31H(SP)=60H程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第26页共36页 53、ORG054、ORG0LJMPSTART;跳转到START处MOVR0,#20H;R0←#20H,(R0)=20HORG30HMOVA,#6FH;A←#6FH,(A)=6FHSTART:MOVSP,#70H;SP←#70H,(SP)=70HSETBC;Cy←1,(Cy)=1MOVR0,#03H;R0←#03H,(R0)=03HADDCA,R0;A←(A)+(R0)+(Cy),(A)=90H,(Cy)=0MOVA,#34H;A←#34H,(A)=34HMOVR2,#4;R2←#4,(R2)=04HADDA,R0;A←(A)+(R0),(A)=37HSETBC;Cy←1,(Cy)=1LOOP:MOV@R0,A;(R0)←(A),循环执行完(20H)~(23H)=90H~93HRLCA;A带进位循环左移,(A)=6FH,(Cy)=0INCA;A←(A)+1MOVR0,#21H;R0←#20H,(R0)=21HINCR0;R0←(R0)+1MOV@R0,A;(R0)←(A),(21H)=6FHDJNZR2,LOOP;R2←(R2)-1,若(R2)≠0则转移SETB0FH;bit0FH←1,(21H)=0EFHMOVP1,R2;P1←(R2),(P1)=00HMOVDPTR,#1200H;DPTR←#1200H,(DPTR)=1200HMOVX@DPTR,A;(DPTR)←(A),(1200H)=6FHSETB0AH;bit0AH←1,(21H)=95HINCDPL;DPL←(DPL)+1,(DPL)=01H,(DPTR)=1201HMOVA,21H;A←(21H),(A)=95HMOVA,@R0;A←((R0)),(A)=0EFHPUSHACC;SP←(SP)+1,(SP)←(A)SWAPA;A高低四位交换,(A)=0FEHINCA;A←(A)+1,(A)=96HMOVX@DPTR,A;(DPTR)←(A),(1201H)=0FEHPOPDPL;DPL←((SP)),SP←(SP)-1,(DPL)=95HPUSHACC;SP←(SP)+1,(SP)←(A),(SP)=71HXRLA,#0FFH;A←(A)○+#0FFH,(A)=01HMOVDPH,A;DPH←(A),(DPH)=96HPUSHACC;SP←(SP)+1,(SP)←(A),(SP)=72HENDPOPDPH;DPH←((SP)),SP←(SP)-1,(SP)=71H,(DPH)=01HEND(20H)=90H(23H)=93H(Cy)=0(SP)=71H(DPTR)=9695H(P1)=00H(Cy)=0(DPTR)=0101H(1200H)=6FH(1201H)=0FEH评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第27页共36页 55、ORG056、ORG0LJMPSTART;跳转到START处MOVSP,#5FH;SP←#5FH,(SP)=5FHORG30HMOVA,#79H;A←#79H,(A)=79HSTART:MOVR0,#20H;R0←#20H,(R0)=20HCPLA;A←A,(A)=86HMOVR2,#39H;R2←#39H,(R2)=39HMOVA,#43H;A←#43H,(A)=43HCLRC;Cy←0,(Cy)=0XRLA,#0FFH;A←(A)○+#0FFH,(A)=0BCHSUBBA,#0BFH;A←(A)-#0BFH-(Cy),(A)=0C7H,(Cy)=1MOV@R0,A;(R0)←(A),(20H)=0BCHRLCA;A带进位循环左移,(A)=8FH,(Cy)=1CLR07H;bit07H←0,(20H)=3CHMOVDPTR,#1000H;DPTR←#1000H,(DPTR)=1000HMOVA,#58H;A←#58H,(A)=58HMOVX@DPTR,A;(DPTR)←(A),(1000H)=8FHXCHDA,@R0;(A)3-0←→((R0))3-0,(A)=5CH,(20H)=38HMOVP2,A;P2←(A),(P2)=5CHMOVR2,#4FH;R2←#4FH,(R2)=4FHADDA,R2;A←(A)+(R2),(A)=95HINCR2;R2←(R2)+1,(R2)=50HMOVDPTR,#2500H;DPTR←#2500H,(DPTR)=2500HDJNZR2,$;R2←(R2)-1,若(R2)≠0则转移MOVX@DPTR,A;(DPTR)←(A),(2500H)=95HORLA,#03H;A←(A)∨#03H,(A)=8FHPUSHACC;SP←(SP)+1,(SP)←(A)MOVP2,R2;P2←(R2),(P2)=00HADDA,#02H;A←(A)+#02H,(A)=97HINCDPTR;DPTR←(DPTR)+1,(DPTR)=2501HPUSHACC;SP←(SP)+1,(SP)←(A),(SP)=60HANLA,#77H;A←(A)∧#77H,(A)=17HPOPDPL;DPL←((SP)),SP←(SP)-1,(SP)=5FH,(DPL)=8FHMOVX@DPTR,A;(DPTR)←(A),(2501H)=17HINCDPL;DPL←(DPL)+1,(DPL)=90HDECDPH;DPH←(DPH)-1,(DPH)=24HPUSHDPL;SP←(SP)+1,(SP)←(DPL),(SP)=60HPOPDPL;DPL←((SP)),SP←(SP)-1,(DPL)=95HPOPDPH;DPH←((SP)),SP←(SP)-1,(DPH)=90H,(SP)=5FHENDPUSHDPH;SP←(SP)+1,(SP)←(DPH),(SP)=60H(20H)=38H(P2)=5CHEND(DPTR)=2495H(2500H)=95H(2501H)=17H(P2)=00H(Cy)=1评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),(DPTR)=9090H(1000H)=8FH(SP)=60H程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第28页共36页 57、ORG058、ORG0MOVR0,#21H;R0←#21H,(R0)=21HMOVSP,#50H;SP←#50H,(SP)=50HMOVR2,#8;R2←#8,(R2)=08HMOVA,#77H;A←#77H,(A)=77HMOVA,#0E2H;A←#0E2H,(A)=0E2HCPLA;A←A,(A)=88HORLA,#1EH;A←(A)∨#1EH,(A)=0FEHADDA,#7;A←(A)+#07H,(A)=8FHMOV@R0,A;(R0)←(A),(21H)=0FEHSETBC;Cy←1,(Cy)=1MOVA,21H;A←(21H),(A)=0FEHRRCA;累加器A带进位循环右移1位,(A)=0C7H,(Cy)=1SWAPA;(A)7-4←→(A)3-0,(A)=0EFHMOVDPTR,#3210H;DPTR←#3210H,(DPTR)=3210HMOVP1,A;P1←(A),(P1)=0EFHMOVR2,#10H;R2←#10H,(R2)=10HADDA,R2;A←(A)+(R2),(A)=0F7H,(Cy)=0MOVX@DPTR,A;(DPTR)←(A),(3210H)=C7HMOVDPTR,#2100H;DPTR←#2100H,(DPTR)=2100HDJNZR2,$;R2←(R2)-1,若(R2)≠0则转移MOVX@DPTR,A;(DPTR)←(A),(2100H)=0F7HADDA,R2;A←(A)+(R2),(A)=0C7H,(Cy)=0ANLA,#0FH;A←(A)∧#0FH,(A)=07HANLA,#0F1H;A←(A)∧#0F1H,(A)=0C1HINCDPTR;DPTR←(DPTR)+1,(DPTR)=2101HPUSHACC;SP←(SP)+1,(SP)←(A),(SP)=51HMOVX@DPTR,A;(DPTR)←(A),(2101H)=07HPOPDPH;DPH←(SP),SP←(SP)-1,(DPH)=0C1H,(SP)=50HDECDPL;DPL←(DPL)-1,(DPTR)=2100HINCA;A←(A)+1,(A)=0C2HINCDPH;DPH←(DPH)+1,(DPTR)=2200HPUSHACC;SP←(SP)+1,(SP)←(A),(SP)=51HENDMOVP1,A;P1←(A),(P1)=0C2HEND(21H)=0FEH(P1)=0EFH(P1)=0C2H(Cy)=0(DPTR)=2200H(2100H)=0F7H(2101H)=07H评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),(DPTR)=0C110H(3210H)=0C7H(SP)=51H程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第29页共36页 59、ORG060、ORG0LJMPSTART;跳转到START处LJMPSTART;跳转到START处ORG30HORG30HSTART:MOVDPTR,#1000H;DPTR←#1000H,(DPTR)=1000HSTART:MOVSP,#60H;SP←#60H,(SP)=60HCLRA;A←#0,(A)=00HMOVR3,#8H;R3←#08H,(R3)=08HMOVR1,#20H;R1←#20H,(R1)=20HCLRA;A←#0,(A)=00HSETBC;Cy←1,(Cy)=1MOVR0,#20H;R0←#20H,(R0)=20HADDCA,R1;A←(A)+(R1)+Cy,(A)=21H,(Cy)=0LOOP:MOV@R0,A;(R0)←(A),循环执行完毕(20H)-(27H)=00H-07HMOV@R1,A;(R1)←(A),(20H)=21HINCA;A←(A)+1PUSHACC;SP←(SP)+1,(SP)←(A)INCR0;R0←(R0)+1POPDPL;DPL←(SP),SP←(SP)-1,(DPL)=21HDJNZR3,LOOP;R3←(R3)-1,若(R3)≠0则转移到LOOP处,循环结束后(A)=08HRRCA;累加器内容带进位循环右移1位,(A)=10H,(Cy)=1SETB06H;BIT06H←1,(20H)=40HMOVR0,A;R0←(A),(R0)=10HSETBC;Cy←1,(Cy)=1ANLA,#7EH;A←(A)∧#7EH,(A)=10HSUBBA,#00H;A←(A)-#00H-(Cy),(A)=07HMOVP1,A;P1←(A),(P1)=10HMOVDPL,A;DPL←(A),(DPL)=07HSWAPA;累加器内容高低4位交换,(A)=01HPUSHACC;SP←(SP)+1,(SP)←(A),(SP)=61HMOVDPH,A;DPH←(A),(DPH)=01HMOVA,R3;A←(R3),(A)=00HMOVB,#06H;B←#06H,(B)=06HMOVDPH,A;DPH←(A),(DPH)=00HADDA,B;A←(A)+(B),(A)=07H,(Cy)=0POPACC;A←(SP),SP←(SP)-1,(SP)=60H,(A)=07HSETBACC.6;ACC.6←1,(A)=47HMOVX@DPTR,A;(DPTR)←(A),(0007H)=07HSWAPA;累加器内容高低4位交换,(A)=74HANLA,#77H;A←(A)∧#77H,(A)=07HENDPUSHACC;SP←(SP)+1,(SP)←(A),(SP)=61HCPLA;累加器内容取反,(A)=0F8HEND(A)=74H(R0)=10H(A)=0F8H(R3)=00H(DPTR)=0121H(P1)=10H(20H)=21H(20H)=40H(DPTR)=0007H(SP)=61H评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第30页共36页 61、ORG062、ORG0LJMPSTART;跳转到START处MOVSP,#60H;SP←#60H,(SP)=60HORG30HMOVA,#79H;A←#79H,(A)=79HSTART:MOVR0,#21H;R0←#21H,(R0)=21HSWAPA;累加器内容高低4位交换,(A)=97HMOVR2,#27H;R2←#27H,(R2)=27HCLRC;Cy←0,(Cy)=0MOVA,#34H;A←#34H,(A)=34HCPLA;累加器内容取反,(A)=0CBHSUBBA,#0CDH;A←(A)-#0CDH-Cy,(A)=0CAH,(Cy)=1MOV@R0,A;(R0)←(A),(21H)=0CBHRRCA;累加器内容带进位循环右移1位,(A)=0E5H,(Cy)=0CLR0FH;bit0FH←0,(21H)=4BHMOVDPTR,#2200H;DPTR←#2200H,(DPTR)=2200HMOVA,#58H;A←#58H,(A)=58HMOVX@DPTR,A;(DPTR)←(A),(2200H)=0E5HXCHA,R2;A←→R2,(A)=27H,(R2)=58HMOVR2,#6EH;R2←#6EH,(R2)=6EHMOVP2,A;P2←(A),(P2)=27HINCR2;R2←(R2)+1,(R2)=6FHADDA,R2;A←(A)+(R2),(A)=7FHMOVDPTR,#3000H;DPTR←#3000H,(DPTR)=3000HDJNZR2,$;R2←(R2)-1,若(R2)≠0则转移MOVX@DPTR,A;(DPTR)←(A),(3000H)=7FHANLA,#77H;A←(A)∧#77H,(A)=65HPUSHACC;SP←(SP)+1,(SP)←(A)MOVP2,R2;P2←(R2),(P2)=00HADDA,#06H;A←(A)+#06H,(A)=85HPUSHACC;SP←(SP)+1,(SP)←(A),(SP)=61HINCDPTR;DPTR←(DPTR)+1,(DPTR)=3001HPOPDPL;DPL←(SP),SP←(SP)-1,(SP)=60H,(DPL)=65HORLA,#65H;A←(A)∨#65H,(A)=0E5HINCDPL;DPL←(DPL)+1,(DPL)=66HMOVX@DPTR,A;(DPTR)←(A),(3001H)=0E5HDECDPH;DPH←(DPH)-1,(DPH)=2FHPUSHDPL;SP←(SP)+1,(SP)←(DPL),(SP)=61HPOPDPL;DPL←(SP),SP←(SP)-1,(DPL)=7FHPOPDPH;DPH←(SP),SP←(SP)-1,(SP)=60H,(DPH)=66HENDPUSHDPH;SP←(SP)+1,(SP)←(DPH),(SP)=61HEND(21H)=4BH(P2)=27H(P2)=00H(Cy)=0(DPTR)=2F7FH(3000H)=7FH(3001H)=0E5H评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),(DPTR)=6666H(2200H)=0E5H(SP)=61H程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第31页共36页 63、ORG064、ORG0000HMOVR0,#20H;R0←#20H,(R0)=20HLJMPSTART;无条件跳转到START处MOVR2,#16;R2←#16,(R2)=10HORG0040HMOVA,#0F9H;A←#0F9H,(A)=0F9HSTART:MOV20H,#22H;20H←#22H,(20H)=22HORLA,#02H;A←A∨#02H,(A)=0FBHMOV21H,#7FH;21H←#7FH,(21H)=7FHMOV@R0,A;(R0)←(A),(20H)=0FBHMOV22H,#0E5H;22H←#0E5H,(22H)=0E5HMOVA,20H;A←(20H),(A)=0FBHMOVA,#19H;A←#19H,(A)=19HSWAPA;(A)7-4←→(A)3-0,(A)=0BFHMOVDPTR,#2000H;DPTR←#2000H,(DPTR)=#2000HMOVP1,A;P1←(A),(P1)=0BFHMOVR0,#20H;R0←#20H,(R0)=20HADDA,R2;A←(A)+(R2),(A)=0CFHXCHA,@R0;(A)←→((R0)),(A)=22H,(20H)=19HMOVDPTR,#3100H;DPTR←#3100H,(DPTR)=3100HINCR0;R0←(R0)+1,(R0)=21HMOVX@DPTR,A;(DPTR)←(A),(3100H)=0CFHINCR0;R0←(R0)+1,(R0)=22HXRLA,#0FH;A←(A)○+#0FH,(A)=0C0HXCHDA,@R0;(A)3-0←→((R0))3-0,(A)=25H,(22H)=0E2HINCDPTR;DPTR←(DPTR)+1,(DPTR)=3101HINCDPTR;DPTR←(DPTR)+1,(DPTR)=2001HMOVX@DPTR,A;(DPTR)←(A),(3101H)=0C0HMOVX@DPTR,A;(DPTR)←(A),(2001H)=25HDECDPL;DPL←(DPL)-1,(DPTR)=3100HINCA;A←(A)+1,(A)=26HDECDPL;DPL←(DPL)-1,(DPTR)=31FFHDECR0;R0←(R0)-1,(R0)=21HENDMOV@R0,A;(R0)←(A),(21H)=26HRLA;累加器A的内容循环左移一位,(A)=4CH(20H)=0FBH(P1)=0BFHRLA;累加器A的内容循环左移一位,(A)=98HEND(DPTR)=31FFH(3100H)=0CFH(3101H)=0C0H(A)=98H(20H)=19H(2001H)=25H评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),(21H)=26H(22H)=0E2H程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第32页共36页 65、ORG066、ORG0MOVSP,#60H;SP←#60H,(SP)=60HLJMPSTART;跳转到START处CLRA;A←#0,(A)=00HORG30HMOVR0,#20H;R0←#20H,(R0)=20HSTART:MOVSP,#5FH;SP←#5FH,(SP)=5FHDECA;A←(A)-1,(A)=0FFHMOV@R0,A;(R0)←(A),(20H)=0FFHMOVA,#0;A←#0,(A)=00HINC@R0;(R0)←((R0))+1,(20H)=00HMOVR2,#8;R2←#08H,(R2)=08HMOVDPTR,#1000H;DPTR←#1000H,(DPTR)=1000HMOVR0,#20H;R0←#20H,(R0)=20HINC20H;20H←(20H)+1,(20H)=01HLOOP:MOV@R0,A;(R0)←(A),循环结束则(20H)~(27H)=00H~07HMOVA,@R0;A←((R0)),(A)=01HINCA;A←(A)+1MOVB,#4;B←#04H,(B)=04HINCA;A←(A)+1,(A)=02HINCR0;R0←(R0)+1MULAB;BA←(A)×(B),(B)=00H,(A)=08HDJNZR2,LOOP;R2←(R2)-1,若(R0)≠00H则转移到LOOP处。PUSHB;SP←(SP)+1,(SP)←(B),(SP)=61HSETB02H;bit02H←1,(20H)=04HPOPDPH;DPH←((SP)),SP←(SP)-1,(DPH)=00H,(SP)=60HMOVA,R2;A←(R2),(A)=00HMOVX@DPTR,A;(DPTR)←(A),(0000H)=08HSETBC;Cy←1,(Cy)=1PUSHACC;SP←(SP)+1,(SP)←(A),(SP)=61HPOPDPL;DPL←((SP)),SP←(SP)-1,(DPL)=08H,(SP)=60HADDCA,20H;A←(A)+(20H)+Cy,(A)=05H,(Cy)=0MOVA,@R0;A←((R0)),(A)=01HMOVP2,A;P2←(A),(P2)=05HMOVX@DPTR,A;(DPTR)←(A),(0008H)=01HPUSHACC;SP←(SP)+1,(SP)←(A),(SP)=60HENDPUSH22H;SP←(SP)+1,(SP)←(22H),(SP)=61HEND(A)=01H(R0)=20H(P2)=05H(Cy)=0(DPTR)=0008H(0000H)=08H(SP)=60H评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),(R0)=28H(22H)=02H(SP)=61H程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第33页共36页 67、ORG068、ORG0000HMOVB,#2;B←#2,(B)=02HLJMPSTART;跳转到START处MOVR0,#21H;R0←#21H,(R0)=21HORG30HMOVA,#5;A←#5,(A)=05HSTART:MOVSP,#6FH;SP←#6FH,(SP)=6FHDECA;A←(A)-1,(A)=04HMOVA,#08H;A←#08H,(A)=08HDIVAB;A←商(A/B),B←余数(A/B),(A)=02H,(B)=00HMOVR2,#8;R2←#8,(R2)=08HMOV@R0,A;(R0)←(A),(21H)=02HMOVR0,#20H;R0←#20H,(R0)=20HSETB08H;bit08H←1,(21H)=03HLOOP:MOV@R0,A;(R0)←(A),循环结束后(20H)~(27H)=08H~01HMOVDPTR,#2000H;DPTR←#2000H,(DPTR)=2000HDECA;A←(A)-1MOVA,@R0;A←((R0)),(A)=03HINCR0;R0←(R0)+1MOVX@DPTR,A;(DPTR)←(A),(2000H)=03HDJNZR2,LOOP;R2←(R2)-1,若(R2)≠0则转移到LOOP处。PUSHB;SP←(SP)+1,(SP)=(B)SETB00H;bit00H←1,(20H)=09HPOPDPH;DPH←((SP)),SP←(SP)-1,(DPH)=00HMOVA,21H;A←(21H),(A)=07HSETB0AH;bit0AH←1,(21H)=07HORLA,#10H;A←(A)∨#10H,(A)=17HMOVA,@R0;A←((R0)),(A)=07HSETBC;Cy←1,(Cy)=1SWAPA;累加器A高低四位交换,(A)=70HADDCA,20H;A←(A)+(20H)+Cy,(A)=21HINCA;A←(A)+1,(A)=71HMOVDPTR,#3000H;DPTR←#3000H,(DPTR)=3000HENDMOVX@DPTR,A;(DPTR)←(A),(3000H)=21HSWAPA;累加器A高低四位交换,(A)=12H(A)=71H(Cy)=0MOVR3,A;R3←(A),(R3)=12HEND(DPTR)=0000H(2000H)=03H(R0)=21H(22H)=06H(Cy)=0(3000H)=21H评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),(R2)=00H(R3)=12H程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第34页共36页 69、ORG070、ORG0MOVSP,#65H;SP←#65H,(SP)=65HLJMPSTART;跳转到START处CLRA;A←0,(A)=00HORG30HMOVR0,#21H;R0←#21H,(R0)=21HSTART:MOVSP,#60H;SP←#60H,(SP)=60HCPLA;累加器内容取反,(A)=0FFHCLRA;A←#0,(A)=00HMOV@R0,A;(R0)←(A),(21H)=0FFHMOVR2,#16;R2←#16,(R2)=10HDEC@R0;(R0)←((R0))-1,(21H)=0FEHMOVR0,#20H;R0←#20H,(R0)=20HMOVDPTR,#1200H;DPTR←#1200H,(DPTR)=1200HDEC21H;21H←(21H)-1,(21H)=0FDHLOOP:MOV@R0,A;(R0)←(A),循环执行完(20H)~(2FH)单元的内容为00H,0FFH,MOVA,@R0;A←((R0)),(A)=0FDHDECA;A←(A)-1,0FEH,0FDH,……0F0HMOVB,#4;B←#4,(B)=04HINCR0;R0←(R0)+1INCA;A←(A)+1,(A)=0FEHDJNZR2,LOOP;R2←(R2)-1,若(R2)≠0则跳转到LOOP处DIVAB;A←商(A/B),B←余数(A/B),(A)=3FH,(B)=02HSETB03H;bit03H←1,(20H)=08HINCB;B←(B)+1,(B)=03HMOVA,R2;A←(R2),(A)=0MOVDPH,B;DPH←(B),(DPH)=03HMOVR0,#20H;R0←#20H,(R0)=20HMOVX@DPTR,A;(DPTR)←(A),(0300H)=3FHSETBC;Cy←1,(Cy)=1PUSHACC;SP←(SP)+1,(SP)←(A),(SP)=66HSUBBA,@R0;A←(A)-((R0))-Cy,(A)=0F7HPOPDPL;DPL←((SP)),SP←(SP)-1,(DPL)=3FH,(SP)=65HMOVP1,A;P1←(A),(P1)=0F7HMOVA,@R0;A←(R0),(A)=0FDHMOVX@DPTR,A;(DPTR)←(A),(033FH)=0FDHPUSHACC;SP←(SP)+1,(SP)←(A),(SP)=61H,(61H)=0F7HENDPUSH23H;SP←(SP)+1,(SP)←(23H),(SP)=62H,(62H)=0FDHPOP23H;23H←((SP)),SP←(SP)-1,(SP)=61H,(23H)=0FDHEND(A)=0FDH(R0)=21H(P1)=0F7H(Cy)=1(DPTR)=033FH(0300H)=3FH(SP)=65H评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),(R0)=20H(23H)=0FDH(SP)=61H程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第35页共36页 71、ORG072、ORG0000HMOVB,#3;B←#3,(B)=03HLJMPSTART;跳转到START处ORG30HMOVR0,#20H;R0←@20H,(R0)=20HSTART:MOVSP,#65H;SP←#65H,(SP)=65HMOVA,#0FH;A←#0FH,(A)=0FHMOVA,#10H;A←#10H,(A)=10HINCA;A←(A)+1,(A)=10HMOVR2,#9;R2←#9,(R2)=09HMULAB;BA←(A)*(B),(A)=30H,(B)=00HMOVR0,#20H;R0←#20H,(R0)=20HMOV@R0,A;(R0)←(A),(20H)=30HLOOP:MOV@R0,A;(R0)←A,循环结束20H~28H单元的内容为10H~18HSETB00H;bit00H←1,(20H)=31HINCA;A←(A)+1MOVDPTR,#3200H;DPTR←#3200,(DPTR)=3200HINCR0;R0←(R0)+1MOVA,@R0;A←((R0)),(A)=31HDJNZR2,LOOP;R2←(R2)-1,若R2内容不为零则转移MOVX@DPTR,A;(DPTR)←(A),(3200H)=31HSETB09H;BIT09H←1,(21H)=13HDECB;B←(B)-1,(B)=0FFHMOVA,21H;A←(21H),(A)=13HMOVDPH,B;DPH←(B),(DPH)=0FFHANLA,#0FEH;A←(A)∧#0FEH,(A)=12HSETBC;Cy←1,(C)=1SETB03H;bit03H←1,(20H)=39HSUBBA,20H;A←(A)-(20H)-Cy,(A)=01HMOVA,@R0;A←((R0)),(A)=39HMOVDPTR,#1500H;DPTR←#1500H,(DPTR)=1500HSWAPA;累加器高低四位交换,(A)=93HMOVX@DPTR,A;(DPTR)←(A),(1500H)=01HDECA;A←(A)-A,(A)=92HSWAPA;累加器内容高低四位交换,(A)=10HENDDECA;A←(A)-1,(A)=0FHMOVR3,A;R3←(A),(R3)=0FH(A)=92H(Cy)=0END(22H)=12H(Cy)=0(1500H)=01H(DPTR)=0FF00H(3200H)=31H(R0)=20H(R2)=00H(R3)=0FH评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),评分办法:注释写对可得5分(不要求写出相应寄存器内容,可以采用文字来说明指令执行的操作),程程序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。序运行结果写对可得5分(每个结果1分)。若仅写对部分注释可酌情给1-4分。第36页共36页'