Motorola MCF5281, MCF5282 user manual MAC.sz Ry,RxSF,eay&,Rw

Models: MCF5282 MCF5281

1 816
Download 816 pages 28.97 Kb
Page 115
Image 115

Memory Map/Register Set

This register performs a simple AND with the operand address for MAC instructions. That is, the processor calculates the normal operand address and, if enabled, that address is then ANDed with {0xFFFF, MASK[15:0]} to form the final address. Therefore, with certain MASK bits cleared, the operand address can be constrained to a certain memory region. This is used primarily to implement circular queues in conjunction with the (An)+ addressing mode.

This feature minimizes the addressing support required for filtering, convolution, or any routine that implements a data array as a circular queue. For MAC + MOVE operations, the MASK contents can optionally be included in all memory effective address calculations. The syntax is as follows:

MAC.sz Ry,RxSF,<ea>y&,Rw

The & operator enables the use of MASK and causes bit 5 of the extension word to be set. The exact algorithm for the use of MASK is as follows:

if extension word, bit [5] = 1, the MASK bit, then if <ea> = (An)

oa = An & {0xFFFF, MASK}

if <ea> = (An)+ oa = An

An = (An + 4) & {0xFFFF, MASK}

if <ea> =-(An)

oa = (An - 4) & {0xFFFF, MASK} An = (An - 4) & {0xFFFF, MASK}

if <ea> = (d16,An)

oa = (An + se_d16) & {0xFFFF0x, MASK}

Here, oa is the calculated operand address and se_d16 is a sign-extended 16-bit displacement. For auto-addressing modes of post-increment and pre-decrement, the calculation of the updated An value is also shown.

Use of the post-increment addressing mode, {(An)+} with the MASK is suggested for circular queue implementations.

MOTOROLA

Chapter 3. Enhanced Multiply-Accumulate Unit (EMAC)

3-11

Page 115
Image 115
Motorola MCF5281, MCF5282 user manual MAC.sz Ry,RxSF,eay&,Rw