English

If accumulator contains the data ABH and register B contains 54H. ‘What will be the contents of accumulator in hexadecimal after execution of each of the instructions dependently - Computer Science 2

Advertisements
Advertisements

Question

If accumulator contains the data ABH and register B contains 54H. ‘What will be the contents of accumulator in hexadecimal after execution of each of the instructions dependently (Stepwise, i.e., one after another.

  1. ANA B
  2. CMA
  3. CMP B
  4. ANI OOH
Long Answer
Advertisements

Solution

Initial: A = ABH, B = 54H.

1. ANA B, A ← A AND B.
ABH AND 54H = 00H, so Accumulator = 00H.

2. CMA, Complement accumulator (one's complement).
Complement of 00H = FFH, so Accumulator = FFH.

3. CMP B, Compare A with B (flags affected); the accumulator is not changed.
A remains FFH after CMP B. (Flags: since FFH > 54H, CY = 0 and Z = 0.)

ANI 00H, A ← A AND 00H (immediate).
FFH AND 00H = 00H, so Accumulator = 00H.

After ANA B: 00H

After CMA: FFH

After CMP B: FFH

After ANI 00H: 00H

shaalaa.com
  Is there an error in this question or solution?
2024-2025 (July) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×