Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
46
Добавлен:
27.04.2015
Размер:
4.26 Mб
Скачать

Accessing the Accumulator Registers

3.2.2.4 Examples of Writing the Entire Accumulator

Figure 3-7 shows the result of writing a 16-bit signed value to an entire accumulator. Note that all three portions of the accumulator are modified. The LSP (B0) is set to zero, and the extension portion (B2) is appropriately sign extended.

Writing a Positive Value into 36-Bit Accumulator Example: MOVE #$1234,B

 

 

 

 

Before Execution

 

 

 

 

 

After Execution

 

 

B2

 

B1

 

B0

 

B2

 

B1

 

B0

B

X

X X X X

X X X X

B

0

1 2 3 4

0 0 0 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

35

32

31

16

15

0

35

32

31

16

15

0

Writing a Negative Value into 36-Bit Accumulator Example: MOVE #$A987,B

 

 

 

 

Before Execution

 

 

 

 

 

After Execution

 

 

B2

 

B1

 

B0

 

B2

 

B1

 

B0

 

 

 

 

 

 

 

 

B

X

X X X X

X X X X

B

F

A 9 8 7

0 0 0 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

35

32

31

16

15

0

35

32

31

16

15

0

Figure 3-7. Writing the Accumulator as a Whole

Successfully using the DSP56800 Family requires a full understanding of the methods and implications of the various accumulator-register access methods. The architecture of the accumulator registers offers a great deal of flexibility and power, but it is necessary to completely understand the access mechanisms involved to fully exploit this power.

3.2.3 General Integer Processing

General integer and control processing typically involves manipulating 16and 32-bit integer quantities. Rarely will such code use a full 36-bit accumulator such as that implemented by the DSP56800 Family. The architecture of the DSP56800 supports the manipulation of 16-bit integer quantities using the accumulators, but care must be taken when performing such manipulation.

3.2.3.1 Writing Integer Data to an Accumulator

When loading an accumulator, it is most desirable for the 36 bits of the accumulator to correctly reflect the 16-bit data. To this end, it is recommended that all accumulator loads of 16-bit data clear the least significant portion of the accumulator and also sign extend the extension portion. This can be accomplished through specifying the full accumulator register as the destination of the move, as shown in Example 3-1.

Example 3-1. Loading an Accumulator with a Word for Integer Processing

MOVE X:(R0),A

; A2

receives sign extension

 

;

A1

receives the

16-bit data

 

;

A0

receives the

value $0000

 

 

 

 

 

Data Arithmetic Logic Unit

3-11

Соседние файлы в папке DSP568xx