Top Banner
ADDRESSING MODES OF 8051 by -SHARIQUE MULLA 1 3/3/2015 SHARIQUE MULLA
15
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 8051 addressing

ADDRESSING MODES OF 8051

by

-SHARIQUE MULLA

13/3/2015 SHARIQUE MULLA

Page 2: 8051 addressing

WHAT IS AN ADDRESSING MODE?

• An Addressing mode is a way to address an operand.

• Operand means the data we are operating upon (in most cases source data).

• It can be a direct address of memory, it can be any numerical data, etc.

23/3/2015 SHARIQUE MULLA

Page 3: 8051 addressing

ADDRESSING MODES

1. Immediate addressing mode

2. Direct addressing mode

3. Register direct addressing mode

4. Register indirect addressing mode

5. Indexed addressing mode

33/3/2015 SHARIQUE MULLA

Page 4: 8051 addressing

1) IMMEDIATE ADDRESSING MODE

• This type of addressing mode is named as “immediate addressing”, because it transfers an 8-bit data immediately to the accumulator (destination register).

• This instruction has an 8-bit immediate data at the operand.

43/3/2015 SHARIQUE MULLA

Page 5: 8051 addressing

• Example- MOV A,#6AH

53/3/2015 SHARIQUE MULLA

Page 6: 8051 addressing

2) DIRECT ADDRESSING MODE

• This is an another way of addressing an operand.

• In this type of addressing mode, the address of the data (source data) is given as operand instead of immediate data .

63/3/2015 SHARIQUE MULLA

Page 7: 8051 addressing

• Example- MOV A,04H

73/3/2015 SHARIQUE MULLA

Page 8: 8051 addressing

3) REGISTER DIRECT ADDRESSING MODE

• In this type of addressing mode, we use the register name directly as source operand.

• In 8051,there are 4 register banks, containing 8 registers (R0-R7) each.

• Hence, the selection of a register bank is done by a special function register (SFR) called Processor Status Word (PSW).

83/3/2015 SHARIQUE MULLA

Page 9: 8051 addressing

• Example- MOV A,R4

93/3/2015 SHARIQUE MULLA

Page 10: 8051 addressing

4) REGISTER INDIRECT ADDRESSING MODE

• In this type of addressing mode, the address of the data (source data) is given in the register operand.

• Here also, the register bank is required to be selected by PSW (Processor Status Word).

• Here, the selected register is first loaded with a value which acts as the address of the data.

103/3/2015 SHARIQUE MULLA

Page 11: 8051 addressing

• Example- MOV A,@R0

113/3/2015 SHARIQUE MULLA

Page 12: 8051 addressing

5) INDEXED ADDRESSING MODE

• In this type of addressing, DPTR (Data Pointer) or PC (Program Counter), i.e. 16-bit registers, are used in the instruction.

• Here, the content of DPTR or PC is added to the current content of accumulator.

• The result acts as the address of the source data.

• After execution the source data is stored in accumulator.

123/3/2015 SHARIQUE MULLA

Page 13: 8051 addressing

• Example- MOV A,@A+DPTR

133/3/2015 SHARIQUE MULLA

Page 14: 8051 addressing

PROCESSOR STATUS WORD (PSW)

143/3/2015 SHARIQUE MULLA

Page 15: 8051 addressing

THANK YOU

153/3/2015 SHARIQUE MULLA