Crossware

Table of Contents        Previous topic       Next topic       

MICROPROCESSOR INSTRUCTION REFERENCE->MOVX

MOVX    Move External: Move <destination byte>,<source byte>

This instruction transfers data between the accumulator and a byte of external data memory and takes two forms:


8 BIT INDIRECT ADDRESS:

The contents of R0 or R1 in the current register bank provide an 8 bit low order address whilst the contents of port 2 contain the high order address.  A write to the P2 Special Function Register before the MOVX instruction therefore selects the address page that will be used.


16 BIT INDIRECT ADDRESS:

The data pointer (DPTR) generates a 16 bit address.  The contents of the P2 Special Function Register are unaffected by this command.


Formats:
    
DescriptionMnemonicBytesCycles
8 bit address:
Move external memory to accumulator:MOVX A,@Ri12
Move accumulator to external memory:MOVX @Ri,A12
    

16 bit address:
Move external memory to accumulator:MOVX A,@DPTR12
Move accumulator to external memory:MOVX @DPTR,A12

where Ri is R0 or R1.