On Fri, Aug 20, 2010 at 6:36 AM, Xiaohui Liu <[email protected]> wrote:

> Why the uint32_t is not aligned on a 32 bit boundary. Is it because the
> MSP430 used on TelosB is 16-bit


yes the msp430 is a 16 bit machine.


> and 32-bit is sort of software-implemented? Thanks.
>

there are no 32 bit instructions so 32 bit abstractions such as uint32_t
have to be implemented by the compiler.


>
> On Fri, Aug 20, 2010 at 2:50 AM, Eric Decker <[email protected]> wrote:
>
>>
>>
>> On Thu, Aug 19, 2010 at 10:01 PM, Xiaohui Liu <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> For the following structure
>>> struct foo{
>>> uint8_t foo_a;
>>> uint32_t foo_b;
>>> };
>>> what is the actual layout after compilation on a TelosB platform? Will it
>>> be packed? Thanks.
>>>
>>
>> unless explicit package is requested no packing is done.   The struct will
>> be laid out
>>
>> byte
>> pad
>> 32 d
>> 32 c
>> 32 b
>> 32 a
>>
>>
>> The 32 bit uint32_t will be laid out in little endian order on a 16 bit
>> boundary.
>>
>> eric
>>
>>
>>
>>>
>>> --
>>> -Xiaohui Liu
>>>
>>> _______________________________________________
>>> Tinyos-help mailing list
>>> [email protected]
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>
>>
>>
>>
>> --
>> Eric B. Decker
>> Senior (over 50 :-) Researcher
>>
>>
>>
>
>
> --
> -Xiaohui Liu
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to