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 />

17<br />

For compare (search) instructions, the Z Flag is set to 1 if a comparison is found<br />

between the value in the Accumulator and the memory located pointed to by the<br />

contents of the register pair HL. When testing a bit in a register or memory<br />

location, the Z Flag contains the complemented state of the indicated bit (see<br />

the BIT b, m instruction).<br />

When inputting or outputting a byte between a memory location and an I/O<br />

device (INI, IND, OUTI and OUTD), if the result of B-1 is zero, the Z Flag is set<br />

to 1. Otherwise, the Z Flag is reset. Also, for byte inputs from I/O devices using<br />

IN r,(C), the Z Flag is set to 1 to indicate a zero byte input.<br />

Sign Flag<br />

The Sign (S) Flag stores the state of the most-significant bit of the Accumulator<br />

(Bit 7). When the <strong>eZ80</strong> performs arithmetic operations on signed numbers,<br />

binary two’s complement notation is used to represent and process numerical<br />

information. A positive number is identified by a 0 in Bit 7. A negative number is<br />

identified by a 1. The binary equivalent of the magnitude of a positive number is<br />

stored in Bits 0-6 for a total range of 0-127. A negative number is represented<br />

by the two’s complement of the equivalent positive number. The total range for<br />

negative numbers is -1 to -128.<br />

When inputting a byte from an I/O device to a register, IN r,(C), the S Flag<br />

indicates either positive (S=0) or negative (S=1) data.<br />

Instructions<br />

The notations in the <strong>eZ80</strong> instructions are defined in the following table.<br />

Table 6. Instruction Notations<br />

Mnemonic<br />

Definition<br />

cc A condition code C, NC, Z, NZ, P, M, PO, PE, V, or NV.<br />

cc’ A condition code C, NC, Z, or NZ.<br />

d An 8-bit signed displacement -128 to 127.<br />

Mmn A 16- or 24-bit immediate value or direct address.<br />

m A, B, C, D, E, H, L, (HL), (IX+d), or (IY+d).<br />

n An 8-bit immediate value or port number in the range of 0-255 or 0-FFH.<br />

p A, B, C, D, E, H, L, n, or (HL)<br />

pp BC, DE, HL, IX+d, or IY+d.<br />

qq BC, DE, HL, SP, IX, or IY.<br />

r, r’ A, B, C, D, E, H, L.<br />

ii IX+d or IY+d.<br />

rr HL, IX, or IY.<br />

s A, B, C, D, E, H, L, n, (HL), (IX+d), or (IY+d).<br />

ss BC, DE, HL, or SP.<br />

tt BC, DE, HL, IX, or IY.<br />

uu HL, IX+d, or IY+d.<br />

vv AF, BC, DE, HL, IX, or IY.<br />

UM007701-1100

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

Saved successfully!

Ooh no, something went wrong!