[56] Space–time tradeoff
- 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:

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

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

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

![[158] Most Important Brick in the Least Important Wall](https://static.wixstatic.com/media/df100d_f70be6ae4318455fbbc605cd1069c6ee~mv2.jpg/v1/fill/w_980,h_410,al_c,q_85,usm_0.66_1.00_0.01,enc_avif,quality_auto/df100d_f70be6ae4318455fbbc605cd1069c6ee~mv2.jpg)
![[157] Mail Order Sacrifice](https://static.wixstatic.com/media/df100d_e284fa6c51b04524bab9d3cf9f1f6441~mv2.png/v1/fill/w_980,h_382,al_c,q_90,usm_0.66_1.00_0.01,enc_avif,quality_auto/df100d_e284fa6c51b04524bab9d3cf9f1f6441~mv2.png)
![[156] Moat of Babble](https://static.wixstatic.com/media/df100d_091e451794b14aecb494a16c15c966c3~mv2.png/v1/fill/w_980,h_705,al_c,q_90,usm_0.66_1.00_0.01,enc_avif,quality_auto/df100d_091e451794b14aecb494a16c15c966c3~mv2.png)
Comments