6 ms·
That's just convention though. There's no reason "[x]" couldn't have been defined to be "+ (x - 1) * sizeof". There would be no runtime cost to this, and the co
by nicoburns 4y ago
That's just convention though. There's no reason "[x]" couldn't have been defined to be "+ (x - 1) * sizeof". There would be no runtime cost to this, and the compile time penalty would be tiny even on ancient systems.
- nwlieb 4y agoIs `(x - 1)` not a runtime cost if `x` is a runtime variable?
- vikingerik 4y agoNot on many instruction architectures - addressing modes often support adding/subtracting a constant.