News for hackers. Stuff that matters.
Re:Dirty tricks 6502 programmers use by kazinator on Sunday August 18, 2019 @09:47PM (#20734257)
My first 6502 program was self-modifying; I wrote it just before reading the book chapter on using registers for indexing relative to a base address. That book was Programming the 6502 by Rodney Zaks.

I have some 1986-dated 6502 assembly code of mine in hard copy (on dot matrix paper with the "holes" intact). I'm going to scan it one day and post.

Re:Dirty tricks 6502 programmers use by vidarh on Sunday August 18, 2019 @10:53PM (#20734517)
A lot more 6502 code was self modifying than necessary - I know a lot of people (myself included) did not pick up zero-page indexed indirect/indirect indexed address modes and instead kept using absolute x/y indexed and modified the absolute part for larger loops. A large part of the reason why I didn't learn about it until fairly late was that I mostly saw absolute x/y indexing in the code I looked at to learn. It's interesting how many bad habits you'd see in code like that, given e.g. the C64 ROMs were extensively dissected and documented and published, and they used zero page all over the place.
Re:Dirty tricks 6502 programmers use by ddingus on Monday August 19, 2019 @01:00AM (#20735003)
Raises hand. Yeah, me too.

When I first got zero page, I thought it looked like up to 128 address registers, with only a couple cycle penalty.

But, like you, a lot of code self modified the easier a solute indexed address mode instructions.

And it was right there, easy to see.