Professional Documents
Culture Documents
MPP Exp9 Final On 14-10-13
MPP Exp9 Final On 14-10-13
09
EXPERIMENT NO.09
This refers to transferring the block of data from source memory locations to destination
memory locations. Counter is set, whose value is equal to the block length and on each
transfer of data from source to destination, the counter is decremented by one and the
memory pointer is incremented by one. This process is repeated till the counter
becomes zero.
Concept Structure 1:
136
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Microprocessors and Programming (17431) Experiment No. 09
This refers to exchanging the block of data between one-memory location to other.
Here, the counter is set whose value is equal to block length and on each transfer of
data from source to destination, the counter is decremented by one and the memory
pointer is incremented by one. This process is repeated till counter becomes zero.
Concept Structure 1:
This instruction will load the starting address of BLOCK1 into SI and Address of
BLOCK2 into DI of the data segment register.
Intellectual skills:
Understand program development steps like: Problem definition, Analysis,
Design of Logic, Coding, Testing and Maintenance (Modification, error
Correction etc.)
Use of programming Language constructs in assembly language program
implementation.
To apply different logics/ approaches to solve the given problem.
Understand the tools available for assembly language programming of 8086
such as Editor (Edit), Assembler (TASM /MASM/ NASM, Linker (TLINK
137
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Microprocessors and Programming (17431) Experiment No. 09
/LINK /NLINK and Debugger (TD, Debug) and to identify/locate different types
of errors as syntactical semantics, fatal, linker and logical.
To understand the execution of Assembly Language Program.
Motor skills:
Ability of proper handling of the computer system.
Ability to switch between and operate the different tools of assembling.
Ability to draw the flowchart.
Ability to check the status of flags and memory registers during execution of
the programs.
5.0 Equipment:
Hardware:
A Personal computer with Pentium onwards, with minimum 1GHZ processor,
1GB RAM, 80GB HDD (minimum 1 per student or two)
Software:
Assemblers (MASM Macro Assembler from Microsoft Corp or TASM Turbo
Assembler from Borland Inc. or NASM),
Linker (TLINK, LINK or NLINK),
Debugger (TD, Debug) and any other
Editor like EDIT, Norton Editor, and Notepad etc.
Teachers shall make the students aware of the use of 8086 simulator for writing
and executing assembly language programs.
Problem Statement 1 :
The source block is at address 2000H and Destination Block is at address 3000H. Write
an assembly Language program to move block of N bytes from source location to a
destination location. (N= 10)
STEP1:
Algorithm for transfer block of data from one memory block to other.
1. Initialize the Data Segment with address of Source and Destination block.
138
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Microprocessors and Programming (17431) Experiment No. 09
6. Transfer contents from source location to destination location and vise versa.
139
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Microprocessors and Programming (17431) Experiment No. 09
Flow Chart for transfer block of data from one memory block to other.
NO If Counter=0
YES
Stop
140
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Microprocessors and Programming (17431) Experiment No. 09
Step3:
Mnemonics Comments
DATA SEGMENT Start of data segment
BLOCK1 DB 10 DUP(10H) Declare array BLOCK1 of size 10 bytes.
BLOCK2 DB 10DUP(0) Declare array BLOCK2 of size 10 bytes.
DATA ENDS End of data segment:
CODE SEGMENT Start of code segment
ASSUME CS:CODE ,DS:DATA ,ES:EXTRA
INT 21H
141
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Microprocessors and Programming (17431) Experiment No. 09
2. If CLD instruction is instruction is omitted, will the program run correctly? Why?
142
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Microprocessors and Programming (17431) Experiment No. 09
[Teacher should form groups of 8 students and allocate different activities to each
group]
Student’s activity1:
Problem statement:
Write an assembly Language Program to transfer data between Block1 and Block2
without using string instructions.
Step1:
Step2:
143
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Microprocessors and Programming (17431) Experiment No. 09
Student’s activity2:
Flow Chart for block transfer without using string instructions.
Student’s activity 3:
Step3: Assembly Language Coding Sheet for block transfer without
data using string instructions.
Mnemonics Comments
144
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Microprocessors and Programming (17431) Experiment No. 09
Results obtained:
10.0 Questions:
145
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Microprocessors and Programming (17431) Experiment No. 09
1. Draw the flow chart showing how the block of N bytes are read into memory using
programmed I/O.
2. Explain how the address of block1 and block 2 is obtained in SI and DI registers?
3. What are the use of source Index and Destination Index registers?
5. Given that VARIABLE1 and VARIABLE2 are word variables and LABEL is a label.
a. ADD DX
b. SUB AL, BX
c. JNZ VARIABLE1
10. List all string instructions of 8086.Explain each with suitable example.
146
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Microprocessors and Programming (17431) Experiment No. 09
147
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION
Microprocessors and Programming (17431) Experiment No. 09
Signature of
C(4) P(4) A(2) Total
Subject Teacher
148
MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION