A discussion group for the PICMicro microcontroller. Also called the Microchip PIC, this list is dedicated to the use and abuse of this fine, simple, microcontroller. Close to topic posts are welcome, ie. general electronics.
|
Hi to everyone, I just wrote a quite big code (7000 lines) where there are many goto exit lines with the exit label near the end. Runnint the program i realised that not all of the goto were going to the real exit but to some lines differing 2048 address lines. Reading the instruction set i realised that goto k command is only used for k<=2047. Is there any way to correct the problem. is it possibleto keep "goto exit" commands or must i use goto +(a number) and adjusting the PCLATH? IT is some kind of a problem. Thank you all for your time. Nikolaos Trikoupis |
|
|
|
Read the
section 2.3 of
the PIC16F877 datasheet or the equivalen on any other datasheet. The title is “PCL
and PCLATH” it explains you that issue Mauricio D.
Jancic Janso Desarrollos -
Microchip Consultant (54) 011 - 4542 -
3519 Lugones 3238
"B" - C1430ECN www.janso.com.ar i...@janso.com.ar MSN:
j...@hotmail.com From:
ntricoup [mailto:n...@yahoo.gr] Hi to
everyone, |
|
Check out the documentation on LGOTO and LCALL - these are built-in macros that handle paging. --- In , "ntricoup" <ntricoup@y...> wrote: > Hi to everyone, > I just wrote a quite big code (7000 lines) where there are many goto > exit lines with the exit label near the end. Runnint the program i > realised that not all of the goto were going to the real exit but to > some lines differing 2048 address lines. Reading the instruction set > i realised that goto k command is only used for k<=2047. Is there > any way to correct the problem. is it possibleto keep "goto exit" > commands or must i use goto +(a number) and adjusting the PCLATH? IT > is some kind of a problem. Thank you all for your time. > Nikolaos Trikoupis |