Logiciel Libre

August 27, 2005

Simple concepts combined become interesting and useful

Filed under: Uncategorized — Tags: — adam @ 8:04 am UTC

I just finished an excellent book, Code: The Hidden Language of Computer Hardware and Software by Charles Petzold. It’s well written, and I highly recommend it to anyone curious about digital logic, assembly language, and other topics about how computers really work. I’ve never had formal schooling in these subjects, and I don’t believe it is necessary in order to enjoy this book. I wrote an email to the author this morning.

Dear Mr. Petzold,

One fine, clear evening my wife and I were strolling around downtown Seattle. At Barnes and Noble I was lucky enough to pick up a copy of your book, “Code”.

Thank you. Thank you for writing this book! I just completed it, and am happy to say that I feel strengthened in my understanding of how computers really work. I enjoyed the examples, the humor and the simple, straightforward explanations. It is amazing to see what can be built by combining simple, tangible objects with novel ideas.

I do have a question about something you mention on page 353. Quoted: “An example: Many processors have bit-shifting instructions. As you’ll recall, these instructions shift the bits of the accumulator to the right or left. But almost no high-level programming languages include such operations.”

I believe a clarification is necessary. I’m familiar with Java, Perl, Bash Scripting, and Python. All of these high-level programming languages are quite popular, and all have bit-shifting operations.

Sincerely,
-Adam Monsen

And in a couple of hours he wrote back! What a cool guy.

Thank you very much. When “Code” was first published I figured that this was at least one book I’d never have to revise. Maybe that’s not entirely true….

When I wrote that passage, I was undoubtedly thinking in the long view. I was considering primarily the classic procedural languages such as Cobol and Fortran and Algol and Basic and Pascal and PL/I, and the many, many other languages discussed in the 785-page “Programming Languages: History and Fundamentals” by Jean B. Sammet and published a long, long time ago in 1969.

Of course, I knew at the time of one *major* exception to the “no bit-shifting” rule, and that is C (as I discuss ten pages later). It was primarily because of C that I said “almost no.” Of course, C has been a highly-influential language, as is evident with your list of bit-shifting languages. You might also have included C++ and C#.

I’m not sure how I’d change that passage today. Perhaps instead of “But almost no…” I’d say “Historically, few high-level programming languages have included such operations, although C and many recent languages influenced by C implement bit-shifting instructions.”

Charles

This book is not for the easily distracted. I had to read over some of the examples many times before I felt like I really “got” them. The effort was well worth it, and I’m glad I discovered this book! If you’re ready to dig in and really understand how the computer works, check it out.

This book might be thought of as a “beginner’s tutorial to assembly language”. Many pages are spent explaining the purpose and function of machine language and data.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress