执行下列单片机指令后各有关存储单元内容填空
扫描二维码
随时随地手机看文章
设内部RAM(30H)=5AH,(5AH)=40H,(40H)=00H,端口P1=7FH,问执行下列指令后,各有关存储单元(即R0,R1,A,B,P1,30H,40H及5AH单元)的内容如何?
MOVR0,#30H;R0=30H
MOVA,@R0;A=5AH
MOVR1,A;R1=5AH
MOVB,R1;B=5AH
MOV@R1,P1;(5AH)=7FH
MOVA,P1;A=7FH
MOV40H,#20H;(40H)=20H
MOV30H,40H;(30H)=20H
解:每一条指令执行后的结果如注释字段所标。最后结果为:R0=30H,R1=5AH,A=7FH,B=5AH,P1=7FH,(30H)=20H,(40H)=20H,(5AH)=7FH。