You don't need to do anything special with PBP to access special function
registers. Just use the register name like you would with any other part.
You have several options;
Code:CAPBUF VAR WORD CAPBUF = 0 @CAP1Buffer = CAP1BUFL CAP1Buffer VAR WORD EXT CAP1BUFL = 10 CAP1BUFH = 88 Main: WithPBP: CAPBUF.LowByte = CAP1BUFL ' low byte CAPBUF.HighByte = CAP1BUFH ' high byte GOTO Main TheDarrelWay: CAPBUF = CAP1Buffer GOTO Main ' Or in asembler. TheMovffWay: @ MOVFF CAP1BUFL, _CAPBUF ; low byte @ MOVFF CAP1BUFH, _CAPBUF+1 ; high byte GOTO Main TheLongWay: ' banked method @ MOVLB 0x0F ; point to bank 15 @ MOVF CAP1BUFL,W ; low byte @ MOVWF _CAPBUF,ACCESS @ MOVF CAP1BUFH,W ; high byte @ MOVWF _CAPBUF+1,ACCESS GOTO Main




Bookmarks