Chapter 5: PEEK, POKE, and the Memory Map
BASIC was friendly, like a polite translator standing between Frank and the hardware, yet after a few months he noticed a frustrating ceiling. BASIC could print text and add numbers, but it couldn't easily draw flying spaceships, flash the screen border like lightning, or check the exact position of a joystick in a fraction of a millisecond. The real power of the Commodore 64 lived behind a curtain—and the keys to that curtain were two strange four-letter words: PEEK and POKE.
Frank found them in a thick, dog-eared copy of the Commodore 64 Programmer's Reference Guide borrowed from an older kid down the street. Inside was a fold-out chart called the Memory Map: a vast street directory of 65,536 numbered addresses, from 0 all the way to 65535. Every single thing the computer could see, hear, or remember lived at a specific numbered house along that street. PEEK let you knock on a door and read the number sitting inside; POKE let you walk right in and replace it with a number of your own.
His hands practically buzzed as he typed his very first hardware command directly onto the blue screen:
POKE 53280,0
The instant he hit RETURN, the pale blue border snapped pitch black. He typed POKE 53281,0, and the entire screen turned into the velvet darkness of outer space. A tiny thrill raced down his spine. Address 53280 wasn't just a random memory cell—it was a live wire connected straight into the VIC-II video chip's border color register. By dropping a single byte from 0 to 15 into that mailbox, he was speaking directly to the silicon.
Soon he discovered 1024, the start of screen memory, where poking the number 1 placed the letter A in the top-left corner faster than PRINT ever could. Then came sprites—little twenty-four-by-twenty-one pixel grids carved out of binary ones and zeros on graph paper with a dull pencil. Frank drew a tiny rocket ship square by square, added up the powers of two for each row (128, 64, 32, 16, 8, 4, 2, 1), poked the resulting bytes into RAM, switched on the sprite enable register at 53269, and held his breath.
There it was: his own little rocket, floating effortlessly over the text screen, gliding smoothly from left to right as a loop incremented address 53248. And when he made a typo—poking the wrong byte into zero-page memory—the screen froze in a chaotic snowstorm of garbage characters until he cycled the power switch.
Strangely, even the crashes felt exhilarating. The machine never lied, never guessed what he meant, and never held a grudge. If his math was right, the rocket flew; if his byte was off by one, the hardware showed him the exact consequence without sugarcoating it. In that strict, crystal-clear honesty, Frank found a kind of peace he had never felt anywhere else.
PEEK and POKE strip away the illusion of software and reveal the truth underneath: a computer is a street of numbered mailboxes, and every address obeys the exact byte you write.