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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5.0 Instruction Set Overview (Continued)<br />

Indexed Addressing Modes<br />

The Immediate-Relative mode adds an unsigned 8-bit im-<br />

mediate number to the index register IZ forming a data byte<br />

address. The Register-Relative mode adds the unsigned<br />

8-bit value in the current accumulator, A, to anyone of the<br />

index registers forming a data byte address. Both of these<br />

indirect memory addressing modes are available only on the<br />

MOVE instruction. Table IV shows the notation used for<br />

these two addressing modes.<br />

Indexed operands involve one of four possible CPU register<br />

pairs referred to as the index registers. Figure 1 illustrates<br />

how the index registers map into the CPU Register Set.<br />

Note that the index registers are 16 bits wide.<br />

Index registers allow for indirect memory addressing and<br />

usually contain data memory addresses, although, the<br />

LJMP instruction can use index registers to hold instruction<br />

memory addresses. Most of the instructions that allow<br />

memory indirect addressing, (i.e. the use of index registers),<br />

also allow pre-incrementing, post-incrementing, or post-decrementing<br />

of the index register contents during instruction<br />

execution, if desired. Table III lists the notations used for the<br />

index register modes.<br />

Immediate-Relative and Register-Relative<br />

Address Modes<br />

INSTRUCTION SET OVERVIEW<br />

The BCP's RISC instruction set contains seven categories<br />

of instructions: Data Movement, Integer Arithmetic, Logic,<br />

Shift-Rotate, Comparison, Program Flow, and Miscellane-<br />

Index CPU Register Pair Forming Index Register ous. Utilizing these instructions, any communications task<br />

Register (MSB) (LSB) and almost any general computing task can be easily per-<br />

I I I I I I I I I I I I I I I I I<br />

IW R13 R12<br />

formed.<br />

15 87 0<br />

Data Movement Instructions<br />

The MOVE instruction is responsible for all the data transfer<br />

IX I I I I I I I I I I I I I I I I operations that the BCP can perform. Moving one byte at a<br />

R15 R14 I time, five different types of transfer are allowed: register to<br />

15 87 0 register, data memory to register, register to data memory,<br />

instruction memory to register, and instruction memory to<br />

IY<br />

I I I I I I I I I I I I I I I I data memory. Table V lists all the variations of the MOVE<br />

R17 R16 I instruction.<br />

15 87 0<br />

IZ<br />

I I I I I I I I I I I I I I I I R19 R18 I<br />

15 87 0<br />

FIGURE 1. Index Register Map<br />

Notation<br />

TABLE III. Index Register Addressing Mode Notations<br />

Meaning<br />

[lrl<br />

Index Register, Contents Not Changed<br />

[lr-I<br />

Index Register, Contents Post-Decremented<br />

[lr+1<br />

Index Register, Contents Post-Incremented<br />

[ +Irl Index Register, Contents Pre-Incremented<br />

[mlrl<br />

General Notation I ndicating that Any of the Above Modes Is <strong>Al</strong>lowed<br />

Note: [] denotes indirect memory addressing and is part of the instruction syntax.<br />

TABLE IV. Relative Index Register Mode Notations<br />

Notation<br />

[lZ + nl<br />

[lr + <strong>Al</strong><br />

Type of Action Performed to Calculate a Data Memory Address<br />

IZ + Immediate Number (unsigned) ~ Data Memory Address<br />

Index Register + Current Accumulator (unsigned) ~ Data Memory Address<br />

Note: [] denotes indirect memory addressing and is part of the instruction syntax.<br />

TABLE V. Data Movement Instructions<br />

Syntax Instruction Operation Addressing Modes<br />

MOVERs, Rd register ~ register Register, Register<br />

MOVE Rs, [mlrl register ~ data memory Register, Indexed<br />

MOVE [mlrl, Rd data memory ~ register Indexed, Register<br />

MOVE Rs, [lr + <strong>Al</strong> register ~ data memory Register, Register-Relative<br />

MOVE [lr + A), Rd data memory ~ register Register-Relative, Register<br />

MOVE rs, [lZ + nl register ~ data memory Limited Register, Immediate-Relative<br />

MOVE [lZ + nl, rd data memory ~ register Immediate-Relative, Limited Register<br />

MOVE n, rd instruction memory ~ register Immediate, Limited Register<br />

MOVE n, [lrl instruction memory ~ data memory Immediate, Indexed<br />

2-92

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

Saved successfully!

Ooh no, something went wrong!