4.8.1.3 EDS Data Window

The edspage() and edsoffset() operators can be used with the EDS data window. The EDS data window replaces the PSV data window in certain device families. However, these operators are supported on all devices.

The edspage() operator may be applied to any symbol in any on-chip memory space. The operator returns a 10-bit page value. Unlike psvpage(), a value of zero is never returned.

The edsoffset() operator may be applied to any symbol in any on-chip memory space. The operator returns a 16-bit data space pointer. Unlike psvoffset(), the value of this pointer may fall anywhere in the data address space (0x0 to 0xFFFF).

Suppose that a table of data is located in any on-chip memory space. To access this table through the EDS data window, use the edspage() and edsoffset() operators as follows:

; set DSRPAG to the page that contains the glob_data array
mov    #edspage(glob_data),w0
mov    w0, _DSRPAG
; make a pointer to glob_data
mov    #edsoffset(glob_data),w0
; Load the first data value
mov    [w0++], w1

In order to access multiple items from a data table, you must ensure that the table does not cross a page boundary. To prevent this, specify the page section directive when the data table is defined. If additional constant storage is required, simply create additional tables, each with its own symbol, and repeat the code sequence above to load the DSRPAG register and derive a pointer.