From 97fb99719a1c1caaac6d85c17e7665a92fb98f3b Mon Sep 17 00:00:00 2001 From: frief Date: Tue, 7 Sep 2004 07:00:17 +0000 Subject: [PATCH] __XPAGE instead of P2 in outcommented code git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3479 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- device/lib/_gptrget.c | 9 ++++++--- device/lib/_gptrput.c | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/device/lib/_gptrget.c b/device/lib/_gptrget.c index f0a4ab89..25a42125 100644 --- a/device/lib/_gptrget.c +++ b/device/lib/_gptrget.c @@ -23,7 +23,10 @@ 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 diff --git a/device/lib/_gptrput.c b/device/lib/_gptrput.c index 65e99abc..242a7f53 100644 --- a/device/lib/_gptrput.c +++ b/device/lib/_gptrput.c @@ -23,7 +23,10 @@ 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 -- 2.47.2