0% found this document useful (0 votes)
14 views5 pages

Jayesh 102 MP Exp7

The document outlines Experiment 7, which involves performing assembly programming based on string instructions using TASM. It includes three programs: one for block transfer, one for block exchange without string instructions, and one for block exchange using string instructions, each with corresponding assembly code. The student, Jayesh Ruchandani, conducted the experiment on February 28, 2025, and is set to submit it by March 14, 2025.
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)
14 views5 pages

Jayesh 102 MP Exp7

The document outlines Experiment 7, which involves performing assembly programming based on string instructions using TASM. It includes three programs: one for block transfer, one for block exchange without string instructions, and one for block exchange using string instructions, each with corresponding assembly code. The student, Jayesh Ruchandani, conducted the experiment on February 28, 2025, and is set to submit it by March 14, 2025.
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/ 5

Experiment 7 Title: To perform assembly program based on string instructions using software TASM

Name of student: Jayesh Class Roll Number: 102 Date of Performance: 28/02/2025
Ruchandani
Batch: S22 Timing: 8:00 AM Date of Submission: 14/03/2025

Assembly program based on string instructions


(a) block transfer, (b) block exchange without using string instructions,
(c) block exchange using string instructions

ASSEMBLY LANGUAGE CODE

(a) Program for block transfer

DATA_SEG SEGMENT
SRC DB 10H, 20H, 30H, 40H, 50H
DEST DB 5 DUP(?)
DATA_SEG ENDS

CODE_SEG SEGMENT
ASSUME CS:CODE_SEG, DS:DATA_SEG
START:
MOV AX, DATA_SEG
MOV DS, AX

LEA SI, SRC


LEA DI, DEST
MOV CX, 5
CLD
REP MOVSB

MOV AX, 4C00H


INT 21H
CODE_SEG ENDS
END START
OUTPUT
(b) Program for block exchange without string instructions

DATA_SEG SEGMENT
SRC DB 10H, 20H, 30H, 40H, 50H
DEST DB 60H, 70H, 80H, 90H, 0A0H
TEMP DB 5 DUP(?)
DATA_SEG ENDS

CODE_SEG SEGMENT
ASSUME CS:CODE_SEG, DS:DATA_SEG
START:
MOV AX, DATA_SEG
MOV DS, AX

LEA SI, SRC


LEA DI, DEST
LEA BX, TEMP
MOV CX, 5
XCHG_LOOP:
MOV AL, [SI]
MOV [BX], AL
MOV AL, [DI]
MOV [SI], AL
MOV AL, [BX]
MOV [DI], AL
INC SI
INC DI
INC BX
LOOP XCHG_LOOP

MOV AX, 4C00H


INT 21H
CODE_SEG ENDS
END START

OUTPUT
(c) Block exchange using string instructions

DATA_SEG SEGMENT
SRC DB 10H, 20H, 30H, 40H, 50H
DEST DB 60H, 70H, 80H, 90H, 0A0H
DATA_SEG ENDS

CODE_SEG SEGMENT
ASSUME CS:CODE_SEG, DS:DATA_SEG
START:
MOV AX, DATA_SEG
MOV DS, AX

LEA SI, SRC


LEA DI, DEST
MOV CX, 5
XCHG_STR:
LODSB
XCHG AL, [DI]
STOSB
LOOP XCHG_STR

MOV AX, 4C00H


INT 21H
CODE_SEG ENDS
END START

OUTPUT

You might also like