Ethereal-dev: RE: [Ethereal-dev] Re: question on TLV

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Mark Pilant <Mark.Pilant@xxxxxxx>
Date: Tue, 13 Sep 2005 14:15:54 -0400
> ofcourse nothing wrong in sticking with the norm of octet aligned etc,
> but just curious...if yes we have to stick to word aligned, it should
> be "documented"

The "preferred" alignment is up to the chip maker, and it gets hidden by
the compiler.  This isn't usually a problem unless one of two things
happen: 1) you want to send the data out on the wire or 2) you are
trying
to fit you data in a confined (think embedded controllers) space.

This is all usually documented in the chip maker's architecture manual
for the specific chip.  However, most folks these days don't ever have
to dig that deep, and are unaware of the issue.

Unless you are like me, and like to tinker.  I've also been playing
around with computers since they were built with individual transistors.
I missed the vacuum tube era by a couple of years :-) :-)

> but eitherways i would need a way to treat each element seperately say
> unit8 A unit8 B unit8 C unit8 D
>
> i may fetch each individually or if they can be fetched in 1 instr,
> together, but they still quantize different elements of the data.

The alignment issue doesn't come up when accessing individual bytes or a
byte stream.  If, for example, you try and access a 32 bit int from
address 0x1001 (instead of 0x1000) you will see the performance hit or
exception.

> unless u argue with the coder and he tell u to jump :-)

:-P

- Mark