The memory test we used was a general-purpose one. It's flexible and reusable. The price is some speed. Let's try and make it faster. One very common

A little more speed from the 6502

submited by
Style Pass
2022-06-24 11:00:05

The memory test we used was a general-purpose one. It's flexible and reusable. The price is some speed. Let's try and make it faster.

One very common use on an 8Bit machine would be a memory copy to the screen memory location. Maybe as part of a background change in a game, something along those lines.

So let's do exactly that. We'll use 1024 bytes here so that it's precisely 4 - 256 byte pages. We're going for speed for real now; not crossing page boundaries will help.

The price we pay is that it's now a 6159-byte long program to move 1024 bytes (fits from $2000 to $380f). But it sure is fast!

After chatting a little with Robin, he mentioned that this technique, or something like it, is used in many demos that push on what vintage hardware can do. Some coders generate this code at runtime to save some space. Pretty neat.

Have some fun trying to make this 1024-byte copy faster or get it close to this performance in an exciting way. Also, let's see it implemented on other 6502-based machines. Surely the Atari and Apple II peeps out there want to give this a go, right?

Leave a Comment