How to handle address alignment when declaring a buffer?

General discussion on mikroC for dsPIC30/33 and PIC24.
Post Reply
Author
Message
buzzo182
Posts: 11
Joined: 14 Jan 2008 20:32

How to handle address alignment when declaring a buffer?

#1 Post by buzzo182 » 27 Apr 2012 07:41

Hello everyone,

I would like to declare a 256 bytes buffer which has its start address aligned on a memory address finishing by 0x00.

Is there a specific keyword available from the compiler to perform such address alignment?

Thank you in advance.
Matt.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: How to handle address alignment when declaring a buffer?

#2 Post by filip » 27 Apr 2012 11:07

Hi,

You can do this in this manner, using absolute keyword :

Code: Select all

short Array[] = {1,2,3} absolute 0x50;
For more information, please read the Linker Directives chapter in the Help file of the compiler.

Regards,
Filip.

buzzo182
Posts: 11
Joined: 14 Jan 2008 20:32

Re: How to handle address alignment when declaring a buffer?

#3 Post by buzzo182 » 27 Apr 2012 12:13

Great, thank you for this quick answer.

Post Reply

Return to “mikroC for dsPIC30/33 and PIC24 General”