Microsoft Color BASIC easter egg.

Over in the Color Computer group on Facebook, there was a post by Phill Harvey-Smith discussing CoCo ROMs and the ROMs of the CoCo clones.

Cathe Cita responded and provided a link to this cool article about the Microsoft BASIC ROM easter eggs:

https://www.pagetable.com/?p=43

I got curious, and wrote this:

10 REM MS-EGG.BAS
20 P$="ABCDEFGHIJKLMNOPQRSTUVWXYZ......!"
30 FOR L=&HBFEF TO &HBFE6 STEP -1
40 V=PEEK(L) AND &H3F
50 C$=MID$(P$,V,1)
60 PRINT HEX$(L);" ";HEX$(PEEK(L));" -> ";HEX$(V),C$
70 NEXT

Now I’ve finally seen it with my own eyes.

Color BASIC Easter Egg

Line 20 is just enough of the PETASCII characters that would get POKEd to the screen memory on the Commodore for our hidden message. (A is POKE x, 1 … B is POKE x,2, etc.)

Line 30 loops through the memory locations in the Color BASIC ROM where the easter egg is stored, just after a numeric table. And stored in reverse.

Like 40 uses PEEK to get the byte at that location, then uses AND to mask off the top 2 bits, which were added (“randomly?”) to obfuscate the message so you couldn’t see in the ROM binary.

Line 50 gets the corresponding character from the P$ that matches the value of the PEEK’d byte.

Line 60 prints out the memory location, then the original value stored there, then the “mask off the top two bits” value, and then the character it represents.

…neat, huh?

Until next time…

Leave a Reply

Your email address will not be published. Required fields are marked *