Un-alignment in structures

MLY.G.SHADES%MIT-OZ at MIT-MC.ARPA MLY.G.SHADES%MIT-OZ at MIT-MC.ARPA
Fri Mar 15 21:13:37 AEST 1985


	the reason for the padding, which admittedly does not hold for
some machines, is that many machines, notably the pdp-11, can not
handle words generated at an odd address.  if the compiler was allowed
to generate incorrectly aligned data then the compiler would rapidly
acquire, and rightfully so, a reputation for uselessness; the code
produced would generate odd instruction traps at the most inconvenient
locations.

	another interesting effect is with machines that don't have
proper byte addressing but simulate it instead; pdp-10, and honeywell
600/6000/dps 8 line use an incrementing byte pointer into a word; the
honewell level 6/dps 6 uses indexed byte instructions to generate
offset and left/rightness; the raytheon rds 500/704 uses separate
left/right instructions, except as i remember when the argument is
indexed. this list is not by any means definitive or even reasonably
exhaustive. it does however show why in a language that is to be as
portable as possible (c) you would not want and should not include
machine breaking structures.

	sorry but that's life down here in river city.

                   shades%mit-oz%mit-mc.arpa at seismo (? looks right ?)



More information about the Comp.lang.c mailing list