Module-2
Module-2
TE(EXCS) SEM-V
Microcontroller & Applications
By
Dr. Arun Chavan
MOV A,#0FH;
MOV R3,#45H;
MOV DPTR,#2E00H;
MOV A,R5;
MOV R2,R1;
MOV R0,A; Dr. Arun Chavan, Department of Electronics and Computer Science
8051 Addressing Modes
Addressing Modes of 8051:
Direct Addressing Mode
In the Direct Addressing Mode, the source or destination in the instruction
specifies 8-bit direct address of the operand. The internal data memory and
SFRs can be addressed directly. Here some of the examples of direct
Addressing Mode.
MOV 80H,R6;
MOV R2,45H;
MOVX A,@DPTR;
Dr. Arun Chavan, Department of Electronics and Computer Science
MOV @R1, A
8051 Addressing Modes
Addressing Modes of 8051:
MOVC A,@A+PC;
MOVC A,@A+DPTR;
RL A;
SWAP A;
Dr. Arun Chavan, Department of Electronics and Computer Science
8051 Addressing Modes
Quiz
DT
Example:
ORG
LIST DB 7FH, 42H, 35H
END
EQU
Three consecutive byte memory locations are
reserved for the variable LIST and each 8-bit data
specified in the statement is stored as initial value in
the reserved memory location
DT
Example:
ORG
EQU
DT
Example:
ORG
EQU
DT
Example:
ORG
EQU
DT
Example:
ORG
END Num DT ?
EQU
DQ
EQU (Equate) is used to attach a value to a variable
DT
For Example :
ORG
OGR 1000H
END
Two EQU 2
EQU
MOV A, R0
|
|
|
END
• Arithmetic Group
• Logical Group
1. Classify the Instruction set of 8051 and give at least four examples under each group of
instructions.
2. Write assembly language program for 8051 to subtract contents of external RAM 5001H
from the contents of 5000H and store result at 6000H and borrow at 6001H.
3. Write assembly language program for 8051 to count +ve and -ve elements of an array of 10
elements stored in the internal RAM from 50H onwards, store the +ve element count in R4
& -ve element count in R5.