Found the problem, the carry bit wasn't being saved properly for long variables. Hopefully this is now fixed in SVN, and I've also uploaded a new build of the compiler exe to http://gcbasic.sourceforge.net/newfiles/gcbasic.exe
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There appears to be a bug with the Rotate command.
If you try to Rotate ALongVariable Right Simple it appears that the rotate picks up the carry bit and stuffs it in the most significant bit.
I have found you need to clear the carry flag before the rotate for it to work correctly.
Use STATUS.C = 0.
Peter.
Thank you.
What chip type? What version/date of the compiler please?
PIC18F26F80.
Version 0.9 3/8/14
Found the problem, the carry bit wasn't being saved properly for long variables. Hopefully this is now fixed in SVN, and I've also uploaded a new build of the compiler exe to http://gcbasic.sourceforge.net/newfiles/gcbasic.exe