I claim it's best to give up on the idea of being clever, and just go straight for being interactive. Particularly true for 6502; there's nothing remotely approaching an ABI, and, in general, anything goes. You'll never be able to automate everything. Simplest to give up before you start, and just settle for recursively discovering code from a specified starting point by following obvious branches and jumps.<p>But that's fine! That's all you need to do. The interactivity solves the rest, and the user can specify code vs data and so on themselves as they work through the code.<p>See IDA Pro (<a href="https://www.hex-rays.com/products/ida/" rel="nofollow">https://www.hex-rays.com/products/ida/</a>), Dis6502 (<a href="https://www.atarimax.com/dis6502/" rel="nofollow">https://www.atarimax.com/dis6502/</a>), Ghidra (<a href="https://ghidra-sre.org/" rel="nofollow">https://ghidra-sre.org/</a> - actually, terrible for 6502 last I checked, but it <i>is</i> interactive), Hopper (<a href="https://www.hopperapp.com/" rel="nofollow">https://www.hopperapp.com/</a>), and probably more.
PyDisAss? A booty meme pic to finish out the article? Great example of why women don't feel welcome in tech and why there are so few women on HN.<p>Totally unnecessary spoilage of a laboriously crafted project and article.
A better title might be: "How to write a 6502 disassembler in Python"<p>In that light, it's a great, at times hilarious, article. (For example, the bit about self-modifying code is most elucidating.)