Microchip Technology AC164139 Data Sheet

Page of 408
PIC24FJ256DA210 FAMILY
DS39969B-page 80
 2010 Microchip Technology Inc.
EXAMPLE 4-3:
EDS READ CODE FROM PROGRAM MEMORY IN ASSEMBLY
; Set the EDS page from where the data to be read
mov
#0x0202 , w0
mov
w0 , DSRPAG 
;page 0x202, consisting lower words, is selected for read
mov
#0x000A ,  w1 
;select the location (0x0A) to be read
bset
w1 , #15
;set the MSB of the base address, enable EDS mode
;Read a byte from the selected location
mov.b 
[w1++] , w2
;read Low byte
mov.b 
[w1++] , w3
;read High byte
;Read a word from the selected location
mov 
[w1] , w2
;
;Read Double - word from the selected location
mov.d 
[w1] , w2
;two word read, stored in w2 and w3