8051 Microcontroller

Discussion in 'Programmer's Corner' started by RaviKumar.N, Nov 24, 2005.

  1. RaviKumar.N

    Thread Starter New Member

    Nov 24, 2005
    Dear All,
    I am Ravikumar.N, working on atmel AT89C52 microcontrolller. I have been writing C code for this processor from past 6 months. I am using SDCC cross compiler as a development tool.

    When we call a funtion from any "ISR", that particular function has to be preceded by the pragma known as "#pragma nooverlay". This is with respect to SDCC compiler

    If anybody knows the purpose of this pragma,please share our knowledge with me.

    With Regards,
  2. n9352527

    AAC Fanatic!

    Oct 14, 2005
    It is to prevent the compiler from overlaying the parameters and local variables of that function. Overlaying is performed by assigning the parameters and local variables to the overlayable segment. If the parameters and the variables are overlaid, then it might not be available when the ISR occurs resulting in fatal errors or segment corruptions. Only non-reentrant, non-function-calling functions are overlayable and only in small memory model.