2026-07-21 10 REM"_(C2SLFF4 Let's dive into The Wizard's Castle (source code)! 10 REM"_(C2SLFF4 That is the first line of the 80s microcomputer BASIC game The Wizard's Castle initially written for the Exidy Sorcerer platform. It's a REMark statement, a comment in that particular language. 10 is the line number, if you're unfamiliar with languages that had such things. But the interesting part was this "_(C2SLFF4 mess. A typo or garbage? No. It appears verbatim in the source code as originally published in the July, 1980 issue of Recreational Computing. What the heck is it? Note: I'm going to jump back and forth between decimal (which is BASIC-friendly) and hex (which is programmer-friendly). Hex will be prefixed with 0x, suffixed with h, or will obviously have digits A-F in it. Note: Thanks to Josh and Chris, my hacking buddies, for doing tons of the emulator and research work on this. It took hours, but they were good hours. It would have taken me 10x as long without their help. Suspicions Here's more of the source in context, but with irrelevant pieces removed and some spaces added: 10 REM"_(C2SLFF4 40 POKE 260,218: POKE 261,1: T = USR(0): T = PEEK(-2049) 80 Q = RND(-(2*T+1)) In BASIC, a : is a command separator. POKE writes a byte value to the specified memory location. PEEK reads from one. Sorcerer BASIC used signed 16-bit numbers, apparently, so address -2049 is 65536-2049 or 0xF7FF in hex. We'll revisit that address later. Calling the pseudo-random number generator (PRNG) RND() with a negative number seeds it. Old PRNGs liked to be seeded with odd numbers, thus the 2*T+1 expression forcing it odd. And the USR() function calls a machine code routine. And line 80 is the first use of T after it is initialized from the PEEK(). The proximity of these things makes it seem like they're all related to seeding the PRNG. Sorcerer BASIC didn't have a RANDOMIZE command, so the only options of the day were: Ask the user to enter a random seed. Run an increment loop until t...
First seen: 2026-07-22 13:45
Last seen: 2026-07-22 22:52