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

Assignment 4 With Remaining Notes.-1

Assignment

Uploaded by

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

Assignment 4 With Remaining Notes.-1

Assignment

Uploaded by

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

Instruction Format in 8086:

This instruction format can be coded from 1 to 6 bytes depending upon


the addressing modes used for instructions.
The general Instruction format is as follow :

 The Opcode stands for Operation Code. Every Instruction has a


unique 6-bit opcode. For example, the opcode for MOV is
100010.
 D stands for direction
If D=0, then the direction is from the register
If D=1, then the direction is to the register
 W stands for word
If W=0, then only a byte is being transferred, i.e. 8 bits
If W=1, them a whole word is being transferred, i.e. 16 bits
 The MOD and R/M together is calculated based upon the
addressing mode and register being used in it. This is calculated
as follows:
R/M 00 01 10 11
(Memory Mode with (Memory mode with 8 (Memory Mode (Register Mode)
no displacement) bit displacement) with 16 bit displacement)

000 [BX] + [SI] [BX] + [SI] + d8 [BX] + [SI] + d16 AL AX

001 [BX] + [DI] [BX] + [DI] + d8 [BX] + [DI] + d16 CL CX

010 [BP] + [SI] [BP] + [SI] + d8 [BP] + [SI] + d16 DL DX

011 [BP] + [DI] [BP] + [DI] + d8 [BP] + [DI] + d16 BL BX

100 [SI] [SI] + d8 [SI] + d16 AH SP

101 [DI] [DI] + d8 [DI] + d16 CH BP

110 d16 (direct) [BP] + d8 [BP] + d16 DH SI

111 [BX] [BX] + d8 [BX] + d16 BH DI


REG stands for register selected. It is a 3-bit code which is calculated
as follows:
REG Register
Code Selected
000 AL AX
001 CL CX
010 DL DX
011 BL BX
100 AH SP
101 CH BP
110 DH SI
111 BH DI
 The low order displacement and high order displacement are
optional and the instruction format contains them only if there
exists any displacement in the instruction. If the displacement is
of 8 bits, then only the cell of low order displacement infilled and
if the displacement is of 16 bits, then both the cells od low order
and high order are filled, with the exact bits that the
displacement number represents.
Assembler is a program for converting instructions written in low-level
assembly code into relocatable machine code and generating along
information for the loader.

Types of Assembler
On the basis of this functionality, assembler has two types:
 Single-Pass Assembler: If an assembler does all this work in one scan
then it is called a single-pass assembler.
 Multiple-Pass Assembler: If it does it in multiple scans then called a
multiple-pass assembler.

The concept of linker and loader-


or
Roles of the compiler, linker, assembler, and loader in
execution of program-

1. A compiler is a specialized system tool that translates a program


written in a specific programming language into the assembly language
code.
2. Assembler is a program for converting instructions written in low-level
assembly code into relocatable machine code and generating along
information for the loader.
3. The linker combines all external programs with our program to create a
final executable.
4. Loader loads the final executable code into memory. Then it creates
the program and data stack and initializes various registers and finally
gives control to the CPU so that it can start executing the code.
Assembly language programming of 8086
Write an ALP to perform 8-bit addition
MOV DI,1000H
MOV AL, [DI]
INC DI
MOV BL, [DI]
ADD AL, BL
INC DI
MOV [DI, AL
HLT

Write an ALP to perform 8-bit subtraction.


MOV DI,1000H
MOV AL, [DI]
INC DI
MOV BL, [DI]
SUB AL, BL
INC DI
MOV [DI], AL
HLT

Assignment 4
1. Draw instruction format used in 8086.
2. Draw 3-bit register select code with register selected.
3. Explain concept of linker and loader.
4. What is assembler? What are its types?
5. Write an assemble language program for addition of 8-
bit numbers using 8086.
6. Write an assemble language program for subtraction of
8- bit numbers using 8086.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy