Immediate Addressing Mode
- In this mode, the source operand is an 8-bit or 16-bit constant value
- Constant is specified in instruction rather than in a register or memory location
- Immediate operands are preceded by #
- Operands may be numeric constant, a symbolic variable, or an arithmetic expression using constants, symbols and operators
- Assembler computes the value and substitutes the immediate data into the instruction
- The value to be stored in memory immediately follows the operation code in memory
- Example: ADD A, #30H
The above instruction add constant 30H to value in accumulator
MOV DPTR, #FE00H
The above instruction move constant FE00H to DPTR
COUNT EQU 30
....
MOV R4, #COUNT ; R4 = 30
MOV DPTR, #DATA ; DPTR = 200H
....
ORG 200H
DATA: DB “HELLO”
....
Related topics:
8051 Addressing Modes | 8051 Register Addressing Mode | 8051 Direct Addressing Mode | 8051 Indirect Addressing Mode | 8051 Relative Addressing Mode | 8051 Absolute Addressing Mode | 8051 Long Addressing Mode | 8051 Indexed Addressing Mode | 8051 External Addressing Mode
List of topics: 8051
No comments:
Post a Comment