Poke:
; Write any PIC file register
movf payload0,W ; get address to poke
movwf FSR ; put into FSR
movf payload1,W ; get the data to poke
btfsc FSR,7 ; check to see what page we want
page1 ; switch page if necessary
movwf INDF ; poke
page0 ; always return to page0
Peek:
; Read any PIC file register
movf payload0,W ; get address to peek
movwf FSR ; put into FSR
movwf replydata0 ; put address into packet
btfsc FSR,7 ; check my pages
page1 ; switch page if necessary
movf INDF,W ; peek
page0 ; always return to page0
movwf replydata1 ; put data into packet
return
Listing 7—Just like BASIC
but different.