top of page
Search

[56] Space–time tradeoff

  • Writer: Conlan Walker
    Conlan Walker
  • Nov 4, 2022
  • 1 min read

With the holiday season ramping up in intensity, I have less time to work on things, but I want at least something I can show for this post, so I'll talk about things I learned. I found a lot of neat optimization tricks for 6502, and while I can't say them all in a reasonable time, I can list off a few favorites.


The negative of a binary number is just that same number with its bits flipped plus one, and while the 6502 doesn't have a "not" instruction, an "eor #$ff" will do fine in its place:

ree

Here's two ways of implementing an indirect jump, with the latter being called the "RTS trick" on the Nesdev wiki:

ree

And there's my favorite of favorites, which is this ugly thing right here:

ree

Things should speed up a bit next week, as I was mainly focused on preparing for heading to Idaho for thanksgiving.

 
 
 

Comments


bottom of page