what you give them. Help stamp out software-hoarding!
-------------------------------------------------------------------------*/
+#define P2_PAGES_PDATA 0 /* not all devices use P2 to page pdata memory */
/* the return value is expected to be in acc, and not in the standard
* location dpl. Therefore we choose return type void here: */
dec a
jz 00003$ ; 2 code
dec a
- jz 00004$
+ jz 00004$ ; 3 pdata
dec a ; 4 skip generic pointer
dec a
jz 00001$ ; 5 idata
movc a,@a+dptr
sjmp 00005$
;
-; pointer to xternal stack
+; pointer to xternal stack or pdata
;
00004$:
+#if P2_PAGES_PDATA
mov dph,p2 ; p2 holds high byte for pdata access
movx a,@dptr
+#else
+ push ar0
+ mov r0,dpl
+ movx a,@r0
+ pop ar0
+#endif
+
;
; return
;
dec a
jz 00003$ ; 2 code
dec a
- jz 00004$
+ jz 00004$ ; 3 pdata
dec a ; 4 skip generic pointer
dec a
jz 00001$ ; 5 idata
what you give them. Help stamp out software-hoarding!
-------------------------------------------------------------------------*/
-/* the return value is expected to be in acc, and not in the standard
- * location dpl. Therefore we choose return type void here: */
+#define P2_PAGES_PDATA 0 /* not all devices use P2 to page pdata memory */
+
void
_gptrput (char *gptr, char c)
{
sjmp 00005$
00004$:
+#if P2_PAGES_PDATA
pop acc
- mov dph,p2
+ mov dph,p2 ; p2 holds high byte for pdata access
movx @dptr,a
+#else
+ pop acc
+ push ar0
+ mov r0,dpl
+ movx @r0,a
+ pop ar0
+#endif
+
00005$:
_endasm;
}
dec a
jz 00013$ ; 2 code
dec a
- jz 00014$
+ jz 00014$ ; 3 pdata
dec a ; 4 skip generic pointer
dec a
jz 00011$ ; 5 idata