Modulo Addressing (Circular Buffers) - Analog Devices adsp-2100 Manual

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

4 Data Transfer
Here is a simple example of linear indirect addressing:
I3=0x3800;
M2=0;
L3=0;
AX0=DM(I3,M2);
Here is an example which uses a memory variable to store an address
pointer:
.VAR/DM/RAM
accessed}
I3=DM(addr_ptr);
L3=0;
M1=0;
AX0=DM(I3,M1);
4.2.3
The modulus logic implements automatic modulo addressing for accessing
circular data buffers. To calculate the next address, the modulus logic uses
the following information:
• The current location, found in the I register (unsigned).
• The modify value, found in the M register (signed).
• The buffer length, found in the L register (unsigned).
• The buffer base address.
From these inputs, the next address is calculated according to the formula:
Next Address = (I + M – B) Modulo (L) + B
where:
I
M
B
L
M + I =
The inputs are subject to the condition:
|M| < L
This condition insures that the next address cannot wrap around the buffer
more than once in one operation.
4 – 4
addr_ptr; {variable holds address to be

Modulo Addressing (Circular Buffers)

=
current address
=
modify value (signed)
=
base address
=
buffer length
modified address
{I3 loaded using direct addressing}
{disable circular addressing}
{no post-modify of I3}
{AX0 loaded using indirect addressing}

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents