MAD Magazines Mad Computer Program

MAD Magazine's Mad Computer Program printed in 1985 in issue #258.

In 1985, I aquired this magazine from a grocery store and quickly typed in the Mad Computer Program into my Commodore 64 but it would not run. I remember spending many hours trying to get it to work, but I never found my bug and it would always draw incorrectly. A few years later I typed in the IBM version and it rendered fine.

Fast forward to 2020 when I decided to once again to get the Commodore 64 version working. I used OCR software to scan in the DATA lines and typed or fixed the rest. However no matter what I tried I could not get Alfred to render correctly. After months of failed attempts to fix what I thought was a bug on my part, I finally asked about it on a bulletin board where I got an answer. There was a bug printed in the Mad Magazine for the C64 version!

The bug is at the end on line 80, the subtraction needs to be addition. The LY assignment needs to be "LY=199-(Y2+YC)" rather than "LY=199-(Y2-YC)".

After I fixed the bug, I found out that Mad Magazine issue #260 had a code correction stating that it was because the Commdore 64 had different versions of the BASIC ROM, but if the problem was in the BASIC ROM rather than being a simple bug in the code, it would mean that there is a version of the BASIC ROM that would have interpreted the plus and minus operators incorrectly which I find to be highly unlikely. I will probably never know the full story.

Sometime after I got the BASIC version working, I translated the BASIC version to 6510 machine language. I also used a BASIC compiler to compile the original for speed comparison of the hand rolled assembly versus the generated.

Download the CBM source code below.

Mad Magazines Alfred - BASIC
Mad Magazines Alfred - 6510 Machine Language
Mad Magazines Alfred - Compiled BASIC