]> git.gag.com Git - fw/sdcc/commitdiff
__XPAGE instead of P2 in outcommented code
authorfrief <frief@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 7 Sep 2004 07:00:17 +0000 (07:00 +0000)
committerfrief <frief@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 7 Sep 2004 07:00:17 +0000 (07:00 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3479 4a8a32a2-be11-0410-ad9d-d568d2c75423

device/lib/_gptrget.c
device/lib/_gptrput.c

index f0a4ab89988e2de035140f9cb8930bd3af1cbba3..25a421254558fb0a684733434e39aede44ee381a 100644 (file)
    what you give them.   Help stamp out software-hoarding!
 -------------------------------------------------------------------------*/
 
-#define P2_PAGES_PDATA 0 /* not all devices use P2 to page pdata memory */
+/* not all devices use P2 to page pdata memory, therefore __XPAGE was 
+   introduced. On some targets __XPAGE itself is a paged SFR so it is 
+   not save for all platforms to set this */
+#define USE_PDATA_PAGING_REGISTER 0
 
 /* the  return value is expected to be in acc, and not in the standard
  * location dpl. Therefore we choose return type void here: */
@@ -82,8 +85,8 @@ _gptrget (char *gptr)
 ;   pointer to xternal stack or pdata
 ;
  00004$:
-#if P2_PAGES_PDATA
-        mov     dph,p2          ; p2 holds high byte for pdata access
+#if USE_PDATA_PAGING_REGISTER
+        mov     dph,__XPAGE     ; __XPAGE (usually p2) holds high byte for pdata access
         movx    a,@dptr
 #else
        push    ar0
index 65e99abcf63a95cdcc8b7dc8766c6743278fc7b1..242a7f53884442021738cbb337320d666778aee0 100644 (file)
    what you give them.   Help stamp out software-hoarding!  
 -------------------------------------------------------------------------*/
 
-#define P2_PAGES_PDATA 0 /* not all devices use P2 to page pdata memory */
+/* not all devices use P2 to page pdata memory, therefore __XPAGE was 
+   introduced. On some targets __XPAGE itself is a paged SFR so it is 
+   not save for all platforms to set this */
+#define USE_PDATA_PAGING_REGISTER 0
 
 void
 _gptrput (char *gptr, char c)
@@ -67,9 +70,9 @@ _gptrput (char *gptr, char c)
        sjmp    00005$
 
  00004$:
-#if P2_PAGES_PDATA
+#if USE_PDATA_PAGING_REGISTER
        pop     acc
-       mov     dph,p2          ; p2 holds high byte for pdata access
+       mov     dph,__XPAGE     ; __XPAGE (usually p2) holds high byte for pdata access
        movx    @dptr,a
 #else
        pop     acc