Unix History: Why does hexdump default to word alignment?

Unix History: Why does hexdump default to word alignment?

Oleg Goldshmidt pub at goldshmidt.org
Thu Dec 1 12:51:46 IST 2011


On Thu, Dec 1, 2011 at 12:25 PM, geoffrey mendelson
<geoffreymendelson at gmail.com> wrote:


> Turbo Pascal for the IBM PC had a decimal mode were it would store numbers
> as decimal digits and do decimal arithmetic on them. I never used TP, so I
> don't know much more about it. Any Pascal programmers out there?

My first paid software job was programming in Turbo Pascal on IBM PCs,
20-something years ago. Late 80ies... Before Linux even existed as a
concept... Oh, my.

I *think* TP had BCD (binary-coded decimals, google or check Wikipedia
if you are interested). Basically, in BCDs every decimal digit is
coded separately as a 4-bit binary number. IIRC, all x86 processors
provided BCD-related instructions (conversions to and from), but I
think even then it was slower than straightforward binary arithmetic.
It was slow because the machine instructions were for single bytes
only, but not for wider objects. I do not remember if it was in any
way related to 8087 math co-processors.

I don't recall ever using BCD explicitly, but I may have been too
inexperienced to notice. Never programmed in Pascal since.

-- 
Oleg Goldshmidt | pub at goldshmidt.org



More information about the Linux-il mailing list