4 ms·
i'm curious if you've written optimized code for these platforms... it's not about remembering the registers within a routine. it's about maximizing register
by chillingeffect 8y ago
i'm curious if you've written optimized code for these platforms...
it's not about remembering the registers within a routine. it's about maximizing register use across several routines.
E.g. You call "circle" which uses registers d0-d3. Then it calls "line" which uses d4 and d5. Then you want to call "draw_point" which uses d3 and d7, but you realize you don't want to stomp on d3, so you write an alternate version of draw_point which uses d6 and d7 instead.
The OP is that platforms with few registers, such as x86, rely on the stack and don't have this problem. Macros won't help either, bc it's not about naming, it's about resource allocation. A good C compiler could do it well, but OP was talking about programming in Assembly.