English

Explain the following instruction of Micro-processor 8085 with an example: CMP M - Computer Science 2

Advertisements
Advertisements

Question

Explain the following instruction of Micro-processor 8085 with an example:

CMP M

Explain
Advertisements

Solution

This instruction compares the contents of the Accumulator with the memory location pointed to by the HL register pair. It performs an internal subtraction (A − M) and updates the status flags, but the data in the Accumulator and memory remains unchanged.

Example:

If A = 20H and M = 10H, after executing CMP M:

  • Carry Flag (CY) = 0 (because A > M)
  • Zero Flag (Z) = 0 (because  A ≠ M)
shaalaa.com
  Is there an error in this question or solution?
2023-2024 (July) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×