I was following a tutorial that was showing how the ARM processor worked and it used a main like this:
int main() { int counter = 0; ++counter; ++counter; ++counter; ++counter; return 0; }
The example was to show some register usage by the arm. Everything I tried optimzed away the steps. Their keil example had an instruction for each increment. the closest I got was putting volatile on the int, and that produce a move of 4 to the stack.
Can it be done in MDK5?
Thanks.
Turn Off All Optimizations and it wont optimize away your stuff...