9 ms·
I don't know if this is the real reason, but it's more natural for stack-relative addressing to have the stack grow downwards, because you can write e.g. [rsp+1
by pcwalton 5y ago
I don't know if this is the real reason, but it's more natural for stack-relative addressing to have the stack grow downwards, because you can write e.g. [rsp+10] instead of [rsp-10].
Apparently on PA-RISC (hppa) the stack grows the other way, so it is arbitrary.
- tom_mellior 5y agoWhy is rsp+10 more natural? If rsp is the top of the stack, everything is below it, and "below" and "minus" go well together. Though I would agree that for the topmost value specifically, rsp+0 feels more natural than rsp-4 or rsp-8.