Multiple Wrap-Around Modulo Addressing Mode; Modulo Register Values For Modulo Addressing Mode - Freescale Semiconductor SC140 DSP Core Reference Manual

Digital signal processor (dsp) core
Table of Contents

Advertisement

Table 2-21 describes the modulo register values and the corresponding address calculation.
Table 2-21. Modulo Register Values for Modulo Addressing Mode

2.3.4.4 Multiple Wrap-Around Modulo Addressing Mode

Multiple wrap-around addressing is useful for decimation, interpolation, and waveform generation. The
multiple wrap-around capability can be used for argument reduction. In multiple wrap-around modulo
addressing mode, the modulus M is a power of 2 in the range of 2
modifier register (Mj). The B registers B0 to B7 are not used for multiple wrap-around modulo addressing;
therefore, their corresponding R8–R15 registers can be used for linear addressing.
The lower and upper boundaries are derived from the contents of Mj. The lower boundary (base address)
value has zeros in the k LSBs where M = 2
involved in the memory access is used to set the MSBs of the base address. The base address is set so that
the initial value in the Rn register is within the lower and upper boundaries. The upper boundary is the
lower boundary plus the modulo size minus one (base address + M–1).
The size of the modulo buffer must be aligned to (be a multiple of) the access width. If the modulus is less
than the access width, the data accessed as well as the address calculations are undefined.
If an offset Ni is used in the address calculations, it is not required to be less than or equal to M for proper
modulo addressing. The multiple wrap-around modulo addressing mode supports unlimited boundary
wraps.
When using the (Rn)+ and (Rn)- addressing modes with a modulus 2
between the multiple wrap-around and normal modulo modes since the address can only be wrapped
around once.
As an example, consider the instruction
is set to $000f, then M0 = 16. If r0 is initially $24 (36), the lower boundary is $20 (32) and the upper
boundary is $2f (47). The memory access is done from address $26 (38), calculated by 36 + 66 = 102,
102–48=54, 54–3x16=6, 6+32=38.
SC140 DSP Core Reference Manual
Modifier Mj
$0000 0000
$0000 0001
$0000 0002
$7FFF FFFE
$7FFF FFFF
k
and therefore must be a multiple of M. The Rn register
move.w (r0 + $0042),d0
Address Calculation Arithmetic
Unused
Modulo 1
Modulo 2
31
Modulo 2
-2
31
Modulo 2
-1
1
31
to 2
. The value M-1 is stored in the
≥ 8, there is no functional difference
k
. If the mctl is set to $000c, and m0
Address Generation Unit
2-47

Advertisement

Table of Contents
loading

This manual is also suitable for:

Starcore sc140

Table of Contents