Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/11/00 20:48
Read: times


 
#3662 - RE: Saving p2
Use of P2 as a 2nd pointer in XRAM.

I agree with Peter Danegger and Steve Taylor that you always need a copy register to save and restore P2 while using external code access.

suppose XPAGE is your copy byte in IRAM
use: INC XPAGE ;example increment high byte of pointer
INC P2 ; this instruction works correct!! */
save: PUSH XPAGE
restore: POP ACC
MOV XPAGE,A
MOV P2,A
This method even works in interrupt routines.
You have now in fact 3 XRAM pointers: DPTR, (XPAGE,R0), (XPAGE,P2)
Works on many 8051's 80C552, Philips, Intel, Dallas etc.


List of 5 messages in thread
TopicAuthorDate
Saving p2            01/01/70 00:00      
RE: Saving p2            01/01/70 00:00      
RE: Saving p2            01/01/70 00:00      
RE: Saving p2            01/01/70 00:00      
RE: Saving p2            01/01/70 00:00      

Back to Subject List