This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

turn off the optimizer

I have two subroutines with exactly same content but different names. I want them to be located in different addresses.

I don't want the two subroutines to share same code, and I set the optimizer to "0". But still one of the subroutines is not working.

How can I turn off the optimizer?

Parents
  • I have 2 subroutines A and B with same content but different names. I relocated the subroutine B to 0xE000, so that when subroutine B is called, there is no instruction execution below memory address 0xE000, because subroutine B will program some data bytes into flash memory below 0xE000.
    In the .M51 file, I see that subroutine B is reloacated, but I am not sure if the compiler has optimized subroutine B and replace the content with a call back to subroutine A.
    How can I make sure it?
    Thank you for your kind support.

Reply
  • I have 2 subroutines A and B with same content but different names. I relocated the subroutine B to 0xE000, so that when subroutine B is called, there is no instruction execution below memory address 0xE000, because subroutine B will program some data bytes into flash memory below 0xE000.
    In the .M51 file, I see that subroutine B is reloacated, but I am not sure if the compiler has optimized subroutine B and replace the content with a call back to subroutine A.
    How can I make sure it?
    Thank you for your kind support.

Children