RSSAmplifier

Blog

2^x bits on Imapenguin

Recent content in 2^x bits on Imapenguin

imapenguin.comRSS feed ↗121 posts

Latest posts

Matrix Math on a Commodore 64

Matrix fundamentals from the ground up. Definitions, the operations that matter, plain Python, numpy for comparison, and a complete BASIC program on a real C64.

The SID Chip Is a Reservoir Computer

Reservoir computing says don’t train the dynamics, just train the readout. I used the SID’s analog filter as the dynamics and one ridge regression as the readout. It’s not state of the art, but the chip earns its keep exactly where a linear model falls apart.

WOZMON, Eight CPUs, and a Paper Tape

Eight CPUs from the 1970s and 1980s, sharing one 64K bus, an Apple-1 style monitor on the front, and a paper tape station. Open it in your browser and poke around.

Forty-Three Quintillion on a Commodore 64

Where the famous 43 quintillion comes from, why a C64 can’t print it the easy way, and a tiny multi-precision multiplier in BASIC that gets every digit right.

Fixing a Timex Sinclair 2068 and Porting the Bond Maze

I picked up a boxed Timex Sinclair 2068 that wouldn’t boot. An oscilloscope, a BackBit tester, and a fresh Z80 later, it was running. Then I ported Charles Bond’s 1981 maze algorithm from the C64 to Sinclair BASIC.

Biological Processing Units and a Commodore 64

The fruit fly has a brain structure that acts like a hash function. I built it in Python, matched the 2017 paper’s MNIST results against a classical baseline, then got the same algorithm running on a Commodore 64.

Breaking Enigma with Index of Coincidence on a Commodore 64

The Bombe needs a crib. What if you don’t have one? Index of coincidence measures how much an output looks like real language vs random noise. We use it to attack Enigma without any known plaintext.

The Wallis Product for Pi on the C64

John Wallis found an infinite product for pi in 1655. Multiply enough fractions together and pi falls out. We run it on the C64 in BASIC and assembly, watching it converge one digit at a time.

Enigma Ring Settings on the Commodore 64

Ring settings multiply Enigma’s keyspace by 17,576. We add them to our C64 emulator, see why brute force alone can’t keep up, and set the stage for smarter attacks.

Breaking Enigma on the Commodore 64

The Commodore 64 searches nearly six million Enigma M3 configurations to find the one that matches a known plaintext crib. First the concept, then BASIC, then 6502 assembly fast enough to crack it in about 22 minutes.

Enigma Emulator on the Commodore 64

A working Enigma M3 emulator on the Commodore 64. First in BASIC for clarity, then in 6502 assembly for speed. Eight rotors with dual notches, plugboard, and the double-step anomaly, all on a 1 MHz machine.

10 PRINT on the Apple II

Bringing 10PRINT to the Apple II with Applesoft BASIC and Lo-Res graphics, exploring both text-mode and graphical approaches to this iconic one-liner.

The Math Behind Enigma

Why German cryptographers believed Enigma was unbreakable, and why Allied codebreakers ultimately proved them wrong.

Sorting Algorithms Visualized on the Commodore 64

Visualizing sorting algorithms in real-time on the Commodore 64 using PETSCII characters. Three classic algorithms rendered as animated bar charts in BASIC.

First Principles: Why You Must Learn Before You Prompt

Vibe coding with AI feels productive until it isn’t. Dorothy Vaughan’s team didn’t just operate the IBM—they understood the math behind it. That’s why they succeeded. Here’s why first principles must come before AI assistance.

Dorothy Vaughan: Adapt or Become Obsolete

When IBM machines threatened to make her job obsolete, Dorothy Vaughan didn’t retreat—she learned FORTRAN and taught her entire team. Her story offers a blueprint for surviving technological change in any era.

Three Maze Generators on the Commodore 64

Exploring three different maze generation algorithms on the Commodore 64: Depth-First Search, Randomized Prim’s, and the classic 1981 algorithm from Compute! magazine.

16-bit Unsigned AND on Commodore 64

Implementing 16-bit unsigned AND operations in Commodore BASIC using two’s complement to work around the signed integer limitation.

The Best Book Cover of All Time

Celebrating the gloriously absurd cover of ‘FORTH on the Atari’—possibly the greatest unintentionally funny book cover ever created.

10 PRINT for the KIM-1

Implementing 10PRINT on a KIM-1 clone (PAL-II) in both Microsoft BASIC and 6502 assembly, displaying the maze on the 7-segment LED display.

10PRINT and 100 Doors on the PicoCalc from Clockwork Pi

Running 10PRINT and 100 Doors on the Clockwork Pi PicoCalc, a retro-inspired Raspberry Pi Pico handheld running PicoMite BASIC.

PICO-8 100 Doors Problem

A visual exploration of the classic 100 Doors programming problem implemented in PICO-8, featuring animated circles that show the door-toggling pattern in action. This version pays homage to the VIC-20 implementation while leveraging PICO-8’s built-in game loop for smooth animation and visual feedback. Complete with code explanations and comparison to the classic VIC-20 version.

10 Print on PICO-8

Continuing the exploration of 10PRINT, we look at how to implement the 10 Print algorithm on the Pico-8 platform.

Dragon Curves

We draw some dragon curves with Logo on the Commodore 64 inspired by Jurassic Park

10 PRINT in Rust vs C

A head-to-head performance comparison of the classic 10PRINT maze algorithm implemented in Rust and C, with benchmarks measuring millions of iterations.

wAx the VIC-20

Exploring wAx, a native assembler for the VIC-20 that integrates with BASIC. Includes examples implementing 10PRINT and Fibonacci in assembly directly on the machine.

10 PRINT on the HP-42s

Implementing the classic 10PRINT maze algorithm on the HP-42s calculator using RPN programming. Works on SwissMicros DM42 and Free42 emulators too.

The McNuggets Problem

Solving the classic McNuggets Problem in Commodore BASIC: what’s the largest number of nuggets you can’t buy with 6, 9, and 20 packs?

Back to the basics with BASIC (and Python): Binary Search

Why your algorithm choice matters: comparing linear search O(n) vs binary search O(log n) with implementations in Commodore BASIC and Python.

Machine Language: Count Faster on 6502

Optimizing a simple counting loop on the 6502, progressing from slow BASIC to increasingly faster assembly implementations. A practical guide to 6502 optimization.

Visualize and verify the reverse engineered Commodore 64 SID LFSR

Building and verifying the Commodore 64 SID chip’s 23-bit LFSR in hardware on a breadboard and comparing the output against the actual SID chip.

A Gentle Introduction to LFSRs

An introduction to Linear Feedback Shift Registers: how they work, building one on a breadboard with shift registers and XOR gates, and implementing them in Python and Rust.

Quick Post: Printing binary numbers in Commodore BASIC 2.0

Commodore BASIC 2.0 
 A lot of fun with binary numbers can be had by printing them to the screen. This is a quick post to show how to do that with Commodore BASIC 2.0. This is a follow up to Quick Post: XOR in Commodore BASIC 2.0 . 
 We’ll be using both of these in upcoming posts, so it’s good to have them handy. 
 5 REM PRINT ALL 8 BIT NUMBERS IN BINARY 
 10 FOR N = 0…

10 Print on the TI-92

Implementing 10PRINT on the TI-92 calculator using TI-BASIC. Also covers Python versions on the Numworks and TI-nspire calculators.

A gentle introduction to two's complement

Understanding two’s complement: how computers represent negative numbers, why it simplifies hardware design, and how to work with signed integers in assembly and high-level languages.

N-Queens problem

Solving the classic N-Queens puzzle using backtracking. Covers both iterative and recursive approaches with implementations on the Commodore 64.

Rail Fence Cipher on Commoodore 64 and TI 99/4A

Implementing the Rail Fence Cipher on the Commodore 64 and TI 99/4A. A fun transposition cipher for secret messages with kids.

A grid drawing rabbit hole

Drawing grids for screen layout planning on the Commodore 64 and VIC-20. Comparing BASIC, Simon’s BASIC, and Super Expander approaches.

10 PRINT on the Rockwell AIM 65

Rockwell International was a powerhouse of the 1970s and 80s. 
 The Rockwell AIM 65 computer, also known as the Advanced Interactive Microcomputer 65, is an early microcomputer produced by Rockwell International in the late 1970s. It was essentially a development system, intended primarily for engineers, educators, and hobbyists, and was named for its built-in alphanumeric keyboard and LED…

Building a software serial bridge

Modern and retro mix 
 One of my favorite peices of retro clone hardware is Bob Corsham’s KIM-1 Clone. I’ve featured it many places like the 6502 speed series . 
 I have the latest model of this board, and he made an interesting design choice. It actually has an FTDI chip on board and you use that via USB to connect via a modern computer with an FTDI driver. This is very…

Blinkenlights

Driving LEDs from the VIC-20 and KIM-1 USR ports. Binary counting in the real world with vintage hardware.

40 years on, this is still the best maze algorithm

Exploring the elegant maze generator from Compute! magazine (December 1981). A line-by-line breakdown of how this classic BASIC algorithm works.

Validating Pilish

Writing code to validate Pilish text—prose where word lengths match the digits of Pi. Implementations in Julia and Commodore BASIC.

My mostly retro writing platform contenders in National Novel Writing Month for 2022 NaNoWriMo

Evaluating vintage computers for NaNoWriMo 2022: VIC-20, Plus/4, Commodore 64, and PET. Word processing on 8-bit machines with SpeedScript and other tools.

Adding very large integers in 8 Bit BASIC

Adding integers with hundreds of digits using string manipulation in Commodore BASIC. When your numbers are too big for Wolfram Alpha.

MOS paper tape format

Understanding the MOS paper tape format used by the KIM-1 and other 6502 systems. Breaking down the hex format line by line with checksum verification.

A little more speed from the 6502

Optimizing 6502 memory transfers beyond the general-purpose approach. Testing on a 1MHz KIM-1 clone with precise timing measurements.

How fast can a 6502 transfer memory

Testing real-world memory transfer speeds on 6502 machines. Inspired by Apple M2 marketing, let’s see what Commodore hardware can actually do.

Almost primes with TinyBASIC on the KIM-1 clone: PAL-1

Finding k-almost-primes using TinyBASIC on a KIM-1 clone. A look at the copyleft origins of TinyBASIC and Bill Gates’ infamous open letter.

VIC’s Revenge, the drop-in replacement for the VIC-20 VIC chip Part 1: Introduction, design goals, and FAQs

Starting a year-long project to reverse engineer and create a drop-in FPGA replacement for the VIC-20’s 6560/6561 video chip.