| |||
| Home > Writing Position Independent Code and Data > Read-write position independence > Register usage with RWPI | |||
Register r9 is the static base register, sb.
It must point to the base address of the appropriate static data
segments whenever you call any externally visible routine.
You can use r9 for other purposes in a
routine that does not use sb. If you do this
you must save the contents of sb on entry to
your routine and restore these before exit. You must also restore
the contents before any call to an external routine.
In all other respects the usage of registers is the same with or without RWPI.