Skip to content

LOVE SQUIDS

I recently got on a kick of old educational games: The Learning Company‘s Super Solvers series, MECC‘s DinoPark Tycoon, etc. One game I started playing is Sierra‘s The Island of Dr. Brain, the only of the four Sierra-developed Dr. Brain titles that I never played while growing up.

The first two games in the series, Castle of Dr. Brain and Island, were in the style of a Sierra point-and-click adventure game (although simplistically so). Each screen has one or more puzzles which you have to solve in order to move onto the next screen. There’s a hand tool to interact with puzzles and other objects on each screen and an eye tool to inspect things, and there’s an inventory which is used on occasion to collect items (that you get by solving a puzzle) and use items (to unlock another puzzle or the next screen).

In grand Sierra fashion, every screen has quite a few scenery objects which you can poke or inspect to activate short little animations or display joke messages. There are many things in the game which are seemingly there just to make puns when you look at them. One screen has a large hand hanging from the ceiling, and sitting in the hand is a bird. This serves absolutely no purpose except to make the obvious joke when you look at it.

Looks like Dr. Brain prefers his bird in the hand.

There’s a scene in a laboratory late in the game that contains a large computer with a flashing red light.

the underground laboratory from The Island of Dr. Brain

When you inspect the computer, you get the message “Dr. Brain’s mainframe sure seems to be working overtime on something.” There’s a small scrap of paper coming out of the right side of the computer, behind the teacup. If you inspect this, you’ll see that it actually contains x86 assembly code:

the assembly code listing easter egg

This is written for an assembler I’m not familiar with, MASM I believe, so there are a few lines I can’t explain, and I can’t tell you whether the whole code is valid and can be assembled into something executable. But the code is pretty simple, so I can explain what it does.

.MODEL SMALL
.CODE
        ORG     100H
Start:  JMP     Begin
        text    DB  4CH,4FH,56H,45H,20H,53H,
                    51H,55H,49H,44H,53H,20H,
                    20H,24H

Ignoring the first three lines, this code does two things: it moves execution to the label “Begin” (line 4) and defines a string with the name text (lines 5-7). The string is a comma-separated listed of characters, and each character is encoded with its hexadecimal ASCII representation. We could use a table of all the characters to translate the string by hand, but let’s just write some quick Python instead:

>>> chars = ["4C", "4F", "56", "45", "20", "53", "51", "55", "49",
...  "44", "53", "20", "20", "24"]
>>> [chr(int(c, 16)) for c in chars]
['L', 'O', 'V', 'E', ' ', 'S', 'Q', 'U', 'I', 'D', 'S', ' ', ' ', '$']

So, uh… “LOVE SQUIDS $”. Yeah. Moving on to the real stuff.

Begin:  MOV     AH, 9
        MOV     BX, 093H
        MOV     DX, OFFSET text
Looper: INT     21H
        DEC     BX
        JNZ     Looper

Lines 1 and 3 here set up the registers for a call to DOS interrupt 0x21, which encompasses a whole lot of I/O functions. Specfically, subprogram 0x09, which prints a $-terminated string, is going to be used. This is why the string definition ends in a dollar sign. Only “LOVE SQUIDS ” (with two trailing spaces and no newline) will be printed.

The second line puts the number 147 (0x93) into register BX. This is used as a counter by the last three lines, which run the interrupt, printing the string, 147 times.

Exit:   INT     20H

        END     Start

And this just calls another DOS interrupt that terminates the program.

So, The Island of Dr. Brain contains an easter egg of hidden code that prints the following:

“LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS LOVE SQUIDS “

I wonder how many people playing this game understood what this code did, or even entered it into an assembler to run it.

{ 1 } Comments

  1. Frank from Oyster Bay | 2011-08-01 at 7:11 am | Permalink

    I just found this site, and I love it!

    I played Dr. Brain and related games with my now-grown son, when they came out. I think we were using the newest EGA video technology. I’m sure I enjoyed the games more than my son did.

    Somehow, I never came across the code fragment, although I do remember the computer scene. I was an assembly language programmer at the time, and I’m sure I would have attempted what you accomplished. Thank you for taking it one step further and sharing it with the world!

    That game was pretty cool… I wonder if anyone makes USB 5.25″ drives …

Post a Comment

You must be logged in to post a comment.