Data Memory:  

8051 has address up to 64k Bytes external data memory.

MOVX Instruction is used to address the external data memory In the Fig. 2.9 interfacing of external data memory with 8051 microcontroller is shown. Port 0 is used as multiplexed Address/data Bus. It provides lower byte address in Initial T state and later it is used to carry data.

The 8-bit address is latched using external latch and ALE signal generated by 8051. Port 2 carries higher byre address signal RD and WR enable selected memory location for read and write operation respectively.


Two instructions each related with external data memory and program memory of 8051 microcontroller are

External data memory data transfer

1)  MOVX A, @ Ri,

(A)  <-  R move contents of external RAM addressed by register

Ri (R0 and R1) in to accumulator

eg.  MOVX A, @ R0


(2) MOVX A, @DPTR

(A) <- (DPTR) Move the contents of external memory addressed by data pointer to accumulator.

External Program Memory data transfer

1) MOVC A, @A + DPTR

BOS1 Microcontroller Architecture

(A) <-  ((A) + (DPTR)) Move the contents of ROM address formed by adding

A and the DPTR to A register

(2) MOVC A, @A + PC

(PC) <- (PC) + 1

(A) <-  ((PC) + (A)) Move the contents of ROM address formed by adding A and
PC to A register.