Advertisement Remove all ads

Accumulator contents of 8085 are B7H and register B contents are A5H.What will be the effect of following instructions on the. contents of  Accumulator, when executed independently ? - Computer Science 2

Accumulator contents of 8085 are B7H and register B contents are A5H.What will be the effect of following instructions on the. contents of  Accumulator, when executed independently ?
(i) ADI 05
(ii) CMP B
(iii) CMA
(iv) XRA B
(v) ORA B

Advertisement Remove all ads

Solution

The accumulator value is B7H and B register value is A5H
(i) ADI 05
Add immediately with 05H
Before execution [A] = B7H = 1 0 1 1 0 1 1 1
Instruction - ADI 05
After execution [A] = 1 0 1 1 1 1 0 0 [1 Mark]
(ii) CMP B
Compare B with accumulator
Before execution [A] = B7H = 1 0 1 1 0 1 1 1
Before execution [B] = A5H = 1 0 1 0 0 1 0 1
Instruction - CMP B
Condition:
(a) If [A] < [B] then Carry flag is set.
(b) If [A] = [B] then Zero flag is set.
(c) If [A] > [B] then both Carry and Zero flags are reset. [1 Mark]
(iii) CMA
Complement the accumulator
Befor execution [A] = B7H = 1 0 1 1 0 1 1 1
Instruction - CMA
After execution : 48H = 0 1 0 0 1 0 0 0 [1 Mark]
(iv) XRA B
Exclusive OR with accumulator
Before execution [A] = B7H = 1 0 1 1 0 1 1 1
Before execution [B] = A5H = 1 0 1 0 0 1 0 1
After execution : 12H = 0 0 0 1 0 0 1 0

(v) ORA B
Logical OR with B
Before execution [A] = B7H = 1 0 1 1 0 1 1 1
Before execution [B] = A5H = 1 0 1 0 0 1 0 1
After execution : B7H = 1 0 1 1 0 1 1 1

Concept: Instruction Set and Programming of 8085
  Is there an error in this question or solution?
Advertisement Remove all ads

APPEARS IN

Advertisement Remove all ads
Advertisement Remove all ads
Share
Notifications

View all notifications


      Forgot password?
View in app×