8051 addressing
-
Upload
sharique-mulla -
Category
Engineering
-
view
227 -
download
7
Transcript of 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
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
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
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
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
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
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