PDA

View Full Version : code size using On Interrupt PBP instruction



eduardojx
- 20th December 2005, 20:16
Hi,

I´m a coding a program that has something like 2AFFh ocuped into program memory (18F4520) until now without interrupts. But now, I´m needing to use interrupt (timer0) and when I put in my code the instruction
ON INTERRUPT GOTO rotine_name, i put too the interrupt handler and so on. Whith this, my code get a 407Fh ocuped in program memory. Looking for the disassembly listing, after each PBP instruction, the compiler insert a CALL 0x366 (in this case a adress designated by own compiler ). Doing a test, when I take off a On INTERUPT instruction, the size back around to the first value.
Someone Can help me?
Could I handle my interrupt rotine through asm instead of PBP directives?

Best Regards.
EJx.

Ioannis
- 20th December 2005, 21:07
After ON INTERRUPT GOTO command put DISABLE up to the point you want to use the interrupts.

After that point use ENABLE for the block of code that interrupt should be on and then again DISABLE.

PBP puts a check every after a command to check for interrupts. So the numbers you report seem very true.

Ioannis

Paul
- 20th December 2005, 21:15
If the timer needs to running all the time, setup the interrrupt and write your interrupt routine in assembler. That way you will significant reduce the program size.

Paul.

eduardojx
- 21st December 2005, 09:57
ok, friends,

thanks for help... i´ll try these tips....

Regards