This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

The 6502 instructions nobody uses!

The 6502 instructions nobody uses!
by on (#30999)
In my tests, these instructions were used infrequently:
1e   ASL $nnnn,X
41   EOR ($nn,X)
59   EOR $nnnn,Y
5E   LSR $nnnn,X
81   STA ($nn,X)
a1   LDA ($nn,X)
b8   CLV
And these instructions were used VERY VERY infrequently:
21   AND ($nn,X)
56   LSR $nn,X
61   ADC ($nn,X)
E1   SBC ($nn,X)

by on (#31003)
Interesting !
I'm not very sursprited, tough. The only surprise is LSR $nn,X, which I think would be used decently frequently. The whole ($xx,X) adressing mode isn't very usefull, exept if you have a table of pointer in Zero Page, which just doesn't happen often. I only use this in my sound codes.

by on (#31021)
How often is SED ($F8) used??

The only time I saw (zp,X) used was in a routine which parsed simultaneously through two data blocks. The code used (zp),Y to dereference one pointer and (zp,X) (with X always set to zero) to dereference the other. Obviously, the latter pointer had to be incremented after every read, while the first didn't need adjustment (until Y overflowed of course).

I sure would love to know whose idea it was to have (zp,X) as an addressing mode...

by on (#31023)
Forgot that one, that's also in the VERY VERY infrequently used section.

ZP,X is used very frequently on the Atari 2600, which has 128 bytes of IO ports, then 128 bytes of RAM in the zero page. Then it's all mirrored for the 01xx stack page.

by on (#31032)
At least one multiplayer game that I have developed for NES uses a lot of zp,X addressing. Much of the game state is stored in a bunch of two-element arrays, one for each player.