Скачиваний:
26
Добавлен:
17.04.2013
Размер:
219.62 Кб
Скачать

15 Instruction Set Reference

Multifunction Instructions

<ALU>*

 

,

 

 

AX0

 

 

= DM (

 

 

 

I0

,

 

 

M0

) ,

 

 

AY0

 

 

 

= PM (

I4

,

M4

);

<MAC>*

 

 

 

 

 

 

AX1

 

 

 

 

 

 

 

 

 

I1

,

 

 

M1

 

 

 

 

AY1

 

 

 

 

 

 

 

I5

,

M5

 

 

 

 

 

 

 

 

 

 

MX0

 

 

 

 

 

 

 

 

 

I2

,

 

 

M2

 

 

 

 

MY0

 

 

 

 

 

 

 

I6

,

M6

 

 

 

 

 

 

 

 

 

 

MX1

 

 

 

 

 

 

 

 

 

I3

,

 

 

M3

 

 

 

 

MY1

 

 

 

 

 

 

 

I7

,

M7

 

 

= DM (

 

I0

 

 

,

 

M0

 

) ,

 

 

AY0

 

= PM (

 

 

 

I4

 

,

 

M4

 

);

 

 

AX0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

AX1

 

 

 

 

 

 

 

 

 

 

I1

 

 

,

 

M1

 

 

 

 

AY1

 

 

 

 

 

 

 

 

 

 

 

 

I5

 

,

 

M5

 

 

 

 

 

MX0

 

 

 

 

 

 

 

 

 

 

I2

 

 

,

 

M2

 

 

 

 

MY0

 

 

 

 

 

 

 

 

 

 

 

I6

 

,

 

M6

 

 

 

 

 

MX1

 

 

 

 

 

 

 

 

 

 

I3

 

 

,

 

M3

 

 

 

 

MY1

 

 

 

 

 

 

 

 

 

 

 

I7

 

,

 

M7

 

 

 

 

 

<ALU>*

 

 

 

 

 

, dreg

=

 

 

 

DM (

 

 

I0

 

,

 

 

M0

 

 

)

 

;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<MAC>*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I1

 

,

 

 

M1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<SHIFT>*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I2

 

,

 

 

M2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I3

 

,

 

 

M3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I4

 

,

 

 

M4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I5

 

,

 

 

M5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I6

 

,

 

 

M6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I7

 

,

 

 

M7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PM (

 

 

I4

 

 

,

 

 

M4

 

 

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I5

 

 

,

 

 

M5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I6

 

 

,

 

 

M6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I7

 

 

,

 

 

M7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DM (

 

 

I0

 

,

 

M0

 

)

 

 

= dreg,

 

 

 

 

<ALU>*

 

 

 

 

 

 

;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I1

 

,

 

M1

 

 

 

 

 

 

 

 

 

 

 

 

 

<MAC>*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I2

 

,

 

M2

 

 

 

 

 

 

 

 

 

 

 

 

 

<SHIFT>*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I3

 

,

 

M3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I4

 

 

,

 

M4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I5

 

 

,

 

M5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I6

 

 

,

 

M6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I7

 

 

,

 

M7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PM (

 

 

I4

 

 

,

 

M4

 

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I5

 

 

,

 

M5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I6

 

 

,

 

M6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I7

 

 

,

 

M7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<ALU>*

 

 

 

 

 

, dreg

=

 

 

 

dreg;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<MAC>*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<SHIFT>*

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Table 15.2

 

 

Multifunction Instructions

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<ALU>

 

 

 

 

 

Any ALU instruction (except DIVS, DIVQ)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<MAC>

 

 

 

 

 

Any multiply/accumulate instruction

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<SHIFT>

 

 

 

 

 

Any shifter instruction (except Shift Immediate)

 

 

 

 

 

 

 

 

 

 

 

 

 

* May not be conditional instruction

AR, MR result registers must be used—not AF, MF feedback registers. 15 –8 (See Section 15.4.1, “ALU/MAC with Data & Program Memory Read.”)

Instruction Set Reference 15

15.5ALU, MAC & SHIFTER INSTRUCTIONS

This group of instructions performs computations. All of these instructions can be executed conditionally except the ALU division instructions and the Shifter SHIFT IMMEDIATE instructions.

15.5.1ALU Group

Here is an example of one ALU instruction, Add/Add with Carry:

IF AC AR=AX0+AY0+C;

The (optional) conditional expression, IF AC, tests the ALU Carry bit (AC); if there is a carry from the previous instruction, this instruction executes, otherwise a NOP occurs and execution continues with the next instruction. The algebraic expression AR=AX0+AY0+C means that the ALU result register (AR) gets the value of the ALU X input and Y input registers plus the value of the carry-in bit.

Table 15.3 gives a summary list of all ALU instructions. In this list, condition stands for all the possible conditions that can be tested and xop and yop stand for the registers that can be specified as input for the ALU. The conditional clause is optional and is enclosed in square brackets to show this. A complete list of the permissible xops and yops is given in the reference page for each instruction. A complete list of conditions is given in Table 15.9.

ALU Instructions

[IF condition]

AR

=

xop

 

+ yop

 

;

 

 

AF

 

 

 

+ C

 

 

 

 

 

 

 

 

 

 

+ yop + C

 

 

 

 

 

 

 

 

 

 

+ constant

 

 

 

 

 

 

 

 

 

 

+ constant + C

 

 

 

[IF condition]

 

AR

 

=

xop

 

– yop

 

;

 

 

 

 

 

 

AF

 

 

 

 

– yop + C – 1

 

 

 

 

 

 

 

 

 

+ C – 1

 

 

 

 

 

 

 

 

 

– constant

 

 

 

 

 

 

 

 

 

– constant + C – 1

 

 

[IF condition]

AR

=

yop

 

– xop

 

 

;

 

 

 

 

AF

 

 

 

– xop + C – 1

 

 

 

 

xop + C – 1

xop + constant

xop + constant + C – 1

15 – 9

15 Instruction Set Reference

[IF condition]

AR

 

=

 

xop

 

AND

 

 

 

yop

;

 

 

 

 

AF

 

 

 

 

 

 

 

OR

 

 

 

constant

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

XOR

 

 

 

 

 

 

[IF condition]

 

AR

 

=

 

TSTBIT n OF xop

 

 

;

 

 

 

 

 

 

 

 

 

 

AF

 

 

 

SETBIT n OF xop

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CLRBIT n OF xop

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TGLBIT n OF xop

 

 

 

 

 

[IF condition]

 

AR

 

=

 

PASS

 

xop

 

;

 

 

 

 

 

 

 

 

 

 

 

AF

 

 

 

 

 

 

 

yop

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

constant

 

 

 

[IF condition]

 

 

AR

 

 

=

 

 

 

 

xop

 

 

;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

AF

 

 

 

 

 

 

 

 

 

yop

 

 

 

 

 

[IF condition]

 

 

AR

 

 

=

 

NOT

 

 

 

xop

 

 

;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

AF

 

 

 

 

 

 

 

 

 

yop

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[IF condition]

 

 

AR

 

 

=

 

ABS

 

xop

;

 

 

 

 

 

 

 

 

 

 

 

 

AF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[IF condition]

 

 

AR

 

 

=

 

yop

+ 1

 

 

 

 

 

;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

AF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[IF condition]

 

 

AR

 

 

=

 

yop

 

– 1

;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

AF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DIVS yop, xop ;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DIVQ xop ;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

NONE = <ALU> ;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Table 15.3 ALU Instructions

15.5.2MAC Group

Here is an example of one of the MAC instructions, Multiply/Accumulate:

IF NOT MV MR=MR+MX0*MY0(UU);

The conditional expression, IF NOT MV, tests the MAC overflow bit. If the condition is not true, a NOP is executed. The expression MR=MR+MX0*MY0 is the multiply/accumulate operation: the multiplier result register (MR) gets the value of itself plus the product of the X and Y input registers selected. The modifier in parentheses (UU) treats the operands as unsigned. There can be only one such modifier selected from the available set. (SS) means both are signed, while (US) and (SU) mean that either the first or second operand is signed; (RND) means to round the (implicitly signed) result.

15 –10

Instruction Set Reference 15

Table 15.4 gives a summary list of all MAC instructions. In this list, condition stands for all the possible conditions that can be tested and xop and yop stand for the registers that can be specified as input for the MAC. A complete list of the permissible xops and yops is given in the reference page for each instruction.

MAC Instructions

[IF condition]

 

 

MR

 

=

xop *

 

 

 

yop

 

(

 

SS

 

);

 

 

 

MF

 

 

 

 

 

 

xop

 

 

 

 

SU

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

US

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UU

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RND

 

 

[IF condition]

 

 

MR

 

=

MR + xop *

 

 

 

yop

 

(

 

SS

 

);

 

 

 

 

 

 

 

 

 

MF

 

 

 

 

 

 

xop

 

 

 

 

SU

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

US

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UU

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RND

 

 

[IF condition]

 

 

MR

 

=

MR – xop *

 

 

yop

 

 

(

 

SS

 

);

 

 

 

 

 

 

 

 

 

 

MF

 

 

 

 

 

 

xop

 

 

 

 

SU

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

US

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

UU

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RND

 

 

[IF condition]

 

 

MR

 

=

0;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[IF condition]

 

 

MR

 

= MR [( RND )];

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MF

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IF MV SAT MR ;

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Table 15.4 MAC Instructions

15.5.3Shifter Group

Here is an example of one of the Shifter instructions, Normalize:

IF NOT CE SR= SR OR NORM SI (HI);

The conditional expression, IF NOT CE, tests the “not counter expired” condition. If the condition is false, a NOP is executed. The destination of all shifting operations is the Shifter Result register, SR. (The destination of exponent detection instructions is SE or SB, as shown below.) In this example, SI, the Shifter Input register, is the operand. The amount and direction of the shift is controlled by the signed value in the SE register in all shift operations except an immediate shift. Positive values cause left shifts; negative values cause right shifts.

15 – 11

Соседние файлы в папке Документация по ЦСП Analog Devices