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?
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?
That'll be a library routine - see: http://www.keil.com/support/docs/1965.htm You might have to write your own compare routine for longs? Remember that the 8051 is only an 8-bit processor, so the instruction set has no built-in support for any operation involving anything larger than a single byte!
I got it. Thanks, Andrew.