Matthias Weingart wrote:
[about examples/tasker]
I like it. It's quite simple. But another question, is it enough to push
just R4 to R11? The mspgcc users manual says that R12 to R15 are "clobbered"
registers.

yes, these are used to pass parameters to the called function and the return value. thus, gcc assumes that these registers are clobbered by the call to "swap()" anyway, thus, you dont need to save them.

> Can I use R12 to R15 for my own special purpose?

no, as mentioned above, they used for parameter passing, and within the function they are used by gcc for local and (internal) temp vars. however if you write a "naked" or assembler function, you're free to use these four register at your wish, without saving them on the stack. R4 to R11 have to be saved by the called function, if it wants to use them for local vars, etc.

HTH
chris


Reply via email to