N098 - MM - Exp 4

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Roll No.

N098 Name: Vedashree Yogesh Shetye


Program : MBA.TECH CE Division: E
Batch: E2 Date of Experiment:11/01/2021
Date of Submission: 19/01/2023 Grade :

EXP . 4

AIM :- Block transfer using string instruction

Apparatus: Tasm software


Theory:
Register SI and DI must be initialized to point to the source/destination strings before executing the
string instructions. The string instructions automatically update SI and/or DI in anticipation of
processing the next string element. For this user have to set/reset DF flag to determine whether pointer
should auto increment (DF = 0) or should auto decrement (DF = 1).

Procedure:
Steps to be followed to execute 8086 program in tasm software
 Write Assembly language program in notepad.
 Save this program file in tasm /bin folder with .asm extension
 Go to window start then select run
 Type command cmd (command window will pop up for dos prompt).
 Change the directory (cd\)
 Select path c:cd tasm/bin
 Write command tasm/zi file name .asm
 Write command tlink/v file name .obj
 Write command td file name .exe
 Program Window will appear
 Select view tab then select cpu
 Press F8 to execute program in single step mode
 Select view tab then select variable to see the result.
Program:
A) MOVSB without repeat
data segment
Block1 db 08 dup (98h)
Counter db 08
data ends
extra segment
Block2 db 08 dup (00h)
extra ends
code segment
start: assume ds: data, cs: code, es:extra
mov ax,data
mov ds,ax
mov ax,extra
mov es,ax
lea si,Block1
lea di,Block2
mov cl,counter

CLD
UP:MOVSB
DEC CL
JNZ UP
mov ax,4c00h
int 21h
code ends
end start

B) MOVSB with repeat


data segment
Block1 db 08 dup (98h)
Counter db 08
data ends
extra segment
Block2 db 08 dup (00h)
extra ends
code segment
start: assume ds: data, cs: code, es:extra
mov ax,data
mov ds,ax
mov ax,extra
mov es,ax
lea si,Block1
lea di,Block2
mov cl,counter

cld
rep movsb
mov ax,4c00h
int 21h
code ends
end start

C) MOVSW without repeat


data segment
Block1 db 08 dup (07h)
Counter db 04
data ends
extra segment
Block2 db 08 dup (00h)
extra ends
code segment
start: assume ds: data, cs: code, es:extra
mov ax,data
mov ds,ax
mov ax,extra
mov es,ax
lea si,Block1
lea di,Block2
mov cl,counter

CLD
UP:MOVSW
DEC CL
JNZ UP
mov ax,4c00h
int 21h
code ends
end start

D) MOVSW with repeat


data segment
Block1 db 08 dup (07h)
Counter db 04
data ends
extra segment
Block2 db 08 dup (00h)
extra ends
code segment
start: assume ds: data, cs: code, es:extra
mov ax,data
mov ds,ax
mov ax,extra
mov es,ax
lea si,Block1
lea di,Block2
mov cl,counter
cld
rep movsw
mov ax,4c00h
int 21h
code ends
end start

RESULT:
A) MOVSB without repeat

B) MOVSB with repeat


(C) MOVSW without repeat

(D) MOVSW with repeat

CONCLUSION: Therefore, after successfully completing this experiment, we are


able to perform Block Transfer using string instructions.

You might also like