ADDA

Example 1

adda r0,r1

Register/Memory Address

MCTL

R0

R1

Before

$0000 0000

$0000 1100

$0000 2200

After

$0000 3300

Example 2

move.l #$8,mctl ;assigns m0 to r0, modulo arithmetic move.l #$10,m0 ;puts modulo 16 in m0

move.w #$c,r0 ;initializes 12 to r0 nop

adda #$8,r0,r1 ; 8 + 12 = 20 or 4 modulo 16

Register/Memory Address

MCTL

R0

R1

Before

$00000008

$0000000c

$00000000

After

$00000004

Instruction Formats and Opcodes

Instruction

Words Cycles Type

Opcode

15

8

7

0

ADDA #u5,Rx

1

1

2

1 1 1 0 R R R R 0 1 0 i i i i i

 

 

 

 

15

 

 

 

 

 

 

8

7

 

 

 

 

 

 

0

ADDA #s16,rx,Rn

2

1

4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

0

1

0

r

r

r

r

i

i

i

0

1

R

R

R

 

 

 

 

1

0

0

i

i

i

i

i

i

i

i

i

i

i

i

i

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ADDA rx,Rx

1

1

2

158 70

1 1 1 0 R R R R 0 0 0 1 r r r r

Instruction Fields

Rn

RRR

 

 

Address Register

 

 

 

 

000

R0

010

R2

100

R4

110

R6

 

 

 

 

 

 

 

 

 

 

001

R1

011

R3

101

R5

111

R7

 

 

 

 

 

 

 

 

Note:

This instruction

can specify R8-R15 as operands by using a high register prefix.

 

A-30

SC140 DSP Core Reference Manual

Page 344
Image 344
Freescale Semiconductor SC140 specifications Adda r0,r1, Address Register