On Mon, 11 Sep 2000 10:32:40 +0200, Andor Bariska wrote: > I guess the problem is how to lock an I (and B and L) register from the > C compiler. If you can accomplish that you could use assembler > instructions to access data directly via the respective registers > instead of the C pointers. One can use the -reserve switch to reserve a comma-delimited list of registers. The compiler manual shows what registers the compiler needs preserved. All others are used as scratch registers and may be reserved. > If you don't use the alternate DAG register set for interrupts, you > could use these registers as locked pointers. The C compiler is surely > not going to touch them. Or perhaps the C compiler does not utilize all > of the I registers? Maybe there are some I registers that never get used > in your program - this should be visible in the simulator. There *are* spare I registers. Even using an R register and suffering an extra cycle of penalty would be better than the current process of loading an R register, moving it to an I register, and then dereferencing. > You can then setup the Ix,Bx,Lx register set during program > initialization and use assembler instructions of the form r0=dm(n,Ix) > instead of the C var=*var_ptr instructions. The problem here is that I would have to use asm a *lot*. I have what amounts to a multi-tasking system with N sets (one per task) of state variables to manage. I essentially want to use an I register as an MMU, switching it to point at each task's state data. The amount of state data is quite large, so the potential gain from locking the base pointer in a register could be large. Kenneth Porter Kensington Laboratories, Inc. mailto: http://www.kensingtonlabs.com |