23.03.2015 Views

eZ80 CPU - writeframeofmind.biz

eZ80 CPU - writeframeofmind.biz

eZ80 CPU - writeframeofmind.biz

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>eZ80</strong> <strong>CPU</strong><br />

User Manual<br />

28<br />

CP A, s<br />

Compare with Accumulator<br />

Operation<br />

A - s<br />

Description<br />

The s operand is any of r, n, (HL), (IX+d), or (IY+d). The s operand is compared<br />

with (subtracted from) the contents of the Accumulator. The execution of this<br />

instruction does not affect the contents of the Accumulator or the s operand.<br />

ADL mode affects operation with the HL, IX, and IY registers. ADL mode may<br />

be overridden with the .S or .L suffix.<br />

Condition Bits Affected<br />

S<br />

Z<br />

H<br />

P/V<br />

N<br />

C<br />

Set if result is negative; reset otherwise.<br />

Set if result is zero; reset otherwise.<br />

Set if borrow from Bit 4; reset otherwise.<br />

Set if overflow: reset otherwise.<br />

Set.<br />

Set if borrow; reset otherwise.<br />

Mnemonic Operands ADL Mode Cycles Op Codes<br />

CP A,r X 1 jj<br />

CP A,n X 2 FE, nn<br />

CP A,(HL) X 2 BE<br />

CP.S A,(HL) 1 3 52, BE<br />

CP.L A,(HL) 0 3 49, BE<br />

CP A,(IX+d) X 4 DD, BE, dd<br />

CP.S A,(IX+d) 1 5 52, DD, BE, dd<br />

CP.L A,(IX+d) 0 5 49, DD, BE, dd<br />

CP A,(IY+d) X 4 FD, BE, dd<br />

CP.S A,(IY+d) 1 5 52, FD, BE, dd<br />

CP.L A,(IY+d) 0 5 49, FD, BE, dd<br />

jj = binary code 10 111 rrr where rrr identifies the A, B, C, D, E, H, or L<br />

register assembled as follows into the object code.<br />

Register rrr<br />

A 111<br />

B 000<br />

C 001<br />

D 010<br />

E 011<br />

H 100<br />

L 101<br />

UM007701-1100

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!