8085 Addressing modes with example and Instruction Size

//8085 Addressing modes with example and Instruction Size

8085 Addressing modes with example and Instruction Size

ADDRESSING MODES

The various ways of specifying data (or operands) for instructions are called as addressing modes.
The 8085 addressing modes are classified into following types:

  1. Immediate addressing mode
  2. Direct addressing mode
  3. Register addressing mode
  4. Register indirect addressing mode
  5. Implicit addressing mode

(i) Immediate Addressing mode

In this mode operand is a part of the instruction itself is known as Immediate Addressing mode. If the immediate data is 8-bit, the instruction will be of two bytes. If the immediate data is 16 bit, the instruction is of 3 bytes.





Ex: (1). ADI DATA    ; Add immediate the data to the contents of the accumulator.
(2).LXIH 8500H  : Load immediate the H-L pair with the operand 8500H
(3). MVI 08H      ; Move the data 08 H immediately to the accumulator
(4). SUI 05H       ; Subtract immediately the data 05H from the accumulator

(ii) Direct Addressing mode

The mode of addressing in which the 16-bit address of the operand is directly available in the instruction itself is called Direct Addressing mode. i.e., the address of the operand is available in the instruction itself. This is a 3-byte instruction.

Ex: (1). LDA 9525H; Load the contents of memory location into Accumulator.

(2). STA 8000H; Store the contents of the Accumulator in the location 8000H

(3). IN 01H; Read the data from port whose address is 01H.

(iii) Register addressing modes

In this mode the operands are microprocessor registers only. i.e. the operation is performed within various registers of the microprocessor.

Ex: (1). MOV A, B;      Move the contents of B register to A register.

(2). SUB D;          Subtract the contents of D register from Accumulator.

(3). ADD B, C;     Add the contents of C register to the contents of B register.

(iv) Register indirect addressing modes

The 16-bit address location of the operand stored in a register pair (H-L) is given in the instruction. The address of the operand is given in an indirect way with the help of a register pair. So it is called Register indirect addressing mode.

Ex: (1). LXIH 9570H   : Load immediate the H-L pair with the address of the location 9570H

MOV A, M      : Move the contents of the memory location pointed by the H-L pair to   accumulator

(v) Implicit Addressing mode

The mode of instruction which do not specify the operand in the instruction but it is implicated, is known as implicit addressing mode. i.e., the operand is supposed to be present generally in accumulator.

Ex: (1).CMA; complement the contents of Accumulator

(2).CMC; Complement carry

(3). RLC; Rotate Accumulator left by one bit

(4). RRC; Rotate Accumulator right by one bit

(5). STC; Set carry.

Instruction and data formats

The format of a typical instruction is composed of two parts: an operation code or op-code and an operand. Every instruction needs an opcode to specify the operation of the instruction is and then an operand that gives the appropriate data needed for that particular operation code.

Depending upon the size of machine codes, the 8085 instructions are classified into three types.

(a) One byte (single) instructions.
(b)Two byte instructions.
(c) Three byte instructions.

One-byte instructions:

A 1 byte instruction include the opcode and the operand in the 8 bits only which is one byte.

Ex:  1. MOV C, A             Hex code = 4FH (one byte)

  1. ADD B Hex code = 80H (one byte)
  2. CMA Hex code = 2FH (one byte)

Two-byte instructions

The two byte instruction is one which contains an 8-bit op-code and 8-bit operand (Data).

Ex:  1. MVI A, 09           Hex code = 3E, 09 (two bytes)

  1. ADD B, 07       Hex code = 80, 07 (two bytes)
  2. SUB A, 05 Hex code = 97, 05 (two bytes)

Three-byte instructions

In a three byte instruction the first byte is opcode and second and third bytes are operands i.e. 16-bit data or 16-bit address.

  1. LDA 8509           Hex code = 3A, 09, 85 (Three bytes)
  2. LXI 2500           Hex code = 21, 00, 25 (Three bytes)
  3. STA 2600 Hex code = 32, 00, 26 (Three bytes)

 

Data Formats

The 8085 is an 8-bit microprocessor which process only on binary numbers. Since t is very difficult to understand these numbers by a common user, So we are using different data formats to code these binary numbers. ASCII, BCD, signed integers and unsigned integers are some of the data formats. The ASCII code is a 7-bit alpha-numeric code that represents decimal numbers, English alphabets and certain special characters. The ASCII stands for “American Standard code for Information Interchange”.

The term BCD stands for binary coded decimal, used for the decimal numbers from 0-9. An 8-bit register can store two BCD numbers. A signed integer can be both either negative or positive number. In 8085 microprocessor the most significant bit is used for the sign. Here 0 denotes positive sign and 1 denotes the negative sign. An integer without a sign is represented by all the 8-bits in a microprocessor register. So, the largest number that can be processed at one time is FFH. The numbers larger than 8-bits like 16, 24, 32 bits can be processed by dividing them in groups of 8-bits.

 



By |2018-11-29T23:24:04+00:00February 10th, 2015|8085 Microprocessor|0 Comments

You May Like




Author

Posted by
This author has not yet filled in any details.
So far the author has created 1 blog entries.
February 10th, 2015

Recent Posts

Categories

For You