Hi everybody,
i have tried to write a simple program to display on led.
i used the template source and the linker script from microchip but i keep getting an error on stack underflow at address 0x00005 of my 16f877a chip
You could try adding all the parameters to it?, what destination are you sending the result to?. I can't even remember what the default is?, but it's important to add the destination to the end of such commands - in this case ', f' so the answer is written back to the port.
However, in this case, the rapid 'read, modify, write' might be a problem?, and I would suggest incrementing a GPR instead, then moving it to the port.