Unix History: Why does hexdump default to word alignment?

Unix History: Why does hexdump default to word alignment?

Valery Reznic valery_reznic at yahoo.com
Thu Dec 1 09:31:49 IST 2011


First computer Unix run on was PDP. On PDP instructions and also short/int are word aligned, so may be it's a reason.

Valery




>________________________________
> From: Elazar Leibovich <elazarl at gmail.com>
>To: linux-il <linux-il at cs.huji.ac.il> 
>Sent: Thursday, December 1, 2011 9:16 AM
>Subject: Unix History: Why does hexdump default to word alignment?
> 
>
>The default behaviour of hexdump is to align data word-wide. For instance
>
>
>    printf '\xFF\xFF\x01' | hexdump
>    0000000 ffff 0001
>    0000003
>
>
>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.
>
>
>    printf '\xFA\xFB\x01' | hexdump -C
>    00000000  fa fb 01                                          |...|
>    00000003
>
>
>No confusion.
>
>
>I'm sure there was a reason for that, but I can't think about one.
>
>
>(I apologize for the slightly off-topic post)
>
>
>
>
>_______________________________________________
>Linux-il mailing list
>Linux-il at cs.huji.ac.il
>http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20111130/ffb5c92b/attachment-0001.html>


More information about the Linux-il mailing list