0% found this document useful (0 votes)
16 views4 pages

Module2 - (3) Addressing Modes

Addressing
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views4 pages

Module2 - (3) Addressing Modes

Addressing
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Assembly Language Programming

Assembly language programming is a low-level programming language in which the instructions


are written in the form of mnemonics.

Basically mnemonics are the short form of the words that are used to specify the operation
performed by an instruction. In assembly language, the instruction to be performed is represented
by 2,3 or 4 letters or a word.

For example: for addition, the mnemonics used in assembly language is ADD, for transferring
data from one location to another, the mnemonics used is MOV.

Advantages of Assembly Language


 It requires less memory and execution time;
 It allows hardware-specific complex jobs in an easier way;
 It is suitable for time-critical jobs;
 It is most suitable for writing interrupt service routines and other memory resident
programs
 An understanding of assembly language provides knowledge
 How processor accesses and executes instruction;
 How instructions accesses and process data;
 How a program access external devices.

Syntax for Assembly Language Instruction


Label : Mnemonic Operand1,Operand2 ;Comments
Label is an optional field of instruction in assembly language and acts as an identifier that
provides a symbolic name to the first byte of the instruction and is generally used at the time of
branching.

Mnemonics provide the information about the operation to be performed and is a compulsory
field of the instruction format.

Operand specifies the data over which operation is performed. The number of operands in an
instruction depends on the type of instruction. This is so because some hold no operand while
some hold one or two operands. A comma is used to separate two operands of an instruction.

The comment field starts with a semicolon and it signifies the objective of a particular
instruction.
INSTRUCTION SET OF 8086
ADDRESSING MODES : The method of specifying data to be operated by an instruction is
known as addressing modes.The 8086 has 12 addressing modes and they can be classified in
to 5 groups:

1. Register addressing mode


In Register addressing mode the instruction will specify the name of the register which holds
the data to be operated by the instruction.

2. Immediate addressing mode. In immediate addressing mode an 8 bit or 16 bit data is


specified as part of the instruction itself.

3. Direct addressing mode :


In direct addressing mode the effective address (EA)or offset address will be specified in the
instruction. The 20bit physical address is calculated by using segment register value and offset
address.
4 .Register Indirect Addressing mode: In Register Indirect Addressing mode the name of
the register which hold the offset address or EA will be specified in the instruction. The
register used to hold the effective address are BX,SI and DI. The content of DS is used for
segment base address calculation.

5. Based addressing mode: In this addressing mode BX or BP is used to hold the effective
address and a displacement will be specified in the instruction. The displacement is added to
the base value in BX or BP to obtain the effective address(EA).

6.Indexed addressing mode: In this addressing mode SI or DI register is used to hold an


index value for memory data and a displacement will be specified in the instruction. The
displacement is added to the index value in SI or DI to obtain the effective address(EA).

Eg: MOV AX, [SI+0008H]

7.Based Indexed addressing mode: In this addressing mode offset address is given by sum
of base value, index value and the displacement specified in the instruction. The base value is
stored in Bx or Bp , index value is stored in SI or DI register.

Eg: MOV AX, [BX+SI+08H]

8.String addressing mode: This addressing mode is used in string instructions to operate on
string data. In string addressing mode offset address of source is stored in SI register and offset
address of destination is stored in DI register. This addressing mode also supports auto
increment or auto decrement depending on direction flag(DF).

9. Direct I/O port addressing mode: This addressing mode is used to access data from
standard I/O port. In direct addressing mode an 8 bit port address is directly specified in the
instruction.

Eg: IN AL, [09H]

Port address = 09H

(AL) (port) ; The content of port with address 09H is moved to AL register.

10. Indirect I/O port addressing mode: This addressing mode is used to access data from
standard I/O port. In the indirect port addressing mode, the instruction will specify the name of
register which hold the port address. In 8086, the 16 bit port address is stored in DX register.

Eg: OUT [DX] , AX

Port address = (DX) ; (Port) (AX)

The content of AX register is moved to port whose address is specified by DX register.

11. Relative addressing mode : In this addressing mode effective address of a program
instruction is specified relative to instruction pointer ( IP ) by an 8 bit signed displacement.

12. Implied addressing mode: In Implied addressing mode , the instruction itself will
specify the data to be operated by the instruction. Eg: CLC -- Clear carry ; CF = 0. Execution of
this instruction will clear the carry flag.

You might also like