compare with register the contents of the


Compare with Register

The contents  of the register  are compared with  the contents  of the accumulator  here  register  may be  any one  of the  A, B, C, D E, H, or L  registers. The instruction format is

CMPR                          (A-R)

Actually the comparison is done  by subtracting  the contents  of the register from the  contents  of the  accumulator. The contents of the  register  and  the accumulator do not  change the  flags  are modified similar  to subtraction.

Flags : All flags  are modified  as they  would  change  in subtract  operation. But the  contents of both the  operand do  not change.

Although  all flags  are modified  but the  conclusion can be made only by CY and Z flag as shown  below

If A> R : CY  and Z flags  are reset.

IF A= R: Z Flag is set and  CY flag is reset.

IF A < R : CY  is set  and Z  flag s reset.

 

Request for Solution File

Ask an Expert for Answer!!
Electrical Engineering: compare with register the contents of the
Reference No:- TGS0262481

Expected delivery within 24 Hours