
Semiconductor Group 3 - 13
Memory Organization
Figure 3-4
Use of Port 2 as I/O-Port
At a write to Port 2, XRAM address in XPAGE-register will be overwritten because of the concurrent
write to Port 2 and XPAGE-register. So whenever XRAM is used and the XRAM address differs
from the byte written to Port 2 latch it is absolutely nessesary to rewrite XPAGE with page address.
Example:
I/O-Data at Port 2 shall be 0AAH. A Byte shall be fetched from XRAM at address 0F830
H
MOV R0, #30H
MOV P2, #0AAH ; P2 shows 0AA
H
MOV XPAGE, #0F8H ; P2 still shows 0AA
H
but XRAM is addressed
MOVX A, @R0 ; the contents of XRAM at 0F830
H
is moved to accu
Komentarze do niniejszej Instrukcji