3 INSTRUCTION SET

CP YH,i

Compare immediate data i with YH

Source Format:

CP YH,i

 

 

 

 

 

 

 

Operation:

YH - i3 to i0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OP-Code:

 

1

0

1

0

0

1

1

0

i3

i2

i1

i0

A60H to A6FH

 

MSB

 

 

 

 

 

LSB

Type:

IV

 

 

 

 

 

 

 

Clock Cycles:

7

 

 

 

 

 

 

 

 

 

 

 

 

Flag:

 

C – Set if YH < i3 to i0; otherwise, reset.

 

 

Z – Set if YH = i3 to i0; otherwise, reset.

 

 

D – Not affected

 

 

 

 

 

 

 

 

 

I – Not affected

 

 

 

 

 

 

 

Description: Compares immediate data i to YH by subtracting i from the contents of YH. YH remains unchanged.

1.When Z = 0 and C = 0 then i < YH

2.When Z = 1 and C = 0 then i = YH

3.When Z = 0 and C = 1 then i > YH

Example:

 

CP YH,0AH

 

CP YH,3

 

 

CP YH,0FH

 

YH register

1010

 

1010

 

1010

 

1010

 

C flag

1

 

0

 

0

 

1

 

Z flag

0

 

1

 

0

 

0

CP YL,i

Compare immediate data i with YL

 

Source Format:

CP YL,i

 

 

 

 

 

 

 

 

Operation:

YL - i3 to i0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OP-Code:

 

1

 

0

1

0

0

1

1

1

i3

i2

i1

i0

 

A70H to A7FH

 

MSB

 

 

 

 

 

LSB

 

Type:

IV

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Clock Cycles:

7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Flag:

 

C – Set if YL < i3 to i0; otherwise, reset.

 

 

 

Z – Set if YL = i3 to i0; otherwise, reset.

 

 

 

D – Not affected

 

 

 

 

 

 

 

 

 

 

I

– Not affected

 

 

 

 

 

 

 

 

Description: Compares immediate data i to YL by subtracting i from the contents of YL. YL remains unchanged.

1.When Z = 0 and C = 0 then i < YL

2.When Z = 1 and C = 0 then i = YL

3.When Z = 0 and C = 1 then i > YL

Example:

 

CP YL,5

 

 

CP YL,1

 

CP YL,4

 

YL register

0100

 

0100

 

0100

 

0100

 

C flag

0

 

1

 

0

 

0

 

Z flag

1

 

0

 

0

 

1

S1C6200/6200A CORE CPU MANUAL

EPSON

37