Hi,
You can use the "register" keyword to suggest (not force) that the compiler
put the variable in a register. But this will depend not only on the optimization
level you choose (under project settings -> Code Generation -> Global
Optimizations), but for CW7.0 at least, also possibly on if you enable "Register
Coloring" (under project settings -> Code Generation -> ColdFire Processor).
To use the "register" keyword is straightforward -- declare a variable like:
register int i;
Then build and check your disassembly (right-click on the file and select
"Disassemble" ).
In general, I would also add that if you turn up the optimization level and enable
Register Coloring (for CW7.0), you probably will find you don't need to tell the
compiler to use a register -- it will often do so on its own. However, this really
depends on the exact version of CodeWarrior you are using (OK, and I even
*assumed* you were using Code Warrior!).
Good luck.
-- Rich