<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>First computer Unix run on was PDP. On PDP instructions and also short/int are word aligned, so may be it's a reason.</span></div><div><br><span></span></div><div><span>Valery<br></span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;">  <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"> <font face="Arial" size="2"> <hr size="1">  <b><span style="font-weight: bold;">From:</span></b> Elazar Leibovich &lt;elazarl@gmail.com&gt;<br> <b><span style="font-weight: bold;">To:</span></b> linux-il &lt;linux-il@cs.huji.ac.il&gt; <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, December 1, 2011 9:16 AM<br> <b><span
 style="font-weight: bold;">Subject:</span></b> Unix History: Why does hexdump default to word alignment?<br> </font> <br>
<div id="yiv1727701282"><div dir="ltr">The default behaviour of hexdump is to align data word-wide. For instance<div><br></div><div>&nbsp; &nbsp; printf '\xFF\xFF\x01' | hexdump</div><div>&nbsp; &nbsp; 0000000 ffff 0001</div><div><div>&nbsp; &nbsp; 0000003</div></div>
<div><br></div><div>This makes little sense to me. In C, structs are not necessarily aligned to words, and it doesn't seems useful to view about any data format for which you're sure everything is word-aligned. The "hexdump -C" behaviour makes much more sense in the general case.</div>
<div><br></div><div><div>&nbsp; &nbsp; printf '\xFA\xFB\x01' | hexdump -C</div><div>&nbsp; &nbsp; 00000000 &nbsp;fa fb 01 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|...|</div><div>&nbsp; &nbsp; 00000003</div></div><div><br></div><div>No confusion.</div>
<div><br></div><div>I'm sure there was a reason for that, but I can't think about one.</div><div><br></div><div>(I apologize for the slightly off-topic post)</div><div><br></div><div><br></div></div>
</div><br>_______________________________________________<br>Linux-il mailing list<br><a ymailto="mailto:Linux-il@cs.huji.ac.il" href="mailto:Linux-il@cs.huji.ac.il">Linux-il@cs.huji.ac.il</a><br><a href="http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il" target="_blank">http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il</a><br><br><br> </div> </div> </blockquote></div>   </div></body></html>