17.05.2015 Views

~ National ~ Semiconductor - Al Kossow's Bitsavers

~ National ~ Semiconductor - Al Kossow's Bitsavers

~ National ~ Semiconductor - Al Kossow's Bitsavers

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.

5.0 Instruction Set Overview (Continued)<br />

Integer Arithmetic Instructions<br />

The integer arithmetic instructions operate on B-bit signed<br />

(two's complement) binary numbers. Two arithmetic functions<br />

are supported: Add and Subtract. Three versions of<br />

the Add and Subtract instructions exist: operand ± accumulator,<br />

operand ± accumulator ± carry, and immediate operand<br />

± operand. The first two versions support both the register<br />

and indexed addressing modes for the destination operand.<br />

These two versions also allow the specification of a<br />

separate register or data address for the destination operand<br />

so that the sources may retain their integrity; (i.e., true<br />

three-operand instructions). Note that the currently active<br />

"B" register bank selects which accumulator is used in<br />

these instructions. The third version, immediate operand ±<br />

operand, only supports the register addressing mode for the<br />

destination operand with the register as both a source and<br />

the destination. Table VI lists the integer arithmetic instructions<br />

along with their variations.<br />

Logic Instructions<br />

The logic instructions operate on B-bit binary data. A full set<br />

of logic functions is supported by the BCP: AND, OR, eXclusive<br />

OR, and Complement. <strong>Al</strong>l the logic functions except<br />

complement allow either an immediate operand or the currently<br />

active accumulator as an implied operand. Complement<br />

only allows one register operand which is both the<br />

source and destination. The other logic instructions include<br />

the following addreSSing modes: register, indexed, and immediate.<br />

As with the integer arithmetic instructions, the integrity<br />

of the sources may be maintained by specifying a<br />

destination register which is different from the source. Table<br />

VII lists all the logic instructions.<br />

TABLE VI. Integer Arithmetic Instructions<br />

Syntax<br />

I nstruction Operation<br />

Addressing Modes<br />

ADD<br />

ADDA<br />

ADDA<br />

ADCA<br />

ADCA<br />

SUB<br />

SUBA<br />

SUBA<br />

SBCA<br />

SBCA<br />

n, rsd<br />

Rs, Rd<br />

Rs, [mir]<br />

Rs, Rd<br />

Rs, [mir]<br />

n, rsd<br />

Rs, Rd<br />

Rs, [mir]<br />

Rs, Rd<br />

Rs, [mir]<br />

register + n ---+ register<br />

Rs + accumulator ---+ Rd<br />

Rs + accumulator ---+ data memory<br />

Rs + accumulator + carry ---+ Rd<br />

Rs + accumulator + carry ---+ data memory<br />

register - n ---+ register<br />

Rs - accumulator ---+ Rd<br />

Rs - accumulator ---+ data memory<br />

Rs - accumulator - carry ---+ Rd<br />

Rs - accumulator - carry ---+ data memory<br />

Immediate, Limited Register<br />

Register, Register<br />

Register, Indexed<br />

Register, Register<br />

Register, Indexed<br />

Immediate, Limited Register<br />

Register, Register<br />

Register, Indexed<br />

Register, Register<br />

Register, Indexed<br />

TABLE VII. Logic Instructions<br />

AND<br />

ANDA<br />

ANDA<br />

OR<br />

ORA<br />

ORA<br />

XOR<br />

XORA<br />

XORA<br />

CPL<br />

Syntax<br />

n, rsd<br />

Rs, Rd<br />

Rs, [mir]<br />

n, rsd<br />

RS,Rd<br />

Rs, [mir]<br />

n, rsd<br />

Rs, Rd<br />

Rs, [mir]<br />

Rsd<br />

Note: & ~ logical AND operation<br />

I ~ logical OR operation<br />

GI = logical exclusive OR operation<br />

r = one's complement<br />

Instruction Operation<br />

register & n ---+ register<br />

Rs & accumulator ---+ Rd<br />

Rs & accumulator ---+ data memory<br />

register I n ---+ register<br />

Rs I accumulator ---+ Rd<br />

Rs I accumulator ---+ data memory<br />

register Ell n ---+ register<br />

Rs Ell accumulator ---+ Rd<br />

Rs Ell accumulator ---+ data memory<br />

register ---+ register<br />

Addressing Modes<br />

Immediate, Limited Register<br />

Register, Register<br />

Register, Indexed<br />

Immediate, Limited Register<br />

Register, Register<br />

Register, Indexed<br />

Immediate, Limited Register<br />

Register, Register<br />

Register, Indexed<br />

Register<br />

2-93

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

Saved successfully!

Ooh no, something went wrong!