We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all , I need some explanations for the code highlighted below.I got this code from the disassembled window. Here temp is declared as unsigned short and onech is declared as unsigned Char. I would like to know why the compiler is doing the LSL and LSR operations here in this part of the code ,though there is only one LSL I have specified in the code .(ie. (temp^onech) << 8.) Looking for help. T.Sendhilraj 74: unsigned short ans=((temp^onech) << 8); MOV R0,R1 MOV R1,R0,LSL #16 MOV R1,R1,LSR #16 MOV R0,R2 MOV R0,R0,LSL #24 MOV R0,R0,LSR #24 EOR R1,R1,R0 MOV R1,R1,LSL #8 MOV R1,R1,LSL #16 MOV R1,R1,LSR #16
This code represents sign extensions. I recommend that you are changing to the RealView Compiler that performs a better optimization in such situations.
Thanks for your reply . better optimization.... Well throughout my simulation these higlighted code does nothing except shifiting left and right.Do I need these codes really ?.If not,Is it ok if i remove these codes while working for an optimized code?If I am correct these highlighted code occupies 24 bytes. recommend that you are changing to the RealView Compiler.... I dont have a RealView Compiler with me.
Just download the current Demo version from http://www.keil.com/demo
Thanks a lot.