Electronic – PIC microcontroller jumping pages

pic

I got this question and wanted to know if my answer was right.

Q.92: Assuming that initially the PIC is addressing Page 0 in program memory; Which of the following snippets of code will jump to program location “PPS2” in Page 1?

a)
goto        PPS2
b) 
movlw       b’00010000’
movwf       PCLATH
goto        PPS2
c)
BSF     PCLATH,4
BCF     PCLATH,3
goto        PPS2
d) 
None of the above

Doing some research online I understand that PCLatch is a register in bank 1 that works in conjuction with pcl to form a 13 bit register due to the high volume of addresses that need to be viewed.

As a result I concluded (not entirely sure on this) that to jump to PPS2 in page 1 from page 0 I would simply run the goto command therefore solution A.

Am I right on this?

Best Answer

Tcrosley's answer is mostly right and addresses the question as asked. The point of the problem is apparently for you to realize that PCLATH<4:3> must have the appopriately state before any GOTO, and that while options B and C did set these bits, they set them to the wrong value.

However, the right answer is not the methods of options B or C to set PCLATH<4:3> to the correct value, but to use PAGESEL. Specifically, the correct code is:

     pagesel    PPS2
     goto       PPS2