Hi, Good Day.
I am working on ARM7TDMI core processor from Analog Devices family (ADuC703x). I developed a preemptive scheduler on the same in ARM environment. The functionality of the same is fine and its working well. For the purpose of optimization, i migrated into thumb mode using Keil RV compiler option (by changing the code generation option to THUMB mode and the optimization level option to 3 in C/C++ tab of the target settings option).
After changing the settings my code size is reduced by 2 KB. But, the complete functionality of the software got changed.
Can anybody help me out to get out of this problem? Also, I would like to know why this kind of behavior is occurring... Please let me know your valuable suggesions.
Thanking you in anticipation, Ravi Kumar Desaraju.
If I am not mistaken, a CPU scheduler must contain some code in assembly language to save/restore registers, manipulate the stack pointer and so on. Because of this, I don't think that switching to THUMB can be achieved by simply changing compiler options. Without seeing the code, I don't think much more can be said.
Regards, - mike
Hi Mike, Thanks for your response.
I understand your point. But, I enabled the option "ARM to THUMB interworking" option in the C/C++ and ASM tabs from the target settings menu. I think, the compiler will automatically generate the corresponding code in generating the object.
Well, as you said, I am using many instructions in the assembly code like... MSR, MRS, PUSH and POP. As I conveyed in my previous message, I developed this code in ARM. ARM architecture doesn't support PUSH and POP instructions. By using the above mentioned option in the compiler (i.e. ARM/THUMB interworking), I observed the code in disassembly window and found that the compiler is internally changing the same. So, I did not modify my assembly code. Also, can you please suggest me any important areas in which I have to concentrate?
Thanks and Regards, Ravi Kumar Deasaraju.