2008-11-20 09:37:11     assembly align

Document created by Aaronwu Employee on Aug 8, 2013
Version 1Show Document
  • View in full screen mode

2008-11-20 09:37:11     assembly align

Daniele Pagani (ITALY)

Message: 65613   

 

Hi,

 

I'm porting the Scaler_Render function from VisualAudio to user application in uClinux.

 

In the source code, I've:

 

.align 2 ; // in VisualAudio on VisualDSP.

 

When I port the code, I need to remove this line, because the user application doesn't work fine.

 

When I enable this line, than the user application works in "strange" way.

 

Any suggestion?

 

Daniele.

 

 

 

The code:

 

.global _Scaler_Render;

 

.align 2;

 

_Scaler_Render:

    P0 = R0 ;      // instance struct ptr

    link  0;       // according to the compiler manual (near the bottom of page 1-192) a function

                   // MUST link at least 12 bytes of stack, even if it doesn't use it?

    P1 = R1 ;      // buffers array

    P2 = R2;         // tickSize

    R0=[P1+ 0];      // *in

    I0=R0;

    R1=[P1+ 4];      // *out

    I1=R1;

 

    M0 =  4 (X);

    R2=W[P0+ 0] (Z);// scale (16 bits), into bottom word

 

        R1 = [I0++M0];                                                   // get input

        A0 = R2.L*R1.H, A1 = R2.L*R1.L (M);                              // scale*in

    LSETUP (sampleLoopStart , sampleLoopEnd) LC0=P2; // blackfin lsetup can only get count from a P register

sampleLoopStart:

        A1 = A1 >>> 15;                                                  // shift mixed-order sum

        R0 = (A0 += A1) || R1 = [I0++M0];                                // add higher-order and mixed-order sums, get next input

sampleLoopEnd:

        A0 = R2.L*R1.H, A1 = R2.L*R1.L (M) || [I1++M0]=R0;               // next scale*in, write output

 

    P0=[FP+ 4];

    unlink;

    JUMP (P0);

 

_Scaler_Render.end:

 

TranslateQuoteReplyEditDelete

 

 

2008-11-20 17:52:56     Re: assembly align

Mike Frysinger (UNITED STATES)

Message: 65633   

 

you should use ".align 4"

Attachments

    Outcomes