When you're working with PBP, it's easy to forget that there are "BANKs" in the RAM because it's all handled for you.
But when you are writing at the ASM level, you have to remember about the BANKs. And on the F1 type parts, there are a lot of them. (32 to be exact).
In your case, RCREG is in BANK3.
And since you only have 1 variable in your program, it will obviously end up in BANK0. But when the program gets bigger, that may not be the case.
It should be able to find your variables no matter what bank they end up in.
Also, when you get an interrupt on an F1 part. You have no idea what bank it is in when it gets to the ISR.
It's up to you to change it to BANK0 (if that's the bank your ISR needs).
Bookmarks