Updates:
- 2020-04-01 – Added image of the Color BASIC Unravelled book section where the Easter egg is located.
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.
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?
BASIC Code
For those curious, here is what those bytes look like in the ROM. This screen shot is from the Color BASIC Unravelled book.
Until next time…
Pingback: The undocumented syntax of Extended Color BASIC | Sub-Etha Software
LOL, the PETASCII and Commodore wording up there on the first paragraph after the XROAR screen seem to be out of place :-)
I don’t see it?