4/17/98 6-125 Addressing Modes and Data Types
MOVX Move External Data
Syntax: MOVX dest, src
Description: Move external data to or from an internal register. The byte or word specified by the
source operand is copied into the variable specified by the destination operand. This instruction
allows access to data external to the microcontroller in the address range of 0 to 64K. The standard
indirect move may access external data only above the boundary where internal data RAM ends,
whereas MOVX always forces an external access. MOVX only operates on the first 64K of
external data memory. This instruction is included to allow compatibility with 80C51 code.
Note that in the 80C51 MOVX instruction using @Ri as a pointer (where i could be 0 or 1), the
pointer was eight bits in length and the upper address lines were not driven on the external bus. The
XA always drives all of the enabled external bus address lines. The use of the pointer depends on
whether compatibility mode is in use. If CM = 0 (compatibility mode off, the default), 16 bits of
R0 or R1 are used as the address within data segment 0. If CM = 1 (compatibility mode on), 8 bits
of R0L or R0H are used as the bottom eight bits of the address, while the remainder of the address
bits, including those corresponding to the data segment are 0.
Size: Byte-Byte, Word-Word
Flags Updated: N, Z
MOVX Rd, [Rs]
Bytes: 2
Clocks: 6
Operation: (Rd) <-- external data memory ((Rs))
Encoding:
MOVX [Rd], Rs
Bytes: 2
Clocks: 6
Operation: external data memory ((Rd)) <-- (Rs)
Encoding:
1 0 1 0 SZ 1 1 1 d d d d 0 s s s
1 0 1 0 SZ 1 1 1 s s s s 1 d d d