The Mudcat Café TM
Thread #72619   Message #1255535
Posted By: HuwG
24-Aug-04 - 03:38 PM
Thread Name: BS: Help El Ted to count to 100 in binary
Subject: RE: BS: Help El Ted to count to 100 in binary
I worked for six years in Assembler programming, i.e. as close to actually programming mainframes in binary as it is possible to get, these days. To be fair, assembler instructions are usually rendered in pseudo-english e.g.

L@0001:
    mov    ax,[bx]
    cmp    ax,dx
    jz      L@0001
    add    bx,2

    etc.

However, a lot of the applications for which assembler work is required, depend on working out the precise offset and segment addresses of areas of code and data in the computer's memory or on discs, and these addresses are in hexadecimal (hex, for short) i.e. they use base 16, with the letter 'A' representing 10, 'B' representing 11 and so on.

When I first tried my hand at this, I ran into the brainwashing inflicted on me at infant and junior school, that of being forced to chant in unison with the rest of the class, "One times two is two, two times two is four" etc. This drudgery left me and most of my fellow programmers unable to warp our minds around hex calculations.

The lazy bought calculators with hex conversion functions (this was long before the days of Windows, with its built-in calculator accessory), some covered sheaves of scrap paper with manual calculations and conversions, while one or two could be heard muttering "eleven times eleven is seventy-nine", and "fifteen times fifteen is fourteenty-one", in an effort to re-educate stubborn brain cells. It is scarcely surprising that one or two programmers of the early days have become known to be obsessive and socially disfunctional types, or perhaps that such types were drawn to programming.

Most of my fellow-coders remained normal (and so did I, or at least as normal as a teapot can be), but one could almost have been used as an illustration of the type. He could look at a page or more of a hex memory dump which read "1B 5B 35 41 53 68 65 20 56 69 64 ...", and read, without a moment's pause, "Ok, escape, left square bracket, five, 'A', that's the 'move cursor to home' command, 'The Widget Manufacturing Company', carriage return, line feed...". On the other hand, he once shipped a floppy disc to a customer with a file called "testicle.exe" on it, and was genuinely surprised at the fuss this caused. After all, it was supposed to test ICL emulation, wasn't it ?


Binary is a powerful tool if you can master it. It allows you to count to 1023 on your fingers (and 1048575, if you remove your socks).