Sorry for playing "20 questions". I could not post the code because the code should not be public knowledge. Anyway the problem is solved and here is an update.
The problem is with RAM allocation, PBP has a problem when assigning RAM space to variables. In this case one byte of a WORD size variable was assigned to the last adress in BANKA and the other byte of the same Word variable to the first adress in BANK0. Variables can not span 2 banks and this is why strange things happend. Melabs helped me to find this and they are working on a fix for this. There is a workaround, assign any BYTE size variable to the last adress of each bank you are using. Check the .ASM file and you can see how many variables you are using. This problem can happen between all RAM banks not only BANKA and BANK0. For 18F4620 that I use I added
n Var Byte $7F
This prevents a WORD to be assigned to the last adress of BANKA and also solved the problem.
If you have a program with many variables this is something you would like to check. This problem is ALSO in current versions of 2.47!
Mike




Bookmarks