Can support any number of parameters from right to left
Parameters need to be pushed onto the stack. The stack is first in, last out. If it is pushed into the stack from left to right, it will be very troublesome to find the first leftmost parameter~
The stacking order is the same as big-endian and little-endian, either one is acceptable. The default choice of C language is from right to left. It should be because the stack grows downward, so the memory arrangement of pushed parameters will be exactly the same as the order of writing. It may be more convenient to debug and look at the memory. However, actual code access is in the form of stack pointer + offset, so it has no special meaning for the machine. Whether it can support variable parameters mainly depends on whether the caller is responsible for clearing the stack. For example, __stdcall also pushes the stack from right to left, but the callee clears the stack, so variable parameters are not supported. __pascal imitates the PASCAL language and pushes the stack from left to right, which is no longer supported by VC.
Can support any number of parameters from right to left
Parameters need to be pushed onto the stack. The stack is first in, last out. If it is pushed into the stack from left to right, it will be very troublesome to find the first leftmost parameter~
The stacking order is the same as big-endian and little-endian, either one is acceptable. The default choice of C language is from right to left. It should be because the stack grows downward, so the memory arrangement of pushed parameters will be exactly the same as the order of writing. It may be more convenient to debug and look at the memory. However, actual code access is in the form of stack pointer + offset, so it has no special meaning for the machine.
Whether it can support variable parameters mainly depends on whether the caller is responsible for clearing the stack. For example, __stdcall also pushes the stack from right to left, but the callee clears the stack, so variable parameters are not supported.
__pascal imitates the PASCAL language and pushes the stack from left to right, which is no longer supported by VC.
Assume from left to right
Then did the 1 of your f(1) pass to a or b? . So it cannot go from left to right. .