Micro Controller Instruction Set - Electrical Engineering - Lecture Slides, Slides of Electrical Engineering

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

2012/2013

Uploaded on 12/31/2013

dheemant
dheemant 🇮🇳

4.4

(68)

105 documents

1 / 73

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MICROCONTROLLER
INSTRUCTION SET
docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49

Partial preview of the text

Download Micro Controller Instruction Set - Electrical Engineering - Lecture Slides and more Slides Electrical Engineering in PDF only on Docsity!

MICROCONTROLLERINSTRUCTION SET

Introduction 

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.

Types Of Instructions 

Instructions are divided into 3 types;

One/single byte instruction.

Two/double byte instruction.

Three/triple byte instruction.

Types Of Instructions 1.

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.

OPCODE

8 bit

Types Of Instructions

  1. Three/triple byte instruction: 

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.

Types Of Instructions

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

OPCODE.

Second byte

8 LSB’s of data/address.

Third byte

8 MSB’S of data/address.

Addressing Modes 

There are 5 types of addressing modes:

Register addressing.

Direct addressing.

Register indirect addressing.

Immediate addressing.

Index addressing.

Register Addressing Mode 

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).

Direct Addressing Mode 

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.

Direct Addressing Mode 

For example;

MOV A, 25H (This instruction willread/move the data from internal RAMaddress 25H and store it in theaccumulator.

Register Indirect Addressing Mode 

For example;

MOV A,@R0 This instruction moves thedata from the register whose address is inthe R0 register into the accumulator.

Immediate Addressing Mode 

In immediate addressing mode, the data isgiven with the instruction itself.

In this case; the data to be stored in memoryimmediately follows the opcode.

Index Addressing Mode 

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.

Index Addressing Mode 

For example;

MOVC A, @ A + DPTR ( This instructionmoves the data from the memory toaccumulator; whose address is computedby adding the contents of accumulator andDPTR)