03.01.2015 Views

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

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.

INSTRUCTION SET DESCRIPTIONS<br />

Table C-4. Instruction Set (Continued)<br />

Name Description Operation<br />

SUB<br />

TEST<br />

NOTE:<br />

Subtract:<br />

SUB dest, src<br />

The source operand is subtracted from<br />

the destination operand, and the result<br />

replaces the destination operand. The<br />

operands may be bytes or words. Both<br />

operands may be signed or unsigned<br />

binary numbers (see AAS and DAS).<br />

Instruction Operands:<br />

SUB reg, reg<br />

SUB reg, mem<br />

SUB mem, reg<br />

SUB accum, immed<br />

SUB reg, immed<br />

SUB mem, immed<br />

Test:<br />

TEST dest, src<br />

Performs the logical "and" of the two<br />

operands (bytes or words), updates<br />

the flags, but does not return the<br />

result, i.e., neither operand is<br />

changed. If a TEST instruction is<br />

followed by a JNZ (jump if not zero)<br />

instruction, the jump will be taken if<br />

there are any corresponding one bits<br />

in both operands.<br />

Instruction Operands:<br />

TEST reg, reg<br />

TEST reg, mem<br />

TEST accum, immed<br />

TEST reg, immed<br />

TEST mem, immed<br />

(dest) ← (dest) – (src)<br />

(dest) and (src)<br />

(CF ) ← 0<br />

(OF) ← 0<br />

The three symbols used in the Flags Affected column are defined as follows:<br />

– the contents of the flag remain unchanged after the instruction is executed<br />

the contents of the flag is undefined after the instruction is executed<br />

üthe flag is updated after the instruction is executed<br />

Flags<br />

Affected<br />

AF ü<br />

CF ü<br />

DF –<br />

IF –<br />

OF ü<br />

PF ü<br />

SF ü<br />

TF –<br />

ZF ü<br />

AF <br />

CF ü<br />

DF –<br />

IF –<br />

OF ü<br />

PF ü<br />

SF ü<br />

TF –<br />

ZF ü<br />

C-45

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

Saved successfully!

Ooh no, something went wrong!