In the following 8085 assembly language program, assume that the carry flag is initially reset. What is the content of the accumulator after the execution of the program? MVI A, O4H RRC MOV B, A RLC RLC ADD B RRC
In the following 8085 assembly language program, assume that the carry flag is initially reset. What is the content of the accumulator after the execution of the program? MVI A, O4H RRC MOV B, A RLC RLC ADD B RRC Correct Answer OSH
Analysis:
1) MVI A, 04 H means move data 04 H immediately to destination register A (accumulator register), i.e.
[ alt="F1 S.B Madhu 29.07.20 D9 " src="//storage.googleapis.com/tb-img/production/20/08/F1_S.B_Madhu_29.07.20_D9_.png" style="width: 282px; height: 26px;">
2) RRC means rotate Accumulator bits right by one position without rotating carry bit, i.e.
[ alt="F1 S.B Madhu 29.07.20 D1" src="//storage.googleapis.com/tb-img/production/20/08/F1_S.B_Madhu_29.07.20_D1.png" style="width: 315px; height: 152px;">
3) RLC means rotate accumulator bits left by one position without rotating carry bit. Perfoming this operation two times, we’ll get:
[ alt="F1 S.B Madhu 29.07.20 D2" src="//storage.googleapis.com/tb-img/production/20/08/F1_S.B_Madhu_29.07.20_D2.png" style="width: 315px; height: 152px;">
[ alt="F1 S.B Madhu 29.07.20 D3" src="//storage.googleapis.com/tb-img/production/20/08/F1_S.B_Madhu_29.07.20_D3.png" style="width: 315px; height: 152px;">
4) ADD B means the addition of content of B with the content of A and store the result into A.
[ alt="F1 S.B Madhu 29.07.20 D4" src="//storage.googleapis.com/tb-img/production/20/08/F1_S.B_Madhu_29.07.20_D4.png" style="width: 319px; height: 106px;">
5) RRC
[ alt="F1 S.B Madhu 29.07.20 D5" src="//storage.googleapis.com/tb-img/production/20/08/F1_S.B_Madhu_29.07.20_D5.png" style="width: 317px; height: 151px;">
∴ Finally, the content of the accumulator after the execution of the program will be A = 05H.
Note:
(i) In the 8085 programs, RRC instruction divides the content of the accumulator by two.
(ii) In the 8085 programs, RLC instruction multiplies the content of the accumulator by two.