02.addressing Modes
02.addressing Modes
00101 indicates the instruction and the three lower bits, 111,
specifies the register.
2) MOV R0, A
3) MOV A, R0
The source and destination registers must match in size.
The movement of data between Rn registers is not allowed (i.e MOV
R2, R0 ; MOV R5, R7).
specify data by its 8-bit address.
Direct addressing can access any on-chip memory location.
MOV A, 0x70 ; copy contents of RAM at 70H to A.
MOV 0xD0 ; load contents of A into PSW.
MOV P1, A ; transfers the contents of A to port 1(address
90H).
How is a variable identified if its address is
determined or modified while a program is running?
solution is indirect addressing: R0 or R1 may
operate as pointer registers (their content indicates
an address in internal RAM where data are written or
read).
In 8051 assembly language, indirect addressing is
represented by an @ before R0 or R1.
EA = PC (or) DPTR + A
Example:
LJMP, 8AF2H
- Jumps to memory location 8AF2H.