CMP (PC), 4(SP)

A recent discussion about the virtues of the Chief Programmer method motivated me to re-read “The Mythical Man-Month”. What a great book. I read it while on vacation and kept on saying to my wife “Why don’t they make all computer science and software engineering undergrads read this book?” When I came back, I asked some of my co-workers if they had read the book. The only ones that had were “old guys” (like me) and one “young guy” who attended UNC where Brooks taught. That’s sad and I encourage everyone young and old to read this book.

The book, however, is a little dated. To prove one of his points, Brooks describes as “extravagant” the use of and additional “10 bytes” to implement leap year support in OS 360’s date code. Now, 10 bytes “back in the day” was indeed extravagant, but for a programmer that has been brought up coding in today’s environments, 10 bytes is less than the guy’s email signature.

As I pondered these 10 bytes, I reminisced about some code I had to maintain in the RSTS/E kernel. The code was:

CMP (PC), 4(SP) ;Is 4 off of SP 4? Saves 2 bytes

This took me and another guy more than a couple of minutes to figured out, but sure enough it saved those precious two bytes. So, just how precious were those two bytes?

Adjusting for the fact that these two bytes were on a 16-bit architecture and today’s machines are 32-bit, I figured that those two bytes are equivalent to 128K. What would you do to save 128K in a space sensitive area of your system or perhaps that application you’re writing for your mobile phone?

So, what does this have to do with software security? Nothing. But, after all, I was on vacation.

Leave a Reply



Resources
> Overview
> Your Account
> Podcast
> Blog
> Case Studies
> White Papers
> Publications
> Books
> Security Articles
> Presentations
> Java Security Rulepack


RSS

About the Bloggers
  • Pravir Chandra
  • Jeremy Epstein
  • Scott Matsumoto
  • Gary McGraw
  • Sammy Migues
  • Craig Miller
  • John Steven
  • Categories
  • Admin (4)
  • Assurance (7)
  • Data Security (3)
  • Defects, Bugs, and Flaws (3)
  • Enterprise Software Security (12)
  • General Interest (5)
  • Governance and Regulation (5)
  • Risk Management (4)
  • Security Features (2)
  • SOA and Web 2.0 (2)
  • Software Quality (4)
  • Software Security (40)
  • Software Security Touchpoints (9)
  • Software Testing (2)
  • Training (3)
  • Archives
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • By Blogger
  • Craig
  • Gary
  • Jeremy
  • John
  • Pravir
  • Sammy
  • Scott
  • Guest bloggers
  • Recent Comments
  • gem on Strengthening Software Security through collaboration : Hi all, Here’s what I said about...
  • gem on The Never Ending Open Source Security Debate Drags On: Hi Andre, Thanks for your resonse. If I...
  • Andre Gironda on The Never Ending Open Source Security Debate Drags On: “The Never Ending Open...
  • Ryan on More on comics and security: Kevin — only two of the animations have audio.
  • gem on More on comics and security: Hi Don, I grew up in east TN (Kingsport) and drove to Knoxville...
  • Recent Entries
  • What Measures do Software Vendors Use for Software Assurance?
  • Justice League’s Newest Blogger
  • RSS Feed for McGraw’s Columns
  • Strengthening Software Security through collaboration
  • Software security is growing
  • Links
  • Cigital
  • Silver Bullet Podcast
  • Blogroll
  • 1 Raindrop
  • Fortify Software's Blog
  • Freedom to Tinker
  • In the Wild
  • Jon Udell
  • Michael Howard's Blog
  • Microsoft Security Vulnerability Research and Defense
  • News.com Security Blog
  • Schneier on Security
  • Security Fix
  • SilverStr's Blog
  • Tao Security