I am a developer by profession and have a wide range of experience in languages including C, C++, Java, Python, and even newer ones like Go.
I do not, however, have any experience or know-how in assembly language programming. I don't know what the usual "patterns" are and probably won't get very far if I tried to develop a S/NES game in assembly. I would like to change this, however, but haven't really found any good resources or starting points.
My question is, is there any resource you have used to learn assembly language methods and patterns? What tutorials or documents would you recommend as far as learning how to develop in assembly on a general level? Is there really a "right" or "common" way to do things like you'd see in designing higher-level langauge programs?
Certain things carry over well, mainly good engineering pragma: Division of tasks into easily-understood components, Abstraction, Model-view-controller.
Other things don't; the 6502 in particular lacks a lot of things resulting in object orientation, stack use, and complex structures being awkward.
One thing I've seen a lot in 6502 code in particular is extensive use of function pointers (in RAM) and/or arrays of function pointers (in ROM).
The 6502 can do polymorphism; it just does it differently from the PDP-11, MC68000, x86, and other architectures designed for the computational model preferred by ALGOL, Pascal, and C. A big difference is that the 6502's addressing modes encourage a structure of arrays, as opposed to C which encourages array of structures. This leads to organization of vtables as an array of function pointers, with one element for each type, instead of putting each type's function pointers together as is done with common Cfront-style approaches to C++ ABI.
Well, the x86 in particular has very effective ways to address the stack, and to address arrays of structures.
The 6502 loses a lot of efficiency when you must address an array that has more than 256 elements, or isn't using byte sized elements. It's usually best to store an array of 16-bit numbers as a pair of arrays of LSB and MSB. The stack can be addressed with TSX, but it is usually more efficient to pass arguments on the zero page, unless you're writing a recursive subroutine.
As far as 6502 assembly tricks, I find that most interesting optimizations are very specific, not something that applies generally. The first part is just learning what all the instructions do so that you aren't tempted to do normal things in inefficient ways (e.g. doing arithmetic with the A and a pointer to index an array indirectly, instead of using X or Y; it works but it's not the "right" way to do it). The second part is mostly about figuring out what to keep in your registers A/X/Y, zero page, and stack, so that you don't waste too many cycles moving data around. Later you'll probably start to notice weird ways to save bytes or cycles, reusing the tail of a subroutine as a sub-subroutine, that kind of thing. I think it will just come with experience, just make sure to keep reading about the instruction set as you're working until you know it cold. That's the important first step.
And don't forget that the CPU is extremely simple, and although some instructions have descriptions like "Jump to SubRoutine", the CPU itself doesn't enforce that it be used exclusively for this purpose. It simply performs a few tasks (in this case, put the current program counter in the stack and jumping to an address) that aid in the implementation of subroutines, but if those tasks are useful in some other way, you can totally use instructions for other purposes. In a game, JSR can be quite useful to "pause" an object's AI routine that you can resume later.