This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Buffer alignment

I have a basic question. I have a test c code in which I have a buffer that I want to be aligned at a particular address. How do I do that. Here is the snippet of the code

void TestFn (void)

{

  unsigned long xmt[80];. // This buffer need to be placed at 128 byte boundary.....How to achieve this???

.

.

.}

  • sachinpdesai,

    Please look at the #pragma DATA_ALIGN command in your C Compiler User's Guide.

    This pragma probably can only be used with global variables, not stack-based variables as in your example.

    Regards,
    RandyP

     

    If you need more help, please reply back. If this answers the question, please click  Verify Answer  , below.