I'm studying the 65c816 assembly for the 1994 game, Super Metroid.
A hobbyist studied the game in-depth and created a RAM map. From it:
7E:0B56 - 7E:0B57 Moves Samus this distance horizontally, in subpixels.
7E:0B58 - 7E:0B59 Moves Samus this distance horizontally, in pixels.
7E:0B5A - 7E:0B5B Moves Samus this distance vertically, in subpixels.
7E:0B5C - 7E:0B5D Moves Samus this distance vertically, in pixels.
I'm new to assembly, but as I understand it, the game stores Samus's movement in RAM, to be picked up later by some code that performs the actual moving (the "function"). But why do things this way? Why not simply push the above "parameters" onto the stack and pop them from within the "function"? Is storing the parameters in static addresses somehow more efficient? Is it to save space on the stack? Is it for better code organization?