News for hackers. Stuff that matters.
Re:Easy 6502 by noobermin on Monday May 30, 2022 @10:05PM (#31565465)
Tbf, the 6502 is super limited even by modern standards I think. I don't really think any of the instructions cannot find some use, not a single one. I think the only real instructions that you could think are not really "needed" are the "illegal opcodes[0]." Some games / demos including commercial ones use them, either for efficiency or just because I guess. A good "just because" reason I know of is for code obfuscation to deter disassembly and copyright infringement.

[0] https://www.masswerk.at/6502/6502_instruction_set.html#illeg...

Re:Easy 6502 by hota_mazi on Monday May 30, 2022 @11:26PM (#31565830)
Well, if you really want to nitpick, there are quite a few instructions in the 6502 that are unnecessary.

For example, STX. You could emulate it with PHA, TXA, STA, PLA.

But overall, you are correct that the 6502 was extremely primitive in various ways, especially compare to the 8080 and followers.

Re:Easy 6502 by tom_ on Tuesday May 31, 2022 @02:47AM (#31566747)
You'd need PHP/PLP too! STX doesn't affect the N and Z flags.