3 ms·
> I mean if you have a macro assembler you should be able to write a macro that generates "save registers" instructions before a section of code and "restore re
by masklinn 4y ago
> I mean if you have a macro assembler you should be able to write a macro that generates "save registers" instructions before a section of code and "restore registers" instructions after it.
Except you want a "macro" which:
- saves only the registers you touched
- which are callee-saved
- according to the ABI you're targeting
And you really only want that for functions, because... that's where ABIs come into play.