Table of Contents
ToggleThe addressing modes in 8085 Microprocessor are the ways in which it accesses memory or registers to retrieve or store data during processing. Before moving to topic, let’s see instruction and word size.
Instruction Format
- An instruction is a command to the microprocessor to perform a given task on a specified data.
- Each instruction has two parts: one is task to be performed, called the operation code (opcode), and the second is the data to be operated on, called the operand.
- The operand (or data) can be specified in various ways. It may include 8-bit (or 16-bit) data, an internal register, a memory location, or 8-bit (or 16-bit) address. In some instructions, the operand is implicit.
Instruction Word Size in 8085
The 8085-instruction set is classified into the following three groups according to word size:
- One-word or 1-byte instructions
- Two-word or 2-byte instructions
- Three-word or 3-byte instructions
In the 8085, “byte” and “word” are synonymous because it is an 8-bit microprocessor. However, instructions are commonly referred to in terms of bytes rather than words.
One-Byte Instructions
A 1-byte instruction includes the opcode and operand in the same byte. Operand(s) are internal register and are coded into the instruction.
MOV rd, rs
rd ← rs copies contents of rs into rd.
Example:
MOV A,B
Coded as 01111000 = 78H = 170 octal (octal was used extensively in instruction design of such processors).
ADD r
A ← A + r
Two-Byte Instructions
In a two-byte instruction, the first byte specifies the operation code and the second byte specifies the operand. Source operand is a data byte immediately following the opcode.
MVI r,data
r ← data
Example: MVI A,30H
coded as 3EH 30H as two contiguous bytes. This is an example of immediate addressing.
ADI data
A ← A + data
Three-Byte Instructions
In a three-byte instruction, the first byte specifies the opcode, and the following two bytes specify the 16-bit address.
Note that the second byte is the low-order address and the third byte is the high-order address.
opcode + data byte + data byte
LXI rp, data16
rp is one of the pairs of registers B-C, D-E, H-L used as 16-bit registers. The two data bytes are 16-bit data in L-H order of significance.
rp ← data16
Example:
LXI H,0520H coded as 21H 20H 50H in three bytes. This is also immediate addressing.
Addressing Modes in 8085 Microprocessor
- Every instruction of a program has to operate on a data.
- The method of specifying the data to be operated by the instruction is called Addressing. and its addressing modes are the ways in which it accesses memory or registers to retrieve or store data during processing.
- The 8085 has the following 5 different types of addressing.
- Immediate Addressing
- Direct Addressing
- Register Addressing
- Register Indirect Addressing
- Implicit Addressing
Immediate Addressing:
- In immediate addressing mode, the data is specified in the instruction itself. The data will be a part of the program instruction.
- EX. MVI B, 3EH – Move the data 3EH given in the instruction to B register; LXI SP, 2700H.
Direct Addressing:
- In direct addressing mode, the address of the data is specified in the instruction. The data will be in memory.
- In this addressing mode, the program instructions and data can be stored in different memory.
- EX. LDA 1050H – Load the data available in memory location 1050H in to accumulator; SHLD 3000H
Register Addressing:
- In this addressing mode, the operand is in one of the registers of the microprocessor. In register addressing mode, the instruction specifies the name of the register in which the data is available.
- EX. MOV A, B – Move the content of B register to A register; SPHL; ADD C.
Register Indirect Addressing:
- In register indirect addressing mode, the instruction specifies the name of the register in which the address of the data is available. Here the data will be in memory and the address will be in the register pair.
- EX. MOV A, M – The memory data addressed by H L pair is moved to A register. LDAX B.
Implicit Addressing:
In implied addressing mode, the instruction itself specifies the data to be operated.
CMA – Complement the content of accumulator; RAL
Recent posts
Related posts:
- Terminology Used in Microprocessor and Microcontroller
- CISC and RISC Processor Architecture
- Von Neumann and Harvard Architecture
- Basics of Microprocessor and Microcontroller
- Introduction to Microprocessor 8085
- Architecture of 8085 Microprocessor
- Pin Diagram of 8085 Microprocessor and Pin Description
- Data Transfer Instructions in 8085 Microprocessor
- Arithmetic Instructions in 8085 Microprocessor
- Logical Instructions in 8085 Microprocessor
- Branching instructions in 8085 Microprocessor
- Machine Control Instructions in 8085 Microprocessor
- Timing Diagram of 8085 Instructions
- Stack and Subroutine in 8085 Microprocessor
- Interrupts in 8085 Microprocessor
- Assembler Directives of 8085 Microprocessor
- Simple Data Transfer Program in 8085 Microprocessor
- Microprocessor 8085 Addition and Subtraction Programs
- Programs on Logical Instructions in 8085 Microprocessor
- Multiplication Programs in 8085 Microprocessor
- Division Programs in 8085 Microprocessor
- Introduction to Assembly Language Programming
- 8085 Program to Find the Largest Number in an Array of Data
- 8085 Program to Count Negative Numbers | ALP to Count Negative Numbers
- 8085 Program to Find the Smallest Number in An Array of Data
- 8085 Program to Arrange an Array of Data in Ascending Order
- 8085 Program to Arrange an Array of Data in Descending Order
- 8085 Program to Find the Square of a Number from 0 to 9 Using a Table of Square