

































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This lecture series is from Electrical Engineering courses. A collection of lectures on all the important topics in EE. These slides covers points such as: Microcontroller Instruction Set, Types of Instructions, Addressing Modes, Register Addressing Mode, Direct Addressing Mode, Register Indirect Addressing Mode, Immediate Addressing Mode, Data Transfer Instructions, Types of Instructions, Arithmetic Instructions
Typology: Slides
1 / 73
This page cannot be seen from the preview
Don't miss anything!


































































An instruction is an order or command givento a processor by a computer program. Allcommands are known as instruction set andset of instructions is known as program.
8051 have in total 111 instructions, i.e. 111different words available for program writing.
Instructions are divided into 3 types;
One/single byte instruction.
Two/double byte instruction.
Three/triple byte instruction.
One/single byte instructions :
If operand is not given in the instruction orthere is no digits present with instruction,the instructions can be completelyrepresented in one byte opcode.
8 bit
If 16 bit number is given as operand in theinstructions than such instructions can becompletely represented in three bytes 16 bitnumber specified may be data or address.
First byte will be instruction code.
Second byte will be 8 LSB’s of 16 bit number.
Third byte will be 8 MSB’s of 16 bit number.
First byte
Second byte
8 LSB’s of data/address.
Third byte
8 MSB’S of data/address.
There are 5 types of addressing modes:
Register addressing.
Direct addressing.
Register indirect addressing.
Immediate addressing.
Index addressing.
In register addressing mode; the sourceand/or destination is a register.
In this case; data is placed in any of the 8registers(R0-R7); in instructions it is specifiedwith letter Rn (where N indicates 0 to 7).
In direct addressing mode; the address ofmemory location containing data to be readis specified in instruction.
In this case; address of the data is given withthe instruction itself.
For example;
MOV A, 25H (This instruction willread/move the data from internal RAMaddress 25H and store it in theaccumulator.
For example;
MOV A,@R0 This instruction moves thedata from the register whose address is inthe R0 register into the accumulator.
In immediate addressing mode, the data isgiven with the instruction itself.
In this case; the data to be stored in memoryimmediately follows the opcode.
Offset (from accumulator) is added to thebase index register( DPTR OR ProgramCounter) to form the effective address of thememory location.
In this case; this mode is made for readingtables in the program memory.
For example;
MOVC A, @ A + DPTR ( This instructionmoves the data from the memory toaccumulator; whose address is computedby adding the contents of accumulator andDPTR)