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
  • Thanks for the suggestion. I looked through the de-assembly window in the debugger and found the cause of the problem.

    Both my subroutine A and B have if(...)command, and the if(...) is replaced by a subroutine C?ULCMP which is located in address 0x0123.

    When subroutine B is called, it will also execute C?ULCMP in 0x0123 for the if(...). But my intention is to locate subroutine B to address above 0xF000, so that when it is called, no execution will take place in code memory address below 0xF000.

    How to prevent the compiler from extracting some general subroutines to share by the user written subroutines?

Reply
  • Thanks for the suggestion. I looked through the de-assembly window in the debugger and found the cause of the problem.

    Both my subroutine A and B have if(...)command, and the if(...) is replaced by a subroutine C?ULCMP which is located in address 0x0123.

    When subroutine B is called, it will also execute C?ULCMP in 0x0123 for the if(...). But my intention is to locate subroutine B to address above 0xF000, so that when it is called, no execution will take place in code memory address below 0xF000.

    How to prevent the compiler from extracting some general subroutines to share by the user written subroutines?

Children