Bit-Reverse Subroutine - Analog Devices adsp-2100 Manual

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

Advertisement

14 Software Examples
14.7.3
The bit-reversal routine, called scramble, puts the input data in bit-
reversed order so that the results will be in sequential order. This routine
uses the bit-reverse capability of the ADSP-2100 family processors.
.MODULE
{
Calling Parameters
Return Values
Altered Registers
Altered Memory
}
.CONST
.EXTERNAL
.ENTRY
scramble:
brev:
.ENDMOD;
Listing 14.7 Bit-Reverse Routine (Scramble)
14 – 18

Bit-Reverse Subroutine

dit_scramble;
Sequentially ordered input data in inputreal
Scrambled input data in inplacereal
I0,I4,M0,M4,AY1
inplacereal
N=1024,mod_value=H#0010; {Initialize constants}
inputreal, inplacereal;
scramble;
I4=^inputreal;
I0=^inplacereal;
M4=1;
M0=mod_value;
L4=0;
L0=0;
CNTR = N;
ENA BIT_REV;
DO brev UNTIL CE;
AY1=DM(I4,M4);
DM(I0,M0)=AY1;
DIS BIT_REV;
RTS;
{I4—>sequentially ordered data}
{I0—>scrambled data}
{M0=modifier for reversing N bits}
{Enable bit-reversed outputs on DAG1}
{Read sequentially ordered data}
{Write data in bit-reversed location}
{Disable bit-reverse}
{Return to calling program}

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents