Hi Pratik,
Unfortunately, your code is too simplified and I cannot simulate it on my side. You also didn’t mention your MCU family.
But I guess that this is just a problem with debugging due to fact that content of modify() (or Modify()) function was directly inlined into Function() code. This may happen when two functions are written consequently and one of them is used only inside the second function. The compiler/linker saves CALL/RTC instructions and space on stack this way. However, it makes problem in C-code debugging since inlined function will not be debugable due to missing CALL/RTC instructions.
When we add somewhere between first and second function asm NOP; command, the inlining cannot be performed because compiler/linker do not optimize assembler codes. So, there will be still CALL/RTC instructions for calling modify() function.
I hope it helps you.
Have a great day,
Radek
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------