Addressing Modes of 8051
Addressing Modes of 8051
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 register names, it can be any numerical data etc.
Addressing mode:
Eg: MOV A,#6AH
Here the data 6A is the operand, often known as
source data. When this instruction is executed, the data 6AH is moved to accumulator A.
There are 5 different ways to execute this instruction
Addressing modes:
They are :
address of the data (source data ) is given as operand. Lets take an example. Eg: MOV A, 04H
Here 04H is the address of register 4 of register
bank#0. When this instruction is executed, what ever data is stored in register 04H is moved to accumulator.
is transferred to accumulator from the register (based on which register bank is selected).
indirect addressing instruction. In other words programmer can must make any instruction either using @R0 or @R1. All register banks are allowed.
the address 20H, then the value 2FH will get transferred to accumulator after executing this instruction.
get the source data (to transfer) from this location. It is nothing but adding contents of DPTR with present content of accumulator.
FE is located in DPL . Accumulator now has the value 02H. A 16 bit addition is performed and now 01FE H+02 H results in 0200 H.
Arithmetic instructions:
ADD ADDC DA CPL SUBB MUL DIV
Addition(ADD):
Addition(ADDC):
Multiplication(MUL):
Division (DIV):