Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Last time friend of mine reported a problem with reading of data through pointer from memory . He did receive MSB bits instead of full number . The problem was only related to floating types if i am not wrong . Other types are read OK .Platform was ARM .
As far as i know aligment is not not specified in C standard thus implementation specific keywords could be used to make it . At least said is true for assemblers .
Check pragma attributes for specific compiler if it is complied with C standard where implementation specific addons to be defined through #pragma .
In may processors 4 byte should start at an address that is multiple of 4 (ends with binary 00), 2 byte at multiple of 2 and byte anywhere. However it possible to load the data other wise. This may be onereason.
The other may be due to the format of data storage, many processors store lower LSByte at a higher address and MSByte at a lower address. (Byte addressable ..)
To avoid problems check the data storage format before programming.
Depends on compiler. For most C compilers you can use directives #pragma align, #pragma pack, and specifier "__align" to control alignment of different data items, structures and its members.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.